From 7362c34d5e3272afc17c9401e07c39eae3f9fcab Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 25 Jul 2018 11:19:50 -0700 Subject: [PATCH 1/7] Generated from 8842b69926229d7097ef82a5c333ced9fcaa06dc (#2252) ensure the correct case is used for the Resource folder in referencing the examples --- .../azure/servicefabric/AadMetadata.java | 173 + ...ementalNamedPartitionScalingMechanism.java | 100 + .../servicefabric/AnalysisEventMetadata.java | 70 + .../ApplicationBackupConfigurationInfo.java | 49 + .../ApplicationBackupEntity.java | 47 + .../ApplicationCapacityDescription.java | 110 + .../ApplicationCreatedEvent.java | 100 + .../ApplicationDefinitionKind.java | 44 + .../ApplicationDeletedEvent.java | 74 + .../servicefabric/ApplicationDescription.java | 162 + .../ApplicationHealthEvaluation.java | 79 + .../ApplicationHealthPolicies.java | 46 + .../ApplicationHealthPolicy.java | 140 + .../ApplicationHealthPolicyMapItem.java | 71 + .../ApplicationHealthReportCreatedEvent.java | 257 + .../ApplicationHealthReportExpiredEvent.java | 257 + .../servicefabric/ApplicationHealthState.java | 44 + .../ApplicationHealthStateChunk.java | 126 + .../ApplicationHealthStateChunkList.java | 47 + .../ApplicationHealthStateFilter.java | 256 + .../ApplicationMetricDescription.java | 168 + .../ApplicationPackageCleanupPolicy.java | 47 + .../servicefabric/ApplicationParameter.java | 70 + .../ApplicationResourceStatus.java | 53 + .../servicefabric/ApplicationStatus.java | 53 + ...ationTypeApplicationsHealthEvaluation.java | 135 + .../ApplicationTypeDefinitionKind.java | 44 + .../ApplicationTypeHealthPolicyMapItem.java | 74 + .../ApplicationTypeImageStorePath.java | 44 + .../servicefabric/ApplicationTypeInfo.java | 185 + .../servicefabric/ApplicationTypeStatus.java | 50 + .../ApplicationUpgradeCompleteEvent.java | 100 + .../ApplicationUpgradeDescription.java | 273 + ...ApplicationUpgradeDomainCompleteEvent.java | 178 + ...plicationUpgradeRollbackCompleteEvent.java | 126 + .../ApplicationUpgradeRollbackStartEvent.java | 152 + .../ApplicationUpgradeStartEvent.java | 178 + .../ApplicationUpgradeUpdateDescription.java | 124 + .../ApplicationsHealthEvaluation.java | 105 + .../AveragePartitionLoadScalingTrigger.java | 129 + .../AverageServiceLoadScalingTrigger.java | 129 + .../AzureBlobBackupStorageDescription.java | 75 + .../BackupConfigurationInfo.java | 110 + .../azure/servicefabric/BackupEntity.java | 26 + .../azure/servicefabric/BackupEntityKind.java | 47 + .../azure/servicefabric/BackupEpoch.java | 78 + .../azure/servicefabric/BackupInfo.java | 310 + .../BackupPartitionDescription.java | 43 + .../servicefabric/BackupPolicyScope.java | 47 + .../BackupScheduleDescription.java | 25 + .../BackupScheduleFrequencyType.java | 44 + .../servicefabric/BackupScheduleKind.java | 44 + .../azure/servicefabric/BackupState.java | 53 + .../BackupStorageDescription.java | 52 + .../servicefabric/BackupStorageKind.java | 44 + .../servicefabric/BackupSuspensionInfo.java | 73 + .../servicefabric/BackupSuspensionScope.java | 47 + .../azure/servicefabric/BackupType.java | 44 + .../servicefabric/BinaryPropertyValue.java | 49 + .../azure/servicefabric/ChaosContext.java | 49 + .../azure/servicefabric/ChaosEvent.java | 57 + .../azure/servicefabric/ChaosEventKind.java | 56 + .../servicefabric/ChaosEventWrapper.java | 43 + .../ChaosMovePrimaryFaultScheduledEvent.java | 153 + ...ChaosMoveSecondaryFaultScheduledEvent.java | 179 + .../azure/servicefabric/ChaosParameters.java | 308 + .../ChaosParametersDictionaryItem.java | 70 + ...ChaosRemoveReplicaFaultCompletedEvent.java | 101 + ...ChaosRemoveReplicaFaultScheduledEvent.java | 101 + ...RestartCodePackageFaultCompletedEvent.java | 179 + ...RestartCodePackageFaultScheduledEvent.java | 179 + .../ChaosRestartNodeFaultCompletedEvent.java | 101 + .../ChaosRestartNodeFaultScheduledEvent.java | 101 + ...haosRestartReplicaFaultScheduledEvent.java | 101 + .../azure/servicefabric/ChaosSchedule.java | 125 + .../azure/servicefabric/ChaosScheduleJob.java | 98 + .../ChaosScheduleJobActiveDaysOfWeek.java | 199 + .../servicefabric/ChaosScheduleStatus.java | 50 + .../servicefabric/ChaosStartedEvent.java | 282 + .../azure/servicefabric/ChaosStatus.java | 44 + .../servicefabric/ChaosStoppedEvent.java | 48 + .../servicefabric/ChaosTargetFilter.java | 134 + .../CheckExistsPropertyBatchOperation.java | 54 + .../CheckSequencePropertyBatchOperation.java | 55 + .../CheckValuePropertyBatchOperation.java | 52 + ...lusterConfigurationUpgradeDescription.java | 312 + .../ClusterHealthChunkQueryDescription.java | 154 + .../servicefabric/ClusterHealthPolicies.java | 85 + .../servicefabric/ClusterHealthPolicy.java | 207 + .../ClusterHealthReportCreatedEvent.java | 231 + .../ClusterHealthReportExpiredEvent.java | 231 + .../ClusterUpgradeCompleteEvent.java | 74 + .../ClusterUpgradeDescriptionObject.java | 331 + .../ClusterUpgradeDomainCompleteEvent.java | 126 + .../ClusterUpgradeHealthPolicyObject.java | 82 + .../ClusterUpgradeRollbackCompleteEvent.java | 100 + .../ClusterUpgradeRollbackStartEvent.java | 100 + .../ClusterUpgradeStartEvent.java | 152 + .../servicefabric/CodePackageEntryPoint.java | 207 + .../CodePackageEntryPointStatistics.java | 306 + .../ComposeDeploymentStatus.java | 59 + .../ComposeDeploymentUpgradeDescription.java | 262 + .../ComposeDeploymentUpgradeState.java | 65 + .../ContainerApiRequestBody.java | 122 + .../servicefabric/ContainerApiResult.java | 121 + .../ContainerCodePackageProperties.java | 349 + .../ContainerDeactivatedEvent.java | 335 + .../azure/servicefabric/ContainerEvent.java | 173 + .../servicefabric/ContainerInstanceView.java | 122 + .../azure/servicefabric/ContainerLabel.java | 69 + .../azure/servicefabric/ContainerState.java | 148 + .../azure/servicefabric/ContainerVolume.java | 96 + .../CreateComposeDeploymentDescription.java | 95 + .../azure/servicefabric/CreateFabricDump.java | 41 + .../CurrentUpgradeDomainProgressInfo.java | 70 + .../azure/servicefabric/DataLossMode.java | 44 + .../azure/servicefabric/DayOfWeek.java | 56 + .../servicefabric/DeactivationIntent.java | 44 + .../DeactivationIntentDescription.java | 47 + .../DeletePropertyBatchOperation.java | 23 + .../DeltaNodesCheckHealthEvaluation.java | 162 + ...DeployServicePackageToNodeDescription.java | 150 + .../DeployedApplicationHealthEvaluation.java | 107 + ...edApplicationHealthReportCreatedEvent.java | 283 + ...edApplicationHealthReportExpiredEvent.java | 283 + .../DeployedApplicationHealthState.java | 70 + .../DeployedApplicationHealthStateChunk.java | 74 + ...ployedApplicationHealthStateChunkList.java | 47 + .../DeployedApplicationHealthStateFilter.java | 181 + .../DeployedApplicationStatus.java | 53 + .../DeployedApplicationsHealthEvaluation.java | 108 + ...ployedServiceHealthReportCreatedEvent.java | 335 + ...ployedServiceHealthReportExpiredEvent.java | 335 + ...eployedServicePackageHealthEvaluation.java | 131 + .../DeployedServicePackageHealthState.java | 131 + ...eployedServicePackageHealthStateChunk.java | 80 + ...yedServicePackageHealthStateChunkList.java | 47 + ...ployedServicePackageHealthStateFilter.java | 175 + ...ployedServicePackagesHealthEvaluation.java | 81 + ...loyedStatefulServiceReplicaDetailInfo.java | 224 + .../DeployedStatefulServiceReplicaInfo.java | 108 + ...yedStatelessServiceInstanceDetailInfo.java | 80 + .../DeployedStatelessServiceInstanceInfo.java | 52 + .../azure/servicefabric/DeploymentStatus.java | 53 + .../servicefabric/DiagnosticsDescription.java | 97 + .../azure/servicefabric/DiagnosticsRef.java | 71 + .../servicefabric/DiagnosticsSinkKind.java | 41 + .../DiagnosticsSinkProperties.java | 74 + .../servicefabric/DoublePropertyValue.java | 47 + .../EnableBackupDescription.java | 43 + .../servicefabric/EndpointProperties.java | 69 + .../EnsureAvailabilitySafetyCheck.java | 22 + .../EnsurePartitionQurumSafetyCheck.java | 21 + .../azure/servicefabric/EntityHealth.java | 137 + .../servicefabric/EntityHealthState.java | 46 + .../servicefabric/EntityHealthStateChunk.java | 46 + .../EntityHealthStateChunkList.java | 45 + .../azure/servicefabric/EntityKind.java | 62 + .../EntityKindHealthStateCount.java | 71 + .../azure/servicefabric/EntryPointStatus.java | 53 + .../servicefabric/EnvironmentVariable.java | 69 + .../microsoft/azure/servicefabric/Epoch.java | 78 + .../servicefabric/EventHealthEvaluation.java | 79 + .../ExecutingFaultsChaosEvent.java | 51 + ...reProvisionApplicationTypeDescription.java | 107 + .../azure/servicefabric/FabricError.java | 45 + .../azure/servicefabric/FabricErrorCodes.java | 284 + .../azure/servicefabric/FabricErrorError.java | 415 + .../servicefabric/FabricErrorException.java | 44 + .../azure/servicefabric/FabricEventKind.java | 239 + .../servicefabric/FabricReplicaStatus.java | 44 + .../FailedUpgradeDomainProgressObject.java | 71 + .../azure/servicefabric/FailureAction.java | 44 + .../azure/servicefabric/FailureReason.java | 50 + .../FailureUpgradeDomainProgressInfo.java | 71 + .../azure/servicefabric/FileInfo.java | 122 + .../FileShareBackupStorageDescription.java | 152 + .../azure/servicefabric/FileVersion.java | 98 + .../azure/servicefabric/FolderInfo.java | 71 + ...equencyBasedBackupScheduleDescription.java | 50 + .../GetBackupByStorageQueryDescription.java | 156 + .../GetPropertyBatchOperation.java | 54 + .../servicefabric/GuidPropertyValue.java | 48 + .../azure/servicefabric/HealthEvaluation.java | 100 + .../servicefabric/HealthEvaluationKind.java | 101 + .../HealthEvaluationWrapper.java | 44 + .../azure/servicefabric/HealthEvent.java | 224 + .../servicefabric/HealthInformation.java | 298 + .../azure/servicefabric/HealthState.java | 50 + .../azure/servicefabric/HealthStateCount.java | 96 + .../azure/servicefabric/HealthStatistics.java | 52 + .../servicefabric/HostIsolationMode.java | 44 + .../azure/servicefabric/HostType.java | 44 + .../ImageRegistryCredential.java | 96 + .../ImageStoreCopyDescription.java | 126 + .../azure/servicefabric/ImpactLevel.java | 50 + .../servicefabric/Int64PropertyValue.java | 47 + .../Int64RangePartitionInformation.java | 74 + .../servicefabric/InvokeDataLossResult.java | 72 + .../servicefabric/InvokeQuorumLossResult.java | 72 + .../KeyValueStoreReplicaStatus.java | 154 + .../azure/servicefabric/LoadMetricReport.java | 97 + .../servicefabric/LoadMetricReportInfo.java | 96 + .../MonitoringPolicyDescription.java | 202 + .../azure/servicefabric/MoveCost.java | 47 + .../azure/servicefabric/NameDescription.java | 43 + .../NamedPartitionInformation.java | 48 + .../NamedPartitionSchemeDescription.java | 75 + .../azure/servicefabric/NetworkRef.java | 43 + .../azure/servicefabric/NodeAbortedEvent.java | 230 + .../servicefabric/NodeAbortingEvent.java | 230 + .../azure/servicefabric/NodeAddedEvent.java | 178 + .../azure/servicefabric/NodeCloseEvent.java | 100 + .../azure/servicefabric/NodeClosingEvent.java | 230 + .../NodeDeactivateCompleteEvent.java | 127 + .../NodeDeactivateStartEvent.java | 100 + .../servicefabric/NodeDeactivationInfo.java | 127 + .../servicefabric/NodeDeactivationIntent.java | 50 + .../servicefabric/NodeDeactivationStatus.java | 47 + .../servicefabric/NodeDeactivationTask.java | 71 + .../servicefabric/NodeDeactivationTaskId.java | 71 + .../NodeDeactivationTaskType.java | 47 + .../azure/servicefabric/NodeDownEvent.java | 75 + .../servicefabric/NodeHealthEvaluation.java | 79 + .../NodeHealthReportCreatedEvent.java | 257 + .../NodeHealthReportExpiredEvent.java | 257 + .../azure/servicefabric/NodeHealthState.java | 71 + .../servicefabric/NodeHealthStateChunk.java | 44 + .../NodeHealthStateChunkList.java | 47 + .../servicefabric/NodeHealthStateFilter.java | 130 + .../microsoft/azure/servicefabric/NodeId.java | 44 + .../azure/servicefabric/NodeImpact.java | 73 + .../NodeLoadMetricInformation.java | 201 + .../servicefabric/NodeOpenFailedEvent.java | 256 + .../servicefabric/NodeOpenedSuccessEvent.java | 230 + .../azure/servicefabric/NodeOpeningEvent.java | 230 + .../azure/servicefabric/NodeRemovedEvent.java | 178 + .../NodeRepairImpactDescription.java | 52 + .../NodeRepairTargetDescription.java | 51 + .../azure/servicefabric/NodeResult.java | 70 + .../azure/servicefabric/NodeStatus.java | 59 + .../azure/servicefabric/NodeStatusFilter.java | 62 + .../servicefabric/NodeTransitionResult.java | 72 + .../servicefabric/NodeTransitionType.java | 44 + .../azure/servicefabric/NodeUpEvent.java | 75 + .../azure/servicefabric/NodeUpgradePhase.java | 47 + .../NodeUpgradeProgressInfo.java | 97 + .../servicefabric/NodesHealthEvaluation.java | 106 + .../servicefabric/OperatingSystemTypes.java | 41 + .../azure/servicefabric/OperationState.java | 56 + .../azure/servicefabric/OperationType.java | 50 + .../PackageSharingPolicyInfo.java | 71 + .../PackageSharingPolicyScope.java | 50 + .../servicefabric/PartitionAccessStatus.java | 50 + .../servicefabric/PartitionAnalysisEvent.java | 52 + .../servicefabric/PartitionBackupEntity.java | 78 + .../PartitionHealthEvaluation.java | 80 + .../PartitionHealthReportCreatedEvent.java | 231 + .../PartitionHealthReportExpiredEvent.java | 231 + .../servicefabric/PartitionHealthState.java | 45 + .../PartitionHealthStateChunk.java | 73 + .../PartitionHealthStateChunkList.java | 48 + .../PartitionHealthStateFilter.java | 175 + .../servicefabric/PartitionInformation.java | 59 + .../PartitionInstanceCountScaleMechanism.java | 100 + .../PartitionPrimaryMoveAnalysisEvent.java | 152 + ...artitionReconfigurationCompletedEvent.java | 360 + .../servicefabric/PartitionSafetyCheck.java | 58 + .../azure/servicefabric/PartitionScheme.java | 47 + .../PartitionSchemeDescription.java | 26 + .../PartitionsHealthEvaluation.java | 106 + .../PrimaryReplicatorStatus.java | 76 + .../ProcessDeactivatedEvent.java | 335 + .../PropertyBatchDescriptionList.java | 45 + .../servicefabric/PropertyBatchInfo.java | 25 + .../servicefabric/PropertyBatchInfoKind.java | 44 + .../servicefabric/PropertyBatchOperation.java | 57 + .../PropertyBatchOperationKind.java | 56 + .../servicefabric/PropertyDescription.java | 96 + .../azure/servicefabric/PropertyMetadata.java | 179 + .../azure/servicefabric/PropertyValue.java | 28 + .../servicefabric/PropertyValueKind.java | 53 + .../ProvisionApplicationTypeDescription.java | 77 + ...ovisionApplicationTypeDescriptionBase.java | 58 + .../ProvisionApplicationTypeKind.java | 44 + .../ProvisionFabricDescription.java | 69 + .../PutPropertyBatchOperation.java | 76 + .../azure/servicefabric/QuorumLossMode.java | 44 + .../ReconfigurationInformation.java | 130 + .../servicefabric/ReconfigurationPhase.java | 59 + .../servicefabric/ReconfigurationType.java | 47 + .../servicefabric/RegistryCredential.java | 95 + ...RemoteReplicatorAcknowledgementDetail.java | 126 + ...RemoteReplicatorAcknowledgementStatus.java | 72 + .../servicefabric/RemoteReplicatorStatus.java | 246 + .../RepairImpactDescriptionBase.java | 27 + .../azure/servicefabric/RepairImpactKind.java | 41 + .../RepairTargetDescriptionBase.java | 27 + .../azure/servicefabric/RepairTargetKind.java | 41 + .../RepairTaskApproveDescription.java | 74 + .../RepairTaskCancelDescription.java | 102 + .../RepairTaskDeleteDescription.java | 74 + .../RepairTaskHealthCheckState.java | 50 + .../servicefabric/RepairTaskHistory.java | 311 + ...pairTaskUpdateHealthPolicyDescription.java | 130 + .../ReplicaHealthEvaluation.java | 115 + .../ReplicaHealthReportServiceKind.java | 41 + .../servicefabric/ReplicaHealthState.java | 54 + .../ReplicaHealthStateChunk.java | 55 + .../ReplicaHealthStateChunkList.java | 46 + .../ReplicaHealthStateFilter.java | 134 + .../azure/servicefabric/ReplicaKind.java | 41 + .../azure/servicefabric/ReplicaRole.java | 50 + .../azure/servicefabric/ReplicaStatus.java | 53 + .../servicefabric/ReplicaStatusBase.java | 24 + .../ReplicasHealthEvaluation.java | 106 + .../ReplicatorOperationName.java | 65 + .../servicefabric/ReplicatorQueueStatus.java | 199 + .../azure/servicefabric/ReplicatorStatus.java | 28 + .../ResolvedServiceEndpoint.java | 72 + .../azure/servicefabric/ResourceLimits.java | 71 + .../azure/servicefabric/ResourceRequests.java | 74 + .../servicefabric/ResourceRequirements.java | 69 + ...RestartDeployedCodePackageDescription.java | 147 + .../servicefabric/RestartNodeDescription.java | 73 + .../servicefabric/RestartPartitionMode.java | 44 + .../servicefabric/RestartPartitionResult.java | 72 + .../RestorePartitionDescription.java | 98 + .../azure/servicefabric/RestoreState.java | 53 + .../azure/servicefabric/ResultStatus.java | 53 + .../ResumeApplicationUpgradeDescription.java | 44 + .../ResumeClusterUpgradeDescription.java | 43 + .../RollingUpgradeUpdateDescription.java | 290 + .../azure/servicefabric/SafetyCheck.java | 27 + .../azure/servicefabric/SafetyCheckKind.java | 59 + .../servicefabric/SafetyCheckWrapper.java | 47 + .../ScalingMechanismDescription.java | 25 + .../servicefabric/ScalingMechanismKind.java | 44 + .../ScalingPolicyDescription.java | 69 + .../ScalingTriggerDescription.java | 25 + .../servicefabric/ScalingTriggerKind.java | 44 + .../SecondaryActiveReplicatorStatus.java | 21 + .../SecondaryIdleReplicatorStatus.java | 21 + .../SecondaryReplicatorStatus.java | 199 + .../servicefabric/SeedNodeSafetyCheck.java | 21 + .../servicefabric/SelectedPartition.java | 75 + .../ServiceBackupConfigurationInfo.java | 49 + .../servicefabric/ServiceBackupEntity.java | 47 + .../ServiceCorrelationDescription.java | 72 + .../ServiceCorrelationScheme.java | 47 + .../servicefabric/ServiceCreatedEvent.java | 287 + .../servicefabric/ServiceDeletedEvent.java | 256 + .../servicefabric/ServiceEndpointRole.java | 47 + .../ServiceFromTemplateDescription.java | 177 + .../ServiceHealthEvaluation.java | 79 + .../ServiceHealthReportCreatedEvent.java | 257 + .../ServiceHealthReportExpiredEvent.java | 257 + .../servicefabric/ServiceHealthState.java | 44 + .../ServiceHealthStateChunk.java | 73 + .../ServiceHealthStateChunkList.java | 46 + .../ServiceHealthStateFilter.java | 173 + .../azure/servicefabric/ServiceKind.java | 44 + .../ServiceLoadMetricDescription.java | 156 + .../ServiceLoadMetricWeight.java | 47 + .../servicefabric/ServiceOperationName.java | 53 + .../ServicePackageActivationMode.java | 41 + .../servicefabric/ServicePartitionKind.java | 47 + .../servicefabric/ServicePartitionStatus.java | 53 + ...acementInvalidDomainPolicyDescription.java | 49 + ...artiallyPlaceServicePolicyDescription.java | 22 + .../ServicePlacementPolicyDescription.java | 28 + .../ServicePlacementPolicyType.java | 53 + ...tPreferPrimaryDomainPolicyDescription.java | 58 + ...reDomainDistributionPolicyDescription.java | 59 + ...cementRequiredDomainPolicyDescription.java | 50 + .../ServiceReplicaProperties.java | 128 + .../servicefabric/ServiceResourceStatus.java | 53 + .../azure/servicefabric/ServiceStatus.java | 53 + .../servicefabric/ServiceTypeDescription.java | 188 + .../ServiceTypeExtensionDescription.java | 69 + .../ServiceTypeHealthPolicy.java | 151 + .../ServiceTypeHealthPolicyMapItem.java | 71 + .../ServiceTypeRegistrationStatus.java | 47 + .../ServiceUpdateDescription.java | 275 + .../ServicesHealthEvaluation.java | 134 + .../azure/servicefabric/Setting.java | 69 + .../SingletonPartitionInformation.java | 22 + .../SingletonPartitionSchemeDescription.java | 21 + .../StartClusterUpgradeDescription.java | 317 + .../servicefabric/StartedChaosEvent.java | 47 + .../microsoft/azure/servicefabric/State.java | 59 + ...atefulReplicaHealthReportCreatedEvent.java | 257 + ...atefulReplicaHealthReportExpiredEvent.java | 257 + .../StatefulServiceDescription.java | 236 + .../servicefabric/StatefulServiceInfo.java | 48 + .../StatefulServicePartitionInfo.java | 134 + .../StatefulServiceReplicaHealth.java | 56 + .../StatefulServiceReplicaHealthState.java | 54 + .../StatefulServiceReplicaInfo.java | 83 + .../StatefulServiceTypeDescription.java | 50 + .../StatefulServiceUpdateDescription.java | 154 + ...telessReplicaHealthReportCreatedEvent.java | 231 + ...telessReplicaHealthReportExpiredEvent.java | 231 + .../StatelessServiceDescription.java | 48 + .../servicefabric/StatelessServiceInfo.java | 21 + .../StatelessServiceInstanceHealth.java | 54 + .../StatelessServiceInstanceHealthState.java | 49 + .../StatelessServiceInstanceInfo.java | 54 + .../StatelessServicePartitionInfo.java | 48 + .../StatelessServiceTypeDescription.java | 51 + .../StatelessServiceUpdateDescription.java | 47 + .../servicefabric/StoppedChaosEvent.java | 49 + .../servicefabric/StringPropertyValue.java | 47 + .../SystemApplicationHealthEvaluation.java | 54 + .../servicefabric/TestErrorChaosEvent.java | 54 + .../TimeBasedBackupScheduleDescription.java | 108 + .../azure/servicefabric/TimeOfDay.java | 71 + .../azure/servicefabric/TimeRange.java | 69 + ...mInt64RangePartitionSchemeDescription.java | 106 + ...ovisionApplicationTypeDescriptionInfo.java | 76 + .../UnprovisionFabricDescription.java | 69 + .../UpdateClusterUpgradeDescription.java | 179 + ...DomainDeltaNodesCheckHealthEvaluation.java | 187 + .../servicefabric/UpgradeDomainInfo.java | 70 + .../UpgradeDomainNodesHealthEvaluation.java | 133 + .../servicefabric/UpgradeDomainState.java | 47 + .../azure/servicefabric/UpgradeKind.java | 41 + .../azure/servicefabric/UpgradeMode.java | 47 + .../azure/servicefabric/UpgradeState.java | 56 + .../azure/servicefabric/UpgradeType.java | 44 + .../azure/servicefabric/UploadChunkRange.java | 71 + .../servicefabric/UploadSessionInfo.java | 153 + .../ValidationFailedChaosEvent.java | 50 + .../VolumeProviderParametersAzureFile.java | 95 + .../WaitForInbuildReplicaSafetyCheck.java | 23 + .../WaitForPrimaryPlacementSafetyCheck.java | 21 + .../WaitForPrimarySwapSafetyCheck.java | 22 + .../WaitForReconfigurationSafetyCheck.java | 21 + .../servicefabric/WaitingChaosEvent.java | 50 + .../AadMetadataObjectInner.java | 71 + .../implementation/ApplicationEventInner.java | 77 + .../ApplicationHealthInner.java | 101 + .../implementation/ApplicationInfoInner.java | 252 + .../ApplicationLoadInfoInner.java | 179 + .../ApplicationNameInfoInner.java | 79 + .../ApplicationResourceDescriptionInner.java | 234 + .../ApplicationTypeManifestInner.java | 44 + .../ApplicationUpgradeProgressInfoInner.java | 488 + .../BackupPolicyDescriptionInner.java | 163 + .../BackupProgressInfoInner.java | 208 + .../ChaosEventsSegmentInner.java | 77 + .../implementation/ChaosInner.java | 105 + .../ChaosScheduleDescriptionInner.java | 71 + .../ClusterConfigurationInner.java | 43 + ...erConfigurationUpgradeStatusInfoInner.java | 125 + .../implementation/ClusterEventInner.java | 32 + .../ClusterHealthChunkInner.java | 115 + .../implementation/ClusterHealthInner.java | 76 + .../implementation/ClusterManifestInner.java | 43 + .../ClusterUpgradeProgressObjectInner.java | 425 + .../ComposeDeploymentStatusInfoInner.java | 124 + ...oseDeploymentUpgradeProgressInfoInner.java | 577 + .../ContainerApiResponseInner.java | 44 + .../ContainerInstanceEventInner.java | 20 + .../implementation/ContainerLogsInner.java | 43 + .../DeployedApplicationHealthInner.java | 101 + .../DeployedApplicationInfoInner.java | 248 + .../DeployedCodePackageInfoInner.java | 303 + .../DeployedServicePackageHealthInner.java | 97 + .../DeployedServicePackageInfoInner.java | 136 + ...DeployedServiceReplicaDetailInfoInner.java | 168 + .../DeployedServiceReplicaInfoInner.java | 278 + .../DeployedServiceTypeInfoInner.java | 159 + .../FabricCodeVersionInfoInner.java | 43 + .../FabricConfigVersionInfoInner.java | 43 + .../implementation/FabricEventInner.java | 111 + .../FailedPropertyBatchInfoInner.java | 76 + .../ImageStoreContentInner.java | 74 + .../implementation/NodeEventInner.java | 67 + .../implementation/NodeHealthInner.java | 44 + .../implementation/NodeInfoInner.java | 504 + .../implementation/NodeLoadInfoInner.java | 73 + .../NodeTransitionProgressInner.java | 77 + .../implementation/OperationStatusInner.java | 104 + .../PagedApplicationInfoListInner.java | 78 + .../PagedApplicationTypeInfoListInner.java | 79 + ...PagedBackupConfigurationInfoListInner.java | 79 + .../PagedBackupEntityListInner.java | 79 + .../PagedBackupInfoListInner.java | 78 + ...PagedBackupPolicyDescriptionListInner.java | 78 + ...dComposeDeploymentStatusInfoListInner.java | 78 + ...PagedDeployedApplicationInfoListInner.java | 79 + .../PagedNodeInfoListInner.java | 77 + .../PagedPropertyInfoListInner.java | 106 + .../PagedReplicaInfoListInner.java | 78 + .../PagedServiceInfoListInner.java | 78 + .../PagedServicePartitionInfoListInner.java | 78 + ...edServiceResourceDescriptionListInner.java | 78 + ...ceResourceReplicaDescriptionListInner.java | 78 + .../PagedSubNameInfoListInner.java | 106 + ...PartitionBackupConfigurationInfoInner.java | 80 + .../PartitionDataLossProgressInner.java | 74 + .../implementation/PartitionEventInner.java | 61 + .../implementation/PartitionHealthInner.java | 74 + .../PartitionLoadInformationInner.java | 106 + .../PartitionQuorumLossProgressInner.java | 74 + .../PartitionRestartProgressInner.java | 74 + .../implementation/PropertyInfoInner.java | 97 + .../implementation/RepairTaskInner.java | 566 + .../RepairTaskUpdateInfoInner.java | 46 + .../implementation/ReplicaEventInner.java | 94 + .../implementation/ReplicaHealthInner.java | 57 + .../implementation/ReplicaInfoInner.java | 162 + .../ResolvedServicePartitionInner.java | 126 + .../RestoreProgressInfoInner.java | 155 + .../ServiceDescriptionInner.java | 407 + .../implementation/ServiceEventInner.java | 65 + .../ServiceFabricClientAPIsImpl.java | 37196 ++++++++++++++++ .../implementation/ServiceHealthInner.java | 73 + .../implementation/ServiceInfoInner.java | 224 + .../implementation/ServiceNameInfoInner.java | 80 + .../ServicePartitionInfoInner.java | 112 + .../ServiceResourceDescriptionInner.java | 259 + ...erviceResourceReplicaDescriptionInner.java | 44 + .../implementation/ServiceTypeInfoInner.java | 127 + .../ServiceTypeManifestInner.java | 44 + .../SuccessfulPropertyBatchInfoInner.java | 53 + ...UpgradeOrchestrationServiceStateInner.java | 43 + ...OrchestrationServiceStateSummaryInner.java | 147 + .../implementation/UploadSessionInner.java | 47 + .../VolumeResourceDescriptionInner.java | 132 + .../implementation/package-info.java | 11 + .../azure/servicefabric/package-info.java | 11 + 533 files changed, 92930 insertions(+) create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AadMetadata.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AddRemoveIncrementalNamedPartitionScalingMechanism.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AnalysisEventMetadata.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationBackupConfigurationInfo.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationBackupEntity.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationCapacityDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationCreatedEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationDefinitionKind.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationDeletedEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationHealthEvaluation.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationHealthPolicies.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationHealthPolicy.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationHealthPolicyMapItem.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationHealthReportCreatedEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationHealthReportExpiredEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationHealthState.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationHealthStateChunk.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationHealthStateChunkList.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationHealthStateFilter.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationMetricDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationPackageCleanupPolicy.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationParameter.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationResourceStatus.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationStatus.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationTypeApplicationsHealthEvaluation.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationTypeDefinitionKind.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationTypeHealthPolicyMapItem.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationTypeImageStorePath.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationTypeInfo.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationTypeStatus.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeCompleteEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeDomainCompleteEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeRollbackCompleteEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeRollbackStartEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeStartEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeUpdateDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationsHealthEvaluation.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AveragePartitionLoadScalingTrigger.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AverageServiceLoadScalingTrigger.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AzureBlobBackupStorageDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupConfigurationInfo.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupEntity.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupEntityKind.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupEpoch.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupInfo.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupPartitionDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupPolicyScope.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupScheduleDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupScheduleFrequencyType.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupScheduleKind.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupState.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupStorageDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupStorageKind.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupSuspensionInfo.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupSuspensionScope.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupType.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BinaryPropertyValue.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosContext.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosEventKind.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosEventWrapper.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosMovePrimaryFaultScheduledEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosMoveSecondaryFaultScheduledEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosParameters.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosParametersDictionaryItem.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosRemoveReplicaFaultCompletedEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosRemoveReplicaFaultScheduledEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosRestartCodePackageFaultCompletedEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosRestartCodePackageFaultScheduledEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosRestartNodeFaultCompletedEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosRestartNodeFaultScheduledEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosRestartReplicaFaultScheduledEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosSchedule.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosScheduleJob.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosScheduleJobActiveDaysOfWeek.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosScheduleStatus.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosStartedEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosStatus.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosStoppedEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosTargetFilter.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/CheckExistsPropertyBatchOperation.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/CheckSequencePropertyBatchOperation.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/CheckValuePropertyBatchOperation.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterConfigurationUpgradeDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterHealthChunkQueryDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterHealthPolicies.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterHealthPolicy.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterHealthReportCreatedEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterHealthReportExpiredEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeCompleteEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeDescriptionObject.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeDomainCompleteEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeHealthPolicyObject.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeRollbackCompleteEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeRollbackStartEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeStartEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/CodePackageEntryPoint.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/CodePackageEntryPointStatistics.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ComposeDeploymentStatus.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ComposeDeploymentUpgradeDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ComposeDeploymentUpgradeState.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ContainerApiRequestBody.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ContainerApiResult.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ContainerCodePackageProperties.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ContainerDeactivatedEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ContainerEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ContainerInstanceView.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ContainerLabel.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ContainerState.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ContainerVolume.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/CreateComposeDeploymentDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/CreateFabricDump.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/CurrentUpgradeDomainProgressInfo.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DataLossMode.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DayOfWeek.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeactivationIntent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeactivationIntentDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeletePropertyBatchOperation.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeltaNodesCheckHealthEvaluation.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployServicePackageToNodeDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedApplicationHealthEvaluation.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedApplicationHealthReportCreatedEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedApplicationHealthReportExpiredEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedApplicationHealthState.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedApplicationHealthStateChunk.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedApplicationHealthStateChunkList.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedApplicationHealthStateFilter.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedApplicationStatus.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedApplicationsHealthEvaluation.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedServiceHealthReportCreatedEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedServiceHealthReportExpiredEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedServicePackageHealthEvaluation.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedServicePackageHealthState.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedServicePackageHealthStateChunk.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedServicePackageHealthStateChunkList.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedServicePackageHealthStateFilter.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedServicePackagesHealthEvaluation.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedStatefulServiceReplicaDetailInfo.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedStatefulServiceReplicaInfo.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedStatelessServiceInstanceDetailInfo.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedStatelessServiceInstanceInfo.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeploymentStatus.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DiagnosticsDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DiagnosticsRef.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DiagnosticsSinkKind.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DiagnosticsSinkProperties.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DoublePropertyValue.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EnableBackupDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EndpointProperties.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EnsureAvailabilitySafetyCheck.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EnsurePartitionQurumSafetyCheck.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EntityHealth.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EntityHealthState.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EntityHealthStateChunk.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EntityHealthStateChunkList.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EntityKind.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EntityKindHealthStateCount.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EntryPointStatus.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EnvironmentVariable.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/Epoch.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EventHealthEvaluation.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ExecutingFaultsChaosEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ExternalStoreProvisionApplicationTypeDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FabricError.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FabricErrorCodes.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FabricErrorError.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FabricErrorException.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FabricEventKind.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FabricReplicaStatus.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FailedUpgradeDomainProgressObject.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FailureAction.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FailureReason.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FailureUpgradeDomainProgressInfo.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FileInfo.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FileShareBackupStorageDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FileVersion.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FolderInfo.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FrequencyBasedBackupScheduleDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/GetBackupByStorageQueryDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/GetPropertyBatchOperation.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/GuidPropertyValue.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HealthEvaluation.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HealthEvaluationKind.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HealthEvaluationWrapper.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HealthEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HealthInformation.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HealthState.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HealthStateCount.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HealthStatistics.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HostIsolationMode.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HostType.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ImageRegistryCredential.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ImageStoreCopyDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ImpactLevel.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/Int64PropertyValue.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/Int64RangePartitionInformation.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/InvokeDataLossResult.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/InvokeQuorumLossResult.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/KeyValueStoreReplicaStatus.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/LoadMetricReport.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/LoadMetricReportInfo.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/MonitoringPolicyDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/MoveCost.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NameDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NamedPartitionInformation.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NamedPartitionSchemeDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NetworkRef.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeAbortedEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeAbortingEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeAddedEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeCloseEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeClosingEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeDeactivateCompleteEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeDeactivateStartEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeDeactivationInfo.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeDeactivationIntent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeDeactivationStatus.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeDeactivationTask.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeDeactivationTaskId.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeDeactivationTaskType.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeDownEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeHealthEvaluation.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeHealthReportCreatedEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeHealthReportExpiredEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeHealthState.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeHealthStateChunk.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeHealthStateChunkList.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeHealthStateFilter.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeId.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeImpact.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeLoadMetricInformation.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeOpenFailedEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeOpenedSuccessEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeOpeningEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeRemovedEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeRepairImpactDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeRepairTargetDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeResult.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeStatus.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeStatusFilter.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeTransitionResult.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeTransitionType.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeUpEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeUpgradePhase.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeUpgradeProgressInfo.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodesHealthEvaluation.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/OperatingSystemTypes.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/OperationState.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/OperationType.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PackageSharingPolicyInfo.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PackageSharingPolicyScope.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionAccessStatus.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionAnalysisEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionBackupEntity.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionHealthEvaluation.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionHealthReportCreatedEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionHealthReportExpiredEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionHealthState.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionHealthStateChunk.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionHealthStateChunkList.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionHealthStateFilter.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionInformation.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionInstanceCountScaleMechanism.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionPrimaryMoveAnalysisEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionReconfigurationCompletedEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionSafetyCheck.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionScheme.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionSchemeDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionsHealthEvaluation.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PrimaryReplicatorStatus.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ProcessDeactivatedEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PropertyBatchDescriptionList.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PropertyBatchInfo.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PropertyBatchInfoKind.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PropertyBatchOperation.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PropertyBatchOperationKind.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PropertyDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PropertyMetadata.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PropertyValue.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PropertyValueKind.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ProvisionApplicationTypeDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ProvisionApplicationTypeDescriptionBase.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ProvisionApplicationTypeKind.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ProvisionFabricDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PutPropertyBatchOperation.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/QuorumLossMode.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReconfigurationInformation.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReconfigurationPhase.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReconfigurationType.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RegistryCredential.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RemoteReplicatorAcknowledgementDetail.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RemoteReplicatorAcknowledgementStatus.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RemoteReplicatorStatus.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RepairImpactDescriptionBase.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RepairImpactKind.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RepairTargetDescriptionBase.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RepairTargetKind.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RepairTaskApproveDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RepairTaskCancelDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RepairTaskDeleteDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RepairTaskHealthCheckState.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RepairTaskHistory.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RepairTaskUpdateHealthPolicyDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicaHealthEvaluation.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicaHealthReportServiceKind.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicaHealthState.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicaHealthStateChunk.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicaHealthStateChunkList.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicaHealthStateFilter.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicaKind.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicaRole.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicaStatus.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicaStatusBase.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicasHealthEvaluation.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicatorOperationName.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicatorQueueStatus.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicatorStatus.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ResolvedServiceEndpoint.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ResourceLimits.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ResourceRequests.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ResourceRequirements.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RestartDeployedCodePackageDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RestartNodeDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RestartPartitionMode.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RestartPartitionResult.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RestorePartitionDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RestoreState.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ResultStatus.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ResumeApplicationUpgradeDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ResumeClusterUpgradeDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RollingUpgradeUpdateDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SafetyCheck.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SafetyCheckKind.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SafetyCheckWrapper.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ScalingMechanismDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ScalingMechanismKind.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ScalingPolicyDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ScalingTriggerDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ScalingTriggerKind.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SecondaryActiveReplicatorStatus.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SecondaryIdleReplicatorStatus.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SecondaryReplicatorStatus.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SeedNodeSafetyCheck.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SelectedPartition.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceBackupConfigurationInfo.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceBackupEntity.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceCorrelationDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceCorrelationScheme.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceCreatedEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceDeletedEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceEndpointRole.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceFromTemplateDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceHealthEvaluation.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceHealthReportCreatedEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceHealthReportExpiredEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceHealthState.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceHealthStateChunk.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceHealthStateChunkList.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceHealthStateFilter.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceKind.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceLoadMetricDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceLoadMetricWeight.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceOperationName.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicePackageActivationMode.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicePartitionKind.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicePartitionStatus.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicePlacementInvalidDomainPolicyDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicePlacementNonPartiallyPlaceServicePolicyDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicePlacementPolicyDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicePlacementPolicyType.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicePlacementPreferPrimaryDomainPolicyDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicePlacementRequireDomainDistributionPolicyDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicePlacementRequiredDomainPolicyDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceReplicaProperties.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceResourceStatus.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceStatus.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceTypeDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceTypeExtensionDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceTypeHealthPolicy.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceTypeHealthPolicyMapItem.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceTypeRegistrationStatus.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceUpdateDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicesHealthEvaluation.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/Setting.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SingletonPartitionInformation.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SingletonPartitionSchemeDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StartClusterUpgradeDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StartedChaosEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/State.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulReplicaHealthReportCreatedEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulReplicaHealthReportExpiredEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulServiceDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulServiceInfo.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulServicePartitionInfo.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulServiceReplicaHealth.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulServiceReplicaHealthState.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulServiceReplicaInfo.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulServiceTypeDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulServiceUpdateDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatelessReplicaHealthReportCreatedEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatelessReplicaHealthReportExpiredEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatelessServiceDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatelessServiceInfo.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatelessServiceInstanceHealth.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatelessServiceInstanceHealthState.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatelessServiceInstanceInfo.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatelessServicePartitionInfo.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatelessServiceTypeDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatelessServiceUpdateDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StoppedChaosEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StringPropertyValue.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SystemApplicationHealthEvaluation.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/TestErrorChaosEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/TimeBasedBackupScheduleDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/TimeOfDay.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/TimeRange.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UniformInt64RangePartitionSchemeDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UnprovisionApplicationTypeDescriptionInfo.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UnprovisionFabricDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UpdateClusterUpgradeDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UpgradeDomainDeltaNodesCheckHealthEvaluation.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UpgradeDomainInfo.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UpgradeDomainNodesHealthEvaluation.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UpgradeDomainState.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UpgradeKind.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UpgradeMode.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UpgradeState.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UpgradeType.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UploadChunkRange.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UploadSessionInfo.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ValidationFailedChaosEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/VolumeProviderParametersAzureFile.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/WaitForInbuildReplicaSafetyCheck.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/WaitForPrimaryPlacementSafetyCheck.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/WaitForPrimarySwapSafetyCheck.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/WaitForReconfigurationSafetyCheck.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/WaitingChaosEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/AadMetadataObjectInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ApplicationEventInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ApplicationHealthInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ApplicationInfoInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ApplicationLoadInfoInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ApplicationNameInfoInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ApplicationResourceDescriptionInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ApplicationTypeManifestInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ApplicationUpgradeProgressInfoInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/BackupPolicyDescriptionInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/BackupProgressInfoInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ChaosEventsSegmentInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ChaosInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ChaosScheduleDescriptionInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ClusterConfigurationInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ClusterConfigurationUpgradeStatusInfoInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ClusterEventInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ClusterHealthChunkInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ClusterHealthInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ClusterManifestInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ClusterUpgradeProgressObjectInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ComposeDeploymentStatusInfoInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ComposeDeploymentUpgradeProgressInfoInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ContainerApiResponseInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ContainerInstanceEventInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ContainerLogsInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/DeployedApplicationHealthInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/DeployedApplicationInfoInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/DeployedCodePackageInfoInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/DeployedServicePackageHealthInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/DeployedServicePackageInfoInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/DeployedServiceReplicaDetailInfoInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/DeployedServiceReplicaInfoInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/DeployedServiceTypeInfoInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/FabricCodeVersionInfoInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/FabricConfigVersionInfoInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/FabricEventInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/FailedPropertyBatchInfoInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ImageStoreContentInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/NodeEventInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/NodeHealthInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/NodeInfoInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/NodeLoadInfoInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/NodeTransitionProgressInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/OperationStatusInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedApplicationInfoListInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedApplicationTypeInfoListInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedBackupConfigurationInfoListInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedBackupEntityListInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedBackupInfoListInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedBackupPolicyDescriptionListInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedComposeDeploymentStatusInfoListInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedDeployedApplicationInfoListInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedNodeInfoListInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedPropertyInfoListInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedReplicaInfoListInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedServiceInfoListInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedServicePartitionInfoListInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedServiceResourceDescriptionListInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedServiceResourceReplicaDescriptionListInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedSubNameInfoListInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PartitionBackupConfigurationInfoInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PartitionDataLossProgressInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PartitionEventInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PartitionHealthInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PartitionLoadInformationInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PartitionQuorumLossProgressInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PartitionRestartProgressInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PropertyInfoInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/RepairTaskInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/RepairTaskUpdateInfoInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ReplicaEventInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ReplicaHealthInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ReplicaInfoInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ResolvedServicePartitionInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/RestoreProgressInfoInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceDescriptionInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceEventInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceFabricClientAPIsImpl.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceHealthInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceInfoInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceNameInfoInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServicePartitionInfoInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceResourceDescriptionInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceResourceReplicaDescriptionInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceTypeInfoInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceTypeManifestInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/SuccessfulPropertyBatchInfoInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/UpgradeOrchestrationServiceStateInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/UpgradeOrchestrationServiceStateSummaryInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/UploadSessionInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/VolumeResourceDescriptionInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/package-info.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/package-info.java diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AadMetadata.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AadMetadata.java new file mode 100644 index 0000000000000..9e7f8ec0759bf --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AadMetadata.java @@ -0,0 +1,173 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Azure Active Directory metadata used for secured connection to cluster. + */ +public class AadMetadata { + /** + * The AAD authority url. + */ + @JsonProperty(value = "authority") + private String authority; + + /** + * The AAD client application Id. + */ + @JsonProperty(value = "client") + private String client; + + /** + * The AAD cluster application Id. + */ + @JsonProperty(value = "cluster") + private String cluster; + + /** + * The AAD login url. + */ + @JsonProperty(value = "login") + private String login; + + /** + * The client application redirect address. + */ + @JsonProperty(value = "redirect") + private String redirect; + + /** + * The AAD tenant Id. + */ + @JsonProperty(value = "tenant") + private String tenant; + + /** + * Get the AAD authority url. + * + * @return the authority value + */ + public String authority() { + return this.authority; + } + + /** + * Set the AAD authority url. + * + * @param authority the authority value to set + * @return the AadMetadata object itself. + */ + public AadMetadata withAuthority(String authority) { + this.authority = authority; + return this; + } + + /** + * Get the AAD client application Id. + * + * @return the client value + */ + public String client() { + return this.client; + } + + /** + * Set the AAD client application Id. + * + * @param client the client value to set + * @return the AadMetadata object itself. + */ + public AadMetadata withClient(String client) { + this.client = client; + return this; + } + + /** + * Get the AAD cluster application Id. + * + * @return the cluster value + */ + public String cluster() { + return this.cluster; + } + + /** + * Set the AAD cluster application Id. + * + * @param cluster the cluster value to set + * @return the AadMetadata object itself. + */ + public AadMetadata withCluster(String cluster) { + this.cluster = cluster; + return this; + } + + /** + * Get the AAD login url. + * + * @return the login value + */ + public String login() { + return this.login; + } + + /** + * Set the AAD login url. + * + * @param login the login value to set + * @return the AadMetadata object itself. + */ + public AadMetadata withLogin(String login) { + this.login = login; + return this; + } + + /** + * Get the client application redirect address. + * + * @return the redirect value + */ + public String redirect() { + return this.redirect; + } + + /** + * Set the client application redirect address. + * + * @param redirect the redirect value to set + * @return the AadMetadata object itself. + */ + public AadMetadata withRedirect(String redirect) { + this.redirect = redirect; + return this; + } + + /** + * Get the AAD tenant Id. + * + * @return the tenant value + */ + public String tenant() { + return this.tenant; + } + + /** + * Set the AAD tenant Id. + * + * @param tenant the tenant value to set + * @return the AadMetadata object itself. + */ + public AadMetadata withTenant(String tenant) { + this.tenant = tenant; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AddRemoveIncrementalNamedPartitionScalingMechanism.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AddRemoveIncrementalNamedPartitionScalingMechanism.java new file mode 100644 index 0000000000000..5ff9ba50c2b93 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AddRemoveIncrementalNamedPartitionScalingMechanism.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents a scaling mechanism for adding or removing named partitions of a + * stateless service. Partition names are in the format '0','1''N-1'. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("AddRemoveIncrementalNamedPartition") +public class AddRemoveIncrementalNamedPartitionScalingMechanism extends ScalingMechanismDescription { + /** + * Minimum number of named partitions of the service. + */ + @JsonProperty(value = "MinPartitionCount", required = true) + private int minPartitionCount; + + /** + * Maximum number of named partitions of the service. + */ + @JsonProperty(value = "MaxPartitionCount", required = true) + private int maxPartitionCount; + + /** + * The number of instances to add or remove during a scaling operation. + */ + @JsonProperty(value = "ScaleIncrement", required = true) + private int scaleIncrement; + + /** + * Get minimum number of named partitions of the service. + * + * @return the minPartitionCount value + */ + public int minPartitionCount() { + return this.minPartitionCount; + } + + /** + * Set minimum number of named partitions of the service. + * + * @param minPartitionCount the minPartitionCount value to set + * @return the AddRemoveIncrementalNamedPartitionScalingMechanism object itself. + */ + public AddRemoveIncrementalNamedPartitionScalingMechanism withMinPartitionCount(int minPartitionCount) { + this.minPartitionCount = minPartitionCount; + return this; + } + + /** + * Get maximum number of named partitions of the service. + * + * @return the maxPartitionCount value + */ + public int maxPartitionCount() { + return this.maxPartitionCount; + } + + /** + * Set maximum number of named partitions of the service. + * + * @param maxPartitionCount the maxPartitionCount value to set + * @return the AddRemoveIncrementalNamedPartitionScalingMechanism object itself. + */ + public AddRemoveIncrementalNamedPartitionScalingMechanism withMaxPartitionCount(int maxPartitionCount) { + this.maxPartitionCount = maxPartitionCount; + return this; + } + + /** + * Get the number of instances to add or remove during a scaling operation. + * + * @return the scaleIncrement value + */ + public int scaleIncrement() { + return this.scaleIncrement; + } + + /** + * Set the number of instances to add or remove during a scaling operation. + * + * @param scaleIncrement the scaleIncrement value to set + * @return the AddRemoveIncrementalNamedPartitionScalingMechanism object itself. + */ + public AddRemoveIncrementalNamedPartitionScalingMechanism withScaleIncrement(int scaleIncrement) { + this.scaleIncrement = scaleIncrement; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AnalysisEventMetadata.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AnalysisEventMetadata.java new file mode 100644 index 0000000000000..6414428b20abf --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AnalysisEventMetadata.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.Period; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Metadata about an Analysis Event. + */ +public class AnalysisEventMetadata { + /** + * The analysis delay. + */ + @JsonProperty(value = "Delay") + private Period delay; + + /** + * The duration of analysis. + */ + @JsonProperty(value = "Duration") + private Period duration; + + /** + * Get the analysis delay. + * + * @return the delay value + */ + public Period delay() { + return this.delay; + } + + /** + * Set the analysis delay. + * + * @param delay the delay value to set + * @return the AnalysisEventMetadata object itself. + */ + public AnalysisEventMetadata withDelay(Period delay) { + this.delay = delay; + return this; + } + + /** + * Get the duration of analysis. + * + * @return the duration value + */ + public Period duration() { + return this.duration; + } + + /** + * Set the duration of analysis. + * + * @param duration the duration value to set + * @return the AnalysisEventMetadata object itself. + */ + public AnalysisEventMetadata withDuration(Period duration) { + this.duration = duration; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationBackupConfigurationInfo.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationBackupConfigurationInfo.java new file mode 100644 index 0000000000000..36d534d66ad2d --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationBackupConfigurationInfo.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Backup configuration information for a specific Service Fabric application + * specifying what backup policy is being applied and suspend description, if + * any. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("Application") +public class ApplicationBackupConfigurationInfo extends BackupConfigurationInfo { + /** + * The name of the application, including the 'fabric:' URI scheme. + */ + @JsonProperty(value = "ApplicationName") + private String applicationName; + + /** + * Get the name of the application, including the 'fabric:' URI scheme. + * + * @return the applicationName value + */ + public String applicationName() { + return this.applicationName; + } + + /** + * Set the name of the application, including the 'fabric:' URI scheme. + * + * @param applicationName the applicationName value to set + * @return the ApplicationBackupConfigurationInfo object itself. + */ + public ApplicationBackupConfigurationInfo withApplicationName(String applicationName) { + this.applicationName = applicationName; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationBackupEntity.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationBackupEntity.java new file mode 100644 index 0000000000000..0a767f3f7f425 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationBackupEntity.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Identifies the Service Fabric application which is being backed up. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "EntityKind") +@JsonTypeName("Application") +public class ApplicationBackupEntity extends BackupEntity { + /** + * The name of the application, including the 'fabric:' URI scheme. + */ + @JsonProperty(value = "ApplicationName") + private String applicationName; + + /** + * Get the name of the application, including the 'fabric:' URI scheme. + * + * @return the applicationName value + */ + public String applicationName() { + return this.applicationName; + } + + /** + * Set the name of the application, including the 'fabric:' URI scheme. + * + * @param applicationName the applicationName value to set + * @return the ApplicationBackupEntity object itself. + */ + public ApplicationBackupEntity withApplicationName(String applicationName) { + this.applicationName = applicationName; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationCapacityDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationCapacityDescription.java new file mode 100644 index 0000000000000..e50e5da35a68c --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationCapacityDescription.java @@ -0,0 +1,110 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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. + */ +public class ApplicationCapacityDescription { + /** + * 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. + */ + @JsonProperty(value = "MinimumNodes") + private Long minimumNodes; + + /** + * 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. + */ + @JsonProperty(value = "MaximumNodes") + private Long maximumNodes; + + /** + * List of application capacity metric description. + */ + @JsonProperty(value = "ApplicationMetrics") + private List applicationMetrics; + + /** + * Get 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. + * + * @return the minimumNodes value + */ + public Long minimumNodes() { + return this.minimumNodes; + } + + /** + * Set 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 minimumNodes the minimumNodes value to set + * @return the ApplicationCapacityDescription object itself. + */ + public ApplicationCapacityDescription withMinimumNodes(Long minimumNodes) { + this.minimumNodes = minimumNodes; + return this; + } + + /** + * Get 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. + * + * @return the maximumNodes value + */ + public Long maximumNodes() { + return this.maximumNodes; + } + + /** + * Set 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 maximumNodes the maximumNodes value to set + * @return the ApplicationCapacityDescription object itself. + */ + public ApplicationCapacityDescription withMaximumNodes(Long maximumNodes) { + this.maximumNodes = maximumNodes; + return this; + } + + /** + * Get list of application capacity metric description. + * + * @return the applicationMetrics value + */ + public List applicationMetrics() { + return this.applicationMetrics; + } + + /** + * Set list of application capacity metric description. + * + * @param applicationMetrics the applicationMetrics value to set + * @return the ApplicationCapacityDescription object itself. + */ + public ApplicationCapacityDescription withApplicationMetrics(List applicationMetrics) { + this.applicationMetrics = applicationMetrics; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationCreatedEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationCreatedEvent.java new file mode 100644 index 0000000000000..a894737a16909 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationCreatedEvent.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ApplicationEventInner; + +/** + * Application Created event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ApplicationCreated") +public class ApplicationCreatedEvent extends ApplicationEventInner { + /** + * Application type name. + */ + @JsonProperty(value = "ApplicationTypeName", required = true) + private String applicationTypeName; + + /** + * Application type version. + */ + @JsonProperty(value = "ApplicationTypeVersion", required = true) + private String applicationTypeVersion; + + /** + * Application definition kind. + */ + @JsonProperty(value = "ApplicationDefinitionKind", required = true) + private String applicationDefinitionKind; + + /** + * Get application type name. + * + * @return the applicationTypeName value + */ + public String applicationTypeName() { + return this.applicationTypeName; + } + + /** + * Set application type name. + * + * @param applicationTypeName the applicationTypeName value to set + * @return the ApplicationCreatedEvent object itself. + */ + public ApplicationCreatedEvent withApplicationTypeName(String applicationTypeName) { + this.applicationTypeName = applicationTypeName; + return this; + } + + /** + * Get application type version. + * + * @return the applicationTypeVersion value + */ + public String applicationTypeVersion() { + return this.applicationTypeVersion; + } + + /** + * Set application type version. + * + * @param applicationTypeVersion the applicationTypeVersion value to set + * @return the ApplicationCreatedEvent object itself. + */ + public ApplicationCreatedEvent withApplicationTypeVersion(String applicationTypeVersion) { + this.applicationTypeVersion = applicationTypeVersion; + return this; + } + + /** + * Get application definition kind. + * + * @return the applicationDefinitionKind value + */ + public String applicationDefinitionKind() { + return this.applicationDefinitionKind; + } + + /** + * Set application definition kind. + * + * @param applicationDefinitionKind the applicationDefinitionKind value to set + * @return the ApplicationCreatedEvent object itself. + */ + public ApplicationCreatedEvent withApplicationDefinitionKind(String applicationDefinitionKind) { + this.applicationDefinitionKind = applicationDefinitionKind; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationDefinitionKind.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationDefinitionKind.java new file mode 100644 index 0000000000000..72de580d4d363 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationDefinitionKind.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationDefinitionKind. + */ +public final class ApplicationDefinitionKind extends ExpandableStringEnum { + /** Static value Invalid for ApplicationDefinitionKind. */ + public static final ApplicationDefinitionKind INVALID = fromString("Invalid"); + + /** Static value ServiceFabricApplicationDescription for ApplicationDefinitionKind. */ + public static final ApplicationDefinitionKind SERVICE_FABRIC_APPLICATION_DESCRIPTION = fromString("ServiceFabricApplicationDescription"); + + /** Static value Compose for ApplicationDefinitionKind. */ + public static final ApplicationDefinitionKind COMPOSE = fromString("Compose"); + + /** + * Creates or finds a ApplicationDefinitionKind from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationDefinitionKind + */ + @JsonCreator + public static ApplicationDefinitionKind fromString(String name) { + return fromString(name, ApplicationDefinitionKind.class); + } + + /** + * @return known ApplicationDefinitionKind values + */ + public static Collection values() { + return values(ApplicationDefinitionKind.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationDeletedEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationDeletedEvent.java new file mode 100644 index 0000000000000..f0f99be9b3dfc --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationDeletedEvent.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ApplicationEventInner; + +/** + * Application Deleted event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ApplicationDeleted") +public class ApplicationDeletedEvent extends ApplicationEventInner { + /** + * Application type name. + */ + @JsonProperty(value = "ApplicationTypeName", required = true) + private String applicationTypeName; + + /** + * Application type version. + */ + @JsonProperty(value = "ApplicationTypeVersion", required = true) + private String applicationTypeVersion; + + /** + * Get application type name. + * + * @return the applicationTypeName value + */ + public String applicationTypeName() { + return this.applicationTypeName; + } + + /** + * Set application type name. + * + * @param applicationTypeName the applicationTypeName value to set + * @return the ApplicationDeletedEvent object itself. + */ + public ApplicationDeletedEvent withApplicationTypeName(String applicationTypeName) { + this.applicationTypeName = applicationTypeName; + return this; + } + + /** + * Get application type version. + * + * @return the applicationTypeVersion value + */ + public String applicationTypeVersion() { + return this.applicationTypeVersion; + } + + /** + * Set application type version. + * + * @param applicationTypeVersion the applicationTypeVersion value to set + * @return the ApplicationDeletedEvent object itself. + */ + public ApplicationDeletedEvent withApplicationTypeVersion(String applicationTypeVersion) { + this.applicationTypeVersion = applicationTypeVersion; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationDescription.java new file mode 100644 index 0000000000000..d026aed78603e --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationDescription.java @@ -0,0 +1,162 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a Service Fabric application. + */ +public class ApplicationDescription { + /** + * The name of the application, including the 'fabric:' URI scheme. + */ + @JsonProperty(value = "Name", required = true) + private String name; + + /** + * The application type name as defined in the application manifest. + */ + @JsonProperty(value = "TypeName", required = true) + private String typeName; + + /** + * The version of the application type as defined in the application + * manifest. + */ + @JsonProperty(value = "TypeVersion", required = true) + private String typeVersion; + + /** + * List of application parameters with overridden values from their default + * values specified in the application manifest. + */ + @JsonProperty(value = "ParameterList") + private List parameterList; + + /** + * 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. + */ + @JsonProperty(value = "ApplicationCapacity") + private ApplicationCapacityDescription applicationCapacity; + + /** + * Get the name of the application, including the 'fabric:' URI scheme. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the application, including the 'fabric:' URI scheme. + * + * @param name the name value to set + * @return the ApplicationDescription object itself. + */ + public ApplicationDescription withName(String name) { + this.name = name; + return this; + } + + /** + * Get the application type name as defined in the application manifest. + * + * @return the typeName value + */ + public String typeName() { + return this.typeName; + } + + /** + * Set the application type name as defined in the application manifest. + * + * @param typeName the typeName value to set + * @return the ApplicationDescription object itself. + */ + public ApplicationDescription withTypeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get the version of the application type as defined in the application manifest. + * + * @return the typeVersion value + */ + public String typeVersion() { + return this.typeVersion; + } + + /** + * Set the version of the application type as defined in the application manifest. + * + * @param typeVersion the typeVersion value to set + * @return the ApplicationDescription object itself. + */ + public ApplicationDescription withTypeVersion(String typeVersion) { + this.typeVersion = typeVersion; + return this; + } + + /** + * Get list of application parameters with overridden values from their default values specified in the application manifest. + * + * @return the parameterList value + */ + public List parameterList() { + return this.parameterList; + } + + /** + * Set list of application parameters with overridden values from their default values specified in the application manifest. + * + * @param parameterList the parameterList value to set + * @return the ApplicationDescription object itself. + */ + public ApplicationDescription withParameterList(List parameterList) { + this.parameterList = parameterList; + return this; + } + + /** + * Get 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. + * + * @return the applicationCapacity value + */ + public ApplicationCapacityDescription applicationCapacity() { + return this.applicationCapacity; + } + + /** + * Set 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 applicationCapacity the applicationCapacity value to set + * @return the ApplicationDescription object itself. + */ + public ApplicationDescription withApplicationCapacity(ApplicationCapacityDescription applicationCapacity) { + this.applicationCapacity = applicationCapacity; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationHealthEvaluation.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationHealthEvaluation.java new file mode 100644 index 0000000000000..cc2e9c17b3c43 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationHealthEvaluation.java @@ -0,0 +1,79 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents health evaluation for an application, containing information + * about the data and the algorithm used by the health store to evaluate + * health. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("Application") +public class ApplicationHealthEvaluation extends HealthEvaluation { + /** + * The name of the application, including the 'fabric:' URI scheme. + */ + @JsonProperty(value = "ApplicationName") + private String applicationName; + + /** + * List of unhealthy evaluations that led to the current aggregated health + * state of the application. The types of the unhealthy evaluations can be + * DeployedApplicationsHealthEvaluation, ServicesHealthEvaluation or + * EventHealthEvaluation. + */ + @JsonProperty(value = "UnhealthyEvaluations") + private List unhealthyEvaluations; + + /** + * Get the name of the application, including the 'fabric:' URI scheme. + * + * @return the applicationName value + */ + public String applicationName() { + return this.applicationName; + } + + /** + * Set the name of the application, including the 'fabric:' URI scheme. + * + * @param applicationName the applicationName value to set + * @return the ApplicationHealthEvaluation object itself. + */ + public ApplicationHealthEvaluation withApplicationName(String applicationName) { + this.applicationName = applicationName; + return this; + } + + /** + * Get list of unhealthy evaluations that led to the current aggregated health state of the application. The types of the unhealthy evaluations can be DeployedApplicationsHealthEvaluation, ServicesHealthEvaluation or EventHealthEvaluation. + * + * @return the unhealthyEvaluations value + */ + public List unhealthyEvaluations() { + return this.unhealthyEvaluations; + } + + /** + * Set list of unhealthy evaluations that led to the current aggregated health state of the application. The types of the unhealthy evaluations can be DeployedApplicationsHealthEvaluation, ServicesHealthEvaluation or EventHealthEvaluation. + * + * @param unhealthyEvaluations the unhealthyEvaluations value to set + * @return the ApplicationHealthEvaluation object itself. + */ + public ApplicationHealthEvaluation withUnhealthyEvaluations(List unhealthyEvaluations) { + this.unhealthyEvaluations = unhealthyEvaluations; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationHealthPolicies.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationHealthPolicies.java new file mode 100644 index 0000000000000..030aa1caf38af --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationHealthPolicies.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines the application health policy map used to evaluate the health of an + * application or one of its children entities. + */ +public class ApplicationHealthPolicies { + /** + * The wrapper that contains the map with application health policies used + * to evaluate specific applications in the cluster. + */ + @JsonProperty(value = "ApplicationHealthPolicyMap") + private List applicationHealthPolicyMap; + + /** + * Get the wrapper that contains the map with application health policies used to evaluate specific applications in the cluster. + * + * @return the applicationHealthPolicyMap value + */ + public List applicationHealthPolicyMap() { + return this.applicationHealthPolicyMap; + } + + /** + * Set the wrapper that contains the map with application health policies used to evaluate specific applications in the cluster. + * + * @param applicationHealthPolicyMap the applicationHealthPolicyMap value to set + * @return the ApplicationHealthPolicies object itself. + */ + public ApplicationHealthPolicies withApplicationHealthPolicyMap(List applicationHealthPolicyMap) { + this.applicationHealthPolicyMap = applicationHealthPolicyMap; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationHealthPolicy.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationHealthPolicy.java new file mode 100644 index 0000000000000..ebae4b4becf76 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationHealthPolicy.java @@ -0,0 +1,140 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines a health policy used to evaluate the health of an application or one + * of its children entities. + */ +public class ApplicationHealthPolicy { + /** + * Indicates whether warnings are treated with the same severity as errors. + */ + @JsonProperty(value = "ConsiderWarningAsError") + private Boolean considerWarningAsError; + + /** + * 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. + */ + @JsonProperty(value = "MaxPercentUnhealthyDeployedApplications") + private Integer maxPercentUnhealthyDeployedApplications; + + /** + * The health policy used by default to evaluate the health of a service + * type. + */ + @JsonProperty(value = "DefaultServiceTypeHealthPolicy") + private ServiceTypeHealthPolicy defaultServiceTypeHealthPolicy; + + /** + * The map with service type health policy per service type name. The map + * is empty by default. + */ + @JsonProperty(value = "ServiceTypeHealthPolicyMap") + private List serviceTypeHealthPolicyMap; + + /** + * Get indicates whether warnings are treated with the same severity as errors. + * + * @return the considerWarningAsError value + */ + public Boolean considerWarningAsError() { + return this.considerWarningAsError; + } + + /** + * Set indicates whether warnings are treated with the same severity as errors. + * + * @param considerWarningAsError the considerWarningAsError value to set + * @return the ApplicationHealthPolicy object itself. + */ + public ApplicationHealthPolicy withConsiderWarningAsError(Boolean considerWarningAsError) { + this.considerWarningAsError = considerWarningAsError; + return this; + } + + /** + * Get 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. + * + * @return the maxPercentUnhealthyDeployedApplications value + */ + public Integer maxPercentUnhealthyDeployedApplications() { + return this.maxPercentUnhealthyDeployedApplications; + } + + /** + * Set 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 maxPercentUnhealthyDeployedApplications the maxPercentUnhealthyDeployedApplications value to set + * @return the ApplicationHealthPolicy object itself. + */ + public ApplicationHealthPolicy withMaxPercentUnhealthyDeployedApplications(Integer maxPercentUnhealthyDeployedApplications) { + this.maxPercentUnhealthyDeployedApplications = maxPercentUnhealthyDeployedApplications; + return this; + } + + /** + * Get the health policy used by default to evaluate the health of a service type. + * + * @return the defaultServiceTypeHealthPolicy value + */ + public ServiceTypeHealthPolicy defaultServiceTypeHealthPolicy() { + return this.defaultServiceTypeHealthPolicy; + } + + /** + * Set the health policy used by default to evaluate the health of a service type. + * + * @param defaultServiceTypeHealthPolicy the defaultServiceTypeHealthPolicy value to set + * @return the ApplicationHealthPolicy object itself. + */ + public ApplicationHealthPolicy withDefaultServiceTypeHealthPolicy(ServiceTypeHealthPolicy defaultServiceTypeHealthPolicy) { + this.defaultServiceTypeHealthPolicy = defaultServiceTypeHealthPolicy; + return this; + } + + /** + * Get the map with service type health policy per service type name. The map is empty by default. + * + * @return the serviceTypeHealthPolicyMap value + */ + public List serviceTypeHealthPolicyMap() { + return this.serviceTypeHealthPolicyMap; + } + + /** + * Set the map with service type health policy per service type name. The map is empty by default. + * + * @param serviceTypeHealthPolicyMap the serviceTypeHealthPolicyMap value to set + * @return the ApplicationHealthPolicy object itself. + */ + public ApplicationHealthPolicy withServiceTypeHealthPolicyMap(List serviceTypeHealthPolicyMap) { + this.serviceTypeHealthPolicyMap = serviceTypeHealthPolicyMap; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationHealthPolicyMapItem.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationHealthPolicyMapItem.java new file mode 100644 index 0000000000000..d526ce197ce0d --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationHealthPolicyMapItem.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines an item in ApplicationHealthPolicyMap. + */ +public class ApplicationHealthPolicyMapItem { + /** + * The key of the application health policy map item. This is the name of + * the application. + */ + @JsonProperty(value = "Key", required = true) + private String key; + + /** + * The value of the application health policy map item. This is the + * ApplicationHealthPolicy for this application. + */ + @JsonProperty(value = "Value", required = true) + private ApplicationHealthPolicy value; + + /** + * Get the key of the application health policy map item. This is the name of the application. + * + * @return the key value + */ + public String key() { + return this.key; + } + + /** + * Set the key of the application health policy map item. This is the name of the application. + * + * @param key the key value to set + * @return the ApplicationHealthPolicyMapItem object itself. + */ + public ApplicationHealthPolicyMapItem withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value of the application health policy map item. This is the ApplicationHealthPolicy for this application. + * + * @return the value value + */ + public ApplicationHealthPolicy value() { + return this.value; + } + + /** + * Set the value of the application health policy map item. This is the ApplicationHealthPolicy for this application. + * + * @param value the value value to set + * @return the ApplicationHealthPolicyMapItem object itself. + */ + public ApplicationHealthPolicyMapItem withValue(ApplicationHealthPolicy value) { + this.value = value; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationHealthReportCreatedEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationHealthReportCreatedEvent.java new file mode 100644 index 0000000000000..27411c91f38c8 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationHealthReportCreatedEvent.java @@ -0,0 +1,257 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ApplicationEventInner; + +/** + * Application Health Report Created event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ApplicationHealthReportCreated") +public class ApplicationHealthReportCreatedEvent extends ApplicationEventInner { + /** + * Id of Application instance. + */ + @JsonProperty(value = "ApplicationInstanceId", required = true) + private long applicationInstanceId; + + /** + * Id of report source. + */ + @JsonProperty(value = "SourceId", required = true) + private String sourceId; + + /** + * Describes the property. + */ + @JsonProperty(value = "Property", required = true) + private String property; + + /** + * Describes the property health state. + */ + @JsonProperty(value = "HealthState", required = true) + private String healthState; + + /** + * Time to live in milli-seconds. + */ + @JsonProperty(value = "TimeToLiveMs", required = true) + private long timeToLiveMs; + + /** + * Sequence number of report. + */ + @JsonProperty(value = "SequenceNumber", required = true) + private long sequenceNumber; + + /** + * Description of report. + */ + @JsonProperty(value = "Description", required = true) + private String description; + + /** + * Indicates the removal when it expires. + */ + @JsonProperty(value = "RemoveWhenExpired", required = true) + private boolean removeWhenExpired; + + /** + * Source time. + */ + @JsonProperty(value = "SourceUtcTimestamp", required = true) + private DateTime sourceUtcTimestamp; + + /** + * Get id of Application instance. + * + * @return the applicationInstanceId value + */ + public long applicationInstanceId() { + return this.applicationInstanceId; + } + + /** + * Set id of Application instance. + * + * @param applicationInstanceId the applicationInstanceId value to set + * @return the ApplicationHealthReportCreatedEvent object itself. + */ + public ApplicationHealthReportCreatedEvent withApplicationInstanceId(long applicationInstanceId) { + this.applicationInstanceId = applicationInstanceId; + return this; + } + + /** + * Get id of report source. + * + * @return the sourceId value + */ + public String sourceId() { + return this.sourceId; + } + + /** + * Set id of report source. + * + * @param sourceId the sourceId value to set + * @return the ApplicationHealthReportCreatedEvent object itself. + */ + public ApplicationHealthReportCreatedEvent withSourceId(String sourceId) { + this.sourceId = sourceId; + return this; + } + + /** + * Get describes the property. + * + * @return the property value + */ + public String property() { + return this.property; + } + + /** + * Set describes the property. + * + * @param property the property value to set + * @return the ApplicationHealthReportCreatedEvent object itself. + */ + public ApplicationHealthReportCreatedEvent withProperty(String property) { + this.property = property; + return this; + } + + /** + * Get describes the property health state. + * + * @return the healthState value + */ + public String healthState() { + return this.healthState; + } + + /** + * Set describes the property health state. + * + * @param healthState the healthState value to set + * @return the ApplicationHealthReportCreatedEvent object itself. + */ + public ApplicationHealthReportCreatedEvent withHealthState(String healthState) { + this.healthState = healthState; + return this; + } + + /** + * Get time to live in milli-seconds. + * + * @return the timeToLiveMs value + */ + public long timeToLiveMs() { + return this.timeToLiveMs; + } + + /** + * Set time to live in milli-seconds. + * + * @param timeToLiveMs the timeToLiveMs value to set + * @return the ApplicationHealthReportCreatedEvent object itself. + */ + public ApplicationHealthReportCreatedEvent withTimeToLiveMs(long timeToLiveMs) { + this.timeToLiveMs = timeToLiveMs; + return this; + } + + /** + * Get sequence number of report. + * + * @return the sequenceNumber value + */ + public long sequenceNumber() { + return this.sequenceNumber; + } + + /** + * Set sequence number of report. + * + * @param sequenceNumber the sequenceNumber value to set + * @return the ApplicationHealthReportCreatedEvent object itself. + */ + public ApplicationHealthReportCreatedEvent withSequenceNumber(long sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get description of report. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of report. + * + * @param description the description value to set + * @return the ApplicationHealthReportCreatedEvent object itself. + */ + public ApplicationHealthReportCreatedEvent withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get indicates the removal when it expires. + * + * @return the removeWhenExpired value + */ + public boolean removeWhenExpired() { + return this.removeWhenExpired; + } + + /** + * Set indicates the removal when it expires. + * + * @param removeWhenExpired the removeWhenExpired value to set + * @return the ApplicationHealthReportCreatedEvent object itself. + */ + public ApplicationHealthReportCreatedEvent withRemoveWhenExpired(boolean removeWhenExpired) { + this.removeWhenExpired = removeWhenExpired; + return this; + } + + /** + * Get source time. + * + * @return the sourceUtcTimestamp value + */ + public DateTime sourceUtcTimestamp() { + return this.sourceUtcTimestamp; + } + + /** + * Set source time. + * + * @param sourceUtcTimestamp the sourceUtcTimestamp value to set + * @return the ApplicationHealthReportCreatedEvent object itself. + */ + public ApplicationHealthReportCreatedEvent withSourceUtcTimestamp(DateTime sourceUtcTimestamp) { + this.sourceUtcTimestamp = sourceUtcTimestamp; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationHealthReportExpiredEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationHealthReportExpiredEvent.java new file mode 100644 index 0000000000000..8c3b6bd6cd01f --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationHealthReportExpiredEvent.java @@ -0,0 +1,257 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ApplicationEventInner; + +/** + * Application Health Report Expired event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ApplicationHealthReportExpired") +public class ApplicationHealthReportExpiredEvent extends ApplicationEventInner { + /** + * Id of Application instance. + */ + @JsonProperty(value = "ApplicationInstanceId", required = true) + private long applicationInstanceId; + + /** + * Id of report source. + */ + @JsonProperty(value = "SourceId", required = true) + private String sourceId; + + /** + * Describes the property. + */ + @JsonProperty(value = "Property", required = true) + private String property; + + /** + * Describes the property health state. + */ + @JsonProperty(value = "HealthState", required = true) + private String healthState; + + /** + * Time to live in milli-seconds. + */ + @JsonProperty(value = "TimeToLiveMs", required = true) + private long timeToLiveMs; + + /** + * Sequence number of report. + */ + @JsonProperty(value = "SequenceNumber", required = true) + private long sequenceNumber; + + /** + * Description of report. + */ + @JsonProperty(value = "Description", required = true) + private String description; + + /** + * Indicates the removal when it expires. + */ + @JsonProperty(value = "RemoveWhenExpired", required = true) + private boolean removeWhenExpired; + + /** + * Source time. + */ + @JsonProperty(value = "SourceUtcTimestamp", required = true) + private DateTime sourceUtcTimestamp; + + /** + * Get id of Application instance. + * + * @return the applicationInstanceId value + */ + public long applicationInstanceId() { + return this.applicationInstanceId; + } + + /** + * Set id of Application instance. + * + * @param applicationInstanceId the applicationInstanceId value to set + * @return the ApplicationHealthReportExpiredEvent object itself. + */ + public ApplicationHealthReportExpiredEvent withApplicationInstanceId(long applicationInstanceId) { + this.applicationInstanceId = applicationInstanceId; + return this; + } + + /** + * Get id of report source. + * + * @return the sourceId value + */ + public String sourceId() { + return this.sourceId; + } + + /** + * Set id of report source. + * + * @param sourceId the sourceId value to set + * @return the ApplicationHealthReportExpiredEvent object itself. + */ + public ApplicationHealthReportExpiredEvent withSourceId(String sourceId) { + this.sourceId = sourceId; + return this; + } + + /** + * Get describes the property. + * + * @return the property value + */ + public String property() { + return this.property; + } + + /** + * Set describes the property. + * + * @param property the property value to set + * @return the ApplicationHealthReportExpiredEvent object itself. + */ + public ApplicationHealthReportExpiredEvent withProperty(String property) { + this.property = property; + return this; + } + + /** + * Get describes the property health state. + * + * @return the healthState value + */ + public String healthState() { + return this.healthState; + } + + /** + * Set describes the property health state. + * + * @param healthState the healthState value to set + * @return the ApplicationHealthReportExpiredEvent object itself. + */ + public ApplicationHealthReportExpiredEvent withHealthState(String healthState) { + this.healthState = healthState; + return this; + } + + /** + * Get time to live in milli-seconds. + * + * @return the timeToLiveMs value + */ + public long timeToLiveMs() { + return this.timeToLiveMs; + } + + /** + * Set time to live in milli-seconds. + * + * @param timeToLiveMs the timeToLiveMs value to set + * @return the ApplicationHealthReportExpiredEvent object itself. + */ + public ApplicationHealthReportExpiredEvent withTimeToLiveMs(long timeToLiveMs) { + this.timeToLiveMs = timeToLiveMs; + return this; + } + + /** + * Get sequence number of report. + * + * @return the sequenceNumber value + */ + public long sequenceNumber() { + return this.sequenceNumber; + } + + /** + * Set sequence number of report. + * + * @param sequenceNumber the sequenceNumber value to set + * @return the ApplicationHealthReportExpiredEvent object itself. + */ + public ApplicationHealthReportExpiredEvent withSequenceNumber(long sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get description of report. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of report. + * + * @param description the description value to set + * @return the ApplicationHealthReportExpiredEvent object itself. + */ + public ApplicationHealthReportExpiredEvent withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get indicates the removal when it expires. + * + * @return the removeWhenExpired value + */ + public boolean removeWhenExpired() { + return this.removeWhenExpired; + } + + /** + * Set indicates the removal when it expires. + * + * @param removeWhenExpired the removeWhenExpired value to set + * @return the ApplicationHealthReportExpiredEvent object itself. + */ + public ApplicationHealthReportExpiredEvent withRemoveWhenExpired(boolean removeWhenExpired) { + this.removeWhenExpired = removeWhenExpired; + return this; + } + + /** + * Get source time. + * + * @return the sourceUtcTimestamp value + */ + public DateTime sourceUtcTimestamp() { + return this.sourceUtcTimestamp; + } + + /** + * Set source time. + * + * @param sourceUtcTimestamp the sourceUtcTimestamp value to set + * @return the ApplicationHealthReportExpiredEvent object itself. + */ + public ApplicationHealthReportExpiredEvent withSourceUtcTimestamp(DateTime sourceUtcTimestamp) { + this.sourceUtcTimestamp = sourceUtcTimestamp; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationHealthState.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationHealthState.java new file mode 100644 index 0000000000000..7558c769e09db --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationHealthState.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents the health state of an application, which contains the + * application identifier and the aggregated health state. + */ +public class ApplicationHealthState extends EntityHealthState { + /** + * The name of the application, including the 'fabric:' URI scheme. + */ + @JsonProperty(value = "Name") + private String name; + + /** + * Get the name of the application, including the 'fabric:' URI scheme. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the application, including the 'fabric:' URI scheme. + * + * @param name the name value to set + * @return the ApplicationHealthState object itself. + */ + public ApplicationHealthState withName(String name) { + this.name = name; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationHealthStateChunk.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationHealthStateChunk.java new file mode 100644 index 0000000000000..29d685aca88e6 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationHealthStateChunk.java @@ -0,0 +1,126 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents the health state chunk of a application. + * The application health state chunk contains the application name, its + * aggregated health state and any children services and deployed applications + * that respect the filters in cluster health chunk query description. + */ +public class ApplicationHealthStateChunk extends EntityHealthStateChunk { + /** + * The name of the application, including the 'fabric:' URI scheme. + */ + @JsonProperty(value = "ApplicationName") + private String applicationName; + + /** + * The application type name as defined in the application manifest. + */ + @JsonProperty(value = "ApplicationTypeName") + private String applicationTypeName; + + /** + * The list of service health state chunks in the cluster that respect the + * filters in the cluster health chunk query description. + */ + @JsonProperty(value = "ServiceHealthStateChunks") + private ServiceHealthStateChunkList serviceHealthStateChunks; + + /** + * The list of deployed application health state chunks in the cluster that + * respect the filters in the cluster health chunk query description. + */ + @JsonProperty(value = "DeployedApplicationHealthStateChunks") + private DeployedApplicationHealthStateChunkList deployedApplicationHealthStateChunks; + + /** + * Get the name of the application, including the 'fabric:' URI scheme. + * + * @return the applicationName value + */ + public String applicationName() { + return this.applicationName; + } + + /** + * Set the name of the application, including the 'fabric:' URI scheme. + * + * @param applicationName the applicationName value to set + * @return the ApplicationHealthStateChunk object itself. + */ + public ApplicationHealthStateChunk withApplicationName(String applicationName) { + this.applicationName = applicationName; + return this; + } + + /** + * Get the application type name as defined in the application manifest. + * + * @return the applicationTypeName value + */ + public String applicationTypeName() { + return this.applicationTypeName; + } + + /** + * Set the application type name as defined in the application manifest. + * + * @param applicationTypeName the applicationTypeName value to set + * @return the ApplicationHealthStateChunk object itself. + */ + public ApplicationHealthStateChunk withApplicationTypeName(String applicationTypeName) { + this.applicationTypeName = applicationTypeName; + return this; + } + + /** + * Get the list of service health state chunks in the cluster that respect the filters in the cluster health chunk query description. + * + * @return the serviceHealthStateChunks value + */ + public ServiceHealthStateChunkList serviceHealthStateChunks() { + return this.serviceHealthStateChunks; + } + + /** + * Set the list of service health state chunks in the cluster that respect the filters in the cluster health chunk query description. + * + * @param serviceHealthStateChunks the serviceHealthStateChunks value to set + * @return the ApplicationHealthStateChunk object itself. + */ + public ApplicationHealthStateChunk withServiceHealthStateChunks(ServiceHealthStateChunkList serviceHealthStateChunks) { + this.serviceHealthStateChunks = serviceHealthStateChunks; + return this; + } + + /** + * Get the list of deployed application health state chunks in the cluster that respect the filters in the cluster health chunk query description. + * + * @return the deployedApplicationHealthStateChunks value + */ + public DeployedApplicationHealthStateChunkList deployedApplicationHealthStateChunks() { + return this.deployedApplicationHealthStateChunks; + } + + /** + * Set the list of deployed application health state chunks in the cluster that respect the filters in the cluster health chunk query description. + * + * @param deployedApplicationHealthStateChunks the deployedApplicationHealthStateChunks value to set + * @return the ApplicationHealthStateChunk object itself. + */ + public ApplicationHealthStateChunk withDeployedApplicationHealthStateChunks(DeployedApplicationHealthStateChunkList deployedApplicationHealthStateChunks) { + this.deployedApplicationHealthStateChunks = deployedApplicationHealthStateChunks; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationHealthStateChunkList.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationHealthStateChunkList.java new file mode 100644 index 0000000000000..2deac1877a914 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationHealthStateChunkList.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list of application health state chunks in the cluster that respect the + * input filters in the chunk query. Returned by get cluster health state + * chunks query. + */ +public class ApplicationHealthStateChunkList extends EntityHealthStateChunkList { + /** + * The list of application health state chunks that respect the input + * filters in the chunk query. + */ + @JsonProperty(value = "Items") + private List items; + + /** + * Get the list of application health state chunks that respect the input filters in the chunk query. + * + * @return the items value + */ + public List items() { + return this.items; + } + + /** + * Set the list of application health state chunks that respect the input filters in the chunk query. + * + * @param items the items value to set + * @return the ApplicationHealthStateChunkList object itself. + */ + public ApplicationHealthStateChunkList withItems(List items) { + this.items = items; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationHealthStateFilter.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationHealthStateFilter.java new file mode 100644 index 0000000000000..4291d79f5a212 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationHealthStateFilter.java @@ -0,0 +1,256 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines matching criteria to determine whether a application should be + * included in the cluster health chunk. + * One filter can match zero, one or multiple applications, depending on its + * properties. + */ +public class ApplicationHealthStateFilter { + /** + * The name of the application that matches the filter, as a fabric uri. + * The filter is applied only to the specified application, if it exists. + * If the application doesn't exist, no application is returned in the + * cluster health chunk based on this filter. + * If the application exists, it is included in the cluster health chunk if + * it respects the other filter properties. + * If not specified, all applications are matched against the other filter + * members, like health state filter. + */ + @JsonProperty(value = "ApplicationNameFilter") + private String applicationNameFilter; + + /** + * The name of the application type that matches the filter. + * If specified, the filter is applied only to applications of the selected + * application type, if any exists. + * If no applications of the specified application type exists, no + * application is returned in the cluster health chunk based on this + * filter. + * Each application of the specified application type is included in the + * cluster health chunk if it respects the other filter properties. + * If not specified, all applications are matched against the other filter + * members, like health state filter. + */ + @JsonProperty(value = "ApplicationTypeNameFilter") + private String applicationTypeNameFilter; + + /** + * The filter for the health state of the applications. It allows selecting + * applications if they match the desired health states. + * The possible values are integer value of one of the following health + * states. Only applications that match the filter are returned. All + * applications are used to evaluate the cluster aggregated health state. + * If not specified, default value is None, unless the application name or + * the application type name are specified. If the filter has default value + * and application name is specified, the matching application is returned. + * The state values are flag-based enumeration, so the value could be a + * combination of these values obtained using bitwise 'OR' operator. + * For example, if the provided value is 6, it matches applications with + * HealthState value of OK (2) and Warning (4). + * + * - 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. + */ + @JsonProperty(value = "HealthStateFilter") + private Integer healthStateFilter; + + /** + * Defines a list of filters that specify which services to be included in + * the returned cluster health chunk as children of the application. The + * services are returned only if the parent application matches a filter. + * If the list is empty, no services are returned. All the services are + * used to evaluate the parent application aggregated health state, + * regardless of the input filters. + * The application filter may specify multiple service filters. + * For example, it can specify a filter to return all services with health + * state Error and another filter to always include a service identified by + * its service name. + */ + @JsonProperty(value = "ServiceFilters") + private List serviceFilters; + + /** + * Defines a list of filters that specify which deployed applications to be + * included in the returned cluster health chunk as children of the + * application. The deployed applications are returned only if the parent + * application matches a filter. + * If the list is empty, no deployed applications are returned. All the + * deployed applications are used to evaluate the parent application + * aggregated health state, regardless of the input filters. + * The application filter may specify multiple deployed application + * filters. + * For example, it can specify a filter to return all deployed applications + * with health state Error and another filter to always include a deployed + * application on a specified node. + */ + @JsonProperty(value = "DeployedApplicationFilters") + private List deployedApplicationFilters; + + /** + * Get the name of the application that matches the filter, as a fabric uri. The filter is applied only to the specified application, if it exists. + If the application doesn't exist, no application is returned in the cluster health chunk based on this filter. + If the application exists, it is included in the cluster health chunk if it respects the other filter properties. + If not specified, all applications are matched against the other filter members, like health state filter. + * + * @return the applicationNameFilter value + */ + public String applicationNameFilter() { + return this.applicationNameFilter; + } + + /** + * Set the name of the application that matches the filter, as a fabric uri. The filter is applied only to the specified application, if it exists. + If the application doesn't exist, no application is returned in the cluster health chunk based on this filter. + If the application exists, it is included in the cluster health chunk if it respects the other filter properties. + If not specified, all applications are matched against the other filter members, like health state filter. + * + * @param applicationNameFilter the applicationNameFilter value to set + * @return the ApplicationHealthStateFilter object itself. + */ + public ApplicationHealthStateFilter withApplicationNameFilter(String applicationNameFilter) { + this.applicationNameFilter = applicationNameFilter; + return this; + } + + /** + * Get the name of the application type that matches the filter. + If specified, the filter is applied only to applications of the selected application type, if any exists. + If no applications of the specified application type exists, no application is returned in the cluster health chunk based on this filter. + Each application of the specified application type is included in the cluster health chunk if it respects the other filter properties. + If not specified, all applications are matched against the other filter members, like health state filter. + * + * @return the applicationTypeNameFilter value + */ + public String applicationTypeNameFilter() { + return this.applicationTypeNameFilter; + } + + /** + * Set the name of the application type that matches the filter. + If specified, the filter is applied only to applications of the selected application type, if any exists. + If no applications of the specified application type exists, no application is returned in the cluster health chunk based on this filter. + Each application of the specified application type is included in the cluster health chunk if it respects the other filter properties. + If not specified, all applications are matched against the other filter members, like health state filter. + * + * @param applicationTypeNameFilter the applicationTypeNameFilter value to set + * @return the ApplicationHealthStateFilter object itself. + */ + public ApplicationHealthStateFilter withApplicationTypeNameFilter(String applicationTypeNameFilter) { + this.applicationTypeNameFilter = applicationTypeNameFilter; + return this; + } + + /** + * Get the filter for the health state of the applications. It allows selecting applications if they match the desired health states. + The possible values are integer value of one of the following health states. Only applications that match the filter are returned. All applications are used to evaluate the cluster aggregated health state. + If not specified, default value is None, unless the application name or the application type name are specified. If the filter has default value and application name is specified, the matching application is returned. + The state values are flag-based enumeration, so the value could be a combination of these values obtained using bitwise 'OR' operator. + For example, if the provided value is 6, it matches applications with HealthState value of OK (2) and Warning (4). + - Default - Default value. Matches any HealthState. The value is zero. + - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given collection of states. The value is 1. + - Ok - Filter that matches input with HealthState value Ok. The value is 2. + - Warning - Filter that matches input with HealthState value Warning. The value is 4. + - Error - Filter that matches input with HealthState value Error. The value is 8. + - All - Filter that matches input with any HealthState value. The value is 65535. + * + * @return the healthStateFilter value + */ + public Integer healthStateFilter() { + return this.healthStateFilter; + } + + /** + * Set the filter for the health state of the applications. It allows selecting applications if they match the desired health states. + The possible values are integer value of one of the following health states. Only applications that match the filter are returned. All applications are used to evaluate the cluster aggregated health state. + If not specified, default value is None, unless the application name or the application type name are specified. If the filter has default value and application name is specified, the matching application is returned. + The state values are flag-based enumeration, so the value could be a combination of these values obtained using bitwise 'OR' operator. + For example, if the provided value is 6, it matches applications with HealthState value of OK (2) and Warning (4). + - 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 healthStateFilter the healthStateFilter value to set + * @return the ApplicationHealthStateFilter object itself. + */ + public ApplicationHealthStateFilter withHealthStateFilter(Integer healthStateFilter) { + this.healthStateFilter = healthStateFilter; + return this; + } + + /** + * Get defines a list of filters that specify which services to be included in the returned cluster health chunk as children of the application. The services are returned only if the parent application matches a filter. + If the list is empty, no services are returned. All the services are used to evaluate the parent application aggregated health state, regardless of the input filters. + The application filter may specify multiple service filters. + For example, it can specify a filter to return all services with health state Error and another filter to always include a service identified by its service name. + * + * @return the serviceFilters value + */ + public List serviceFilters() { + return this.serviceFilters; + } + + /** + * Set defines a list of filters that specify which services to be included in the returned cluster health chunk as children of the application. The services are returned only if the parent application matches a filter. + If the list is empty, no services are returned. All the services are used to evaluate the parent application aggregated health state, regardless of the input filters. + The application filter may specify multiple service filters. + For example, it can specify a filter to return all services with health state Error and another filter to always include a service identified by its service name. + * + * @param serviceFilters the serviceFilters value to set + * @return the ApplicationHealthStateFilter object itself. + */ + public ApplicationHealthStateFilter withServiceFilters(List serviceFilters) { + this.serviceFilters = serviceFilters; + return this; + } + + /** + * Get defines a list of filters that specify which deployed applications to be included in the returned cluster health chunk as children of the application. The deployed applications are returned only if the parent application matches a filter. + If the list is empty, no deployed applications are returned. All the deployed applications are used to evaluate the parent application aggregated health state, regardless of the input filters. + The application filter may specify multiple deployed application filters. + For example, it can specify a filter to return all deployed applications with health state Error and another filter to always include a deployed application on a specified node. + * + * @return the deployedApplicationFilters value + */ + public List deployedApplicationFilters() { + return this.deployedApplicationFilters; + } + + /** + * Set defines a list of filters that specify which deployed applications to be included in the returned cluster health chunk as children of the application. The deployed applications are returned only if the parent application matches a filter. + If the list is empty, no deployed applications are returned. All the deployed applications are used to evaluate the parent application aggregated health state, regardless of the input filters. + The application filter may specify multiple deployed application filters. + For example, it can specify a filter to return all deployed applications with health state Error and another filter to always include a deployed application on a specified node. + * + * @param deployedApplicationFilters the deployedApplicationFilters value to set + * @return the ApplicationHealthStateFilter object itself. + */ + public ApplicationHealthStateFilter withDeployedApplicationFilters(List deployedApplicationFilters) { + this.deployedApplicationFilters = deployedApplicationFilters; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationMetricDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationMetricDescription.java new file mode 100644 index 0000000000000..336c58509047d --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationMetricDescription.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes capacity information for a custom resource balancing metric. This + * can be used to limit the total consumption of this metric by the services of + * this application. + */ +public class ApplicationMetricDescription { + /** + * The name of the metric. + */ + @JsonProperty(value = "Name") + private String name; + + /** + * The maximum node capacity for Service Fabric application. + * This is the maximum Load for an instance of this application on a single + * node. Even if the capacity of node is greater than this value, Service + * Fabric will limit the total load of services within the application on + * each node to this value. + * If set to zero, capacity for this metric is unlimited on each node. + * When creating a new application with application capacity defined, the + * product of MaximumNodes and this value must always be smaller than or + * equal to TotalApplicationCapacity. + * When updating existing application with application capacity, the + * product of MaximumNodes and this value must always be smaller than or + * equal to TotalApplicationCapacity. + */ + @JsonProperty(value = "MaximumCapacity") + private Long maximumCapacity; + + /** + * The node reservation capacity for Service Fabric application. + * This is the amount of load which is reserved on nodes which have + * instances of this application. + * If MinimumNodes is specified, then the product of these values will be + * the capacity reserved in the cluster for the application. + * If set to zero, no capacity is reserved for this metric. + * When setting application capacity or when updating application capacity; + * this value must be smaller than or equal to MaximumCapacity for each + * metric. + */ + @JsonProperty(value = "ReservationCapacity") + private Long reservationCapacity; + + /** + * The total metric capacity for Service Fabric application. + * This is the total metric capacity for this application in the cluster. + * Service Fabric will try to limit the sum of loads of services within the + * application to this value. + * When creating a new application with application capacity defined, the + * product of MaximumNodes and MaximumCapacity must always be smaller than + * or equal to this value. + */ + @JsonProperty(value = "TotalApplicationCapacity") + private Long totalApplicationCapacity; + + /** + * Get the name of the metric. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the metric. + * + * @param name the name value to set + * @return the ApplicationMetricDescription object itself. + */ + public ApplicationMetricDescription withName(String name) { + this.name = name; + return this; + } + + /** + * Get the maximum node capacity for Service Fabric application. + This is the maximum Load for an instance of this application on a single node. Even if the capacity of node is greater than this value, Service Fabric will limit the total load of services within the application on each node to this value. + If set to zero, capacity for this metric is unlimited on each node. + When creating a new application with application capacity defined, the product of MaximumNodes and this value must always be smaller than or equal to TotalApplicationCapacity. + When updating existing application with application capacity, the product of MaximumNodes and this value must always be smaller than or equal to TotalApplicationCapacity. + * + * @return the maximumCapacity value + */ + public Long maximumCapacity() { + return this.maximumCapacity; + } + + /** + * Set the maximum node capacity for Service Fabric application. + This is the maximum Load for an instance of this application on a single node. Even if the capacity of node is greater than this value, Service Fabric will limit the total load of services within the application on each node to this value. + If set to zero, capacity for this metric is unlimited on each node. + When creating a new application with application capacity defined, the product of MaximumNodes and this value must always be smaller than or equal to TotalApplicationCapacity. + When updating existing application with application capacity, the product of MaximumNodes and this value must always be smaller than or equal to TotalApplicationCapacity. + * + * @param maximumCapacity the maximumCapacity value to set + * @return the ApplicationMetricDescription object itself. + */ + public ApplicationMetricDescription withMaximumCapacity(Long maximumCapacity) { + this.maximumCapacity = maximumCapacity; + return this; + } + + /** + * Get the node reservation capacity for Service Fabric application. + This is the amount of load which is reserved on nodes which have instances of this application. + If MinimumNodes is specified, then the product of these values will be the capacity reserved in the cluster for the application. + If set to zero, no capacity is reserved for this metric. + When setting application capacity or when updating application capacity; this value must be smaller than or equal to MaximumCapacity for each metric. + * + * @return the reservationCapacity value + */ + public Long reservationCapacity() { + return this.reservationCapacity; + } + + /** + * Set the node reservation capacity for Service Fabric application. + This is the amount of load which is reserved on nodes which have instances of this application. + If MinimumNodes is specified, then the product of these values will be the capacity reserved in the cluster for the application. + If set to zero, no capacity is reserved for this metric. + When setting application capacity or when updating application capacity; this value must be smaller than or equal to MaximumCapacity for each metric. + * + * @param reservationCapacity the reservationCapacity value to set + * @return the ApplicationMetricDescription object itself. + */ + public ApplicationMetricDescription withReservationCapacity(Long reservationCapacity) { + this.reservationCapacity = reservationCapacity; + return this; + } + + /** + * Get the total metric capacity for Service Fabric application. + This is the total metric capacity for this application in the cluster. Service Fabric will try to limit the sum of loads of services within the application to this value. + When creating a new application with application capacity defined, the product of MaximumNodes and MaximumCapacity must always be smaller than or equal to this value. + * + * @return the totalApplicationCapacity value + */ + public Long totalApplicationCapacity() { + return this.totalApplicationCapacity; + } + + /** + * Set the total metric capacity for Service Fabric application. + This is the total metric capacity for this application in the cluster. Service Fabric will try to limit the sum of loads of services within the application to this value. + When creating a new application with application capacity defined, the product of MaximumNodes and MaximumCapacity must always be smaller than or equal to this value. + * + * @param totalApplicationCapacity the totalApplicationCapacity value to set + * @return the ApplicationMetricDescription object itself. + */ + public ApplicationMetricDescription withTotalApplicationCapacity(Long totalApplicationCapacity) { + this.totalApplicationCapacity = totalApplicationCapacity; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationPackageCleanupPolicy.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationPackageCleanupPolicy.java new file mode 100644 index 0000000000000..d4499fe0731ee --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationPackageCleanupPolicy.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationPackageCleanupPolicy. + */ +public final class ApplicationPackageCleanupPolicy extends ExpandableStringEnum { + /** Static value Invalid for ApplicationPackageCleanupPolicy. */ + public static final ApplicationPackageCleanupPolicy INVALID = fromString("Invalid"); + + /** Static value Default for ApplicationPackageCleanupPolicy. */ + public static final ApplicationPackageCleanupPolicy DEFAULT = fromString("Default"); + + /** Static value Automatic for ApplicationPackageCleanupPolicy. */ + public static final ApplicationPackageCleanupPolicy AUTOMATIC = fromString("Automatic"); + + /** Static value Manual for ApplicationPackageCleanupPolicy. */ + public static final ApplicationPackageCleanupPolicy MANUAL = fromString("Manual"); + + /** + * Creates or finds a ApplicationPackageCleanupPolicy from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationPackageCleanupPolicy + */ + @JsonCreator + public static ApplicationPackageCleanupPolicy fromString(String name) { + return fromString(name, ApplicationPackageCleanupPolicy.class); + } + + /** + * @return known ApplicationPackageCleanupPolicy values + */ + public static Collection values() { + return values(ApplicationPackageCleanupPolicy.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationParameter.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationParameter.java new file mode 100644 index 0000000000000..cd68df3a06d7a --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationParameter.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes an application parameter override to be applied when creating or + * upgrading an application. + */ +public class ApplicationParameter { + /** + * The name of the parameter. + */ + @JsonProperty(value = "Key", required = true) + private String key; + + /** + * The value of the parameter. + */ + @JsonProperty(value = "Value", required = true) + private String value; + + /** + * Get the name of the parameter. + * + * @return the key value + */ + public String key() { + return this.key; + } + + /** + * Set the name of the parameter. + * + * @param key the key value to set + * @return the ApplicationParameter object itself. + */ + public ApplicationParameter withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value of the parameter. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the value of the parameter. + * + * @param value the value value to set + * @return the ApplicationParameter object itself. + */ + public ApplicationParameter withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationResourceStatus.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationResourceStatus.java new file mode 100644 index 0000000000000..8ee5862969365 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationResourceStatus.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationResourceStatus. + */ +public final class ApplicationResourceStatus extends ExpandableStringEnum { + /** Static value Invalid for ApplicationResourceStatus. */ + public static final ApplicationResourceStatus INVALID = fromString("Invalid"); + + /** Static value Ready for ApplicationResourceStatus. */ + public static final ApplicationResourceStatus READY = fromString("Ready"); + + /** Static value Upgrading for ApplicationResourceStatus. */ + public static final ApplicationResourceStatus UPGRADING = fromString("Upgrading"); + + /** Static value Creating for ApplicationResourceStatus. */ + public static final ApplicationResourceStatus CREATING = fromString("Creating"); + + /** Static value Deleting for ApplicationResourceStatus. */ + public static final ApplicationResourceStatus DELETING = fromString("Deleting"); + + /** Static value Failed for ApplicationResourceStatus. */ + public static final ApplicationResourceStatus FAILED = fromString("Failed"); + + /** + * Creates or finds a ApplicationResourceStatus from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationResourceStatus + */ + @JsonCreator + public static ApplicationResourceStatus fromString(String name) { + return fromString(name, ApplicationResourceStatus.class); + } + + /** + * @return known ApplicationResourceStatus values + */ + public static Collection values() { + return values(ApplicationResourceStatus.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationStatus.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationStatus.java new file mode 100644 index 0000000000000..8b8fbe270ed7f --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationStatus.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationStatus. + */ +public final class ApplicationStatus extends ExpandableStringEnum { + /** Static value Invalid for ApplicationStatus. */ + public static final ApplicationStatus INVALID = fromString("Invalid"); + + /** Static value Ready for ApplicationStatus. */ + public static final ApplicationStatus READY = fromString("Ready"); + + /** Static value Upgrading for ApplicationStatus. */ + public static final ApplicationStatus UPGRADING = fromString("Upgrading"); + + /** Static value Creating for ApplicationStatus. */ + public static final ApplicationStatus CREATING = fromString("Creating"); + + /** Static value Deleting for ApplicationStatus. */ + public static final ApplicationStatus DELETING = fromString("Deleting"); + + /** Static value Failed for ApplicationStatus. */ + public static final ApplicationStatus FAILED = fromString("Failed"); + + /** + * Creates or finds a ApplicationStatus from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationStatus + */ + @JsonCreator + public static ApplicationStatus fromString(String name) { + return fromString(name, ApplicationStatus.class); + } + + /** + * @return known ApplicationStatus values + */ + public static Collection values() { + return values(ApplicationStatus.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationTypeApplicationsHealthEvaluation.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationTypeApplicationsHealthEvaluation.java new file mode 100644 index 0000000000000..b16f6e650d2b1 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationTypeApplicationsHealthEvaluation.java @@ -0,0 +1,135 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents health evaluation for applications of a particular application + * type. The application type applications evaluation can be returned when + * cluster health evaluation returns unhealthy aggregated health state, either + * Error or Warning. It contains health evaluations for each unhealthy + * application of the included application type that impacted current + * aggregated health state. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ApplicationTypeApplications") +public class ApplicationTypeApplicationsHealthEvaluation extends HealthEvaluation { + /** + * The application type name as defined in the application manifest. + */ + @JsonProperty(value = "ApplicationTypeName") + private String applicationTypeName; + + /** + * Maximum allowed percentage of unhealthy applications for the application + * type, specified as an entry in ApplicationTypeHealthPolicyMap. + */ + @JsonProperty(value = "MaxPercentUnhealthyApplications") + private Integer maxPercentUnhealthyApplications; + + /** + * Total number of applications of the application type found in the health + * store. + */ + @JsonProperty(value = "TotalCount") + private Long totalCount; + + /** + * List of unhealthy evaluations that led to the aggregated health state. + * Includes all the unhealthy ApplicationHealthEvaluation of this + * application type that impacted the aggregated health. + */ + @JsonProperty(value = "UnhealthyEvaluations") + private List unhealthyEvaluations; + + /** + * Get the application type name as defined in the application manifest. + * + * @return the applicationTypeName value + */ + public String applicationTypeName() { + return this.applicationTypeName; + } + + /** + * Set the application type name as defined in the application manifest. + * + * @param applicationTypeName the applicationTypeName value to set + * @return the ApplicationTypeApplicationsHealthEvaluation object itself. + */ + public ApplicationTypeApplicationsHealthEvaluation withApplicationTypeName(String applicationTypeName) { + this.applicationTypeName = applicationTypeName; + return this; + } + + /** + * Get maximum allowed percentage of unhealthy applications for the application type, specified as an entry in ApplicationTypeHealthPolicyMap. + * + * @return the maxPercentUnhealthyApplications value + */ + public Integer maxPercentUnhealthyApplications() { + return this.maxPercentUnhealthyApplications; + } + + /** + * Set maximum allowed percentage of unhealthy applications for the application type, specified as an entry in ApplicationTypeHealthPolicyMap. + * + * @param maxPercentUnhealthyApplications the maxPercentUnhealthyApplications value to set + * @return the ApplicationTypeApplicationsHealthEvaluation object itself. + */ + public ApplicationTypeApplicationsHealthEvaluation withMaxPercentUnhealthyApplications(Integer maxPercentUnhealthyApplications) { + this.maxPercentUnhealthyApplications = maxPercentUnhealthyApplications; + return this; + } + + /** + * Get total number of applications of the application type found in the health store. + * + * @return the totalCount value + */ + public Long totalCount() { + return this.totalCount; + } + + /** + * Set total number of applications of the application type found in the health store. + * + * @param totalCount the totalCount value to set + * @return the ApplicationTypeApplicationsHealthEvaluation object itself. + */ + public ApplicationTypeApplicationsHealthEvaluation withTotalCount(Long totalCount) { + this.totalCount = totalCount; + return this; + } + + /** + * Get list of unhealthy evaluations that led to the aggregated health state. Includes all the unhealthy ApplicationHealthEvaluation of this application type that impacted the aggregated health. + * + * @return the unhealthyEvaluations value + */ + public List unhealthyEvaluations() { + return this.unhealthyEvaluations; + } + + /** + * Set list of unhealthy evaluations that led to the aggregated health state. Includes all the unhealthy ApplicationHealthEvaluation of this application type that impacted the aggregated health. + * + * @param unhealthyEvaluations the unhealthyEvaluations value to set + * @return the ApplicationTypeApplicationsHealthEvaluation object itself. + */ + public ApplicationTypeApplicationsHealthEvaluation withUnhealthyEvaluations(List unhealthyEvaluations) { + this.unhealthyEvaluations = unhealthyEvaluations; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationTypeDefinitionKind.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationTypeDefinitionKind.java new file mode 100644 index 0000000000000..18851bc1c3050 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationTypeDefinitionKind.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationTypeDefinitionKind. + */ +public final class ApplicationTypeDefinitionKind extends ExpandableStringEnum { + /** Static value Invalid for ApplicationTypeDefinitionKind. */ + public static final ApplicationTypeDefinitionKind INVALID = fromString("Invalid"); + + /** Static value ServiceFabricApplicationPackage for ApplicationTypeDefinitionKind. */ + public static final ApplicationTypeDefinitionKind SERVICE_FABRIC_APPLICATION_PACKAGE = fromString("ServiceFabricApplicationPackage"); + + /** Static value Compose for ApplicationTypeDefinitionKind. */ + public static final ApplicationTypeDefinitionKind COMPOSE = fromString("Compose"); + + /** + * Creates or finds a ApplicationTypeDefinitionKind from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationTypeDefinitionKind + */ + @JsonCreator + public static ApplicationTypeDefinitionKind fromString(String name) { + return fromString(name, ApplicationTypeDefinitionKind.class); + } + + /** + * @return known ApplicationTypeDefinitionKind values + */ + public static Collection values() { + return values(ApplicationTypeDefinitionKind.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationTypeHealthPolicyMapItem.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationTypeHealthPolicyMapItem.java new file mode 100644 index 0000000000000..d58abe8225f95 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationTypeHealthPolicyMapItem.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines an item in ApplicationTypeHealthPolicyMap. + */ +public class ApplicationTypeHealthPolicyMapItem { + /** + * The key of the application type health policy map item. This is the name + * of the application type. + */ + @JsonProperty(value = "Key", required = true) + private String key; + + /** + * The value of the application type health policy map item. + * The max percent unhealthy applications allowed for the application type. + * Must be between zero and 100. + */ + @JsonProperty(value = "Value", required = true) + private int value; + + /** + * Get the key of the application type health policy map item. This is the name of the application type. + * + * @return the key value + */ + public String key() { + return this.key; + } + + /** + * Set the key of the application type health policy map item. This is the name of the application type. + * + * @param key the key value to set + * @return the ApplicationTypeHealthPolicyMapItem object itself. + */ + public ApplicationTypeHealthPolicyMapItem withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value of the application type health policy map item. + The max percent unhealthy applications allowed for the application type. Must be between zero and 100. + * + * @return the value value + */ + public int value() { + return this.value; + } + + /** + * Set the value of the application type health policy map item. + The max percent unhealthy applications allowed for the application type. Must be between zero and 100. + * + * @param value the value value to set + * @return the ApplicationTypeHealthPolicyMapItem object itself. + */ + public ApplicationTypeHealthPolicyMapItem withValue(int value) { + this.value = value; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationTypeImageStorePath.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationTypeImageStorePath.java new file mode 100644 index 0000000000000..284ed14ee60ba --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationTypeImageStorePath.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Path description for the application package in the image store specified + * during the prior copy operation. + */ +public class ApplicationTypeImageStorePath { + /** + * The relative image store path to the application package. + */ + @JsonProperty(value = "ApplicationTypeBuildPath", required = true) + private String applicationTypeBuildPath; + + /** + * Get the relative image store path to the application package. + * + * @return the applicationTypeBuildPath value + */ + public String applicationTypeBuildPath() { + return this.applicationTypeBuildPath; + } + + /** + * Set the relative image store path to the application package. + * + * @param applicationTypeBuildPath the applicationTypeBuildPath value to set + * @return the ApplicationTypeImageStorePath object itself. + */ + public ApplicationTypeImageStorePath withApplicationTypeBuildPath(String applicationTypeBuildPath) { + this.applicationTypeBuildPath = applicationTypeBuildPath; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationTypeInfo.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationTypeInfo.java new file mode 100644 index 0000000000000..c9d3307489ed5 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationTypeInfo.java @@ -0,0 +1,185 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about an application type. + */ +public class ApplicationTypeInfo { + /** + * The application type name as defined in the application manifest. + */ + @JsonProperty(value = "Name") + private String name; + + /** + * The version of the application type as defined in the application + * manifest. + */ + @JsonProperty(value = "Version") + private String version; + + /** + * List of application type parameters that can be overridden when creating + * or updating the application. + */ + @JsonProperty(value = "DefaultParameterList") + private List defaultParameterList; + + /** + * The status of the application type. + * . Possible values include: 'Invalid', 'Provisioning', 'Available', + * 'Unprovisioning', 'Failed'. + */ + @JsonProperty(value = "Status") + private ApplicationTypeStatus status; + + /** + * Additional detailed information about the status of the application + * type. + */ + @JsonProperty(value = "StatusDetails") + private String statusDetails; + + /** + * The mechanism used to define a Service Fabric application type. + * . Possible values include: 'Invalid', 'ServiceFabricApplicationPackage', + * 'Compose'. + */ + @JsonProperty(value = "ApplicationTypeDefinitionKind") + private ApplicationTypeDefinitionKind applicationTypeDefinitionKind; + + /** + * Get the application type name as defined in the application manifest. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the application type name as defined in the application manifest. + * + * @param name the name value to set + * @return the ApplicationTypeInfo object itself. + */ + public ApplicationTypeInfo withName(String name) { + this.name = name; + return this; + } + + /** + * Get the version of the application type as defined in the application manifest. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Set the version of the application type as defined in the application manifest. + * + * @param version the version value to set + * @return the ApplicationTypeInfo object itself. + */ + public ApplicationTypeInfo withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get list of application type parameters that can be overridden when creating or updating the application. + * + * @return the defaultParameterList value + */ + public List defaultParameterList() { + return this.defaultParameterList; + } + + /** + * Set list of application type parameters that can be overridden when creating or updating the application. + * + * @param defaultParameterList the defaultParameterList value to set + * @return the ApplicationTypeInfo object itself. + */ + public ApplicationTypeInfo withDefaultParameterList(List defaultParameterList) { + this.defaultParameterList = defaultParameterList; + return this; + } + + /** + * Get the status of the application type. + . Possible values include: 'Invalid', 'Provisioning', 'Available', 'Unprovisioning', 'Failed'. + * + * @return the status value + */ + public ApplicationTypeStatus status() { + return this.status; + } + + /** + * Set the status of the application type. + . Possible values include: 'Invalid', 'Provisioning', 'Available', 'Unprovisioning', 'Failed'. + * + * @param status the status value to set + * @return the ApplicationTypeInfo object itself. + */ + public ApplicationTypeInfo withStatus(ApplicationTypeStatus status) { + this.status = status; + return this; + } + + /** + * Get additional detailed information about the status of the application type. + * + * @return the statusDetails value + */ + public String statusDetails() { + return this.statusDetails; + } + + /** + * Set additional detailed information about the status of the application type. + * + * @param statusDetails the statusDetails value to set + * @return the ApplicationTypeInfo object itself. + */ + public ApplicationTypeInfo withStatusDetails(String statusDetails) { + this.statusDetails = statusDetails; + return this; + } + + /** + * Get the mechanism used to define a Service Fabric application type. + . Possible values include: 'Invalid', 'ServiceFabricApplicationPackage', 'Compose'. + * + * @return the applicationTypeDefinitionKind value + */ + public ApplicationTypeDefinitionKind applicationTypeDefinitionKind() { + return this.applicationTypeDefinitionKind; + } + + /** + * Set the mechanism used to define a Service Fabric application type. + . Possible values include: 'Invalid', 'ServiceFabricApplicationPackage', 'Compose'. + * + * @param applicationTypeDefinitionKind the applicationTypeDefinitionKind value to set + * @return the ApplicationTypeInfo object itself. + */ + public ApplicationTypeInfo withApplicationTypeDefinitionKind(ApplicationTypeDefinitionKind applicationTypeDefinitionKind) { + this.applicationTypeDefinitionKind = applicationTypeDefinitionKind; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationTypeStatus.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationTypeStatus.java new file mode 100644 index 0000000000000..d982fd62a0482 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationTypeStatus.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationTypeStatus. + */ +public final class ApplicationTypeStatus extends ExpandableStringEnum { + /** Static value Invalid for ApplicationTypeStatus. */ + public static final ApplicationTypeStatus INVALID = fromString("Invalid"); + + /** Static value Provisioning for ApplicationTypeStatus. */ + public static final ApplicationTypeStatus PROVISIONING = fromString("Provisioning"); + + /** Static value Available for ApplicationTypeStatus. */ + public static final ApplicationTypeStatus AVAILABLE = fromString("Available"); + + /** Static value Unprovisioning for ApplicationTypeStatus. */ + public static final ApplicationTypeStatus UNPROVISIONING = fromString("Unprovisioning"); + + /** Static value Failed for ApplicationTypeStatus. */ + public static final ApplicationTypeStatus FAILED = fromString("Failed"); + + /** + * Creates or finds a ApplicationTypeStatus from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationTypeStatus + */ + @JsonCreator + public static ApplicationTypeStatus fromString(String name) { + return fromString(name, ApplicationTypeStatus.class); + } + + /** + * @return known ApplicationTypeStatus values + */ + public static Collection values() { + return values(ApplicationTypeStatus.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeCompleteEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeCompleteEvent.java new file mode 100644 index 0000000000000..31e0dafacc39d --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeCompleteEvent.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ApplicationEventInner; + +/** + * Application Upgrade Complete event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ApplicationUpgradeComplete") +public class ApplicationUpgradeCompleteEvent extends ApplicationEventInner { + /** + * Application type name. + */ + @JsonProperty(value = "ApplicationTypeName", required = true) + private String applicationTypeName; + + /** + * Application type version. + */ + @JsonProperty(value = "ApplicationTypeVersion", required = true) + private String applicationTypeVersion; + + /** + * Overall upgrade time in milli-seconds. + */ + @JsonProperty(value = "OverallUpgradeElapsedTimeInMs", required = true) + private double overallUpgradeElapsedTimeInMs; + + /** + * Get application type name. + * + * @return the applicationTypeName value + */ + public String applicationTypeName() { + return this.applicationTypeName; + } + + /** + * Set application type name. + * + * @param applicationTypeName the applicationTypeName value to set + * @return the ApplicationUpgradeCompleteEvent object itself. + */ + public ApplicationUpgradeCompleteEvent withApplicationTypeName(String applicationTypeName) { + this.applicationTypeName = applicationTypeName; + return this; + } + + /** + * Get application type version. + * + * @return the applicationTypeVersion value + */ + public String applicationTypeVersion() { + return this.applicationTypeVersion; + } + + /** + * Set application type version. + * + * @param applicationTypeVersion the applicationTypeVersion value to set + * @return the ApplicationUpgradeCompleteEvent object itself. + */ + public ApplicationUpgradeCompleteEvent withApplicationTypeVersion(String applicationTypeVersion) { + this.applicationTypeVersion = applicationTypeVersion; + return this; + } + + /** + * Get overall upgrade time in milli-seconds. + * + * @return the overallUpgradeElapsedTimeInMs value + */ + public double overallUpgradeElapsedTimeInMs() { + return this.overallUpgradeElapsedTimeInMs; + } + + /** + * Set overall upgrade time in milli-seconds. + * + * @param overallUpgradeElapsedTimeInMs the overallUpgradeElapsedTimeInMs value to set + * @return the ApplicationUpgradeCompleteEvent object itself. + */ + public ApplicationUpgradeCompleteEvent withOverallUpgradeElapsedTimeInMs(double overallUpgradeElapsedTimeInMs) { + this.overallUpgradeElapsedTimeInMs = overallUpgradeElapsedTimeInMs; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeDescription.java new file mode 100644 index 0000000000000..396cc76338687 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeDescription.java @@ -0,0 +1,273 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the parameters for an application upgrade. Note that upgrade + * description replaces the existing application description. This means that + * if the parameters are not specified, the existing parameters on the + * applications will be overwritten with the empty parameters list. This would + * result in the application using the default value of the parameters from the + * application manifest. If you do not want to change any existing parameter + * values, please get the application parameters first using the + * GetApplicationInfo query and then supply those values as Parameters in this + * ApplicationUpgradeDescription. + */ +public class ApplicationUpgradeDescription { + /** + * The name of the target application, including the 'fabric:' URI scheme. + */ + @JsonProperty(value = "Name", required = true) + private String name; + + /** + * The target application type version (found in the application manifest) + * for the application upgrade. + */ + @JsonProperty(value = "TargetApplicationTypeVersion", required = true) + private String targetApplicationTypeVersion; + + /** + * List of application parameters with overridden values from their default + * values specified in the application manifest. + */ + @JsonProperty(value = "Parameters", required = true) + private List parameters; + + /** + * The kind of upgrade out of the following possible values. Possible + * values include: 'Invalid', 'Rolling'. + */ + @JsonProperty(value = "UpgradeKind", required = true) + private UpgradeKind upgradeKind; + + /** + * The mode used to monitor health during a rolling upgrade. The values are + * UnmonitoredAuto, UnmonitoredManual, and Monitored. Possible values + * include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored'. + */ + @JsonProperty(value = "RollingUpgradeMode") + private UpgradeMode rollingUpgradeMode; + + /** + * 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). + */ + @JsonProperty(value = "UpgradeReplicaSetCheckTimeoutInSeconds") + private Long upgradeReplicaSetCheckTimeoutInSeconds; + + /** + * If true, then processes are forcefully restarted during upgrade even + * when the code version has not changed (the upgrade only changes + * configuration or data). + */ + @JsonProperty(value = "ForceRestart") + private Boolean forceRestart; + + /** + * Describes the parameters for monitoring an upgrade in Monitored mode. + */ + @JsonProperty(value = "MonitoringPolicy") + private MonitoringPolicyDescription monitoringPolicy; + + /** + * Defines a health policy used to evaluate the health of an application or + * one of its children entities. + */ + @JsonProperty(value = "ApplicationHealthPolicy") + private ApplicationHealthPolicy applicationHealthPolicy; + + /** + * Get the name of the target application, including the 'fabric:' URI scheme. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the target application, including the 'fabric:' URI scheme. + * + * @param name the name value to set + * @return the ApplicationUpgradeDescription object itself. + */ + public ApplicationUpgradeDescription withName(String name) { + this.name = name; + return this; + } + + /** + * Get the target application type version (found in the application manifest) for the application upgrade. + * + * @return the targetApplicationTypeVersion value + */ + public String targetApplicationTypeVersion() { + return this.targetApplicationTypeVersion; + } + + /** + * Set the target application type version (found in the application manifest) for the application upgrade. + * + * @param targetApplicationTypeVersion the targetApplicationTypeVersion value to set + * @return the ApplicationUpgradeDescription object itself. + */ + public ApplicationUpgradeDescription withTargetApplicationTypeVersion(String targetApplicationTypeVersion) { + this.targetApplicationTypeVersion = targetApplicationTypeVersion; + return this; + } + + /** + * Get list of application parameters with overridden values from their default values specified in the application manifest. + * + * @return the parameters value + */ + public List parameters() { + return this.parameters; + } + + /** + * Set list of application parameters with overridden values from their default values specified in the application manifest. + * + * @param parameters the parameters value to set + * @return the ApplicationUpgradeDescription object itself. + */ + public ApplicationUpgradeDescription withParameters(List parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the kind of upgrade out of the following possible values. Possible values include: 'Invalid', 'Rolling'. + * + * @return the upgradeKind value + */ + public UpgradeKind upgradeKind() { + return this.upgradeKind; + } + + /** + * Set the kind of upgrade out of the following possible values. Possible values include: 'Invalid', 'Rolling'. + * + * @param upgradeKind the upgradeKind value to set + * @return the ApplicationUpgradeDescription object itself. + */ + public ApplicationUpgradeDescription withUpgradeKind(UpgradeKind upgradeKind) { + this.upgradeKind = upgradeKind; + return this; + } + + /** + * Get the mode used to monitor health during a rolling upgrade. The values are UnmonitoredAuto, UnmonitoredManual, and Monitored. Possible values include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored'. + * + * @return the rollingUpgradeMode value + */ + public UpgradeMode rollingUpgradeMode() { + return this.rollingUpgradeMode; + } + + /** + * Set 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 rollingUpgradeMode the rollingUpgradeMode value to set + * @return the ApplicationUpgradeDescription object itself. + */ + public ApplicationUpgradeDescription withRollingUpgradeMode(UpgradeMode rollingUpgradeMode) { + this.rollingUpgradeMode = rollingUpgradeMode; + return this; + } + + /** + * Get 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). + * + * @return the upgradeReplicaSetCheckTimeoutInSeconds value + */ + public Long upgradeReplicaSetCheckTimeoutInSeconds() { + return this.upgradeReplicaSetCheckTimeoutInSeconds; + } + + /** + * Set 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 upgradeReplicaSetCheckTimeoutInSeconds the upgradeReplicaSetCheckTimeoutInSeconds value to set + * @return the ApplicationUpgradeDescription object itself. + */ + public ApplicationUpgradeDescription withUpgradeReplicaSetCheckTimeoutInSeconds(Long upgradeReplicaSetCheckTimeoutInSeconds) { + this.upgradeReplicaSetCheckTimeoutInSeconds = upgradeReplicaSetCheckTimeoutInSeconds; + return this; + } + + /** + * Get if true, then processes are forcefully restarted during upgrade even when the code version has not changed (the upgrade only changes configuration or data). + * + * @return the forceRestart value + */ + public Boolean forceRestart() { + return this.forceRestart; + } + + /** + * Set 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 forceRestart the forceRestart value to set + * @return the ApplicationUpgradeDescription object itself. + */ + public ApplicationUpgradeDescription withForceRestart(Boolean forceRestart) { + this.forceRestart = forceRestart; + return this; + } + + /** + * Get describes the parameters for monitoring an upgrade in Monitored mode. + * + * @return the monitoringPolicy value + */ + public MonitoringPolicyDescription monitoringPolicy() { + return this.monitoringPolicy; + } + + /** + * Set describes the parameters for monitoring an upgrade in Monitored mode. + * + * @param monitoringPolicy the monitoringPolicy value to set + * @return the ApplicationUpgradeDescription object itself. + */ + public ApplicationUpgradeDescription withMonitoringPolicy(MonitoringPolicyDescription monitoringPolicy) { + this.monitoringPolicy = monitoringPolicy; + return this; + } + + /** + * Get defines a health policy used to evaluate the health of an application or one of its children entities. + * + * @return the applicationHealthPolicy value + */ + public ApplicationHealthPolicy applicationHealthPolicy() { + return this.applicationHealthPolicy; + } + + /** + * Set defines a health policy used to evaluate the health of an application or one of its children entities. + * + * @param applicationHealthPolicy the applicationHealthPolicy value to set + * @return the ApplicationUpgradeDescription object itself. + */ + public ApplicationUpgradeDescription withApplicationHealthPolicy(ApplicationHealthPolicy applicationHealthPolicy) { + this.applicationHealthPolicy = applicationHealthPolicy; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeDomainCompleteEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeDomainCompleteEvent.java new file mode 100644 index 0000000000000..8b61c7e0937f7 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeDomainCompleteEvent.java @@ -0,0 +1,178 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ApplicationEventInner; + +/** + * Application Upgrade Domain Complete event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ApplicationUpgradeDomainComplete") +public class ApplicationUpgradeDomainCompleteEvent extends ApplicationEventInner { + /** + * Application type name. + */ + @JsonProperty(value = "ApplicationTypeName", required = true) + private String applicationTypeName; + + /** + * Current Application type version. + */ + @JsonProperty(value = "CurrentApplicationTypeVersion", required = true) + private String currentApplicationTypeVersion; + + /** + * Target Application type version. + */ + @JsonProperty(value = "ApplicationTypeVersion", required = true) + private String applicationTypeVersion; + + /** + * State of upgrade. + */ + @JsonProperty(value = "UpgradeState", required = true) + private String upgradeState; + + /** + * Upgrade domains. + */ + @JsonProperty(value = "UpgradeDomains", required = true) + private String upgradeDomains; + + /** + * Upgrade time of domain in milli-seconds. + */ + @JsonProperty(value = "UpgradeDomainElapsedTimeInMs", required = true) + private double upgradeDomainElapsedTimeInMs; + + /** + * Get application type name. + * + * @return the applicationTypeName value + */ + public String applicationTypeName() { + return this.applicationTypeName; + } + + /** + * Set application type name. + * + * @param applicationTypeName the applicationTypeName value to set + * @return the ApplicationUpgradeDomainCompleteEvent object itself. + */ + public ApplicationUpgradeDomainCompleteEvent withApplicationTypeName(String applicationTypeName) { + this.applicationTypeName = applicationTypeName; + return this; + } + + /** + * Get current Application type version. + * + * @return the currentApplicationTypeVersion value + */ + public String currentApplicationTypeVersion() { + return this.currentApplicationTypeVersion; + } + + /** + * Set current Application type version. + * + * @param currentApplicationTypeVersion the currentApplicationTypeVersion value to set + * @return the ApplicationUpgradeDomainCompleteEvent object itself. + */ + public ApplicationUpgradeDomainCompleteEvent withCurrentApplicationTypeVersion(String currentApplicationTypeVersion) { + this.currentApplicationTypeVersion = currentApplicationTypeVersion; + return this; + } + + /** + * Get target Application type version. + * + * @return the applicationTypeVersion value + */ + public String applicationTypeVersion() { + return this.applicationTypeVersion; + } + + /** + * Set target Application type version. + * + * @param applicationTypeVersion the applicationTypeVersion value to set + * @return the ApplicationUpgradeDomainCompleteEvent object itself. + */ + public ApplicationUpgradeDomainCompleteEvent withApplicationTypeVersion(String applicationTypeVersion) { + this.applicationTypeVersion = applicationTypeVersion; + return this; + } + + /** + * Get state of upgrade. + * + * @return the upgradeState value + */ + public String upgradeState() { + return this.upgradeState; + } + + /** + * Set state of upgrade. + * + * @param upgradeState the upgradeState value to set + * @return the ApplicationUpgradeDomainCompleteEvent object itself. + */ + public ApplicationUpgradeDomainCompleteEvent withUpgradeState(String upgradeState) { + this.upgradeState = upgradeState; + return this; + } + + /** + * Get upgrade domains. + * + * @return the upgradeDomains value + */ + public String upgradeDomains() { + return this.upgradeDomains; + } + + /** + * Set upgrade domains. + * + * @param upgradeDomains the upgradeDomains value to set + * @return the ApplicationUpgradeDomainCompleteEvent object itself. + */ + public ApplicationUpgradeDomainCompleteEvent withUpgradeDomains(String upgradeDomains) { + this.upgradeDomains = upgradeDomains; + return this; + } + + /** + * Get upgrade time of domain in milli-seconds. + * + * @return the upgradeDomainElapsedTimeInMs value + */ + public double upgradeDomainElapsedTimeInMs() { + return this.upgradeDomainElapsedTimeInMs; + } + + /** + * Set upgrade time of domain in milli-seconds. + * + * @param upgradeDomainElapsedTimeInMs the upgradeDomainElapsedTimeInMs value to set + * @return the ApplicationUpgradeDomainCompleteEvent object itself. + */ + public ApplicationUpgradeDomainCompleteEvent withUpgradeDomainElapsedTimeInMs(double upgradeDomainElapsedTimeInMs) { + this.upgradeDomainElapsedTimeInMs = upgradeDomainElapsedTimeInMs; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeRollbackCompleteEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeRollbackCompleteEvent.java new file mode 100644 index 0000000000000..344266fe0e95d --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeRollbackCompleteEvent.java @@ -0,0 +1,126 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ApplicationEventInner; + +/** + * Application Upgrade Rollback Complete event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ApplicationUpgradeRollbackComplete") +public class ApplicationUpgradeRollbackCompleteEvent extends ApplicationEventInner { + /** + * Application type name. + */ + @JsonProperty(value = "ApplicationTypeName", required = true) + private String applicationTypeName; + + /** + * Application type version. + */ + @JsonProperty(value = "ApplicationTypeVersion", required = true) + private String applicationTypeVersion; + + /** + * Describes reason of failure. + */ + @JsonProperty(value = "FailureReason", required = true) + private String failureReason; + + /** + * Overall upgrade time in milli-seconds. + */ + @JsonProperty(value = "OverallUpgradeElapsedTimeInMs", required = true) + private double overallUpgradeElapsedTimeInMs; + + /** + * Get application type name. + * + * @return the applicationTypeName value + */ + public String applicationTypeName() { + return this.applicationTypeName; + } + + /** + * Set application type name. + * + * @param applicationTypeName the applicationTypeName value to set + * @return the ApplicationUpgradeRollbackCompleteEvent object itself. + */ + public ApplicationUpgradeRollbackCompleteEvent withApplicationTypeName(String applicationTypeName) { + this.applicationTypeName = applicationTypeName; + return this; + } + + /** + * Get application type version. + * + * @return the applicationTypeVersion value + */ + public String applicationTypeVersion() { + return this.applicationTypeVersion; + } + + /** + * Set application type version. + * + * @param applicationTypeVersion the applicationTypeVersion value to set + * @return the ApplicationUpgradeRollbackCompleteEvent object itself. + */ + public ApplicationUpgradeRollbackCompleteEvent withApplicationTypeVersion(String applicationTypeVersion) { + this.applicationTypeVersion = applicationTypeVersion; + return this; + } + + /** + * Get describes reason of failure. + * + * @return the failureReason value + */ + public String failureReason() { + return this.failureReason; + } + + /** + * Set describes reason of failure. + * + * @param failureReason the failureReason value to set + * @return the ApplicationUpgradeRollbackCompleteEvent object itself. + */ + public ApplicationUpgradeRollbackCompleteEvent withFailureReason(String failureReason) { + this.failureReason = failureReason; + return this; + } + + /** + * Get overall upgrade time in milli-seconds. + * + * @return the overallUpgradeElapsedTimeInMs value + */ + public double overallUpgradeElapsedTimeInMs() { + return this.overallUpgradeElapsedTimeInMs; + } + + /** + * Set overall upgrade time in milli-seconds. + * + * @param overallUpgradeElapsedTimeInMs the overallUpgradeElapsedTimeInMs value to set + * @return the ApplicationUpgradeRollbackCompleteEvent object itself. + */ + public ApplicationUpgradeRollbackCompleteEvent withOverallUpgradeElapsedTimeInMs(double overallUpgradeElapsedTimeInMs) { + this.overallUpgradeElapsedTimeInMs = overallUpgradeElapsedTimeInMs; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeRollbackStartEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeRollbackStartEvent.java new file mode 100644 index 0000000000000..ad0e90812129c --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeRollbackStartEvent.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ApplicationEventInner; + +/** + * Application Upgrade Rollback Start event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ApplicationUpgradeRollbackStart") +public class ApplicationUpgradeRollbackStartEvent extends ApplicationEventInner { + /** + * Application type name. + */ + @JsonProperty(value = "ApplicationTypeName", required = true) + private String applicationTypeName; + + /** + * Current Application type version. + */ + @JsonProperty(value = "CurrentApplicationTypeVersion", required = true) + private String currentApplicationTypeVersion; + + /** + * Target Application type version. + */ + @JsonProperty(value = "ApplicationTypeVersion", required = true) + private String applicationTypeVersion; + + /** + * Describes reason of failure. + */ + @JsonProperty(value = "FailureReason", required = true) + private String failureReason; + + /** + * Overall upgrade time in milli-seconds. + */ + @JsonProperty(value = "OverallUpgradeElapsedTimeInMs", required = true) + private double overallUpgradeElapsedTimeInMs; + + /** + * Get application type name. + * + * @return the applicationTypeName value + */ + public String applicationTypeName() { + return this.applicationTypeName; + } + + /** + * Set application type name. + * + * @param applicationTypeName the applicationTypeName value to set + * @return the ApplicationUpgradeRollbackStartEvent object itself. + */ + public ApplicationUpgradeRollbackStartEvent withApplicationTypeName(String applicationTypeName) { + this.applicationTypeName = applicationTypeName; + return this; + } + + /** + * Get current Application type version. + * + * @return the currentApplicationTypeVersion value + */ + public String currentApplicationTypeVersion() { + return this.currentApplicationTypeVersion; + } + + /** + * Set current Application type version. + * + * @param currentApplicationTypeVersion the currentApplicationTypeVersion value to set + * @return the ApplicationUpgradeRollbackStartEvent object itself. + */ + public ApplicationUpgradeRollbackStartEvent withCurrentApplicationTypeVersion(String currentApplicationTypeVersion) { + this.currentApplicationTypeVersion = currentApplicationTypeVersion; + return this; + } + + /** + * Get target Application type version. + * + * @return the applicationTypeVersion value + */ + public String applicationTypeVersion() { + return this.applicationTypeVersion; + } + + /** + * Set target Application type version. + * + * @param applicationTypeVersion the applicationTypeVersion value to set + * @return the ApplicationUpgradeRollbackStartEvent object itself. + */ + public ApplicationUpgradeRollbackStartEvent withApplicationTypeVersion(String applicationTypeVersion) { + this.applicationTypeVersion = applicationTypeVersion; + return this; + } + + /** + * Get describes reason of failure. + * + * @return the failureReason value + */ + public String failureReason() { + return this.failureReason; + } + + /** + * Set describes reason of failure. + * + * @param failureReason the failureReason value to set + * @return the ApplicationUpgradeRollbackStartEvent object itself. + */ + public ApplicationUpgradeRollbackStartEvent withFailureReason(String failureReason) { + this.failureReason = failureReason; + return this; + } + + /** + * Get overall upgrade time in milli-seconds. + * + * @return the overallUpgradeElapsedTimeInMs value + */ + public double overallUpgradeElapsedTimeInMs() { + return this.overallUpgradeElapsedTimeInMs; + } + + /** + * Set overall upgrade time in milli-seconds. + * + * @param overallUpgradeElapsedTimeInMs the overallUpgradeElapsedTimeInMs value to set + * @return the ApplicationUpgradeRollbackStartEvent object itself. + */ + public ApplicationUpgradeRollbackStartEvent withOverallUpgradeElapsedTimeInMs(double overallUpgradeElapsedTimeInMs) { + this.overallUpgradeElapsedTimeInMs = overallUpgradeElapsedTimeInMs; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeStartEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeStartEvent.java new file mode 100644 index 0000000000000..445b1cdd2d264 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeStartEvent.java @@ -0,0 +1,178 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ApplicationEventInner; + +/** + * Application Upgrade Start event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ApplicationUpgradeStart") +public class ApplicationUpgradeStartEvent extends ApplicationEventInner { + /** + * Application type name. + */ + @JsonProperty(value = "ApplicationTypeName", required = true) + private String applicationTypeName; + + /** + * Current Application type version. + */ + @JsonProperty(value = "CurrentApplicationTypeVersion", required = true) + private String currentApplicationTypeVersion; + + /** + * Target Application type version. + */ + @JsonProperty(value = "ApplicationTypeVersion", required = true) + private String applicationTypeVersion; + + /** + * Type of upgrade. + */ + @JsonProperty(value = "UpgradeType", required = true) + private String upgradeType; + + /** + * Mode of upgrade. + */ + @JsonProperty(value = "RollingUpgradeMode", required = true) + private String rollingUpgradeMode; + + /** + * Action if failed. + */ + @JsonProperty(value = "FailureAction", required = true) + private String failureAction; + + /** + * Get application type name. + * + * @return the applicationTypeName value + */ + public String applicationTypeName() { + return this.applicationTypeName; + } + + /** + * Set application type name. + * + * @param applicationTypeName the applicationTypeName value to set + * @return the ApplicationUpgradeStartEvent object itself. + */ + public ApplicationUpgradeStartEvent withApplicationTypeName(String applicationTypeName) { + this.applicationTypeName = applicationTypeName; + return this; + } + + /** + * Get current Application type version. + * + * @return the currentApplicationTypeVersion value + */ + public String currentApplicationTypeVersion() { + return this.currentApplicationTypeVersion; + } + + /** + * Set current Application type version. + * + * @param currentApplicationTypeVersion the currentApplicationTypeVersion value to set + * @return the ApplicationUpgradeStartEvent object itself. + */ + public ApplicationUpgradeStartEvent withCurrentApplicationTypeVersion(String currentApplicationTypeVersion) { + this.currentApplicationTypeVersion = currentApplicationTypeVersion; + return this; + } + + /** + * Get target Application type version. + * + * @return the applicationTypeVersion value + */ + public String applicationTypeVersion() { + return this.applicationTypeVersion; + } + + /** + * Set target Application type version. + * + * @param applicationTypeVersion the applicationTypeVersion value to set + * @return the ApplicationUpgradeStartEvent object itself. + */ + public ApplicationUpgradeStartEvent withApplicationTypeVersion(String applicationTypeVersion) { + this.applicationTypeVersion = applicationTypeVersion; + return this; + } + + /** + * Get type of upgrade. + * + * @return the upgradeType value + */ + public String upgradeType() { + return this.upgradeType; + } + + /** + * Set type of upgrade. + * + * @param upgradeType the upgradeType value to set + * @return the ApplicationUpgradeStartEvent object itself. + */ + public ApplicationUpgradeStartEvent withUpgradeType(String upgradeType) { + this.upgradeType = upgradeType; + return this; + } + + /** + * Get mode of upgrade. + * + * @return the rollingUpgradeMode value + */ + public String rollingUpgradeMode() { + return this.rollingUpgradeMode; + } + + /** + * Set mode of upgrade. + * + * @param rollingUpgradeMode the rollingUpgradeMode value to set + * @return the ApplicationUpgradeStartEvent object itself. + */ + public ApplicationUpgradeStartEvent withRollingUpgradeMode(String rollingUpgradeMode) { + this.rollingUpgradeMode = rollingUpgradeMode; + return this; + } + + /** + * Get action if failed. + * + * @return the failureAction value + */ + public String failureAction() { + return this.failureAction; + } + + /** + * Set action if failed. + * + * @param failureAction the failureAction value to set + * @return the ApplicationUpgradeStartEvent object itself. + */ + public ApplicationUpgradeStartEvent withFailureAction(String failureAction) { + this.failureAction = failureAction; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeUpdateDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeUpdateDescription.java new file mode 100644 index 0000000000000..6abec5ba6547a --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeUpdateDescription.java @@ -0,0 +1,124 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the parameters for updating an ongoing application upgrade. + */ +public class ApplicationUpgradeUpdateDescription { + /** + * The name of the application, including the 'fabric:' URI scheme. + */ + @JsonProperty(value = "Name", required = true) + private String name; + + /** + * The kind of upgrade out of the following possible values. Possible + * values include: 'Invalid', 'Rolling'. + */ + @JsonProperty(value = "UpgradeKind", required = true) + private UpgradeKind upgradeKind; + + /** + * Defines a health policy used to evaluate the health of an application or + * one of its children entities. + */ + @JsonProperty(value = "ApplicationHealthPolicy") + private ApplicationHealthPolicy applicationHealthPolicy; + + /** + * Describes the parameters for updating a rolling upgrade of application + * or cluster. + */ + @JsonProperty(value = "UpdateDescription") + private RollingUpgradeUpdateDescription updateDescription; + + /** + * Get the name of the application, including the 'fabric:' URI scheme. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the application, including the 'fabric:' URI scheme. + * + * @param name the name value to set + * @return the ApplicationUpgradeUpdateDescription object itself. + */ + public ApplicationUpgradeUpdateDescription withName(String name) { + this.name = name; + return this; + } + + /** + * Get the kind of upgrade out of the following possible values. Possible values include: 'Invalid', 'Rolling'. + * + * @return the upgradeKind value + */ + public UpgradeKind upgradeKind() { + return this.upgradeKind; + } + + /** + * Set the kind of upgrade out of the following possible values. Possible values include: 'Invalid', 'Rolling'. + * + * @param upgradeKind the upgradeKind value to set + * @return the ApplicationUpgradeUpdateDescription object itself. + */ + public ApplicationUpgradeUpdateDescription withUpgradeKind(UpgradeKind upgradeKind) { + this.upgradeKind = upgradeKind; + return this; + } + + /** + * Get defines a health policy used to evaluate the health of an application or one of its children entities. + * + * @return the applicationHealthPolicy value + */ + public ApplicationHealthPolicy applicationHealthPolicy() { + return this.applicationHealthPolicy; + } + + /** + * Set defines a health policy used to evaluate the health of an application or one of its children entities. + * + * @param applicationHealthPolicy the applicationHealthPolicy value to set + * @return the ApplicationUpgradeUpdateDescription object itself. + */ + public ApplicationUpgradeUpdateDescription withApplicationHealthPolicy(ApplicationHealthPolicy applicationHealthPolicy) { + this.applicationHealthPolicy = applicationHealthPolicy; + return this; + } + + /** + * Get describes the parameters for updating a rolling upgrade of application or cluster. + * + * @return the updateDescription value + */ + public RollingUpgradeUpdateDescription updateDescription() { + return this.updateDescription; + } + + /** + * Set describes the parameters for updating a rolling upgrade of application or cluster. + * + * @param updateDescription the updateDescription value to set + * @return the ApplicationUpgradeUpdateDescription object itself. + */ + public ApplicationUpgradeUpdateDescription withUpdateDescription(RollingUpgradeUpdateDescription updateDescription) { + this.updateDescription = updateDescription; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationsHealthEvaluation.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationsHealthEvaluation.java new file mode 100644 index 0000000000000..b178951875b1b --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationsHealthEvaluation.java @@ -0,0 +1,105 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents health evaluation for applications, containing health evaluations + * for each unhealthy application that impacted current aggregated health + * state. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("Applications") +public class ApplicationsHealthEvaluation extends HealthEvaluation { + /** + * Maximum allowed percentage of unhealthy applications from the + * ClusterHealthPolicy. + */ + @JsonProperty(value = "MaxPercentUnhealthyApplications") + private Integer maxPercentUnhealthyApplications; + + /** + * Total number of applications from the health store. + */ + @JsonProperty(value = "TotalCount") + private Long totalCount; + + /** + * List of unhealthy evaluations that led to the aggregated health state. + * Includes all the unhealthy ApplicationHealthEvaluation that impacted the + * aggregated health. + */ + @JsonProperty(value = "UnhealthyEvaluations") + private List unhealthyEvaluations; + + /** + * Get maximum allowed percentage of unhealthy applications from the ClusterHealthPolicy. + * + * @return the maxPercentUnhealthyApplications value + */ + public Integer maxPercentUnhealthyApplications() { + return this.maxPercentUnhealthyApplications; + } + + /** + * Set maximum allowed percentage of unhealthy applications from the ClusterHealthPolicy. + * + * @param maxPercentUnhealthyApplications the maxPercentUnhealthyApplications value to set + * @return the ApplicationsHealthEvaluation object itself. + */ + public ApplicationsHealthEvaluation withMaxPercentUnhealthyApplications(Integer maxPercentUnhealthyApplications) { + this.maxPercentUnhealthyApplications = maxPercentUnhealthyApplications; + return this; + } + + /** + * Get total number of applications from the health store. + * + * @return the totalCount value + */ + public Long totalCount() { + return this.totalCount; + } + + /** + * Set total number of applications from the health store. + * + * @param totalCount the totalCount value to set + * @return the ApplicationsHealthEvaluation object itself. + */ + public ApplicationsHealthEvaluation withTotalCount(Long totalCount) { + this.totalCount = totalCount; + return this; + } + + /** + * Get list of unhealthy evaluations that led to the aggregated health state. Includes all the unhealthy ApplicationHealthEvaluation that impacted the aggregated health. + * + * @return the unhealthyEvaluations value + */ + public List unhealthyEvaluations() { + return this.unhealthyEvaluations; + } + + /** + * Set list of unhealthy evaluations that led to the aggregated health state. Includes all the unhealthy ApplicationHealthEvaluation that impacted the aggregated health. + * + * @param unhealthyEvaluations the unhealthyEvaluations value to set + * @return the ApplicationsHealthEvaluation object itself. + */ + public ApplicationsHealthEvaluation withUnhealthyEvaluations(List unhealthyEvaluations) { + this.unhealthyEvaluations = unhealthyEvaluations; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AveragePartitionLoadScalingTrigger.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AveragePartitionLoadScalingTrigger.java new file mode 100644 index 0000000000000..0cf728bab5f32 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AveragePartitionLoadScalingTrigger.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents a scaling trigger related to an average load of a metric/resource + * of a partition. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("AveragePartitionLoad") +public class AveragePartitionLoadScalingTrigger extends ScalingTriggerDescription { + /** + * The name of the metric for which usage should be tracked. + */ + @JsonProperty(value = "MetricName", required = true) + private String metricName; + + /** + * The lower limit of the load below which a scale in operation should be + * performed. + */ + @JsonProperty(value = "LowerLoadThreshold", required = true) + private String lowerLoadThreshold; + + /** + * The upper limit of the load beyond which a scale out operation should be + * performed. + */ + @JsonProperty(value = "UpperLoadThreshold", required = true) + private String upperLoadThreshold; + + /** + * The period in seconds on which a decision is made whether to scale or + * not. + */ + @JsonProperty(value = "ScaleIntervalInSeconds", required = true) + private long scaleIntervalInSeconds; + + /** + * Get the name of the metric for which usage should be tracked. + * + * @return the metricName value + */ + public String metricName() { + return this.metricName; + } + + /** + * Set the name of the metric for which usage should be tracked. + * + * @param metricName the metricName value to set + * @return the AveragePartitionLoadScalingTrigger object itself. + */ + public AveragePartitionLoadScalingTrigger withMetricName(String metricName) { + this.metricName = metricName; + return this; + } + + /** + * Get the lower limit of the load below which a scale in operation should be performed. + * + * @return the lowerLoadThreshold value + */ + public String lowerLoadThreshold() { + return this.lowerLoadThreshold; + } + + /** + * Set the lower limit of the load below which a scale in operation should be performed. + * + * @param lowerLoadThreshold the lowerLoadThreshold value to set + * @return the AveragePartitionLoadScalingTrigger object itself. + */ + public AveragePartitionLoadScalingTrigger withLowerLoadThreshold(String lowerLoadThreshold) { + this.lowerLoadThreshold = lowerLoadThreshold; + return this; + } + + /** + * Get the upper limit of the load beyond which a scale out operation should be performed. + * + * @return the upperLoadThreshold value + */ + public String upperLoadThreshold() { + return this.upperLoadThreshold; + } + + /** + * Set the upper limit of the load beyond which a scale out operation should be performed. + * + * @param upperLoadThreshold the upperLoadThreshold value to set + * @return the AveragePartitionLoadScalingTrigger object itself. + */ + public AveragePartitionLoadScalingTrigger withUpperLoadThreshold(String upperLoadThreshold) { + this.upperLoadThreshold = upperLoadThreshold; + return this; + } + + /** + * Get the period in seconds on which a decision is made whether to scale or not. + * + * @return the scaleIntervalInSeconds value + */ + public long scaleIntervalInSeconds() { + return this.scaleIntervalInSeconds; + } + + /** + * Set the period in seconds on which a decision is made whether to scale or not. + * + * @param scaleIntervalInSeconds the scaleIntervalInSeconds value to set + * @return the AveragePartitionLoadScalingTrigger object itself. + */ + public AveragePartitionLoadScalingTrigger withScaleIntervalInSeconds(long scaleIntervalInSeconds) { + this.scaleIntervalInSeconds = scaleIntervalInSeconds; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AverageServiceLoadScalingTrigger.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AverageServiceLoadScalingTrigger.java new file mode 100644 index 0000000000000..f21af4d31b412 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AverageServiceLoadScalingTrigger.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents a scaling policy related to an average load of a metric/resource + * of a service. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("AverageServiceLoad") +public class AverageServiceLoadScalingTrigger extends ScalingTriggerDescription { + /** + * The name of the metric for which usage should be tracked. + */ + @JsonProperty(value = "MetricName", required = true) + private String metricName; + + /** + * The lower limit of the load below which a scale in operation should be + * performed. + */ + @JsonProperty(value = "LowerLoadThreshold", required = true) + private String lowerLoadThreshold; + + /** + * The upper limit of the load beyond which a scale out operation should be + * performed. + */ + @JsonProperty(value = "UpperLoadThreshold", required = true) + private String upperLoadThreshold; + + /** + * The period in seconds on which a decision is made whether to scale or + * not. + */ + @JsonProperty(value = "ScaleIntervalInSeconds", required = true) + private long scaleIntervalInSeconds; + + /** + * Get the name of the metric for which usage should be tracked. + * + * @return the metricName value + */ + public String metricName() { + return this.metricName; + } + + /** + * Set the name of the metric for which usage should be tracked. + * + * @param metricName the metricName value to set + * @return the AverageServiceLoadScalingTrigger object itself. + */ + public AverageServiceLoadScalingTrigger withMetricName(String metricName) { + this.metricName = metricName; + return this; + } + + /** + * Get the lower limit of the load below which a scale in operation should be performed. + * + * @return the lowerLoadThreshold value + */ + public String lowerLoadThreshold() { + return this.lowerLoadThreshold; + } + + /** + * Set the lower limit of the load below which a scale in operation should be performed. + * + * @param lowerLoadThreshold the lowerLoadThreshold value to set + * @return the AverageServiceLoadScalingTrigger object itself. + */ + public AverageServiceLoadScalingTrigger withLowerLoadThreshold(String lowerLoadThreshold) { + this.lowerLoadThreshold = lowerLoadThreshold; + return this; + } + + /** + * Get the upper limit of the load beyond which a scale out operation should be performed. + * + * @return the upperLoadThreshold value + */ + public String upperLoadThreshold() { + return this.upperLoadThreshold; + } + + /** + * Set the upper limit of the load beyond which a scale out operation should be performed. + * + * @param upperLoadThreshold the upperLoadThreshold value to set + * @return the AverageServiceLoadScalingTrigger object itself. + */ + public AverageServiceLoadScalingTrigger withUpperLoadThreshold(String upperLoadThreshold) { + this.upperLoadThreshold = upperLoadThreshold; + return this; + } + + /** + * Get the period in seconds on which a decision is made whether to scale or not. + * + * @return the scaleIntervalInSeconds value + */ + public long scaleIntervalInSeconds() { + return this.scaleIntervalInSeconds; + } + + /** + * Set the period in seconds on which a decision is made whether to scale or not. + * + * @param scaleIntervalInSeconds the scaleIntervalInSeconds value to set + * @return the AverageServiceLoadScalingTrigger object itself. + */ + public AverageServiceLoadScalingTrigger withScaleIntervalInSeconds(long scaleIntervalInSeconds) { + this.scaleIntervalInSeconds = scaleIntervalInSeconds; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AzureBlobBackupStorageDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AzureBlobBackupStorageDescription.java new file mode 100644 index 0000000000000..667c081ecbef1 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AzureBlobBackupStorageDescription.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the parameters for Azure blob store used for storing and + * enumerating backups. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "StorageKind") +@JsonTypeName("AzureBlobStore") +public class AzureBlobBackupStorageDescription extends BackupStorageDescription { + /** + * The connection string to connect to the Azure blob store. + */ + @JsonProperty(value = "ConnectionString", required = true) + private String connectionString; + + /** + * The name of the container in the blob store to store and enumerate + * backups from. + */ + @JsonProperty(value = "ContainerName", required = true) + private String containerName; + + /** + * Get the connection string to connect to the Azure blob store. + * + * @return the connectionString value + */ + public String connectionString() { + return this.connectionString; + } + + /** + * Set the connection string to connect to the Azure blob store. + * + * @param connectionString the connectionString value to set + * @return the AzureBlobBackupStorageDescription object itself. + */ + public AzureBlobBackupStorageDescription withConnectionString(String connectionString) { + this.connectionString = connectionString; + return this; + } + + /** + * Get the name of the container in the blob store to store and enumerate backups from. + * + * @return the containerName value + */ + public String containerName() { + return this.containerName; + } + + /** + * Set the name of the container in the blob store to store and enumerate backups from. + * + * @param containerName the containerName value to set + * @return the AzureBlobBackupStorageDescription object itself. + */ + public AzureBlobBackupStorageDescription withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupConfigurationInfo.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupConfigurationInfo.java new file mode 100644 index 0000000000000..2fbfc477ce5ff --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupConfigurationInfo.java @@ -0,0 +1,110 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Describes the backup configuration information. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("BackupConfigurationInfo") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Application", value = ApplicationBackupConfigurationInfo.class), + @JsonSubTypes.Type(name = "Service", value = ServiceBackupConfigurationInfo.class), + @JsonSubTypes.Type(name = "Partition", value = PartitionBackupConfigurationInfoInner.class) +}) +public class BackupConfigurationInfo { + /** + * The name of the backup policy which is applicable to this Service Fabric + * application or service or partition. + */ + @JsonProperty(value = "PolicyName") + private String policyName; + + /** + * Specifies the scope at which the backup policy is applied. + * . Possible values include: 'Invalid', 'Partition', 'Service', + * 'Application'. + */ + @JsonProperty(value = "PolicyInheritedFrom") + private BackupPolicyScope policyInheritedFrom; + + /** + * Describes the backup suspension details. + */ + @JsonProperty(value = "SuspensionInfo") + private BackupSuspensionInfo suspensionInfo; + + /** + * Get the name of the backup policy which is applicable to this Service Fabric application or service or partition. + * + * @return the policyName value + */ + public String policyName() { + return this.policyName; + } + + /** + * Set the name of the backup policy which is applicable to this Service Fabric application or service or partition. + * + * @param policyName the policyName value to set + * @return the BackupConfigurationInfo object itself. + */ + public BackupConfigurationInfo withPolicyName(String policyName) { + this.policyName = policyName; + return this; + } + + /** + * Get specifies the scope at which the backup policy is applied. + . Possible values include: 'Invalid', 'Partition', 'Service', 'Application'. + * + * @return the policyInheritedFrom value + */ + public BackupPolicyScope policyInheritedFrom() { + return this.policyInheritedFrom; + } + + /** + * Set specifies the scope at which the backup policy is applied. + . Possible values include: 'Invalid', 'Partition', 'Service', 'Application'. + * + * @param policyInheritedFrom the policyInheritedFrom value to set + * @return the BackupConfigurationInfo object itself. + */ + public BackupConfigurationInfo withPolicyInheritedFrom(BackupPolicyScope policyInheritedFrom) { + this.policyInheritedFrom = policyInheritedFrom; + return this; + } + + /** + * Get describes the backup suspension details. + * + * @return the suspensionInfo value + */ + public BackupSuspensionInfo suspensionInfo() { + return this.suspensionInfo; + } + + /** + * Set describes the backup suspension details. + * + * @param suspensionInfo the suspensionInfo value to set + * @return the BackupConfigurationInfo object itself. + */ + public BackupConfigurationInfo withSuspensionInfo(BackupSuspensionInfo suspensionInfo) { + this.suspensionInfo = suspensionInfo; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupEntity.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupEntity.java new file mode 100644 index 0000000000000..670d6469a9432 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupEntity.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Describes the Service Fabric entity that is configured for backup. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "EntityKind") +@JsonTypeName("BackupEntity") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Application", value = ApplicationBackupEntity.class), + @JsonSubTypes.Type(name = "Service", value = ServiceBackupEntity.class), + @JsonSubTypes.Type(name = "Partition", value = PartitionBackupEntity.class) +}) +public class BackupEntity { +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupEntityKind.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupEntityKind.java new file mode 100644 index 0000000000000..042ca8e1406fb --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupEntityKind.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for BackupEntityKind. + */ +public final class BackupEntityKind extends ExpandableStringEnum { + /** Static value Invalid for BackupEntityKind. */ + public static final BackupEntityKind INVALID = fromString("Invalid"); + + /** Static value Partition for BackupEntityKind. */ + public static final BackupEntityKind PARTITION = fromString("Partition"); + + /** Static value Service for BackupEntityKind. */ + public static final BackupEntityKind SERVICE = fromString("Service"); + + /** Static value Application for BackupEntityKind. */ + public static final BackupEntityKind APPLICATION = fromString("Application"); + + /** + * Creates or finds a BackupEntityKind from its string representation. + * @param name a name to look for + * @return the corresponding BackupEntityKind + */ + @JsonCreator + public static BackupEntityKind fromString(String name) { + return fromString(name, BackupEntityKind.class); + } + + /** + * @return known BackupEntityKind values + */ + public static Collection values() { + return values(BackupEntityKind.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupEpoch.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupEpoch.java new file mode 100644 index 0000000000000..af1595e4ffb7f --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupEpoch.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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. + */ +public class BackupEpoch { + /** + * 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. + */ + @JsonProperty(value = "ConfigurationNumber") + private String configurationNumber; + + /** + * 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. + */ + @JsonProperty(value = "DataLossNumber") + private String dataLossNumber; + + /** + * Get 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. + * + * @return the configurationNumber value + */ + public String configurationNumber() { + return this.configurationNumber; + } + + /** + * Set 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. + * + * @param configurationNumber the configurationNumber value to set + * @return the BackupEpoch object itself. + */ + public BackupEpoch withConfigurationNumber(String configurationNumber) { + this.configurationNumber = configurationNumber; + return this; + } + + /** + * Get 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. + * + * @return the dataLossNumber value + */ + public String dataLossNumber() { + return this.dataLossNumber; + } + + /** + * Set 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. + * + * @param dataLossNumber the dataLossNumber value to set + * @return the BackupEpoch object itself. + */ + public BackupEpoch withDataLossNumber(String dataLossNumber) { + this.dataLossNumber = dataLossNumber; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupInfo.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupInfo.java new file mode 100644 index 0000000000000..2cbd8c1763791 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupInfo.java @@ -0,0 +1,310 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.UUID; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents a backup point which can be used to trigger a restore. + */ +public class BackupInfo { + /** + * Unique backup ID . + */ + @JsonProperty(value = "BackupId") + private UUID backupId; + + /** + * 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. + */ + @JsonProperty(value = "BackupChainId") + private UUID backupChainId; + + /** + * Name of the Service Fabric application this partition backup belongs to. + */ + @JsonProperty(value = "ApplicationName") + private String applicationName; + + /** + * Name of the Service Fabric service this partition backup belongs to. + */ + @JsonProperty(value = "ServiceName") + private String serviceName; + + /** + * Information about the partition to which this backup belongs to. + */ + @JsonProperty(value = "PartitionInformation") + private PartitionInformation partitionInformation; + + /** + * Location of the backup, relative to the backup store. + */ + @JsonProperty(value = "BackupLocation") + private String backupLocation; + + /** + * Describes the type of backup, whether its full or incremental. + * . Possible values include: 'Invalid', 'Full', 'Incremental'. + */ + @JsonProperty(value = "BackupType") + private BackupType backupType; + + /** + * Epoch of the last record in this backup. + */ + @JsonProperty(value = "EpochOfLastBackupRecord") + private BackupEpoch epochOfLastBackupRecord; + + /** + * LSN of the last record in this backup. + */ + @JsonProperty(value = "LsnOfLastBackupRecord") + private String lsnOfLastBackupRecord; + + /** + * The date time when this backup was taken. + */ + @JsonProperty(value = "CreationTimeUtc") + private DateTime creationTimeUtc; + + /** + * Denotes the failure encountered in getting backup point information. + */ + @JsonProperty(value = "FailureError") + private FabricErrorError failureError; + + /** + * Get unique backup ID . + * + * @return the backupId value + */ + public UUID backupId() { + return this.backupId; + } + + /** + * Set unique backup ID . + * + * @param backupId the backupId value to set + * @return the BackupInfo object itself. + */ + public BackupInfo withBackupId(UUID backupId) { + this.backupId = backupId; + return this; + } + + /** + * Get 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. + * + * @return the backupChainId value + */ + public UUID backupChainId() { + return this.backupChainId; + } + + /** + * Set 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. + * + * @param backupChainId the backupChainId value to set + * @return the BackupInfo object itself. + */ + public BackupInfo withBackupChainId(UUID backupChainId) { + this.backupChainId = backupChainId; + return this; + } + + /** + * Get name of the Service Fabric application this partition backup belongs to. + * + * @return the applicationName value + */ + public String applicationName() { + return this.applicationName; + } + + /** + * Set name of the Service Fabric application this partition backup belongs to. + * + * @param applicationName the applicationName value to set + * @return the BackupInfo object itself. + */ + public BackupInfo withApplicationName(String applicationName) { + this.applicationName = applicationName; + return this; + } + + /** + * Get name of the Service Fabric service this partition backup belongs to. + * + * @return the serviceName value + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set name of the Service Fabric service this partition backup belongs to. + * + * @param serviceName the serviceName value to set + * @return the BackupInfo object itself. + */ + public BackupInfo withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Get information about the partition to which this backup belongs to. + * + * @return the partitionInformation value + */ + public PartitionInformation partitionInformation() { + return this.partitionInformation; + } + + /** + * Set information about the partition to which this backup belongs to. + * + * @param partitionInformation the partitionInformation value to set + * @return the BackupInfo object itself. + */ + public BackupInfo withPartitionInformation(PartitionInformation partitionInformation) { + this.partitionInformation = partitionInformation; + return this; + } + + /** + * Get location of the backup, relative to the backup store. + * + * @return the backupLocation value + */ + public String backupLocation() { + return this.backupLocation; + } + + /** + * Set location of the backup, relative to the backup store. + * + * @param backupLocation the backupLocation value to set + * @return the BackupInfo object itself. + */ + public BackupInfo withBackupLocation(String backupLocation) { + this.backupLocation = backupLocation; + return this; + } + + /** + * Get describes the type of backup, whether its full or incremental. + . Possible values include: 'Invalid', 'Full', 'Incremental'. + * + * @return the backupType value + */ + public BackupType backupType() { + return this.backupType; + } + + /** + * Set describes the type of backup, whether its full or incremental. + . Possible values include: 'Invalid', 'Full', 'Incremental'. + * + * @param backupType the backupType value to set + * @return the BackupInfo object itself. + */ + public BackupInfo withBackupType(BackupType backupType) { + this.backupType = backupType; + return this; + } + + /** + * Get epoch of the last record in this backup. + * + * @return the epochOfLastBackupRecord value + */ + public BackupEpoch epochOfLastBackupRecord() { + return this.epochOfLastBackupRecord; + } + + /** + * Set epoch of the last record in this backup. + * + * @param epochOfLastBackupRecord the epochOfLastBackupRecord value to set + * @return the BackupInfo object itself. + */ + public BackupInfo withEpochOfLastBackupRecord(BackupEpoch epochOfLastBackupRecord) { + this.epochOfLastBackupRecord = epochOfLastBackupRecord; + return this; + } + + /** + * Get lSN of the last record in this backup. + * + * @return the lsnOfLastBackupRecord value + */ + public String lsnOfLastBackupRecord() { + return this.lsnOfLastBackupRecord; + } + + /** + * Set lSN of the last record in this backup. + * + * @param lsnOfLastBackupRecord the lsnOfLastBackupRecord value to set + * @return the BackupInfo object itself. + */ + public BackupInfo withLsnOfLastBackupRecord(String lsnOfLastBackupRecord) { + this.lsnOfLastBackupRecord = lsnOfLastBackupRecord; + return this; + } + + /** + * Get the date time when this backup was taken. + * + * @return the creationTimeUtc value + */ + public DateTime creationTimeUtc() { + return this.creationTimeUtc; + } + + /** + * Set the date time when this backup was taken. + * + * @param creationTimeUtc the creationTimeUtc value to set + * @return the BackupInfo object itself. + */ + public BackupInfo withCreationTimeUtc(DateTime creationTimeUtc) { + this.creationTimeUtc = creationTimeUtc; + return this; + } + + /** + * Get denotes the failure encountered in getting backup point information. + * + * @return the failureError value + */ + public FabricErrorError failureError() { + return this.failureError; + } + + /** + * Set denotes the failure encountered in getting backup point information. + * + * @param failureError the failureError value to set + * @return the BackupInfo object itself. + */ + public BackupInfo withFailureError(FabricErrorError failureError) { + this.failureError = failureError; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupPartitionDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupPartitionDescription.java new file mode 100644 index 0000000000000..ccade70956cd7 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupPartitionDescription.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the parameters for triggering partition's backup. + */ +public class BackupPartitionDescription { + /** + * Specifies the details of the backup storage where to save the backup. + */ + @JsonProperty(value = "BackupStorage") + private BackupStorageDescription backupStorage; + + /** + * Get specifies the details of the backup storage where to save the backup. + * + * @return the backupStorage value + */ + public BackupStorageDescription backupStorage() { + return this.backupStorage; + } + + /** + * Set specifies the details of the backup storage where to save the backup. + * + * @param backupStorage the backupStorage value to set + * @return the BackupPartitionDescription object itself. + */ + public BackupPartitionDescription withBackupStorage(BackupStorageDescription backupStorage) { + this.backupStorage = backupStorage; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupPolicyScope.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupPolicyScope.java new file mode 100644 index 0000000000000..229fc3a4fcbe8 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupPolicyScope.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for BackupPolicyScope. + */ +public final class BackupPolicyScope extends ExpandableStringEnum { + /** Static value Invalid for BackupPolicyScope. */ + public static final BackupPolicyScope INVALID = fromString("Invalid"); + + /** Static value Partition for BackupPolicyScope. */ + public static final BackupPolicyScope PARTITION = fromString("Partition"); + + /** Static value Service for BackupPolicyScope. */ + public static final BackupPolicyScope SERVICE = fromString("Service"); + + /** Static value Application for BackupPolicyScope. */ + public static final BackupPolicyScope APPLICATION = fromString("Application"); + + /** + * Creates or finds a BackupPolicyScope from its string representation. + * @param name a name to look for + * @return the corresponding BackupPolicyScope + */ + @JsonCreator + public static BackupPolicyScope fromString(String name) { + return fromString(name, BackupPolicyScope.class); + } + + /** + * @return known BackupPolicyScope values + */ + public static Collection values() { + return values(BackupPolicyScope.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupScheduleDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupScheduleDescription.java new file mode 100644 index 0000000000000..e895767f98c24 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupScheduleDescription.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Describes the backup schedule parameters. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ScheduleKind") +@JsonTypeName("BackupScheduleDescription") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "FrequencyBased", value = FrequencyBasedBackupScheduleDescription.class), + @JsonSubTypes.Type(name = "TimeBased", value = TimeBasedBackupScheduleDescription.class) +}) +public class BackupScheduleDescription { +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupScheduleFrequencyType.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupScheduleFrequencyType.java new file mode 100644 index 0000000000000..b5d8efc0b4e8f --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupScheduleFrequencyType.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for BackupScheduleFrequencyType. + */ +public final class BackupScheduleFrequencyType extends ExpandableStringEnum { + /** Static value Invalid for BackupScheduleFrequencyType. */ + public static final BackupScheduleFrequencyType INVALID = fromString("Invalid"); + + /** Static value Daily for BackupScheduleFrequencyType. */ + public static final BackupScheduleFrequencyType DAILY = fromString("Daily"); + + /** Static value Weekly for BackupScheduleFrequencyType. */ + public static final BackupScheduleFrequencyType WEEKLY = fromString("Weekly"); + + /** + * Creates or finds a BackupScheduleFrequencyType from its string representation. + * @param name a name to look for + * @return the corresponding BackupScheduleFrequencyType + */ + @JsonCreator + public static BackupScheduleFrequencyType fromString(String name) { + return fromString(name, BackupScheduleFrequencyType.class); + } + + /** + * @return known BackupScheduleFrequencyType values + */ + public static Collection values() { + return values(BackupScheduleFrequencyType.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupScheduleKind.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupScheduleKind.java new file mode 100644 index 0000000000000..fe6e42616e979 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupScheduleKind.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for BackupScheduleKind. + */ +public final class BackupScheduleKind extends ExpandableStringEnum { + /** Static value Invalid for BackupScheduleKind. */ + public static final BackupScheduleKind INVALID = fromString("Invalid"); + + /** Static value TimeBased for BackupScheduleKind. */ + public static final BackupScheduleKind TIME_BASED = fromString("TimeBased"); + + /** Static value FrequencyBased for BackupScheduleKind. */ + public static final BackupScheduleKind FREQUENCY_BASED = fromString("FrequencyBased"); + + /** + * Creates or finds a BackupScheduleKind from its string representation. + * @param name a name to look for + * @return the corresponding BackupScheduleKind + */ + @JsonCreator + public static BackupScheduleKind fromString(String name) { + return fromString(name, BackupScheduleKind.class); + } + + /** + * @return known BackupScheduleKind values + */ + public static Collection values() { + return values(BackupScheduleKind.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupState.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupState.java new file mode 100644 index 0000000000000..91859b0789ec0 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupState.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for BackupState. + */ +public final class BackupState extends ExpandableStringEnum { + /** Static value Invalid for BackupState. */ + public static final BackupState INVALID = fromString("Invalid"); + + /** Static value Accepted for BackupState. */ + public static final BackupState ACCEPTED = fromString("Accepted"); + + /** Static value BackupInProgress for BackupState. */ + public static final BackupState BACKUP_IN_PROGRESS = fromString("BackupInProgress"); + + /** Static value Success for BackupState. */ + public static final BackupState SUCCESS = fromString("Success"); + + /** Static value Failure for BackupState. */ + public static final BackupState FAILURE = fromString("Failure"); + + /** Static value Timeout for BackupState. */ + public static final BackupState TIMEOUT = fromString("Timeout"); + + /** + * Creates or finds a BackupState from its string representation. + * @param name a name to look for + * @return the corresponding BackupState + */ + @JsonCreator + public static BackupState fromString(String name) { + return fromString(name, BackupState.class); + } + + /** + * @return known BackupState values + */ + public static Collection values() { + return values(BackupState.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupStorageDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupStorageDescription.java new file mode 100644 index 0000000000000..e4516bfb141e6 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupStorageDescription.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Describes the parameters for the backup storage. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "StorageKind") +@JsonTypeName("BackupStorageDescription") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureBlobStore", value = AzureBlobBackupStorageDescription.class), + @JsonSubTypes.Type(name = "FileShare", value = FileShareBackupStorageDescription.class) +}) +public class BackupStorageDescription { + /** + * Friendly name for this backup storage. + */ + @JsonProperty(value = "FriendlyName") + private String friendlyName; + + /** + * Get friendly name for this backup storage. + * + * @return the friendlyName value + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set friendly name for this backup storage. + * + * @param friendlyName the friendlyName value to set + * @return the BackupStorageDescription object itself. + */ + public BackupStorageDescription withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupStorageKind.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupStorageKind.java new file mode 100644 index 0000000000000..685ce54347f69 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupStorageKind.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for BackupStorageKind. + */ +public final class BackupStorageKind extends ExpandableStringEnum { + /** Static value Invalid for BackupStorageKind. */ + public static final BackupStorageKind INVALID = fromString("Invalid"); + + /** Static value FileShare for BackupStorageKind. */ + public static final BackupStorageKind FILE_SHARE = fromString("FileShare"); + + /** Static value AzureBlobStore for BackupStorageKind. */ + public static final BackupStorageKind AZURE_BLOB_STORE = fromString("AzureBlobStore"); + + /** + * Creates or finds a BackupStorageKind from its string representation. + * @param name a name to look for + * @return the corresponding BackupStorageKind + */ + @JsonCreator + public static BackupStorageKind fromString(String name) { + return fromString(name, BackupStorageKind.class); + } + + /** + * @return known BackupStorageKind values + */ + public static Collection values() { + return values(BackupStorageKind.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupSuspensionInfo.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupSuspensionInfo.java new file mode 100644 index 0000000000000..2f77343c86076 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupSuspensionInfo.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the backup suspension details. + */ +public class BackupSuspensionInfo { + /** + * Indicates whether periodic backup is suspended at this level or not. + */ + @JsonProperty(value = "IsSuspended") + private Boolean isSuspended; + + /** + * Specifies the scope at which the backup suspension was applied. + * . Possible values include: 'Invalid', 'Partition', 'Service', + * 'Application'. + */ + @JsonProperty(value = "SuspensionInheritedFrom") + private BackupSuspensionScope suspensionInheritedFrom; + + /** + * Get indicates whether periodic backup is suspended at this level or not. + * + * @return the isSuspended value + */ + public Boolean isSuspended() { + return this.isSuspended; + } + + /** + * Set indicates whether periodic backup is suspended at this level or not. + * + * @param isSuspended the isSuspended value to set + * @return the BackupSuspensionInfo object itself. + */ + public BackupSuspensionInfo withIsSuspended(Boolean isSuspended) { + this.isSuspended = isSuspended; + return this; + } + + /** + * Get specifies the scope at which the backup suspension was applied. + . Possible values include: 'Invalid', 'Partition', 'Service', 'Application'. + * + * @return the suspensionInheritedFrom value + */ + public BackupSuspensionScope suspensionInheritedFrom() { + return this.suspensionInheritedFrom; + } + + /** + * Set specifies the scope at which the backup suspension was applied. + . Possible values include: 'Invalid', 'Partition', 'Service', 'Application'. + * + * @param suspensionInheritedFrom the suspensionInheritedFrom value to set + * @return the BackupSuspensionInfo object itself. + */ + public BackupSuspensionInfo withSuspensionInheritedFrom(BackupSuspensionScope suspensionInheritedFrom) { + this.suspensionInheritedFrom = suspensionInheritedFrom; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupSuspensionScope.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupSuspensionScope.java new file mode 100644 index 0000000000000..165e7ad87980c --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupSuspensionScope.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for BackupSuspensionScope. + */ +public final class BackupSuspensionScope extends ExpandableStringEnum { + /** Static value Invalid for BackupSuspensionScope. */ + public static final BackupSuspensionScope INVALID = fromString("Invalid"); + + /** Static value Partition for BackupSuspensionScope. */ + public static final BackupSuspensionScope PARTITION = fromString("Partition"); + + /** Static value Service for BackupSuspensionScope. */ + public static final BackupSuspensionScope SERVICE = fromString("Service"); + + /** Static value Application for BackupSuspensionScope. */ + public static final BackupSuspensionScope APPLICATION = fromString("Application"); + + /** + * Creates or finds a BackupSuspensionScope from its string representation. + * @param name a name to look for + * @return the corresponding BackupSuspensionScope + */ + @JsonCreator + public static BackupSuspensionScope fromString(String name) { + return fromString(name, BackupSuspensionScope.class); + } + + /** + * @return known BackupSuspensionScope values + */ + public static Collection values() { + return values(BackupSuspensionScope.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupType.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupType.java new file mode 100644 index 0000000000000..325d7f88569e1 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupType.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for BackupType. + */ +public final class BackupType extends ExpandableStringEnum { + /** Static value Invalid for BackupType. */ + public static final BackupType INVALID = fromString("Invalid"); + + /** Static value Full for BackupType. */ + public static final BackupType FULL = fromString("Full"); + + /** Static value Incremental for BackupType. */ + public static final BackupType INCREMENTAL = fromString("Incremental"); + + /** + * Creates or finds a BackupType from its string representation. + * @param name a name to look for + * @return the corresponding BackupType + */ + @JsonCreator + public static BackupType fromString(String name) { + return fromString(name, BackupType.class); + } + + /** + * @return known BackupType values + */ + public static Collection values() { + return values(BackupType.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BinaryPropertyValue.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BinaryPropertyValue.java new file mode 100644 index 0000000000000..3b521cf5e1bb1 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BinaryPropertyValue.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes a Service Fabric property value of type Binary. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("Binary") +public class BinaryPropertyValue extends PropertyValue { + /** + * Array of bytes to be sent as an integer array. Each element of array is + * a number between 0 and 255. + */ + @JsonProperty(value = "Data", required = true) + private List data; + + /** + * Get array of bytes to be sent as an integer array. Each element of array is a number between 0 and 255. + * + * @return the data value + */ + public List data() { + return this.data; + } + + /** + * Set array of bytes to be sent as an integer array. Each element of array is a number between 0 and 255. + * + * @param data the data value to set + * @return the BinaryPropertyValue object itself. + */ + public BinaryPropertyValue withData(List data) { + this.data = data; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosContext.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosContext.java new file mode 100644 index 0000000000000..9ec792abcb981 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosContext.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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. + */ +public class ChaosContext { + /** + * Describes a map that contains a collection of ChaosContextMapItem's. + */ + @JsonProperty(value = "Map") + private Map map; + + /** + * Get describes a map that contains a collection of ChaosContextMapItem's. + * + * @return the map value + */ + public Map map() { + return this.map; + } + + /** + * Set describes a map that contains a collection of ChaosContextMapItem's. + * + * @param map the map value to set + * @return the ChaosContext object itself. + */ + public ChaosContext withMap(Map map) { + this.map = map; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosEvent.java new file mode 100644 index 0000000000000..fc894e54f6f55 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosEvent.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Represents an event generated during a Chaos run. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ChaosEvent") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "ExecutingFaults", value = ExecutingFaultsChaosEvent.class), + @JsonSubTypes.Type(name = "Started", value = StartedChaosEvent.class), + @JsonSubTypes.Type(name = "Stopped", value = StoppedChaosEvent.class), + @JsonSubTypes.Type(name = "TestError", value = TestErrorChaosEvent.class), + @JsonSubTypes.Type(name = "ValidationFailed", value = ValidationFailedChaosEvent.class), + @JsonSubTypes.Type(name = "Waiting", value = WaitingChaosEvent.class) +}) +public class ChaosEvent { + /** + * The UTC timestamp when this Chaos event was generated. + */ + @JsonProperty(value = "TimeStampUtc", required = true) + private DateTime timeStampUtc; + + /** + * Get the UTC timestamp when this Chaos event was generated. + * + * @return the timeStampUtc value + */ + public DateTime timeStampUtc() { + return this.timeStampUtc; + } + + /** + * Set the UTC timestamp when this Chaos event was generated. + * + * @param timeStampUtc the timeStampUtc value to set + * @return the ChaosEvent object itself. + */ + public ChaosEvent withTimeStampUtc(DateTime timeStampUtc) { + this.timeStampUtc = timeStampUtc; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosEventKind.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosEventKind.java new file mode 100644 index 0000000000000..6d4e59b6f073d --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosEventKind.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ChaosEventKind. + */ +public final class ChaosEventKind extends ExpandableStringEnum { + /** Static value Invalid for ChaosEventKind. */ + public static final ChaosEventKind INVALID = fromString("Invalid"); + + /** Static value Started for ChaosEventKind. */ + public static final ChaosEventKind STARTED = fromString("Started"); + + /** Static value ExecutingFaults for ChaosEventKind. */ + public static final ChaosEventKind EXECUTING_FAULTS = fromString("ExecutingFaults"); + + /** Static value Waiting for ChaosEventKind. */ + public static final ChaosEventKind WAITING = fromString("Waiting"); + + /** Static value ValidationFailed for ChaosEventKind. */ + public static final ChaosEventKind VALIDATION_FAILED = fromString("ValidationFailed"); + + /** Static value TestError for ChaosEventKind. */ + public static final ChaosEventKind TEST_ERROR = fromString("TestError"); + + /** Static value Stopped for ChaosEventKind. */ + public static final ChaosEventKind STOPPED = fromString("Stopped"); + + /** + * Creates or finds a ChaosEventKind from its string representation. + * @param name a name to look for + * @return the corresponding ChaosEventKind + */ + @JsonCreator + public static ChaosEventKind fromString(String name) { + return fromString(name, ChaosEventKind.class); + } + + /** + * @return known ChaosEventKind values + */ + public static Collection values() { + return values(ChaosEventKind.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosEventWrapper.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosEventWrapper.java new file mode 100644 index 0000000000000..1a777d4d72fd9 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosEventWrapper.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Wrapper object for Chaos event. + */ +public class ChaosEventWrapper { + /** + * Represents an event generated during a Chaos run. + */ + @JsonProperty(value = "ChaosEvent") + private ChaosEvent chaosEvent; + + /** + * Get represents an event generated during a Chaos run. + * + * @return the chaosEvent value + */ + public ChaosEvent chaosEvent() { + return this.chaosEvent; + } + + /** + * Set represents an event generated during a Chaos run. + * + * @param chaosEvent the chaosEvent value to set + * @return the ChaosEventWrapper object itself. + */ + public ChaosEventWrapper withChaosEvent(ChaosEvent chaosEvent) { + this.chaosEvent = chaosEvent; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosMovePrimaryFaultScheduledEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosMovePrimaryFaultScheduledEvent.java new file mode 100644 index 0000000000000..a1ecdd68a74fe --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosMovePrimaryFaultScheduledEvent.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.PartitionEventInner; + +/** + * Chaos Move Primary Fault Scheduled event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ChaosMovePrimaryFaultScheduled") +public class ChaosMovePrimaryFaultScheduledEvent extends PartitionEventInner { + /** + * Id of fault group. + */ + @JsonProperty(value = "FaultGroupId", required = true) + private UUID faultGroupId; + + /** + * Id of fault. + */ + @JsonProperty(value = "FaultId", required = true) + private UUID faultId; + + /** + * Service name. + */ + @JsonProperty(value = "ServiceName", required = true) + private String serviceName; + + /** + * The name of a Service Fabric node. + */ + @JsonProperty(value = "NodeTo", required = true) + private String nodeTo; + + /** + * Indicates a forced move. + */ + @JsonProperty(value = "ForcedMove", required = true) + private boolean forcedMove; + + /** + * Get id of fault group. + * + * @return the faultGroupId value + */ + public UUID faultGroupId() { + return this.faultGroupId; + } + + /** + * Set id of fault group. + * + * @param faultGroupId the faultGroupId value to set + * @return the ChaosMovePrimaryFaultScheduledEvent object itself. + */ + public ChaosMovePrimaryFaultScheduledEvent withFaultGroupId(UUID faultGroupId) { + this.faultGroupId = faultGroupId; + return this; + } + + /** + * Get id of fault. + * + * @return the faultId value + */ + public UUID faultId() { + return this.faultId; + } + + /** + * Set id of fault. + * + * @param faultId the faultId value to set + * @return the ChaosMovePrimaryFaultScheduledEvent object itself. + */ + public ChaosMovePrimaryFaultScheduledEvent withFaultId(UUID faultId) { + this.faultId = faultId; + return this; + } + + /** + * Get service name. + * + * @return the serviceName value + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set service name. + * + * @param serviceName the serviceName value to set + * @return the ChaosMovePrimaryFaultScheduledEvent object itself. + */ + public ChaosMovePrimaryFaultScheduledEvent withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Get the name of a Service Fabric node. + * + * @return the nodeTo value + */ + public String nodeTo() { + return this.nodeTo; + } + + /** + * Set the name of a Service Fabric node. + * + * @param nodeTo the nodeTo value to set + * @return the ChaosMovePrimaryFaultScheduledEvent object itself. + */ + public ChaosMovePrimaryFaultScheduledEvent withNodeTo(String nodeTo) { + this.nodeTo = nodeTo; + return this; + } + + /** + * Get indicates a forced move. + * + * @return the forcedMove value + */ + public boolean forcedMove() { + return this.forcedMove; + } + + /** + * Set indicates a forced move. + * + * @param forcedMove the forcedMove value to set + * @return the ChaosMovePrimaryFaultScheduledEvent object itself. + */ + public ChaosMovePrimaryFaultScheduledEvent withForcedMove(boolean forcedMove) { + this.forcedMove = forcedMove; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosMoveSecondaryFaultScheduledEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosMoveSecondaryFaultScheduledEvent.java new file mode 100644 index 0000000000000..d7bae14d2f640 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosMoveSecondaryFaultScheduledEvent.java @@ -0,0 +1,179 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.PartitionEventInner; + +/** + * Chaos Move Secondary Fault Scheduled event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ChaosMoveSecondaryFaultScheduled") +public class ChaosMoveSecondaryFaultScheduledEvent extends PartitionEventInner { + /** + * Id of fault group. + */ + @JsonProperty(value = "FaultGroupId", required = true) + private UUID faultGroupId; + + /** + * Id of fault. + */ + @JsonProperty(value = "FaultId", required = true) + private UUID faultId; + + /** + * Service name. + */ + @JsonProperty(value = "ServiceName", required = true) + private String serviceName; + + /** + * The name of a Service Fabric node. + */ + @JsonProperty(value = "SourceNode", required = true) + private String sourceNode; + + /** + * The name of a Service Fabric node. + */ + @JsonProperty(value = "DestinationNode", required = true) + private String destinationNode; + + /** + * Indicates a forced move. + */ + @JsonProperty(value = "ForcedMove", required = true) + private boolean forcedMove; + + /** + * Get id of fault group. + * + * @return the faultGroupId value + */ + public UUID faultGroupId() { + return this.faultGroupId; + } + + /** + * Set id of fault group. + * + * @param faultGroupId the faultGroupId value to set + * @return the ChaosMoveSecondaryFaultScheduledEvent object itself. + */ + public ChaosMoveSecondaryFaultScheduledEvent withFaultGroupId(UUID faultGroupId) { + this.faultGroupId = faultGroupId; + return this; + } + + /** + * Get id of fault. + * + * @return the faultId value + */ + public UUID faultId() { + return this.faultId; + } + + /** + * Set id of fault. + * + * @param faultId the faultId value to set + * @return the ChaosMoveSecondaryFaultScheduledEvent object itself. + */ + public ChaosMoveSecondaryFaultScheduledEvent withFaultId(UUID faultId) { + this.faultId = faultId; + return this; + } + + /** + * Get service name. + * + * @return the serviceName value + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set service name. + * + * @param serviceName the serviceName value to set + * @return the ChaosMoveSecondaryFaultScheduledEvent object itself. + */ + public ChaosMoveSecondaryFaultScheduledEvent withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Get the name of a Service Fabric node. + * + * @return the sourceNode value + */ + public String sourceNode() { + return this.sourceNode; + } + + /** + * Set the name of a Service Fabric node. + * + * @param sourceNode the sourceNode value to set + * @return the ChaosMoveSecondaryFaultScheduledEvent object itself. + */ + public ChaosMoveSecondaryFaultScheduledEvent withSourceNode(String sourceNode) { + this.sourceNode = sourceNode; + return this; + } + + /** + * Get the name of a Service Fabric node. + * + * @return the destinationNode value + */ + public String destinationNode() { + return this.destinationNode; + } + + /** + * Set the name of a Service Fabric node. + * + * @param destinationNode the destinationNode value to set + * @return the ChaosMoveSecondaryFaultScheduledEvent object itself. + */ + public ChaosMoveSecondaryFaultScheduledEvent withDestinationNode(String destinationNode) { + this.destinationNode = destinationNode; + return this; + } + + /** + * Get indicates a forced move. + * + * @return the forcedMove value + */ + public boolean forcedMove() { + return this.forcedMove; + } + + /** + * Set indicates a forced move. + * + * @param forcedMove the forcedMove value to set + * @return the ChaosMoveSecondaryFaultScheduledEvent object itself. + */ + public ChaosMoveSecondaryFaultScheduledEvent withForcedMove(boolean forcedMove) { + this.forcedMove = forcedMove; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosParameters.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosParameters.java new file mode 100644 index 0000000000000..e9f7bc309b407 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosParameters.java @@ -0,0 +1,308 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines all the parameters to configure a Chaos run. + */ +public class ChaosParameters { + /** + * Total time (in seconds) for which Chaos will run before automatically + * stopping. The maximum allowed value is 4,294,967,295 + * (System.UInt32.MaxValue). + */ + @JsonProperty(value = "TimeToRunInSeconds") + private String timeToRunInSeconds; + + /** + * 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. + */ + @JsonProperty(value = "MaxClusterStabilizationTimeoutInSeconds") + private Long maxClusterStabilizationTimeoutInSeconds; + + /** + * 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. + */ + @JsonProperty(value = "MaxConcurrentFaults") + private Long maxConcurrentFaults; + + /** + * Enables or disables the move primary and move secondary faults. + */ + @JsonProperty(value = "EnableMoveReplicaFaults") + private Boolean enableMoveReplicaFaults; + + /** + * 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. + */ + @JsonProperty(value = "WaitTimeBetweenFaultsInSeconds") + private Long waitTimeBetweenFaultsInSeconds; + + /** + * Time-separation (in seconds) between two consecutive iterations of + * Chaos. + * The larger the value, the lower the fault injection rate. + */ + @JsonProperty(value = "WaitTimeBetweenIterationsInSeconds") + private Long waitTimeBetweenIterationsInSeconds; + + /** + * 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. + */ + @JsonProperty(value = "ClusterHealthPolicy") + private ClusterHealthPolicy clusterHealthPolicy; + + /** + * 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. + */ + @JsonProperty(value = "Context") + private ChaosContext context; + + /** + * 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. + */ + @JsonProperty(value = "ChaosTargetFilter") + private ChaosTargetFilter chaosTargetFilter; + + /** + * Get total time (in seconds) for which Chaos will run before automatically stopping. The maximum allowed value is 4,294,967,295 (System.UInt32.MaxValue). + * + * @return the timeToRunInSeconds value + */ + public String timeToRunInSeconds() { + return this.timeToRunInSeconds; + } + + /** + * Set 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 timeToRunInSeconds the timeToRunInSeconds value to set + * @return the ChaosParameters object itself. + */ + public ChaosParameters withTimeToRunInSeconds(String timeToRunInSeconds) { + this.timeToRunInSeconds = timeToRunInSeconds; + return this; + } + + /** + * Get 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. + * + * @return the maxClusterStabilizationTimeoutInSeconds value + */ + public Long maxClusterStabilizationTimeoutInSeconds() { + return this.maxClusterStabilizationTimeoutInSeconds; + } + + /** + * Set 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 maxClusterStabilizationTimeoutInSeconds the maxClusterStabilizationTimeoutInSeconds value to set + * @return the ChaosParameters object itself. + */ + public ChaosParameters withMaxClusterStabilizationTimeoutInSeconds(Long maxClusterStabilizationTimeoutInSeconds) { + this.maxClusterStabilizationTimeoutInSeconds = maxClusterStabilizationTimeoutInSeconds; + return this; + } + + /** + * Get 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. + * + * @return the maxConcurrentFaults value + */ + public Long maxConcurrentFaults() { + return this.maxConcurrentFaults; + } + + /** + * Set 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 maxConcurrentFaults the maxConcurrentFaults value to set + * @return the ChaosParameters object itself. + */ + public ChaosParameters withMaxConcurrentFaults(Long maxConcurrentFaults) { + this.maxConcurrentFaults = maxConcurrentFaults; + return this; + } + + /** + * Get enables or disables the move primary and move secondary faults. + * + * @return the enableMoveReplicaFaults value + */ + public Boolean enableMoveReplicaFaults() { + return this.enableMoveReplicaFaults; + } + + /** + * Set enables or disables the move primary and move secondary faults. + * + * @param enableMoveReplicaFaults the enableMoveReplicaFaults value to set + * @return the ChaosParameters object itself. + */ + public ChaosParameters withEnableMoveReplicaFaults(Boolean enableMoveReplicaFaults) { + this.enableMoveReplicaFaults = enableMoveReplicaFaults; + return this; + } + + /** + * Get 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. + * + * @return the waitTimeBetweenFaultsInSeconds value + */ + public Long waitTimeBetweenFaultsInSeconds() { + return this.waitTimeBetweenFaultsInSeconds; + } + + /** + * Set 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 waitTimeBetweenFaultsInSeconds the waitTimeBetweenFaultsInSeconds value to set + * @return the ChaosParameters object itself. + */ + public ChaosParameters withWaitTimeBetweenFaultsInSeconds(Long waitTimeBetweenFaultsInSeconds) { + this.waitTimeBetweenFaultsInSeconds = waitTimeBetweenFaultsInSeconds; + return this; + } + + /** + * Get time-separation (in seconds) between two consecutive iterations of Chaos. + The larger the value, the lower the fault injection rate. + * + * @return the waitTimeBetweenIterationsInSeconds value + */ + public Long waitTimeBetweenIterationsInSeconds() { + return this.waitTimeBetweenIterationsInSeconds; + } + + /** + * Set time-separation (in seconds) between two consecutive iterations of Chaos. + The larger the value, the lower the fault injection rate. + * + * @param waitTimeBetweenIterationsInSeconds the waitTimeBetweenIterationsInSeconds value to set + * @return the ChaosParameters object itself. + */ + public ChaosParameters withWaitTimeBetweenIterationsInSeconds(Long waitTimeBetweenIterationsInSeconds) { + this.waitTimeBetweenIterationsInSeconds = waitTimeBetweenIterationsInSeconds; + return this; + } + + /** + * Get 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. + * + * @return the clusterHealthPolicy value + */ + public ClusterHealthPolicy clusterHealthPolicy() { + return this.clusterHealthPolicy; + } + + /** + * Set 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 clusterHealthPolicy the clusterHealthPolicy value to set + * @return the ChaosParameters object itself. + */ + public ChaosParameters withClusterHealthPolicy(ClusterHealthPolicy clusterHealthPolicy) { + this.clusterHealthPolicy = clusterHealthPolicy; + return this; + } + + /** + * Get 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. + * + * @return the context value + */ + public ChaosContext context() { + return this.context; + } + + /** + * Set 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 context the context value to set + * @return the ChaosParameters object itself. + */ + public ChaosParameters withContext(ChaosContext context) { + this.context = context; + return this; + } + + /** + * Get 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. + * + * @return the chaosTargetFilter value + */ + public ChaosTargetFilter chaosTargetFilter() { + return this.chaosTargetFilter; + } + + /** + * Set 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 chaosTargetFilter the chaosTargetFilter value to set + * @return the ChaosParameters object itself. + */ + public ChaosParameters withChaosTargetFilter(ChaosTargetFilter chaosTargetFilter) { + this.chaosTargetFilter = chaosTargetFilter; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosParametersDictionaryItem.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosParametersDictionaryItem.java new file mode 100644 index 0000000000000..54925224fd5d5 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosParametersDictionaryItem.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines an item in ChaosParametersDictionary of the Chaos Schedule. + */ +public class ChaosParametersDictionaryItem { + /** + * The key identifying the Chaos Parameter in the dictionary. This key is + * referenced by Chaos Schedule Jobs. + */ + @JsonProperty(value = "Key", required = true) + private String key; + + /** + * Defines all the parameters to configure a Chaos run. + */ + @JsonProperty(value = "Value", required = true) + private ChaosParameters value; + + /** + * Get the key identifying the Chaos Parameter in the dictionary. This key is referenced by Chaos Schedule Jobs. + * + * @return the key value + */ + public String key() { + return this.key; + } + + /** + * Set the key identifying the Chaos Parameter in the dictionary. This key is referenced by Chaos Schedule Jobs. + * + * @param key the key value to set + * @return the ChaosParametersDictionaryItem object itself. + */ + public ChaosParametersDictionaryItem withKey(String key) { + this.key = key; + return this; + } + + /** + * Get defines all the parameters to configure a Chaos run. + * + * @return the value value + */ + public ChaosParameters value() { + return this.value; + } + + /** + * Set defines all the parameters to configure a Chaos run. + * + * @param value the value value to set + * @return the ChaosParametersDictionaryItem object itself. + */ + public ChaosParametersDictionaryItem withValue(ChaosParameters value) { + this.value = value; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosRemoveReplicaFaultCompletedEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosRemoveReplicaFaultCompletedEvent.java new file mode 100644 index 0000000000000..c8eb737a37529 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosRemoveReplicaFaultCompletedEvent.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ReplicaEventInner; + +/** + * Chaos Remove Replica Fault Completed event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ChaosRemoveReplicaFaultCompleted") +public class ChaosRemoveReplicaFaultCompletedEvent extends ReplicaEventInner { + /** + * Id of fault group. + */ + @JsonProperty(value = "FaultGroupId", required = true) + private UUID faultGroupId; + + /** + * Id of fault. + */ + @JsonProperty(value = "FaultId", required = true) + private UUID faultId; + + /** + * Service name. + */ + @JsonProperty(value = "ServiceUri", required = true) + private String serviceUri; + + /** + * Get id of fault group. + * + * @return the faultGroupId value + */ + public UUID faultGroupId() { + return this.faultGroupId; + } + + /** + * Set id of fault group. + * + * @param faultGroupId the faultGroupId value to set + * @return the ChaosRemoveReplicaFaultCompletedEvent object itself. + */ + public ChaosRemoveReplicaFaultCompletedEvent withFaultGroupId(UUID faultGroupId) { + this.faultGroupId = faultGroupId; + return this; + } + + /** + * Get id of fault. + * + * @return the faultId value + */ + public UUID faultId() { + return this.faultId; + } + + /** + * Set id of fault. + * + * @param faultId the faultId value to set + * @return the ChaosRemoveReplicaFaultCompletedEvent object itself. + */ + public ChaosRemoveReplicaFaultCompletedEvent withFaultId(UUID faultId) { + this.faultId = faultId; + return this; + } + + /** + * Get service name. + * + * @return the serviceUri value + */ + public String serviceUri() { + return this.serviceUri; + } + + /** + * Set service name. + * + * @param serviceUri the serviceUri value to set + * @return the ChaosRemoveReplicaFaultCompletedEvent object itself. + */ + public ChaosRemoveReplicaFaultCompletedEvent withServiceUri(String serviceUri) { + this.serviceUri = serviceUri; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosRemoveReplicaFaultScheduledEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosRemoveReplicaFaultScheduledEvent.java new file mode 100644 index 0000000000000..4fd34e4d4ace7 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosRemoveReplicaFaultScheduledEvent.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ReplicaEventInner; + +/** + * Chaos Remove Replica Fault Scheduled event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ChaosRemoveReplicaFaultScheduled") +public class ChaosRemoveReplicaFaultScheduledEvent extends ReplicaEventInner { + /** + * Id of fault group. + */ + @JsonProperty(value = "FaultGroupId", required = true) + private UUID faultGroupId; + + /** + * Id of fault. + */ + @JsonProperty(value = "FaultId", required = true) + private UUID faultId; + + /** + * Service name. + */ + @JsonProperty(value = "ServiceUri", required = true) + private String serviceUri; + + /** + * Get id of fault group. + * + * @return the faultGroupId value + */ + public UUID faultGroupId() { + return this.faultGroupId; + } + + /** + * Set id of fault group. + * + * @param faultGroupId the faultGroupId value to set + * @return the ChaosRemoveReplicaFaultScheduledEvent object itself. + */ + public ChaosRemoveReplicaFaultScheduledEvent withFaultGroupId(UUID faultGroupId) { + this.faultGroupId = faultGroupId; + return this; + } + + /** + * Get id of fault. + * + * @return the faultId value + */ + public UUID faultId() { + return this.faultId; + } + + /** + * Set id of fault. + * + * @param faultId the faultId value to set + * @return the ChaosRemoveReplicaFaultScheduledEvent object itself. + */ + public ChaosRemoveReplicaFaultScheduledEvent withFaultId(UUID faultId) { + this.faultId = faultId; + return this; + } + + /** + * Get service name. + * + * @return the serviceUri value + */ + public String serviceUri() { + return this.serviceUri; + } + + /** + * Set service name. + * + * @param serviceUri the serviceUri value to set + * @return the ChaosRemoveReplicaFaultScheduledEvent object itself. + */ + public ChaosRemoveReplicaFaultScheduledEvent withServiceUri(String serviceUri) { + this.serviceUri = serviceUri; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosRestartCodePackageFaultCompletedEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosRestartCodePackageFaultCompletedEvent.java new file mode 100644 index 0000000000000..d0585b51aa4eb --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosRestartCodePackageFaultCompletedEvent.java @@ -0,0 +1,179 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ApplicationEventInner; + +/** + * Chaos Restart Code Package Fault Completed event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ChaosRestartCodePackageFaultCompleted") +public class ChaosRestartCodePackageFaultCompletedEvent extends ApplicationEventInner { + /** + * Id of fault group. + */ + @JsonProperty(value = "FaultGroupId", required = true) + private UUID faultGroupId; + + /** + * Id of fault. + */ + @JsonProperty(value = "FaultId", required = true) + private UUID faultId; + + /** + * The name of a Service Fabric node. + */ + @JsonProperty(value = "NodeName", required = true) + private String nodeName; + + /** + * Service manifest name. + */ + @JsonProperty(value = "ServiceManifestName", required = true) + private String serviceManifestName; + + /** + * Code package name. + */ + @JsonProperty(value = "CodePackageName", required = true) + private String codePackageName; + + /** + * Id of Service package activation. + */ + @JsonProperty(value = "ServicePackageActivationId", required = true) + private String servicePackageActivationId; + + /** + * Get id of fault group. + * + * @return the faultGroupId value + */ + public UUID faultGroupId() { + return this.faultGroupId; + } + + /** + * Set id of fault group. + * + * @param faultGroupId the faultGroupId value to set + * @return the ChaosRestartCodePackageFaultCompletedEvent object itself. + */ + public ChaosRestartCodePackageFaultCompletedEvent withFaultGroupId(UUID faultGroupId) { + this.faultGroupId = faultGroupId; + return this; + } + + /** + * Get id of fault. + * + * @return the faultId value + */ + public UUID faultId() { + return this.faultId; + } + + /** + * Set id of fault. + * + * @param faultId the faultId value to set + * @return the ChaosRestartCodePackageFaultCompletedEvent object itself. + */ + public ChaosRestartCodePackageFaultCompletedEvent withFaultId(UUID faultId) { + this.faultId = faultId; + return this; + } + + /** + * Get the name of a Service Fabric node. + * + * @return the nodeName value + */ + public String nodeName() { + return this.nodeName; + } + + /** + * Set the name of a Service Fabric node. + * + * @param nodeName the nodeName value to set + * @return the ChaosRestartCodePackageFaultCompletedEvent object itself. + */ + public ChaosRestartCodePackageFaultCompletedEvent withNodeName(String nodeName) { + this.nodeName = nodeName; + return this; + } + + /** + * Get service manifest name. + * + * @return the serviceManifestName value + */ + public String serviceManifestName() { + return this.serviceManifestName; + } + + /** + * Set service manifest name. + * + * @param serviceManifestName the serviceManifestName value to set + * @return the ChaosRestartCodePackageFaultCompletedEvent object itself. + */ + public ChaosRestartCodePackageFaultCompletedEvent withServiceManifestName(String serviceManifestName) { + this.serviceManifestName = serviceManifestName; + return this; + } + + /** + * Get code package name. + * + * @return the codePackageName value + */ + public String codePackageName() { + return this.codePackageName; + } + + /** + * Set code package name. + * + * @param codePackageName the codePackageName value to set + * @return the ChaosRestartCodePackageFaultCompletedEvent object itself. + */ + public ChaosRestartCodePackageFaultCompletedEvent withCodePackageName(String codePackageName) { + this.codePackageName = codePackageName; + return this; + } + + /** + * Get id of Service package activation. + * + * @return the servicePackageActivationId value + */ + public String servicePackageActivationId() { + return this.servicePackageActivationId; + } + + /** + * Set id of Service package activation. + * + * @param servicePackageActivationId the servicePackageActivationId value to set + * @return the ChaosRestartCodePackageFaultCompletedEvent object itself. + */ + public ChaosRestartCodePackageFaultCompletedEvent withServicePackageActivationId(String servicePackageActivationId) { + this.servicePackageActivationId = servicePackageActivationId; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosRestartCodePackageFaultScheduledEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosRestartCodePackageFaultScheduledEvent.java new file mode 100644 index 0000000000000..fced36eda0001 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosRestartCodePackageFaultScheduledEvent.java @@ -0,0 +1,179 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ApplicationEventInner; + +/** + * Chaos Restart Code Package Fault Scheduled event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ChaosRestartCodePackageFaultScheduled") +public class ChaosRestartCodePackageFaultScheduledEvent extends ApplicationEventInner { + /** + * Id of fault group. + */ + @JsonProperty(value = "FaultGroupId", required = true) + private UUID faultGroupId; + + /** + * Id of fault. + */ + @JsonProperty(value = "FaultId", required = true) + private UUID faultId; + + /** + * The name of a Service Fabric node. + */ + @JsonProperty(value = "NodeName", required = true) + private String nodeName; + + /** + * Service manifest name. + */ + @JsonProperty(value = "ServiceManifestName", required = true) + private String serviceManifestName; + + /** + * Code package name. + */ + @JsonProperty(value = "CodePackageName", required = true) + private String codePackageName; + + /** + * Id of Service package activation. + */ + @JsonProperty(value = "ServicePackageActivationId", required = true) + private String servicePackageActivationId; + + /** + * Get id of fault group. + * + * @return the faultGroupId value + */ + public UUID faultGroupId() { + return this.faultGroupId; + } + + /** + * Set id of fault group. + * + * @param faultGroupId the faultGroupId value to set + * @return the ChaosRestartCodePackageFaultScheduledEvent object itself. + */ + public ChaosRestartCodePackageFaultScheduledEvent withFaultGroupId(UUID faultGroupId) { + this.faultGroupId = faultGroupId; + return this; + } + + /** + * Get id of fault. + * + * @return the faultId value + */ + public UUID faultId() { + return this.faultId; + } + + /** + * Set id of fault. + * + * @param faultId the faultId value to set + * @return the ChaosRestartCodePackageFaultScheduledEvent object itself. + */ + public ChaosRestartCodePackageFaultScheduledEvent withFaultId(UUID faultId) { + this.faultId = faultId; + return this; + } + + /** + * Get the name of a Service Fabric node. + * + * @return the nodeName value + */ + public String nodeName() { + return this.nodeName; + } + + /** + * Set the name of a Service Fabric node. + * + * @param nodeName the nodeName value to set + * @return the ChaosRestartCodePackageFaultScheduledEvent object itself. + */ + public ChaosRestartCodePackageFaultScheduledEvent withNodeName(String nodeName) { + this.nodeName = nodeName; + return this; + } + + /** + * Get service manifest name. + * + * @return the serviceManifestName value + */ + public String serviceManifestName() { + return this.serviceManifestName; + } + + /** + * Set service manifest name. + * + * @param serviceManifestName the serviceManifestName value to set + * @return the ChaosRestartCodePackageFaultScheduledEvent object itself. + */ + public ChaosRestartCodePackageFaultScheduledEvent withServiceManifestName(String serviceManifestName) { + this.serviceManifestName = serviceManifestName; + return this; + } + + /** + * Get code package name. + * + * @return the codePackageName value + */ + public String codePackageName() { + return this.codePackageName; + } + + /** + * Set code package name. + * + * @param codePackageName the codePackageName value to set + * @return the ChaosRestartCodePackageFaultScheduledEvent object itself. + */ + public ChaosRestartCodePackageFaultScheduledEvent withCodePackageName(String codePackageName) { + this.codePackageName = codePackageName; + return this; + } + + /** + * Get id of Service package activation. + * + * @return the servicePackageActivationId value + */ + public String servicePackageActivationId() { + return this.servicePackageActivationId; + } + + /** + * Set id of Service package activation. + * + * @param servicePackageActivationId the servicePackageActivationId value to set + * @return the ChaosRestartCodePackageFaultScheduledEvent object itself. + */ + public ChaosRestartCodePackageFaultScheduledEvent withServicePackageActivationId(String servicePackageActivationId) { + this.servicePackageActivationId = servicePackageActivationId; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosRestartNodeFaultCompletedEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosRestartNodeFaultCompletedEvent.java new file mode 100644 index 0000000000000..d38f00a36904d --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosRestartNodeFaultCompletedEvent.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.NodeEventInner; + +/** + * Chaos Restart Node Fault Completed event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ChaosRestartNodeFaultCompleted") +public class ChaosRestartNodeFaultCompletedEvent extends NodeEventInner { + /** + * Id of Node instance. + */ + @JsonProperty(value = "NodeInstanceId", required = true) + private long nodeInstanceId; + + /** + * Id of fault group. + */ + @JsonProperty(value = "FaultGroupId", required = true) + private UUID faultGroupId; + + /** + * Id of fault. + */ + @JsonProperty(value = "FaultId", required = true) + private UUID faultId; + + /** + * Get id of Node instance. + * + * @return the nodeInstanceId value + */ + public long nodeInstanceId() { + return this.nodeInstanceId; + } + + /** + * Set id of Node instance. + * + * @param nodeInstanceId the nodeInstanceId value to set + * @return the ChaosRestartNodeFaultCompletedEvent object itself. + */ + public ChaosRestartNodeFaultCompletedEvent withNodeInstanceId(long nodeInstanceId) { + this.nodeInstanceId = nodeInstanceId; + return this; + } + + /** + * Get id of fault group. + * + * @return the faultGroupId value + */ + public UUID faultGroupId() { + return this.faultGroupId; + } + + /** + * Set id of fault group. + * + * @param faultGroupId the faultGroupId value to set + * @return the ChaosRestartNodeFaultCompletedEvent object itself. + */ + public ChaosRestartNodeFaultCompletedEvent withFaultGroupId(UUID faultGroupId) { + this.faultGroupId = faultGroupId; + return this; + } + + /** + * Get id of fault. + * + * @return the faultId value + */ + public UUID faultId() { + return this.faultId; + } + + /** + * Set id of fault. + * + * @param faultId the faultId value to set + * @return the ChaosRestartNodeFaultCompletedEvent object itself. + */ + public ChaosRestartNodeFaultCompletedEvent withFaultId(UUID faultId) { + this.faultId = faultId; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosRestartNodeFaultScheduledEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosRestartNodeFaultScheduledEvent.java new file mode 100644 index 0000000000000..8f1bde12539f0 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosRestartNodeFaultScheduledEvent.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.NodeEventInner; + +/** + * Chaos Restart Node Fault Scheduled event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ChaosRestartNodeFaultScheduled") +public class ChaosRestartNodeFaultScheduledEvent extends NodeEventInner { + /** + * Id of Node instance. + */ + @JsonProperty(value = "NodeInstanceId", required = true) + private long nodeInstanceId; + + /** + * Id of fault group. + */ + @JsonProperty(value = "FaultGroupId", required = true) + private UUID faultGroupId; + + /** + * Id of fault. + */ + @JsonProperty(value = "FaultId", required = true) + private UUID faultId; + + /** + * Get id of Node instance. + * + * @return the nodeInstanceId value + */ + public long nodeInstanceId() { + return this.nodeInstanceId; + } + + /** + * Set id of Node instance. + * + * @param nodeInstanceId the nodeInstanceId value to set + * @return the ChaosRestartNodeFaultScheduledEvent object itself. + */ + public ChaosRestartNodeFaultScheduledEvent withNodeInstanceId(long nodeInstanceId) { + this.nodeInstanceId = nodeInstanceId; + return this; + } + + /** + * Get id of fault group. + * + * @return the faultGroupId value + */ + public UUID faultGroupId() { + return this.faultGroupId; + } + + /** + * Set id of fault group. + * + * @param faultGroupId the faultGroupId value to set + * @return the ChaosRestartNodeFaultScheduledEvent object itself. + */ + public ChaosRestartNodeFaultScheduledEvent withFaultGroupId(UUID faultGroupId) { + this.faultGroupId = faultGroupId; + return this; + } + + /** + * Get id of fault. + * + * @return the faultId value + */ + public UUID faultId() { + return this.faultId; + } + + /** + * Set id of fault. + * + * @param faultId the faultId value to set + * @return the ChaosRestartNodeFaultScheduledEvent object itself. + */ + public ChaosRestartNodeFaultScheduledEvent withFaultId(UUID faultId) { + this.faultId = faultId; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosRestartReplicaFaultScheduledEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosRestartReplicaFaultScheduledEvent.java new file mode 100644 index 0000000000000..58708fd90d73e --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosRestartReplicaFaultScheduledEvent.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ReplicaEventInner; + +/** + * Chaos Restart Replica Fault Scheduled event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ChaosRestartReplicaFaultScheduled") +public class ChaosRestartReplicaFaultScheduledEvent extends ReplicaEventInner { + /** + * Id of fault group. + */ + @JsonProperty(value = "FaultGroupId", required = true) + private UUID faultGroupId; + + /** + * Id of fault. + */ + @JsonProperty(value = "FaultId", required = true) + private UUID faultId; + + /** + * Service name. + */ + @JsonProperty(value = "ServiceUri", required = true) + private String serviceUri; + + /** + * Get id of fault group. + * + * @return the faultGroupId value + */ + public UUID faultGroupId() { + return this.faultGroupId; + } + + /** + * Set id of fault group. + * + * @param faultGroupId the faultGroupId value to set + * @return the ChaosRestartReplicaFaultScheduledEvent object itself. + */ + public ChaosRestartReplicaFaultScheduledEvent withFaultGroupId(UUID faultGroupId) { + this.faultGroupId = faultGroupId; + return this; + } + + /** + * Get id of fault. + * + * @return the faultId value + */ + public UUID faultId() { + return this.faultId; + } + + /** + * Set id of fault. + * + * @param faultId the faultId value to set + * @return the ChaosRestartReplicaFaultScheduledEvent object itself. + */ + public ChaosRestartReplicaFaultScheduledEvent withFaultId(UUID faultId) { + this.faultId = faultId; + return this; + } + + /** + * Get service name. + * + * @return the serviceUri value + */ + public String serviceUri() { + return this.serviceUri; + } + + /** + * Set service name. + * + * @param serviceUri the serviceUri value to set + * @return the ChaosRestartReplicaFaultScheduledEvent object itself. + */ + public ChaosRestartReplicaFaultScheduledEvent withServiceUri(String serviceUri) { + this.serviceUri = serviceUri; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosSchedule.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosSchedule.java new file mode 100644 index 0000000000000..ad46629221189 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosSchedule.java @@ -0,0 +1,125 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines the schedule used by Chaos. + */ +public class ChaosSchedule { + /** + * The date and time Chaos will start using this schedule. + */ + @JsonProperty(value = "StartDate") + private DateTime startDate; + + /** + * The date and time Chaos will continue to use this schedule until. + */ + @JsonProperty(value = "ExpiryDate") + private DateTime expiryDate; + + /** + * A mapping of string names to Chaos Parameters to be referenced by Chaos + * Schedule Jobs. + */ + @JsonProperty(value = "ChaosParametersDictionary") + private List chaosParametersDictionary; + + /** + * A list of all Chaos Schedule Jobs that will be automated by the + * schedule. + */ + @JsonProperty(value = "Jobs") + private List jobs; + + /** + * Get the date and time Chaos will start using this schedule. + * + * @return the startDate value + */ + public DateTime startDate() { + return this.startDate; + } + + /** + * Set the date and time Chaos will start using this schedule. + * + * @param startDate the startDate value to set + * @return the ChaosSchedule object itself. + */ + public ChaosSchedule withStartDate(DateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * Get the date and time Chaos will continue to use this schedule until. + * + * @return the expiryDate value + */ + public DateTime expiryDate() { + return this.expiryDate; + } + + /** + * Set the date and time Chaos will continue to use this schedule until. + * + * @param expiryDate the expiryDate value to set + * @return the ChaosSchedule object itself. + */ + public ChaosSchedule withExpiryDate(DateTime expiryDate) { + this.expiryDate = expiryDate; + return this; + } + + /** + * Get a mapping of string names to Chaos Parameters to be referenced by Chaos Schedule Jobs. + * + * @return the chaosParametersDictionary value + */ + public List chaosParametersDictionary() { + return this.chaosParametersDictionary; + } + + /** + * Set a mapping of string names to Chaos Parameters to be referenced by Chaos Schedule Jobs. + * + * @param chaosParametersDictionary the chaosParametersDictionary value to set + * @return the ChaosSchedule object itself. + */ + public ChaosSchedule withChaosParametersDictionary(List chaosParametersDictionary) { + this.chaosParametersDictionary = chaosParametersDictionary; + return this; + } + + /** + * Get a list of all Chaos Schedule Jobs that will be automated by the schedule. + * + * @return the jobs value + */ + public List jobs() { + return this.jobs; + } + + /** + * Set a list of all Chaos Schedule Jobs that will be automated by the schedule. + * + * @param jobs the jobs value to set + * @return the ChaosSchedule object itself. + */ + public ChaosSchedule withJobs(List jobs) { + this.jobs = jobs; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosScheduleJob.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosScheduleJob.java new file mode 100644 index 0000000000000..997e1a716b9c1 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosScheduleJob.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines a repetition rule and parameters of Chaos to be used with the Chaos + * Schedule. + */ +public class ChaosScheduleJob { + /** + * A reference to which Chaos Parameters of the Chaos Schedule to use. + */ + @JsonProperty(value = "ChaosParameters") + private String chaosParameters; + + /** + * Defines the days of the week that a Chaos Schedule Job will run for. + */ + @JsonProperty(value = "Days") + private ChaosScheduleJobActiveDaysOfWeek days; + + /** + * A list of Time Ranges that specify when during active days that this job + * will run. The times are interpreted as UTC. + */ + @JsonProperty(value = "Times") + private List times; + + /** + * Get a reference to which Chaos Parameters of the Chaos Schedule to use. + * + * @return the chaosParameters value + */ + public String chaosParameters() { + return this.chaosParameters; + } + + /** + * Set a reference to which Chaos Parameters of the Chaos Schedule to use. + * + * @param chaosParameters the chaosParameters value to set + * @return the ChaosScheduleJob object itself. + */ + public ChaosScheduleJob withChaosParameters(String chaosParameters) { + this.chaosParameters = chaosParameters; + return this; + } + + /** + * Get defines the days of the week that a Chaos Schedule Job will run for. + * + * @return the days value + */ + public ChaosScheduleJobActiveDaysOfWeek days() { + return this.days; + } + + /** + * Set defines the days of the week that a Chaos Schedule Job will run for. + * + * @param days the days value to set + * @return the ChaosScheduleJob object itself. + */ + public ChaosScheduleJob withDays(ChaosScheduleJobActiveDaysOfWeek days) { + this.days = days; + return this; + } + + /** + * Get a list of Time Ranges that specify when during active days that this job will run. The times are interpreted as UTC. + * + * @return the times value + */ + public List times() { + return this.times; + } + + /** + * Set a list of Time Ranges that specify when during active days that this job will run. The times are interpreted as UTC. + * + * @param times the times value to set + * @return the ChaosScheduleJob object itself. + */ + public ChaosScheduleJob withTimes(List times) { + this.times = times; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosScheduleJobActiveDaysOfWeek.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosScheduleJobActiveDaysOfWeek.java new file mode 100644 index 0000000000000..126cb41de9f80 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosScheduleJobActiveDaysOfWeek.java @@ -0,0 +1,199 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines the days of the week that a Chaos Schedule Job will run for. + */ +public class ChaosScheduleJobActiveDaysOfWeek { + /** + * Indicates if the Chaos Schedule Job will run on Sunday. + */ + @JsonProperty(value = "Sunday") + private Boolean sunday; + + /** + * Indicates if the Chaos Schedule Job will run on Monday. + */ + @JsonProperty(value = "Monday") + private Boolean monday; + + /** + * Indicates if the Chaos Schedule Job will run on Tuesday. + */ + @JsonProperty(value = "Tuesday") + private Boolean tuesday; + + /** + * Indicates if the Chaos Schedule Job will run on Wednesday. + */ + @JsonProperty(value = "Wednesday") + private Boolean wednesday; + + /** + * Indicates if the Chaos Schedule Job will run on Thursday. + */ + @JsonProperty(value = "Thursday") + private Boolean thursday; + + /** + * Indicates if the Chaos Schedule Job will run on Friday. + */ + @JsonProperty(value = "Friday") + private Boolean friday; + + /** + * Indicates if the Chaos Schedule Job will run on Saturday. + */ + @JsonProperty(value = "Saturday") + private Boolean saturday; + + /** + * Get indicates if the Chaos Schedule Job will run on Sunday. + * + * @return the sunday value + */ + public Boolean sunday() { + return this.sunday; + } + + /** + * Set indicates if the Chaos Schedule Job will run on Sunday. + * + * @param sunday the sunday value to set + * @return the ChaosScheduleJobActiveDaysOfWeek object itself. + */ + public ChaosScheduleJobActiveDaysOfWeek withSunday(Boolean sunday) { + this.sunday = sunday; + return this; + } + + /** + * Get indicates if the Chaos Schedule Job will run on Monday. + * + * @return the monday value + */ + public Boolean monday() { + return this.monday; + } + + /** + * Set indicates if the Chaos Schedule Job will run on Monday. + * + * @param monday the monday value to set + * @return the ChaosScheduleJobActiveDaysOfWeek object itself. + */ + public ChaosScheduleJobActiveDaysOfWeek withMonday(Boolean monday) { + this.monday = monday; + return this; + } + + /** + * Get indicates if the Chaos Schedule Job will run on Tuesday. + * + * @return the tuesday value + */ + public Boolean tuesday() { + return this.tuesday; + } + + /** + * Set indicates if the Chaos Schedule Job will run on Tuesday. + * + * @param tuesday the tuesday value to set + * @return the ChaosScheduleJobActiveDaysOfWeek object itself. + */ + public ChaosScheduleJobActiveDaysOfWeek withTuesday(Boolean tuesday) { + this.tuesday = tuesday; + return this; + } + + /** + * Get indicates if the Chaos Schedule Job will run on Wednesday. + * + * @return the wednesday value + */ + public Boolean wednesday() { + return this.wednesday; + } + + /** + * Set indicates if the Chaos Schedule Job will run on Wednesday. + * + * @param wednesday the wednesday value to set + * @return the ChaosScheduleJobActiveDaysOfWeek object itself. + */ + public ChaosScheduleJobActiveDaysOfWeek withWednesday(Boolean wednesday) { + this.wednesday = wednesday; + return this; + } + + /** + * Get indicates if the Chaos Schedule Job will run on Thursday. + * + * @return the thursday value + */ + public Boolean thursday() { + return this.thursday; + } + + /** + * Set indicates if the Chaos Schedule Job will run on Thursday. + * + * @param thursday the thursday value to set + * @return the ChaosScheduleJobActiveDaysOfWeek object itself. + */ + public ChaosScheduleJobActiveDaysOfWeek withThursday(Boolean thursday) { + this.thursday = thursday; + return this; + } + + /** + * Get indicates if the Chaos Schedule Job will run on Friday. + * + * @return the friday value + */ + public Boolean friday() { + return this.friday; + } + + /** + * Set indicates if the Chaos Schedule Job will run on Friday. + * + * @param friday the friday value to set + * @return the ChaosScheduleJobActiveDaysOfWeek object itself. + */ + public ChaosScheduleJobActiveDaysOfWeek withFriday(Boolean friday) { + this.friday = friday; + return this; + } + + /** + * Get indicates if the Chaos Schedule Job will run on Saturday. + * + * @return the saturday value + */ + public Boolean saturday() { + return this.saturday; + } + + /** + * Set indicates if the Chaos Schedule Job will run on Saturday. + * + * @param saturday the saturday value to set + * @return the ChaosScheduleJobActiveDaysOfWeek object itself. + */ + public ChaosScheduleJobActiveDaysOfWeek withSaturday(Boolean saturday) { + this.saturday = saturday; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosScheduleStatus.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosScheduleStatus.java new file mode 100644 index 0000000000000..14374d689191a --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosScheduleStatus.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ChaosScheduleStatus. + */ +public final class ChaosScheduleStatus extends ExpandableStringEnum { + /** Static value Invalid for ChaosScheduleStatus. */ + public static final ChaosScheduleStatus INVALID = fromString("Invalid"); + + /** Static value Stopped for ChaosScheduleStatus. */ + public static final ChaosScheduleStatus STOPPED = fromString("Stopped"); + + /** Static value Active for ChaosScheduleStatus. */ + public static final ChaosScheduleStatus ACTIVE = fromString("Active"); + + /** Static value Expired for ChaosScheduleStatus. */ + public static final ChaosScheduleStatus EXPIRED = fromString("Expired"); + + /** Static value Pending for ChaosScheduleStatus. */ + public static final ChaosScheduleStatus PENDING = fromString("Pending"); + + /** + * Creates or finds a ChaosScheduleStatus from its string representation. + * @param name a name to look for + * @return the corresponding ChaosScheduleStatus + */ + @JsonCreator + public static ChaosScheduleStatus fromString(String name) { + return fromString(name, ChaosScheduleStatus.class); + } + + /** + * @return known ChaosScheduleStatus values + */ + public static Collection values() { + return values(ChaosScheduleStatus.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosStartedEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosStartedEvent.java new file mode 100644 index 0000000000000..0c3621d22fafd --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosStartedEvent.java @@ -0,0 +1,282 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ClusterEventInner; + +/** + * Chaos Started event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ChaosStarted") +public class ChaosStartedEvent extends ClusterEventInner { + /** + * Maximum number of concurrent faults. + */ + @JsonProperty(value = "MaxConcurrentFaults", required = true) + private long maxConcurrentFaults; + + /** + * Time to run in seconds. + */ + @JsonProperty(value = "TimeToRunInSeconds", required = true) + private double timeToRunInSeconds; + + /** + * Maximum timeout for cluster stabilization in seconds. + */ + @JsonProperty(value = "MaxClusterStabilizationTimeoutInSeconds", required = true) + private double maxClusterStabilizationTimeoutInSeconds; + + /** + * Wait time between iterations in seconds. + */ + @JsonProperty(value = "WaitTimeBetweenIterationsInSeconds", required = true) + private double waitTimeBetweenIterationsInSeconds; + + /** + * Wait time between faults in seconds. + */ + @JsonProperty(value = "WaitTimeBetweenFautlsInSeconds", required = true) + private double waitTimeBetweenFautlsInSeconds; + + /** + * Indicates MoveReplica fault is enabled. + */ + @JsonProperty(value = "MoveReplicaFaultEnabled", required = true) + private boolean moveReplicaFaultEnabled; + + /** + * List of included Node types. + */ + @JsonProperty(value = "IncludedNodeTypeList", required = true) + private String includedNodeTypeList; + + /** + * List of included Applications. + */ + @JsonProperty(value = "IncludedApplicationList", required = true) + private String includedApplicationList; + + /** + * Health policy. + */ + @JsonProperty(value = "ClusterHealthPolicy", required = true) + private String clusterHealthPolicy; + + /** + * Chaos Context. + */ + @JsonProperty(value = "ChaosContext", required = true) + private String chaosContext; + + /** + * Get maximum number of concurrent faults. + * + * @return the maxConcurrentFaults value + */ + public long maxConcurrentFaults() { + return this.maxConcurrentFaults; + } + + /** + * Set maximum number of concurrent faults. + * + * @param maxConcurrentFaults the maxConcurrentFaults value to set + * @return the ChaosStartedEvent object itself. + */ + public ChaosStartedEvent withMaxConcurrentFaults(long maxConcurrentFaults) { + this.maxConcurrentFaults = maxConcurrentFaults; + return this; + } + + /** + * Get time to run in seconds. + * + * @return the timeToRunInSeconds value + */ + public double timeToRunInSeconds() { + return this.timeToRunInSeconds; + } + + /** + * Set time to run in seconds. + * + * @param timeToRunInSeconds the timeToRunInSeconds value to set + * @return the ChaosStartedEvent object itself. + */ + public ChaosStartedEvent withTimeToRunInSeconds(double timeToRunInSeconds) { + this.timeToRunInSeconds = timeToRunInSeconds; + return this; + } + + /** + * Get maximum timeout for cluster stabilization in seconds. + * + * @return the maxClusterStabilizationTimeoutInSeconds value + */ + public double maxClusterStabilizationTimeoutInSeconds() { + return this.maxClusterStabilizationTimeoutInSeconds; + } + + /** + * Set maximum timeout for cluster stabilization in seconds. + * + * @param maxClusterStabilizationTimeoutInSeconds the maxClusterStabilizationTimeoutInSeconds value to set + * @return the ChaosStartedEvent object itself. + */ + public ChaosStartedEvent withMaxClusterStabilizationTimeoutInSeconds(double maxClusterStabilizationTimeoutInSeconds) { + this.maxClusterStabilizationTimeoutInSeconds = maxClusterStabilizationTimeoutInSeconds; + return this; + } + + /** + * Get wait time between iterations in seconds. + * + * @return the waitTimeBetweenIterationsInSeconds value + */ + public double waitTimeBetweenIterationsInSeconds() { + return this.waitTimeBetweenIterationsInSeconds; + } + + /** + * Set wait time between iterations in seconds. + * + * @param waitTimeBetweenIterationsInSeconds the waitTimeBetweenIterationsInSeconds value to set + * @return the ChaosStartedEvent object itself. + */ + public ChaosStartedEvent withWaitTimeBetweenIterationsInSeconds(double waitTimeBetweenIterationsInSeconds) { + this.waitTimeBetweenIterationsInSeconds = waitTimeBetweenIterationsInSeconds; + return this; + } + + /** + * Get wait time between faults in seconds. + * + * @return the waitTimeBetweenFautlsInSeconds value + */ + public double waitTimeBetweenFautlsInSeconds() { + return this.waitTimeBetweenFautlsInSeconds; + } + + /** + * Set wait time between faults in seconds. + * + * @param waitTimeBetweenFautlsInSeconds the waitTimeBetweenFautlsInSeconds value to set + * @return the ChaosStartedEvent object itself. + */ + public ChaosStartedEvent withWaitTimeBetweenFautlsInSeconds(double waitTimeBetweenFautlsInSeconds) { + this.waitTimeBetweenFautlsInSeconds = waitTimeBetweenFautlsInSeconds; + return this; + } + + /** + * Get indicates MoveReplica fault is enabled. + * + * @return the moveReplicaFaultEnabled value + */ + public boolean moveReplicaFaultEnabled() { + return this.moveReplicaFaultEnabled; + } + + /** + * Set indicates MoveReplica fault is enabled. + * + * @param moveReplicaFaultEnabled the moveReplicaFaultEnabled value to set + * @return the ChaosStartedEvent object itself. + */ + public ChaosStartedEvent withMoveReplicaFaultEnabled(boolean moveReplicaFaultEnabled) { + this.moveReplicaFaultEnabled = moveReplicaFaultEnabled; + return this; + } + + /** + * Get list of included Node types. + * + * @return the includedNodeTypeList value + */ + public String includedNodeTypeList() { + return this.includedNodeTypeList; + } + + /** + * Set list of included Node types. + * + * @param includedNodeTypeList the includedNodeTypeList value to set + * @return the ChaosStartedEvent object itself. + */ + public ChaosStartedEvent withIncludedNodeTypeList(String includedNodeTypeList) { + this.includedNodeTypeList = includedNodeTypeList; + return this; + } + + /** + * Get list of included Applications. + * + * @return the includedApplicationList value + */ + public String includedApplicationList() { + return this.includedApplicationList; + } + + /** + * Set list of included Applications. + * + * @param includedApplicationList the includedApplicationList value to set + * @return the ChaosStartedEvent object itself. + */ + public ChaosStartedEvent withIncludedApplicationList(String includedApplicationList) { + this.includedApplicationList = includedApplicationList; + return this; + } + + /** + * Get health policy. + * + * @return the clusterHealthPolicy value + */ + public String clusterHealthPolicy() { + return this.clusterHealthPolicy; + } + + /** + * Set health policy. + * + * @param clusterHealthPolicy the clusterHealthPolicy value to set + * @return the ChaosStartedEvent object itself. + */ + public ChaosStartedEvent withClusterHealthPolicy(String clusterHealthPolicy) { + this.clusterHealthPolicy = clusterHealthPolicy; + return this; + } + + /** + * Get chaos Context. + * + * @return the chaosContext value + */ + public String chaosContext() { + return this.chaosContext; + } + + /** + * Set chaos Context. + * + * @param chaosContext the chaosContext value to set + * @return the ChaosStartedEvent object itself. + */ + public ChaosStartedEvent withChaosContext(String chaosContext) { + this.chaosContext = chaosContext; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosStatus.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosStatus.java new file mode 100644 index 0000000000000..5b2e47ea5747a --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosStatus.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ChaosStatus. + */ +public final class ChaosStatus extends ExpandableStringEnum { + /** Static value Invalid for ChaosStatus. */ + public static final ChaosStatus INVALID = fromString("Invalid"); + + /** Static value Running for ChaosStatus. */ + public static final ChaosStatus RUNNING = fromString("Running"); + + /** Static value Stopped for ChaosStatus. */ + public static final ChaosStatus STOPPED = fromString("Stopped"); + + /** + * Creates or finds a ChaosStatus from its string representation. + * @param name a name to look for + * @return the corresponding ChaosStatus + */ + @JsonCreator + public static ChaosStatus fromString(String name) { + return fromString(name, ChaosStatus.class); + } + + /** + * @return known ChaosStatus values + */ + public static Collection values() { + return values(ChaosStatus.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosStoppedEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosStoppedEvent.java new file mode 100644 index 0000000000000..9fbc89184e296 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosStoppedEvent.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ClusterEventInner; + +/** + * Chaos Stopped event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ChaosStopped") +public class ChaosStoppedEvent extends ClusterEventInner { + /** + * Describes reason. + */ + @JsonProperty(value = "Reason", required = true) + private String reason; + + /** + * Get describes reason. + * + * @return the reason value + */ + public String reason() { + return this.reason; + } + + /** + * Set describes reason. + * + * @param reason the reason value to set + * @return the ChaosStoppedEvent object itself. + */ + public ChaosStoppedEvent withReason(String reason) { + this.reason = reason; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosTargetFilter.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosTargetFilter.java new file mode 100644 index 0000000000000..1bc1d46a6cbec --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosTargetFilter.java @@ -0,0 +1,134 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines all filters for targeted Chaos faults, for example, faulting only + * certain node types or faulting only certain applications. + * If ChaosTargetFilter is not used, Chaos faults all cluster entities. If + * ChaosTargetFilter is used, Chaos faults only the entities that meet the + * ChaosTargetFilter + * specification. NodeTypeInclusionList and ApplicationInclusionList allow a + * union semantics only. It is not possible to specify an intersection + * of NodeTypeInclusionList and ApplicationInclusionList. For example, it is + * not possible to specify "fault this application only when it is on that node + * type." + * Once an entity is included in either NodeTypeInclusionList or + * ApplicationInclusionList, that entity cannot be excluded using + * ChaosTargetFilter. Even if + * applicationX does not appear in ApplicationInclusionList, in some Chaos + * iteration applicationX can be faulted because it happens to be on a node of + * nodeTypeY that is included + * in NodeTypeInclusionList. If both NodeTypeInclusionList and + * ApplicationInclusionList are null or empty, an ArgumentException is thrown. + */ +public class ChaosTargetFilter { + /** + * 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. + */ + @JsonProperty(value = "NodeTypeInclusionList") + private List nodeTypeInclusionList; + + /** + * 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. + */ + @JsonProperty(value = "ApplicationInclusionList") + private List applicationInclusionList; + + /** + * Get 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. + * + * @return the nodeTypeInclusionList value + */ + public List nodeTypeInclusionList() { + return this.nodeTypeInclusionList; + } + + /** + * Set 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 nodeTypeInclusionList the nodeTypeInclusionList value to set + * @return the ChaosTargetFilter object itself. + */ + public ChaosTargetFilter withNodeTypeInclusionList(List nodeTypeInclusionList) { + this.nodeTypeInclusionList = nodeTypeInclusionList; + return this; + } + + /** + * Get 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. + * + * @return the applicationInclusionList value + */ + public List applicationInclusionList() { + return this.applicationInclusionList; + } + + /** + * Set 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 applicationInclusionList the applicationInclusionList value to set + * @return the ChaosTargetFilter object itself. + */ + public ChaosTargetFilter withApplicationInclusionList(List applicationInclusionList) { + this.applicationInclusionList = applicationInclusionList; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/CheckExistsPropertyBatchOperation.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/CheckExistsPropertyBatchOperation.java new file mode 100644 index 0000000000000..5e39e12d0fa3c --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/CheckExistsPropertyBatchOperation.java @@ -0,0 +1,54 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * 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. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("CheckExists") +public class CheckExistsPropertyBatchOperation extends PropertyBatchOperation { + /** + * Whether or not the property should exist for the operation to pass. + */ + @JsonProperty(value = "Exists", required = true) + private boolean exists; + + /** + * Get whether or not the property should exist for the operation to pass. + * + * @return the exists value + */ + public boolean exists() { + return this.exists; + } + + /** + * Set whether or not the property should exist for the operation to pass. + * + * @param exists the exists value to set + * @return the CheckExistsPropertyBatchOperation object itself. + */ + public CheckExistsPropertyBatchOperation withExists(boolean exists) { + this.exists = exists; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/CheckSequencePropertyBatchOperation.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/CheckSequencePropertyBatchOperation.java new file mode 100644 index 0000000000000..23819697b0952 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/CheckSequencePropertyBatchOperation.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * 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. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("CheckSequence") +public class CheckSequencePropertyBatchOperation extends PropertyBatchOperation { + /** + * The expected sequence number. + */ + @JsonProperty(value = "SequenceNumber", required = true) + private String sequenceNumber; + + /** + * Get the expected sequence number. + * + * @return the sequenceNumber value + */ + public String sequenceNumber() { + return this.sequenceNumber; + } + + /** + * Set the expected sequence number. + * + * @param sequenceNumber the sequenceNumber value to set + * @return the CheckSequencePropertyBatchOperation object itself. + */ + public CheckSequencePropertyBatchOperation withSequenceNumber(String sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/CheckValuePropertyBatchOperation.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/CheckValuePropertyBatchOperation.java new file mode 100644 index 0000000000000..c7331929a9d24 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/CheckValuePropertyBatchOperation.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * 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. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("CheckValue") +public class CheckValuePropertyBatchOperation extends PropertyBatchOperation { + /** + * The expected property value. + */ + @JsonProperty(value = "Value", required = true) + private PropertyValue value; + + /** + * Get the expected property value. + * + * @return the value value + */ + public PropertyValue value() { + return this.value; + } + + /** + * Set the expected property value. + * + * @param value the value value to set + * @return the CheckValuePropertyBatchOperation object itself. + */ + public CheckValuePropertyBatchOperation withValue(PropertyValue value) { + this.value = value; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterConfigurationUpgradeDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterConfigurationUpgradeDescription.java new file mode 100644 index 0000000000000..44dff11288c0d --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterConfigurationUpgradeDescription.java @@ -0,0 +1,312 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.Period; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the parameters for a standalone cluster configuration upgrade. + */ +public class ClusterConfigurationUpgradeDescription { + /** + * The cluster configuration. + */ + @JsonProperty(value = "ClusterConfig", required = true) + private String clusterConfig; + + /** + * The length of time between attempts to perform a health checks if the + * application or cluster is not healthy. + */ + @JsonProperty(value = "HealthCheckRetryTimeout") + private Period healthCheckRetryTimeout; + + /** + * The length of time to wait after completing an upgrade domain before + * starting the health checks process. + */ + @JsonProperty(value = "HealthCheckWaitDurationInSeconds") + private Period healthCheckWaitDurationInSeconds; + + /** + * The length of time that the application or cluster must remain healthy. + */ + @JsonProperty(value = "HealthCheckStableDurationInSeconds") + private Period healthCheckStableDurationInSeconds; + + /** + * The timeout for the upgrade domain. + */ + @JsonProperty(value = "UpgradeDomainTimeoutInSeconds") + private Period upgradeDomainTimeoutInSeconds; + + /** + * The upgrade timeout. + */ + @JsonProperty(value = "UpgradeTimeoutInSeconds") + private Period upgradeTimeoutInSeconds; + + /** + * The maximum allowed percentage of unhealthy applications during the + * upgrade. Allowed values are integer values from zero to 100. + */ + @JsonProperty(value = "MaxPercentUnhealthyApplications") + private Integer maxPercentUnhealthyApplications; + + /** + * The maximum allowed percentage of unhealthy nodes during the upgrade. + * Allowed values are integer values from zero to 100. + */ + @JsonProperty(value = "MaxPercentUnhealthyNodes") + private Integer maxPercentUnhealthyNodes; + + /** + * The maximum allowed percentage of delta health degradation during the + * upgrade. Allowed values are integer values from zero to 100. + */ + @JsonProperty(value = "MaxPercentDeltaUnhealthyNodes") + private Integer maxPercentDeltaUnhealthyNodes; + + /** + * The maximum allowed percentage of upgrade domain delta health + * degradation during the upgrade. Allowed values are integer values from + * zero to 100. + */ + @JsonProperty(value = "MaxPercentUpgradeDomainDeltaUnhealthyNodes") + private Integer maxPercentUpgradeDomainDeltaUnhealthyNodes; + + /** + * Defines the application health policy map used to evaluate the health of + * an application or one of its children entities. + */ + @JsonProperty(value = "ApplicationHealthPolicies") + private ApplicationHealthPolicies applicationHealthPolicies; + + /** + * Get the cluster configuration. + * + * @return the clusterConfig value + */ + public String clusterConfig() { + return this.clusterConfig; + } + + /** + * Set the cluster configuration. + * + * @param clusterConfig the clusterConfig value to set + * @return the ClusterConfigurationUpgradeDescription object itself. + */ + public ClusterConfigurationUpgradeDescription withClusterConfig(String clusterConfig) { + this.clusterConfig = clusterConfig; + return this; + } + + /** + * Get the length of time between attempts to perform a health checks if the application or cluster is not healthy. + * + * @return the healthCheckRetryTimeout value + */ + public Period healthCheckRetryTimeout() { + return this.healthCheckRetryTimeout; + } + + /** + * Set the length of time between attempts to perform a health checks if the application or cluster is not healthy. + * + * @param healthCheckRetryTimeout the healthCheckRetryTimeout value to set + * @return the ClusterConfigurationUpgradeDescription object itself. + */ + public ClusterConfigurationUpgradeDescription withHealthCheckRetryTimeout(Period healthCheckRetryTimeout) { + this.healthCheckRetryTimeout = healthCheckRetryTimeout; + return this; + } + + /** + * Get the length of time to wait after completing an upgrade domain before starting the health checks process. + * + * @return the healthCheckWaitDurationInSeconds value + */ + public Period healthCheckWaitDurationInSeconds() { + return this.healthCheckWaitDurationInSeconds; + } + + /** + * Set the length of time to wait after completing an upgrade domain before starting the health checks process. + * + * @param healthCheckWaitDurationInSeconds the healthCheckWaitDurationInSeconds value to set + * @return the ClusterConfigurationUpgradeDescription object itself. + */ + public ClusterConfigurationUpgradeDescription withHealthCheckWaitDurationInSeconds(Period healthCheckWaitDurationInSeconds) { + this.healthCheckWaitDurationInSeconds = healthCheckWaitDurationInSeconds; + return this; + } + + /** + * Get the length of time that the application or cluster must remain healthy. + * + * @return the healthCheckStableDurationInSeconds value + */ + public Period healthCheckStableDurationInSeconds() { + return this.healthCheckStableDurationInSeconds; + } + + /** + * Set the length of time that the application or cluster must remain healthy. + * + * @param healthCheckStableDurationInSeconds the healthCheckStableDurationInSeconds value to set + * @return the ClusterConfigurationUpgradeDescription object itself. + */ + public ClusterConfigurationUpgradeDescription withHealthCheckStableDurationInSeconds(Period healthCheckStableDurationInSeconds) { + this.healthCheckStableDurationInSeconds = healthCheckStableDurationInSeconds; + return this; + } + + /** + * Get the timeout for the upgrade domain. + * + * @return the upgradeDomainTimeoutInSeconds value + */ + public Period upgradeDomainTimeoutInSeconds() { + return this.upgradeDomainTimeoutInSeconds; + } + + /** + * Set the timeout for the upgrade domain. + * + * @param upgradeDomainTimeoutInSeconds the upgradeDomainTimeoutInSeconds value to set + * @return the ClusterConfigurationUpgradeDescription object itself. + */ + public ClusterConfigurationUpgradeDescription withUpgradeDomainTimeoutInSeconds(Period upgradeDomainTimeoutInSeconds) { + this.upgradeDomainTimeoutInSeconds = upgradeDomainTimeoutInSeconds; + return this; + } + + /** + * Get the upgrade timeout. + * + * @return the upgradeTimeoutInSeconds value + */ + public Period upgradeTimeoutInSeconds() { + return this.upgradeTimeoutInSeconds; + } + + /** + * Set the upgrade timeout. + * + * @param upgradeTimeoutInSeconds the upgradeTimeoutInSeconds value to set + * @return the ClusterConfigurationUpgradeDescription object itself. + */ + public ClusterConfigurationUpgradeDescription withUpgradeTimeoutInSeconds(Period upgradeTimeoutInSeconds) { + this.upgradeTimeoutInSeconds = upgradeTimeoutInSeconds; + return this; + } + + /** + * Get the maximum allowed percentage of unhealthy applications during the upgrade. Allowed values are integer values from zero to 100. + * + * @return the maxPercentUnhealthyApplications value + */ + public Integer maxPercentUnhealthyApplications() { + return this.maxPercentUnhealthyApplications; + } + + /** + * Set the maximum allowed percentage of unhealthy applications during the upgrade. Allowed values are integer values from zero to 100. + * + * @param maxPercentUnhealthyApplications the maxPercentUnhealthyApplications value to set + * @return the ClusterConfigurationUpgradeDescription object itself. + */ + public ClusterConfigurationUpgradeDescription withMaxPercentUnhealthyApplications(Integer maxPercentUnhealthyApplications) { + this.maxPercentUnhealthyApplications = maxPercentUnhealthyApplications; + return this; + } + + /** + * Get the maximum allowed percentage of unhealthy nodes during the upgrade. Allowed values are integer values from zero to 100. + * + * @return the maxPercentUnhealthyNodes value + */ + public Integer maxPercentUnhealthyNodes() { + return this.maxPercentUnhealthyNodes; + } + + /** + * Set the maximum allowed percentage of unhealthy nodes during the upgrade. Allowed values are integer values from zero to 100. + * + * @param maxPercentUnhealthyNodes the maxPercentUnhealthyNodes value to set + * @return the ClusterConfigurationUpgradeDescription object itself. + */ + public ClusterConfigurationUpgradeDescription withMaxPercentUnhealthyNodes(Integer maxPercentUnhealthyNodes) { + this.maxPercentUnhealthyNodes = maxPercentUnhealthyNodes; + return this; + } + + /** + * Get the maximum allowed percentage of delta health degradation during the upgrade. Allowed values are integer values from zero to 100. + * + * @return the maxPercentDeltaUnhealthyNodes value + */ + public Integer maxPercentDeltaUnhealthyNodes() { + return this.maxPercentDeltaUnhealthyNodes; + } + + /** + * Set the maximum allowed percentage of delta health degradation during the upgrade. Allowed values are integer values from zero to 100. + * + * @param maxPercentDeltaUnhealthyNodes the maxPercentDeltaUnhealthyNodes value to set + * @return the ClusterConfigurationUpgradeDescription object itself. + */ + public ClusterConfigurationUpgradeDescription withMaxPercentDeltaUnhealthyNodes(Integer maxPercentDeltaUnhealthyNodes) { + this.maxPercentDeltaUnhealthyNodes = maxPercentDeltaUnhealthyNodes; + return this; + } + + /** + * Get the maximum allowed percentage of upgrade domain delta health degradation during the upgrade. Allowed values are integer values from zero to 100. + * + * @return the maxPercentUpgradeDomainDeltaUnhealthyNodes value + */ + public Integer maxPercentUpgradeDomainDeltaUnhealthyNodes() { + return this.maxPercentUpgradeDomainDeltaUnhealthyNodes; + } + + /** + * Set the maximum allowed percentage of upgrade domain delta health degradation during the upgrade. Allowed values are integer values from zero to 100. + * + * @param maxPercentUpgradeDomainDeltaUnhealthyNodes the maxPercentUpgradeDomainDeltaUnhealthyNodes value to set + * @return the ClusterConfigurationUpgradeDescription object itself. + */ + public ClusterConfigurationUpgradeDescription withMaxPercentUpgradeDomainDeltaUnhealthyNodes(Integer maxPercentUpgradeDomainDeltaUnhealthyNodes) { + this.maxPercentUpgradeDomainDeltaUnhealthyNodes = maxPercentUpgradeDomainDeltaUnhealthyNodes; + return this; + } + + /** + * Get defines the application health policy map used to evaluate the health of an application or one of its children entities. + * + * @return the applicationHealthPolicies value + */ + public ApplicationHealthPolicies applicationHealthPolicies() { + return this.applicationHealthPolicies; + } + + /** + * Set defines the application health policy map used to evaluate the health of an application or one of its children entities. + * + * @param applicationHealthPolicies the applicationHealthPolicies value to set + * @return the ClusterConfigurationUpgradeDescription object itself. + */ + public ClusterConfigurationUpgradeDescription withApplicationHealthPolicies(ApplicationHealthPolicies applicationHealthPolicies) { + this.applicationHealthPolicies = applicationHealthPolicies; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterHealthChunkQueryDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterHealthChunkQueryDescription.java new file mode 100644 index 0000000000000..e3cb703f49495 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterHealthChunkQueryDescription.java @@ -0,0 +1,154 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The cluster health chunk query description, which can specify the health + * policies to evaluate cluster health and very expressive filters to select + * which cluster entities to include in response. + */ +public class ClusterHealthChunkQueryDescription { + /** + * Defines a list of filters that specify which nodes to be included in the + * returned cluster health chunk. + * If no filters are specified, no nodes are returned. All the nodes are + * used to evaluate the cluster's aggregated health state, regardless of + * the input filters. + * The cluster health chunk query may specify multiple node filters. + * For example, it can specify a filter to return all nodes with health + * state Error and another filter to always include a node identified by + * its NodeName. + */ + @JsonProperty(value = "NodeFilters") + private List nodeFilters; + + /** + * Defines a list of filters that specify which applications to be included + * in the returned cluster health chunk. + * If no filters are specified, no applications are returned. All the + * applications are used to evaluate the cluster's aggregated health state, + * regardless of the input filters. + * The cluster health chunk query may specify multiple application filters. + * For example, it can specify a filter to return all applications with + * health state Error and another filter to always include applications of + * a specified application type. + */ + @JsonProperty(value = "ApplicationFilters") + private List applicationFilters; + + /** + * Defines a health policy used to evaluate the health of the cluster or of + * a cluster node. + */ + @JsonProperty(value = "ClusterHealthPolicy") + private ClusterHealthPolicy clusterHealthPolicy; + + /** + * Defines the application health policy map used to evaluate the health of + * an application or one of its children entities. + */ + @JsonProperty(value = "ApplicationHealthPolicies") + private ApplicationHealthPolicies applicationHealthPolicies; + + /** + * Get defines a list of filters that specify which nodes to be included in the returned cluster health chunk. + If no filters are specified, no nodes are returned. All the nodes are used to evaluate the cluster's aggregated health state, regardless of the input filters. + The cluster health chunk query may specify multiple node filters. + For example, it can specify a filter to return all nodes with health state Error and another filter to always include a node identified by its NodeName. + * + * @return the nodeFilters value + */ + public List nodeFilters() { + return this.nodeFilters; + } + + /** + * Set defines a list of filters that specify which nodes to be included in the returned cluster health chunk. + If no filters are specified, no nodes are returned. All the nodes are used to evaluate the cluster's aggregated health state, regardless of the input filters. + The cluster health chunk query may specify multiple node filters. + For example, it can specify a filter to return all nodes with health state Error and another filter to always include a node identified by its NodeName. + * + * @param nodeFilters the nodeFilters value to set + * @return the ClusterHealthChunkQueryDescription object itself. + */ + public ClusterHealthChunkQueryDescription withNodeFilters(List nodeFilters) { + this.nodeFilters = nodeFilters; + return this; + } + + /** + * Get defines a list of filters that specify which applications to be included in the returned cluster health chunk. + If no filters are specified, no applications are returned. All the applications are used to evaluate the cluster's aggregated health state, regardless of the input filters. + The cluster health chunk query may specify multiple application filters. + For example, it can specify a filter to return all applications with health state Error and another filter to always include applications of a specified application type. + * + * @return the applicationFilters value + */ + public List applicationFilters() { + return this.applicationFilters; + } + + /** + * Set defines a list of filters that specify which applications to be included in the returned cluster health chunk. + If no filters are specified, no applications are returned. All the applications are used to evaluate the cluster's aggregated health state, regardless of the input filters. + The cluster health chunk query may specify multiple application filters. + For example, it can specify a filter to return all applications with health state Error and another filter to always include applications of a specified application type. + * + * @param applicationFilters the applicationFilters value to set + * @return the ClusterHealthChunkQueryDescription object itself. + */ + public ClusterHealthChunkQueryDescription withApplicationFilters(List applicationFilters) { + this.applicationFilters = applicationFilters; + return this; + } + + /** + * Get defines a health policy used to evaluate the health of the cluster or of a cluster node. + * + * @return the clusterHealthPolicy value + */ + public ClusterHealthPolicy clusterHealthPolicy() { + return this.clusterHealthPolicy; + } + + /** + * Set defines a health policy used to evaluate the health of the cluster or of a cluster node. + * + * @param clusterHealthPolicy the clusterHealthPolicy value to set + * @return the ClusterHealthChunkQueryDescription object itself. + */ + public ClusterHealthChunkQueryDescription withClusterHealthPolicy(ClusterHealthPolicy clusterHealthPolicy) { + this.clusterHealthPolicy = clusterHealthPolicy; + return this; + } + + /** + * Get defines the application health policy map used to evaluate the health of an application or one of its children entities. + * + * @return the applicationHealthPolicies value + */ + public ApplicationHealthPolicies applicationHealthPolicies() { + return this.applicationHealthPolicies; + } + + /** + * Set defines the application health policy map used to evaluate the health of an application or one of its children entities. + * + * @param applicationHealthPolicies the applicationHealthPolicies value to set + * @return the ClusterHealthChunkQueryDescription object itself. + */ + public ClusterHealthChunkQueryDescription withApplicationHealthPolicies(ApplicationHealthPolicies applicationHealthPolicies) { + this.applicationHealthPolicies = applicationHealthPolicies; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterHealthPolicies.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterHealthPolicies.java new file mode 100644 index 0000000000000..3af88717b5563 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterHealthPolicies.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Health policies to evaluate cluster health. + */ +public class ClusterHealthPolicies { + /** + * Defines a map that contains specific application health policies for + * different applications. + * Each entry specifies as key the application name and as value an + * ApplicationHealthPolicy used to evaluate the application health. + * If an application is not specified in the map, the application health + * evaluation uses the ApplicationHealthPolicy found in its application + * manifest or the default application health policy (if no health policy + * is defined in the manifest). + * The map is empty by default. + */ + @JsonProperty(value = "ApplicationHealthPolicyMap") + private List applicationHealthPolicyMap; + + /** + * Defines a health policy used to evaluate the health of the cluster or of + * a cluster node. + */ + @JsonProperty(value = "ClusterHealthPolicy") + private ClusterHealthPolicy clusterHealthPolicy; + + /** + * Get defines a map that contains specific application health policies for different applications. + Each entry specifies as key the application name and as value an ApplicationHealthPolicy used to evaluate the application health. + If an application is not specified in the map, the application health evaluation uses the ApplicationHealthPolicy found in its application manifest or the default application health policy (if no health policy is defined in the manifest). + The map is empty by default. + * + * @return the applicationHealthPolicyMap value + */ + public List applicationHealthPolicyMap() { + return this.applicationHealthPolicyMap; + } + + /** + * Set defines a map that contains specific application health policies for different applications. + Each entry specifies as key the application name and as value an ApplicationHealthPolicy used to evaluate the application health. + If an application is not specified in the map, the application health evaluation uses the ApplicationHealthPolicy found in its application manifest or the default application health policy (if no health policy is defined in the manifest). + The map is empty by default. + * + * @param applicationHealthPolicyMap the applicationHealthPolicyMap value to set + * @return the ClusterHealthPolicies object itself. + */ + public ClusterHealthPolicies withApplicationHealthPolicyMap(List applicationHealthPolicyMap) { + this.applicationHealthPolicyMap = applicationHealthPolicyMap; + return this; + } + + /** + * Get defines a health policy used to evaluate the health of the cluster or of a cluster node. + * + * @return the clusterHealthPolicy value + */ + public ClusterHealthPolicy clusterHealthPolicy() { + return this.clusterHealthPolicy; + } + + /** + * Set defines a health policy used to evaluate the health of the cluster or of a cluster node. + * + * @param clusterHealthPolicy the clusterHealthPolicy value to set + * @return the ClusterHealthPolicies object itself. + */ + public ClusterHealthPolicies withClusterHealthPolicy(ClusterHealthPolicy clusterHealthPolicy) { + this.clusterHealthPolicy = clusterHealthPolicy; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterHealthPolicy.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterHealthPolicy.java new file mode 100644 index 0000000000000..1949d7746d794 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterHealthPolicy.java @@ -0,0 +1,207 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines a health policy used to evaluate the health of the cluster or of a + * cluster node. + */ +public class ClusterHealthPolicy { + /** + * Indicates whether warnings are treated with the same severity as errors. + */ + @JsonProperty(value = "ConsiderWarningAsError") + private Boolean considerWarningAsError; + + /** + * 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. + */ + @JsonProperty(value = "MaxPercentUnhealthyNodes") + private Integer maxPercentUnhealthyNodes; + + /** + * 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. + */ + @JsonProperty(value = "MaxPercentUnhealthyApplications") + private Integer maxPercentUnhealthyApplications; + + /** + * 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. + */ + @JsonProperty(value = "ApplicationTypeHealthPolicyMap") + private List applicationTypeHealthPolicyMap; + + /** + * Get indicates whether warnings are treated with the same severity as errors. + * + * @return the considerWarningAsError value + */ + public Boolean considerWarningAsError() { + return this.considerWarningAsError; + } + + /** + * Set indicates whether warnings are treated with the same severity as errors. + * + * @param considerWarningAsError the considerWarningAsError value to set + * @return the ClusterHealthPolicy object itself. + */ + public ClusterHealthPolicy withConsiderWarningAsError(Boolean considerWarningAsError) { + this.considerWarningAsError = considerWarningAsError; + return this; + } + + /** + * Get 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. + * + * @return the maxPercentUnhealthyNodes value + */ + public Integer maxPercentUnhealthyNodes() { + return this.maxPercentUnhealthyNodes; + } + + /** + * Set 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 maxPercentUnhealthyNodes the maxPercentUnhealthyNodes value to set + * @return the ClusterHealthPolicy object itself. + */ + public ClusterHealthPolicy withMaxPercentUnhealthyNodes(Integer maxPercentUnhealthyNodes) { + this.maxPercentUnhealthyNodes = maxPercentUnhealthyNodes; + return this; + } + + /** + * Get 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. + * + * @return the maxPercentUnhealthyApplications value + */ + public Integer maxPercentUnhealthyApplications() { + return this.maxPercentUnhealthyApplications; + } + + /** + * Set 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 maxPercentUnhealthyApplications the maxPercentUnhealthyApplications value to set + * @return the ClusterHealthPolicy object itself. + */ + public ClusterHealthPolicy withMaxPercentUnhealthyApplications(Integer maxPercentUnhealthyApplications) { + this.maxPercentUnhealthyApplications = maxPercentUnhealthyApplications; + return this; + } + + /** + * Get 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. + * + * @return the applicationTypeHealthPolicyMap value + */ + public List applicationTypeHealthPolicyMap() { + return this.applicationTypeHealthPolicyMap; + } + + /** + * Set 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 applicationTypeHealthPolicyMap the applicationTypeHealthPolicyMap value to set + * @return the ClusterHealthPolicy object itself. + */ + public ClusterHealthPolicy withApplicationTypeHealthPolicyMap(List applicationTypeHealthPolicyMap) { + this.applicationTypeHealthPolicyMap = applicationTypeHealthPolicyMap; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterHealthReportCreatedEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterHealthReportCreatedEvent.java new file mode 100644 index 0000000000000..8a3eee0e036d9 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterHealthReportCreatedEvent.java @@ -0,0 +1,231 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ClusterEventInner; + +/** + * Cluster Health Report Created event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ClusterHealthReportCreated") +public class ClusterHealthReportCreatedEvent extends ClusterEventInner { + /** + * Id of report source. + */ + @JsonProperty(value = "SourceId", required = true) + private String sourceId; + + /** + * Describes the property. + */ + @JsonProperty(value = "Property", required = true) + private String property; + + /** + * Describes the property health state. + */ + @JsonProperty(value = "HealthState", required = true) + private String healthState; + + /** + * Time to live in milli-seconds. + */ + @JsonProperty(value = "TimeToLiveMs", required = true) + private long timeToLiveMs; + + /** + * Sequence number of report. + */ + @JsonProperty(value = "SequenceNumber", required = true) + private long sequenceNumber; + + /** + * Description of report. + */ + @JsonProperty(value = "Description", required = true) + private String description; + + /** + * Indicates the removal when it expires. + */ + @JsonProperty(value = "RemoveWhenExpired", required = true) + private boolean removeWhenExpired; + + /** + * Source time. + */ + @JsonProperty(value = "SourceUtcTimestamp", required = true) + private DateTime sourceUtcTimestamp; + + /** + * Get id of report source. + * + * @return the sourceId value + */ + public String sourceId() { + return this.sourceId; + } + + /** + * Set id of report source. + * + * @param sourceId the sourceId value to set + * @return the ClusterHealthReportCreatedEvent object itself. + */ + public ClusterHealthReportCreatedEvent withSourceId(String sourceId) { + this.sourceId = sourceId; + return this; + } + + /** + * Get describes the property. + * + * @return the property value + */ + public String property() { + return this.property; + } + + /** + * Set describes the property. + * + * @param property the property value to set + * @return the ClusterHealthReportCreatedEvent object itself. + */ + public ClusterHealthReportCreatedEvent withProperty(String property) { + this.property = property; + return this; + } + + /** + * Get describes the property health state. + * + * @return the healthState value + */ + public String healthState() { + return this.healthState; + } + + /** + * Set describes the property health state. + * + * @param healthState the healthState value to set + * @return the ClusterHealthReportCreatedEvent object itself. + */ + public ClusterHealthReportCreatedEvent withHealthState(String healthState) { + this.healthState = healthState; + return this; + } + + /** + * Get time to live in milli-seconds. + * + * @return the timeToLiveMs value + */ + public long timeToLiveMs() { + return this.timeToLiveMs; + } + + /** + * Set time to live in milli-seconds. + * + * @param timeToLiveMs the timeToLiveMs value to set + * @return the ClusterHealthReportCreatedEvent object itself. + */ + public ClusterHealthReportCreatedEvent withTimeToLiveMs(long timeToLiveMs) { + this.timeToLiveMs = timeToLiveMs; + return this; + } + + /** + * Get sequence number of report. + * + * @return the sequenceNumber value + */ + public long sequenceNumber() { + return this.sequenceNumber; + } + + /** + * Set sequence number of report. + * + * @param sequenceNumber the sequenceNumber value to set + * @return the ClusterHealthReportCreatedEvent object itself. + */ + public ClusterHealthReportCreatedEvent withSequenceNumber(long sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get description of report. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of report. + * + * @param description the description value to set + * @return the ClusterHealthReportCreatedEvent object itself. + */ + public ClusterHealthReportCreatedEvent withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get indicates the removal when it expires. + * + * @return the removeWhenExpired value + */ + public boolean removeWhenExpired() { + return this.removeWhenExpired; + } + + /** + * Set indicates the removal when it expires. + * + * @param removeWhenExpired the removeWhenExpired value to set + * @return the ClusterHealthReportCreatedEvent object itself. + */ + public ClusterHealthReportCreatedEvent withRemoveWhenExpired(boolean removeWhenExpired) { + this.removeWhenExpired = removeWhenExpired; + return this; + } + + /** + * Get source time. + * + * @return the sourceUtcTimestamp value + */ + public DateTime sourceUtcTimestamp() { + return this.sourceUtcTimestamp; + } + + /** + * Set source time. + * + * @param sourceUtcTimestamp the sourceUtcTimestamp value to set + * @return the ClusterHealthReportCreatedEvent object itself. + */ + public ClusterHealthReportCreatedEvent withSourceUtcTimestamp(DateTime sourceUtcTimestamp) { + this.sourceUtcTimestamp = sourceUtcTimestamp; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterHealthReportExpiredEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterHealthReportExpiredEvent.java new file mode 100644 index 0000000000000..75271c8b8e7bf --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterHealthReportExpiredEvent.java @@ -0,0 +1,231 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ClusterEventInner; + +/** + * Cluster Health Report Expired event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ClusterHealthReportExpired") +public class ClusterHealthReportExpiredEvent extends ClusterEventInner { + /** + * Id of report source. + */ + @JsonProperty(value = "SourceId", required = true) + private String sourceId; + + /** + * Describes the property. + */ + @JsonProperty(value = "Property", required = true) + private String property; + + /** + * Describes the property health state. + */ + @JsonProperty(value = "HealthState", required = true) + private String healthState; + + /** + * Time to live in milli-seconds. + */ + @JsonProperty(value = "TimeToLiveMs", required = true) + private long timeToLiveMs; + + /** + * Sequence number of report. + */ + @JsonProperty(value = "SequenceNumber", required = true) + private long sequenceNumber; + + /** + * Description of report. + */ + @JsonProperty(value = "Description", required = true) + private String description; + + /** + * Indicates the removal when it expires. + */ + @JsonProperty(value = "RemoveWhenExpired", required = true) + private boolean removeWhenExpired; + + /** + * Source time. + */ + @JsonProperty(value = "SourceUtcTimestamp", required = true) + private DateTime sourceUtcTimestamp; + + /** + * Get id of report source. + * + * @return the sourceId value + */ + public String sourceId() { + return this.sourceId; + } + + /** + * Set id of report source. + * + * @param sourceId the sourceId value to set + * @return the ClusterHealthReportExpiredEvent object itself. + */ + public ClusterHealthReportExpiredEvent withSourceId(String sourceId) { + this.sourceId = sourceId; + return this; + } + + /** + * Get describes the property. + * + * @return the property value + */ + public String property() { + return this.property; + } + + /** + * Set describes the property. + * + * @param property the property value to set + * @return the ClusterHealthReportExpiredEvent object itself. + */ + public ClusterHealthReportExpiredEvent withProperty(String property) { + this.property = property; + return this; + } + + /** + * Get describes the property health state. + * + * @return the healthState value + */ + public String healthState() { + return this.healthState; + } + + /** + * Set describes the property health state. + * + * @param healthState the healthState value to set + * @return the ClusterHealthReportExpiredEvent object itself. + */ + public ClusterHealthReportExpiredEvent withHealthState(String healthState) { + this.healthState = healthState; + return this; + } + + /** + * Get time to live in milli-seconds. + * + * @return the timeToLiveMs value + */ + public long timeToLiveMs() { + return this.timeToLiveMs; + } + + /** + * Set time to live in milli-seconds. + * + * @param timeToLiveMs the timeToLiveMs value to set + * @return the ClusterHealthReportExpiredEvent object itself. + */ + public ClusterHealthReportExpiredEvent withTimeToLiveMs(long timeToLiveMs) { + this.timeToLiveMs = timeToLiveMs; + return this; + } + + /** + * Get sequence number of report. + * + * @return the sequenceNumber value + */ + public long sequenceNumber() { + return this.sequenceNumber; + } + + /** + * Set sequence number of report. + * + * @param sequenceNumber the sequenceNumber value to set + * @return the ClusterHealthReportExpiredEvent object itself. + */ + public ClusterHealthReportExpiredEvent withSequenceNumber(long sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get description of report. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of report. + * + * @param description the description value to set + * @return the ClusterHealthReportExpiredEvent object itself. + */ + public ClusterHealthReportExpiredEvent withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get indicates the removal when it expires. + * + * @return the removeWhenExpired value + */ + public boolean removeWhenExpired() { + return this.removeWhenExpired; + } + + /** + * Set indicates the removal when it expires. + * + * @param removeWhenExpired the removeWhenExpired value to set + * @return the ClusterHealthReportExpiredEvent object itself. + */ + public ClusterHealthReportExpiredEvent withRemoveWhenExpired(boolean removeWhenExpired) { + this.removeWhenExpired = removeWhenExpired; + return this; + } + + /** + * Get source time. + * + * @return the sourceUtcTimestamp value + */ + public DateTime sourceUtcTimestamp() { + return this.sourceUtcTimestamp; + } + + /** + * Set source time. + * + * @param sourceUtcTimestamp the sourceUtcTimestamp value to set + * @return the ClusterHealthReportExpiredEvent object itself. + */ + public ClusterHealthReportExpiredEvent withSourceUtcTimestamp(DateTime sourceUtcTimestamp) { + this.sourceUtcTimestamp = sourceUtcTimestamp; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeCompleteEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeCompleteEvent.java new file mode 100644 index 0000000000000..3094ef2ebf07a --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeCompleteEvent.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ClusterEventInner; + +/** + * Cluster Upgrade Complete event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ClusterUpgradeComplete") +public class ClusterUpgradeCompleteEvent extends ClusterEventInner { + /** + * Target Cluster version. + */ + @JsonProperty(value = "TargetClusterVersion", required = true) + private String targetClusterVersion; + + /** + * Overall duration of upgrade in milli-seconds. + */ + @JsonProperty(value = "OverallUpgradeElapsedTimeInMs", required = true) + private double overallUpgradeElapsedTimeInMs; + + /** + * Get target Cluster version. + * + * @return the targetClusterVersion value + */ + public String targetClusterVersion() { + return this.targetClusterVersion; + } + + /** + * Set target Cluster version. + * + * @param targetClusterVersion the targetClusterVersion value to set + * @return the ClusterUpgradeCompleteEvent object itself. + */ + public ClusterUpgradeCompleteEvent withTargetClusterVersion(String targetClusterVersion) { + this.targetClusterVersion = targetClusterVersion; + return this; + } + + /** + * Get overall duration of upgrade in milli-seconds. + * + * @return the overallUpgradeElapsedTimeInMs value + */ + public double overallUpgradeElapsedTimeInMs() { + return this.overallUpgradeElapsedTimeInMs; + } + + /** + * Set overall duration of upgrade in milli-seconds. + * + * @param overallUpgradeElapsedTimeInMs the overallUpgradeElapsedTimeInMs value to set + * @return the ClusterUpgradeCompleteEvent object itself. + */ + public ClusterUpgradeCompleteEvent withOverallUpgradeElapsedTimeInMs(double overallUpgradeElapsedTimeInMs) { + this.overallUpgradeElapsedTimeInMs = overallUpgradeElapsedTimeInMs; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeDescriptionObject.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeDescriptionObject.java new file mode 100644 index 0000000000000..c05fd400d6a63 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeDescriptionObject.java @@ -0,0 +1,331 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents a ServiceFabric cluster upgrade. + */ +public class ClusterUpgradeDescriptionObject { + /** + * The cluster configuration version (specified in the cluster manifest). + */ + @JsonProperty(value = "ConfigVersion") + private String configVersion; + + /** + * The ServiceFabric code version of the cluster. + */ + @JsonProperty(value = "CodeVersion") + private String codeVersion; + + /** + * The kind of upgrade out of the following possible values. Possible + * values include: 'Invalid', 'Rolling'. + */ + @JsonProperty(value = "UpgradeKind") + private UpgradeKind upgradeKind; + + /** + * The mode used to monitor health during a rolling upgrade. The values are + * UnmonitoredAuto, UnmonitoredManual, and Monitored. Possible values + * include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored'. + */ + @JsonProperty(value = "RollingUpgradeMode") + private UpgradeMode rollingUpgradeMode; + + /** + * 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). + */ + @JsonProperty(value = "UpgradeReplicaSetCheckTimeoutInSeconds") + private Long upgradeReplicaSetCheckTimeoutInSeconds; + + /** + * If true, then processes are forcefully restarted during upgrade even + * when the code version has not changed (the upgrade only changes + * configuration or data). + */ + @JsonProperty(value = "ForceRestart") + private Boolean forceRestart; + + /** + * When true, enables delta health evaluation rather than absolute health + * evaluation after completion of each upgrade domain. + */ + @JsonProperty(value = "EnableDeltaHealthEvaluation") + private Boolean enableDeltaHealthEvaluation; + + /** + * Describes the parameters for monitoring an upgrade in Monitored mode. + */ + @JsonProperty(value = "MonitoringPolicy") + private MonitoringPolicyDescription monitoringPolicy; + + /** + * Defines a health policy used to evaluate the health of the cluster or of + * a cluster node. + */ + @JsonProperty(value = "ClusterHealthPolicy") + private ClusterHealthPolicy clusterHealthPolicy; + + /** + * Defines a health policy used to evaluate the health of the cluster + * during a cluster upgrade. + */ + @JsonProperty(value = "ClusterUpgradeHealthPolicy") + private ClusterUpgradeHealthPolicyObject clusterUpgradeHealthPolicy; + + /** + * Defines a map that contains specific application health policies for + * different applications. + * Each entry specifies as key the application name and as value an + * ApplicationHealthPolicy used to evaluate the application health. + * If an application is not specified in the map, the application health + * evaluation uses the ApplicationHealthPolicy found in its application + * manifest or the default application health policy (if no health policy + * is defined in the manifest). + * The map is empty by default. + */ + @JsonProperty(value = "ApplicationHealthPolicyMap") + private List applicationHealthPolicyMap; + + /** + * Get the cluster configuration version (specified in the cluster manifest). + * + * @return the configVersion value + */ + public String configVersion() { + return this.configVersion; + } + + /** + * Set the cluster configuration version (specified in the cluster manifest). + * + * @param configVersion the configVersion value to set + * @return the ClusterUpgradeDescriptionObject object itself. + */ + public ClusterUpgradeDescriptionObject withConfigVersion(String configVersion) { + this.configVersion = configVersion; + return this; + } + + /** + * Get the ServiceFabric code version of the cluster. + * + * @return the codeVersion value + */ + public String codeVersion() { + return this.codeVersion; + } + + /** + * Set the ServiceFabric code version of the cluster. + * + * @param codeVersion the codeVersion value to set + * @return the ClusterUpgradeDescriptionObject object itself. + */ + public ClusterUpgradeDescriptionObject withCodeVersion(String codeVersion) { + this.codeVersion = codeVersion; + return this; + } + + /** + * Get the kind of upgrade out of the following possible values. Possible values include: 'Invalid', 'Rolling'. + * + * @return the upgradeKind value + */ + public UpgradeKind upgradeKind() { + return this.upgradeKind; + } + + /** + * Set the kind of upgrade out of the following possible values. Possible values include: 'Invalid', 'Rolling'. + * + * @param upgradeKind the upgradeKind value to set + * @return the ClusterUpgradeDescriptionObject object itself. + */ + public ClusterUpgradeDescriptionObject withUpgradeKind(UpgradeKind upgradeKind) { + this.upgradeKind = upgradeKind; + return this; + } + + /** + * Get the mode used to monitor health during a rolling upgrade. The values are UnmonitoredAuto, UnmonitoredManual, and Monitored. Possible values include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored'. + * + * @return the rollingUpgradeMode value + */ + public UpgradeMode rollingUpgradeMode() { + return this.rollingUpgradeMode; + } + + /** + * Set 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 rollingUpgradeMode the rollingUpgradeMode value to set + * @return the ClusterUpgradeDescriptionObject object itself. + */ + public ClusterUpgradeDescriptionObject withRollingUpgradeMode(UpgradeMode rollingUpgradeMode) { + this.rollingUpgradeMode = rollingUpgradeMode; + return this; + } + + /** + * Get 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). + * + * @return the upgradeReplicaSetCheckTimeoutInSeconds value + */ + public Long upgradeReplicaSetCheckTimeoutInSeconds() { + return this.upgradeReplicaSetCheckTimeoutInSeconds; + } + + /** + * Set 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 upgradeReplicaSetCheckTimeoutInSeconds the upgradeReplicaSetCheckTimeoutInSeconds value to set + * @return the ClusterUpgradeDescriptionObject object itself. + */ + public ClusterUpgradeDescriptionObject withUpgradeReplicaSetCheckTimeoutInSeconds(Long upgradeReplicaSetCheckTimeoutInSeconds) { + this.upgradeReplicaSetCheckTimeoutInSeconds = upgradeReplicaSetCheckTimeoutInSeconds; + return this; + } + + /** + * Get if true, then processes are forcefully restarted during upgrade even when the code version has not changed (the upgrade only changes configuration or data). + * + * @return the forceRestart value + */ + public Boolean forceRestart() { + return this.forceRestart; + } + + /** + * Set 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 forceRestart the forceRestart value to set + * @return the ClusterUpgradeDescriptionObject object itself. + */ + public ClusterUpgradeDescriptionObject withForceRestart(Boolean forceRestart) { + this.forceRestart = forceRestart; + return this; + } + + /** + * Get when true, enables delta health evaluation rather than absolute health evaluation after completion of each upgrade domain. + * + * @return the enableDeltaHealthEvaluation value + */ + public Boolean enableDeltaHealthEvaluation() { + return this.enableDeltaHealthEvaluation; + } + + /** + * Set when true, enables delta health evaluation rather than absolute health evaluation after completion of each upgrade domain. + * + * @param enableDeltaHealthEvaluation the enableDeltaHealthEvaluation value to set + * @return the ClusterUpgradeDescriptionObject object itself. + */ + public ClusterUpgradeDescriptionObject withEnableDeltaHealthEvaluation(Boolean enableDeltaHealthEvaluation) { + this.enableDeltaHealthEvaluation = enableDeltaHealthEvaluation; + return this; + } + + /** + * Get describes the parameters for monitoring an upgrade in Monitored mode. + * + * @return the monitoringPolicy value + */ + public MonitoringPolicyDescription monitoringPolicy() { + return this.monitoringPolicy; + } + + /** + * Set describes the parameters for monitoring an upgrade in Monitored mode. + * + * @param monitoringPolicy the monitoringPolicy value to set + * @return the ClusterUpgradeDescriptionObject object itself. + */ + public ClusterUpgradeDescriptionObject withMonitoringPolicy(MonitoringPolicyDescription monitoringPolicy) { + this.monitoringPolicy = monitoringPolicy; + return this; + } + + /** + * Get defines a health policy used to evaluate the health of the cluster or of a cluster node. + * + * @return the clusterHealthPolicy value + */ + public ClusterHealthPolicy clusterHealthPolicy() { + return this.clusterHealthPolicy; + } + + /** + * Set defines a health policy used to evaluate the health of the cluster or of a cluster node. + * + * @param clusterHealthPolicy the clusterHealthPolicy value to set + * @return the ClusterUpgradeDescriptionObject object itself. + */ + public ClusterUpgradeDescriptionObject withClusterHealthPolicy(ClusterHealthPolicy clusterHealthPolicy) { + this.clusterHealthPolicy = clusterHealthPolicy; + return this; + } + + /** + * Get defines a health policy used to evaluate the health of the cluster during a cluster upgrade. + * + * @return the clusterUpgradeHealthPolicy value + */ + public ClusterUpgradeHealthPolicyObject clusterUpgradeHealthPolicy() { + return this.clusterUpgradeHealthPolicy; + } + + /** + * Set defines a health policy used to evaluate the health of the cluster during a cluster upgrade. + * + * @param clusterUpgradeHealthPolicy the clusterUpgradeHealthPolicy value to set + * @return the ClusterUpgradeDescriptionObject object itself. + */ + public ClusterUpgradeDescriptionObject withClusterUpgradeHealthPolicy(ClusterUpgradeHealthPolicyObject clusterUpgradeHealthPolicy) { + this.clusterUpgradeHealthPolicy = clusterUpgradeHealthPolicy; + return this; + } + + /** + * Get defines a map that contains specific application health policies for different applications. + Each entry specifies as key the application name and as value an ApplicationHealthPolicy used to evaluate the application health. + If an application is not specified in the map, the application health evaluation uses the ApplicationHealthPolicy found in its application manifest or the default application health policy (if no health policy is defined in the manifest). + The map is empty by default. + * + * @return the applicationHealthPolicyMap value + */ + public List applicationHealthPolicyMap() { + return this.applicationHealthPolicyMap; + } + + /** + * Set defines a map that contains specific application health policies for different applications. + Each entry specifies as key the application name and as value an ApplicationHealthPolicy used to evaluate the application health. + If an application is not specified in the map, the application health evaluation uses the ApplicationHealthPolicy found in its application manifest or the default application health policy (if no health policy is defined in the manifest). + The map is empty by default. + * + * @param applicationHealthPolicyMap the applicationHealthPolicyMap value to set + * @return the ClusterUpgradeDescriptionObject object itself. + */ + public ClusterUpgradeDescriptionObject withApplicationHealthPolicyMap(List applicationHealthPolicyMap) { + this.applicationHealthPolicyMap = applicationHealthPolicyMap; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeDomainCompleteEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeDomainCompleteEvent.java new file mode 100644 index 0000000000000..0dd1c7f0c7bc8 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeDomainCompleteEvent.java @@ -0,0 +1,126 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ClusterEventInner; + +/** + * Cluster Upgrade Domain Complete event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ClusterUpgradeDomainComplete") +public class ClusterUpgradeDomainCompleteEvent extends ClusterEventInner { + /** + * Target Cluster version. + */ + @JsonProperty(value = "TargetClusterVersion", required = true) + private String targetClusterVersion; + + /** + * State of upgrade. + */ + @JsonProperty(value = "UpgradeState", required = true) + private String upgradeState; + + /** + * Upgrade domains. + */ + @JsonProperty(value = "UpgradeDomains", required = true) + private String upgradeDomains; + + /** + * Duration of domain upgrade in milli-seconds. + */ + @JsonProperty(value = "UpgradeDomainElapsedTimeInMs", required = true) + private double upgradeDomainElapsedTimeInMs; + + /** + * Get target Cluster version. + * + * @return the targetClusterVersion value + */ + public String targetClusterVersion() { + return this.targetClusterVersion; + } + + /** + * Set target Cluster version. + * + * @param targetClusterVersion the targetClusterVersion value to set + * @return the ClusterUpgradeDomainCompleteEvent object itself. + */ + public ClusterUpgradeDomainCompleteEvent withTargetClusterVersion(String targetClusterVersion) { + this.targetClusterVersion = targetClusterVersion; + return this; + } + + /** + * Get state of upgrade. + * + * @return the upgradeState value + */ + public String upgradeState() { + return this.upgradeState; + } + + /** + * Set state of upgrade. + * + * @param upgradeState the upgradeState value to set + * @return the ClusterUpgradeDomainCompleteEvent object itself. + */ + public ClusterUpgradeDomainCompleteEvent withUpgradeState(String upgradeState) { + this.upgradeState = upgradeState; + return this; + } + + /** + * Get upgrade domains. + * + * @return the upgradeDomains value + */ + public String upgradeDomains() { + return this.upgradeDomains; + } + + /** + * Set upgrade domains. + * + * @param upgradeDomains the upgradeDomains value to set + * @return the ClusterUpgradeDomainCompleteEvent object itself. + */ + public ClusterUpgradeDomainCompleteEvent withUpgradeDomains(String upgradeDomains) { + this.upgradeDomains = upgradeDomains; + return this; + } + + /** + * Get duration of domain upgrade in milli-seconds. + * + * @return the upgradeDomainElapsedTimeInMs value + */ + public double upgradeDomainElapsedTimeInMs() { + return this.upgradeDomainElapsedTimeInMs; + } + + /** + * Set duration of domain upgrade in milli-seconds. + * + * @param upgradeDomainElapsedTimeInMs the upgradeDomainElapsedTimeInMs value to set + * @return the ClusterUpgradeDomainCompleteEvent object itself. + */ + public ClusterUpgradeDomainCompleteEvent withUpgradeDomainElapsedTimeInMs(double upgradeDomainElapsedTimeInMs) { + this.upgradeDomainElapsedTimeInMs = upgradeDomainElapsedTimeInMs; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeHealthPolicyObject.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeHealthPolicyObject.java new file mode 100644 index 0000000000000..b3e3e3ef96fac --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeHealthPolicyObject.java @@ -0,0 +1,82 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines a health policy used to evaluate the health of the cluster during a + * cluster upgrade. + */ +public class ClusterUpgradeHealthPolicyObject { + /** + * 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%. + */ + @JsonProperty(value = "MaxPercentDeltaUnhealthyNodes") + private Integer maxPercentDeltaUnhealthyNodes; + + /** + * 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%. + */ + @JsonProperty(value = "MaxPercentUpgradeDomainDeltaUnhealthyNodes") + private Integer maxPercentUpgradeDomainDeltaUnhealthyNodes; + + /** + * Get 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%. + * + * @return the maxPercentDeltaUnhealthyNodes value + */ + public Integer maxPercentDeltaUnhealthyNodes() { + return this.maxPercentDeltaUnhealthyNodes; + } + + /** + * Set 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 maxPercentDeltaUnhealthyNodes the maxPercentDeltaUnhealthyNodes value to set + * @return the ClusterUpgradeHealthPolicyObject object itself. + */ + public ClusterUpgradeHealthPolicyObject withMaxPercentDeltaUnhealthyNodes(Integer maxPercentDeltaUnhealthyNodes) { + this.maxPercentDeltaUnhealthyNodes = maxPercentDeltaUnhealthyNodes; + return this; + } + + /** + * Get 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%. + * + * @return the maxPercentUpgradeDomainDeltaUnhealthyNodes value + */ + public Integer maxPercentUpgradeDomainDeltaUnhealthyNodes() { + return this.maxPercentUpgradeDomainDeltaUnhealthyNodes; + } + + /** + * Set 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 maxPercentUpgradeDomainDeltaUnhealthyNodes the maxPercentUpgradeDomainDeltaUnhealthyNodes value to set + * @return the ClusterUpgradeHealthPolicyObject object itself. + */ + public ClusterUpgradeHealthPolicyObject withMaxPercentUpgradeDomainDeltaUnhealthyNodes(Integer maxPercentUpgradeDomainDeltaUnhealthyNodes) { + this.maxPercentUpgradeDomainDeltaUnhealthyNodes = maxPercentUpgradeDomainDeltaUnhealthyNodes; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeRollbackCompleteEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeRollbackCompleteEvent.java new file mode 100644 index 0000000000000..ac97071e9ac42 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeRollbackCompleteEvent.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ClusterEventInner; + +/** + * Cluster Upgrade Rollback Complete event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ClusterUpgradeRollbackComplete") +public class ClusterUpgradeRollbackCompleteEvent extends ClusterEventInner { + /** + * Target Cluster version. + */ + @JsonProperty(value = "TargetClusterVersion", required = true) + private String targetClusterVersion; + + /** + * Describes failure. + */ + @JsonProperty(value = "FailureReason", required = true) + private String failureReason; + + /** + * Overall duration of upgrade in milli-seconds. + */ + @JsonProperty(value = "OverallUpgradeElapsedTimeInMs", required = true) + private double overallUpgradeElapsedTimeInMs; + + /** + * Get target Cluster version. + * + * @return the targetClusterVersion value + */ + public String targetClusterVersion() { + return this.targetClusterVersion; + } + + /** + * Set target Cluster version. + * + * @param targetClusterVersion the targetClusterVersion value to set + * @return the ClusterUpgradeRollbackCompleteEvent object itself. + */ + public ClusterUpgradeRollbackCompleteEvent withTargetClusterVersion(String targetClusterVersion) { + this.targetClusterVersion = targetClusterVersion; + return this; + } + + /** + * Get describes failure. + * + * @return the failureReason value + */ + public String failureReason() { + return this.failureReason; + } + + /** + * Set describes failure. + * + * @param failureReason the failureReason value to set + * @return the ClusterUpgradeRollbackCompleteEvent object itself. + */ + public ClusterUpgradeRollbackCompleteEvent withFailureReason(String failureReason) { + this.failureReason = failureReason; + return this; + } + + /** + * Get overall duration of upgrade in milli-seconds. + * + * @return the overallUpgradeElapsedTimeInMs value + */ + public double overallUpgradeElapsedTimeInMs() { + return this.overallUpgradeElapsedTimeInMs; + } + + /** + * Set overall duration of upgrade in milli-seconds. + * + * @param overallUpgradeElapsedTimeInMs the overallUpgradeElapsedTimeInMs value to set + * @return the ClusterUpgradeRollbackCompleteEvent object itself. + */ + public ClusterUpgradeRollbackCompleteEvent withOverallUpgradeElapsedTimeInMs(double overallUpgradeElapsedTimeInMs) { + this.overallUpgradeElapsedTimeInMs = overallUpgradeElapsedTimeInMs; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeRollbackStartEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeRollbackStartEvent.java new file mode 100644 index 0000000000000..a414689a16cb0 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeRollbackStartEvent.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ClusterEventInner; + +/** + * Cluster Upgrade Rollback Start event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ClusterUpgradeRollbackStart") +public class ClusterUpgradeRollbackStartEvent extends ClusterEventInner { + /** + * Target Cluster version. + */ + @JsonProperty(value = "TargetClusterVersion", required = true) + private String targetClusterVersion; + + /** + * Describes failure. + */ + @JsonProperty(value = "FailureReason", required = true) + private String failureReason; + + /** + * Overall duration of upgrade in milli-seconds. + */ + @JsonProperty(value = "OverallUpgradeElapsedTimeInMs", required = true) + private double overallUpgradeElapsedTimeInMs; + + /** + * Get target Cluster version. + * + * @return the targetClusterVersion value + */ + public String targetClusterVersion() { + return this.targetClusterVersion; + } + + /** + * Set target Cluster version. + * + * @param targetClusterVersion the targetClusterVersion value to set + * @return the ClusterUpgradeRollbackStartEvent object itself. + */ + public ClusterUpgradeRollbackStartEvent withTargetClusterVersion(String targetClusterVersion) { + this.targetClusterVersion = targetClusterVersion; + return this; + } + + /** + * Get describes failure. + * + * @return the failureReason value + */ + public String failureReason() { + return this.failureReason; + } + + /** + * Set describes failure. + * + * @param failureReason the failureReason value to set + * @return the ClusterUpgradeRollbackStartEvent object itself. + */ + public ClusterUpgradeRollbackStartEvent withFailureReason(String failureReason) { + this.failureReason = failureReason; + return this; + } + + /** + * Get overall duration of upgrade in milli-seconds. + * + * @return the overallUpgradeElapsedTimeInMs value + */ + public double overallUpgradeElapsedTimeInMs() { + return this.overallUpgradeElapsedTimeInMs; + } + + /** + * Set overall duration of upgrade in milli-seconds. + * + * @param overallUpgradeElapsedTimeInMs the overallUpgradeElapsedTimeInMs value to set + * @return the ClusterUpgradeRollbackStartEvent object itself. + */ + public ClusterUpgradeRollbackStartEvent withOverallUpgradeElapsedTimeInMs(double overallUpgradeElapsedTimeInMs) { + this.overallUpgradeElapsedTimeInMs = overallUpgradeElapsedTimeInMs; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeStartEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeStartEvent.java new file mode 100644 index 0000000000000..8ca410df65abf --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeStartEvent.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ClusterEventInner; + +/** + * Cluster Upgrade Start event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ClusterUpgradeStart") +public class ClusterUpgradeStartEvent extends ClusterEventInner { + /** + * Current Cluster version. + */ + @JsonProperty(value = "CurrentClusterVersion", required = true) + private String currentClusterVersion; + + /** + * Target Cluster version. + */ + @JsonProperty(value = "TargetClusterVersion", required = true) + private String targetClusterVersion; + + /** + * Type of upgrade. + */ + @JsonProperty(value = "UpgradeType", required = true) + private String upgradeType; + + /** + * Mode of upgrade. + */ + @JsonProperty(value = "RollingUpgradeMode", required = true) + private String rollingUpgradeMode; + + /** + * Action if failed. + */ + @JsonProperty(value = "FailureAction", required = true) + private String failureAction; + + /** + * Get current Cluster version. + * + * @return the currentClusterVersion value + */ + public String currentClusterVersion() { + return this.currentClusterVersion; + } + + /** + * Set current Cluster version. + * + * @param currentClusterVersion the currentClusterVersion value to set + * @return the ClusterUpgradeStartEvent object itself. + */ + public ClusterUpgradeStartEvent withCurrentClusterVersion(String currentClusterVersion) { + this.currentClusterVersion = currentClusterVersion; + return this; + } + + /** + * Get target Cluster version. + * + * @return the targetClusterVersion value + */ + public String targetClusterVersion() { + return this.targetClusterVersion; + } + + /** + * Set target Cluster version. + * + * @param targetClusterVersion the targetClusterVersion value to set + * @return the ClusterUpgradeStartEvent object itself. + */ + public ClusterUpgradeStartEvent withTargetClusterVersion(String targetClusterVersion) { + this.targetClusterVersion = targetClusterVersion; + return this; + } + + /** + * Get type of upgrade. + * + * @return the upgradeType value + */ + public String upgradeType() { + return this.upgradeType; + } + + /** + * Set type of upgrade. + * + * @param upgradeType the upgradeType value to set + * @return the ClusterUpgradeStartEvent object itself. + */ + public ClusterUpgradeStartEvent withUpgradeType(String upgradeType) { + this.upgradeType = upgradeType; + return this; + } + + /** + * Get mode of upgrade. + * + * @return the rollingUpgradeMode value + */ + public String rollingUpgradeMode() { + return this.rollingUpgradeMode; + } + + /** + * Set mode of upgrade. + * + * @param rollingUpgradeMode the rollingUpgradeMode value to set + * @return the ClusterUpgradeStartEvent object itself. + */ + public ClusterUpgradeStartEvent withRollingUpgradeMode(String rollingUpgradeMode) { + this.rollingUpgradeMode = rollingUpgradeMode; + return this; + } + + /** + * Get action if failed. + * + * @return the failureAction value + */ + public String failureAction() { + return this.failureAction; + } + + /** + * Set action if failed. + * + * @param failureAction the failureAction value to set + * @return the ClusterUpgradeStartEvent object itself. + */ + public ClusterUpgradeStartEvent withFailureAction(String failureAction) { + this.failureAction = failureAction; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/CodePackageEntryPoint.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/CodePackageEntryPoint.java new file mode 100644 index 0000000000000..413d7105fa0f5 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/CodePackageEntryPoint.java @@ -0,0 +1,207 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about setup or main entry point of a code package deployed on a + * Service Fabric node. + */ +public class CodePackageEntryPoint { + /** + * The location of entry point executable on the node. + */ + @JsonProperty(value = "EntryPointLocation") + private String entryPointLocation; + + /** + * The process ID of the entry point. + */ + @JsonProperty(value = "ProcessId") + private String processId; + + /** + * The user name under which entry point executable is run on the node. + */ + @JsonProperty(value = "RunAsUserName") + private String runAsUserName; + + /** + * Statistics about setup or main entry point of a code package deployed + * on a Service Fabric node. + */ + @JsonProperty(value = "CodePackageEntryPointStatistics") + private CodePackageEntryPointStatistics codePackageEntryPointStatistics; + + /** + * Specifies the status of the code package entry point deployed on a + * Service Fabric node. Possible values include: 'Invalid', 'Pending', + * 'Starting', 'Started', 'Stopping', 'Stopped'. + */ + @JsonProperty(value = "Status") + private EntryPointStatus status; + + /** + * The time (in UTC) when the entry point executable will be run next. + */ + @JsonProperty(value = "NextActivationTime") + private DateTime nextActivationTime; + + /** + * The instance ID for current running entry point. For a code package + * setup entry point (if specified) runs first and after it finishes main + * entry point is started. Each time entry point executable is run, its + * instance id will change. + */ + @JsonProperty(value = "InstanceId") + private String instanceId; + + /** + * Get the location of entry point executable on the node. + * + * @return the entryPointLocation value + */ + public String entryPointLocation() { + return this.entryPointLocation; + } + + /** + * Set the location of entry point executable on the node. + * + * @param entryPointLocation the entryPointLocation value to set + * @return the CodePackageEntryPoint object itself. + */ + public CodePackageEntryPoint withEntryPointLocation(String entryPointLocation) { + this.entryPointLocation = entryPointLocation; + return this; + } + + /** + * Get the process ID of the entry point. + * + * @return the processId value + */ + public String processId() { + return this.processId; + } + + /** + * Set the process ID of the entry point. + * + * @param processId the processId value to set + * @return the CodePackageEntryPoint object itself. + */ + public CodePackageEntryPoint withProcessId(String processId) { + this.processId = processId; + return this; + } + + /** + * Get the user name under which entry point executable is run on the node. + * + * @return the runAsUserName value + */ + public String runAsUserName() { + return this.runAsUserName; + } + + /** + * Set the user name under which entry point executable is run on the node. + * + * @param runAsUserName the runAsUserName value to set + * @return the CodePackageEntryPoint object itself. + */ + public CodePackageEntryPoint withRunAsUserName(String runAsUserName) { + this.runAsUserName = runAsUserName; + return this; + } + + /** + * Get statistics about setup or main entry point of a code package deployed on a Service Fabric node. + * + * @return the codePackageEntryPointStatistics value + */ + public CodePackageEntryPointStatistics codePackageEntryPointStatistics() { + return this.codePackageEntryPointStatistics; + } + + /** + * Set statistics about setup or main entry point of a code package deployed on a Service Fabric node. + * + * @param codePackageEntryPointStatistics the codePackageEntryPointStatistics value to set + * @return the CodePackageEntryPoint object itself. + */ + public CodePackageEntryPoint withCodePackageEntryPointStatistics(CodePackageEntryPointStatistics codePackageEntryPointStatistics) { + this.codePackageEntryPointStatistics = codePackageEntryPointStatistics; + return this; + } + + /** + * Get specifies the status of the code package entry point deployed on a Service Fabric node. Possible values include: 'Invalid', 'Pending', 'Starting', 'Started', 'Stopping', 'Stopped'. + * + * @return the status value + */ + public EntryPointStatus status() { + return this.status; + } + + /** + * Set specifies the status of the code package entry point deployed on a Service Fabric node. Possible values include: 'Invalid', 'Pending', 'Starting', 'Started', 'Stopping', 'Stopped'. + * + * @param status the status value to set + * @return the CodePackageEntryPoint object itself. + */ + public CodePackageEntryPoint withStatus(EntryPointStatus status) { + this.status = status; + return this; + } + + /** + * Get the time (in UTC) when the entry point executable will be run next. + * + * @return the nextActivationTime value + */ + public DateTime nextActivationTime() { + return this.nextActivationTime; + } + + /** + * Set the time (in UTC) when the entry point executable will be run next. + * + * @param nextActivationTime the nextActivationTime value to set + * @return the CodePackageEntryPoint object itself. + */ + public CodePackageEntryPoint withNextActivationTime(DateTime nextActivationTime) { + this.nextActivationTime = nextActivationTime; + return this; + } + + /** + * Get the instance ID for current running entry point. For a code package setup entry point (if specified) runs first and after it finishes main entry point is started. Each time entry point executable is run, its instance id will change. + * + * @return the instanceId value + */ + public String instanceId() { + return this.instanceId; + } + + /** + * Set the instance ID for current running entry point. For a code package setup entry point (if specified) runs first and after it finishes main entry point is started. Each time entry point executable is run, its instance id will change. + * + * @param instanceId the instanceId value to set + * @return the CodePackageEntryPoint object itself. + */ + public CodePackageEntryPoint withInstanceId(String instanceId) { + this.instanceId = instanceId; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/CodePackageEntryPointStatistics.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/CodePackageEntryPointStatistics.java new file mode 100644 index 0000000000000..9e6d4ab5b3b17 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/CodePackageEntryPointStatistics.java @@ -0,0 +1,306 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Statistics about setup or main entry point of a code package deployed on a + * Service Fabric node. + */ +public class CodePackageEntryPointStatistics { + /** + * The last exit code of the entry point. + */ + @JsonProperty(value = "LastExitCode") + private String lastExitCode; + + /** + * The last time (in UTC) when Service Fabric attempted to run the entry + * point. + */ + @JsonProperty(value = "LastActivationTime") + private DateTime lastActivationTime; + + /** + * The last time (in UTC) when the entry point finished running. + */ + @JsonProperty(value = "LastExitTime") + private DateTime lastExitTime; + + /** + * The last time (in UTC) when the entry point ran successfully. + */ + @JsonProperty(value = "LastSuccessfulActivationTime") + private DateTime lastSuccessfulActivationTime; + + /** + * The last time (in UTC) when the entry point finished running gracefully. + */ + @JsonProperty(value = "LastSuccessfulExitTime") + private DateTime lastSuccessfulExitTime; + + /** + * Number of times the entry point has run. + */ + @JsonProperty(value = "ActivationCount") + private String activationCount; + + /** + * Number of times the entry point failed to run. + */ + @JsonProperty(value = "ActivationFailureCount") + private String activationFailureCount; + + /** + * Number of times the entry point continuously failed to run. + */ + @JsonProperty(value = "ContinuousActivationFailureCount") + private String continuousActivationFailureCount; + + /** + * Number of times the entry point finished running. + */ + @JsonProperty(value = "ExitCount") + private String exitCount; + + /** + * Number of times the entry point failed to exit gracefully. + */ + @JsonProperty(value = "ExitFailureCount") + private String exitFailureCount; + + /** + * Number of times the entry point continuously failed to exit gracefully. + */ + @JsonProperty(value = "ContinuousExitFailureCount") + private String continuousExitFailureCount; + + /** + * Get the last exit code of the entry point. + * + * @return the lastExitCode value + */ + public String lastExitCode() { + return this.lastExitCode; + } + + /** + * Set the last exit code of the entry point. + * + * @param lastExitCode the lastExitCode value to set + * @return the CodePackageEntryPointStatistics object itself. + */ + public CodePackageEntryPointStatistics withLastExitCode(String lastExitCode) { + this.lastExitCode = lastExitCode; + return this; + } + + /** + * Get the last time (in UTC) when Service Fabric attempted to run the entry point. + * + * @return the lastActivationTime value + */ + public DateTime lastActivationTime() { + return this.lastActivationTime; + } + + /** + * Set the last time (in UTC) when Service Fabric attempted to run the entry point. + * + * @param lastActivationTime the lastActivationTime value to set + * @return the CodePackageEntryPointStatistics object itself. + */ + public CodePackageEntryPointStatistics withLastActivationTime(DateTime lastActivationTime) { + this.lastActivationTime = lastActivationTime; + return this; + } + + /** + * Get the last time (in UTC) when the entry point finished running. + * + * @return the lastExitTime value + */ + public DateTime lastExitTime() { + return this.lastExitTime; + } + + /** + * Set the last time (in UTC) when the entry point finished running. + * + * @param lastExitTime the lastExitTime value to set + * @return the CodePackageEntryPointStatistics object itself. + */ + public CodePackageEntryPointStatistics withLastExitTime(DateTime lastExitTime) { + this.lastExitTime = lastExitTime; + return this; + } + + /** + * Get the last time (in UTC) when the entry point ran successfully. + * + * @return the lastSuccessfulActivationTime value + */ + public DateTime lastSuccessfulActivationTime() { + return this.lastSuccessfulActivationTime; + } + + /** + * Set the last time (in UTC) when the entry point ran successfully. + * + * @param lastSuccessfulActivationTime the lastSuccessfulActivationTime value to set + * @return the CodePackageEntryPointStatistics object itself. + */ + public CodePackageEntryPointStatistics withLastSuccessfulActivationTime(DateTime lastSuccessfulActivationTime) { + this.lastSuccessfulActivationTime = lastSuccessfulActivationTime; + return this; + } + + /** + * Get the last time (in UTC) when the entry point finished running gracefully. + * + * @return the lastSuccessfulExitTime value + */ + public DateTime lastSuccessfulExitTime() { + return this.lastSuccessfulExitTime; + } + + /** + * Set the last time (in UTC) when the entry point finished running gracefully. + * + * @param lastSuccessfulExitTime the lastSuccessfulExitTime value to set + * @return the CodePackageEntryPointStatistics object itself. + */ + public CodePackageEntryPointStatistics withLastSuccessfulExitTime(DateTime lastSuccessfulExitTime) { + this.lastSuccessfulExitTime = lastSuccessfulExitTime; + return this; + } + + /** + * Get number of times the entry point has run. + * + * @return the activationCount value + */ + public String activationCount() { + return this.activationCount; + } + + /** + * Set number of times the entry point has run. + * + * @param activationCount the activationCount value to set + * @return the CodePackageEntryPointStatistics object itself. + */ + public CodePackageEntryPointStatistics withActivationCount(String activationCount) { + this.activationCount = activationCount; + return this; + } + + /** + * Get number of times the entry point failed to run. + * + * @return the activationFailureCount value + */ + public String activationFailureCount() { + return this.activationFailureCount; + } + + /** + * Set number of times the entry point failed to run. + * + * @param activationFailureCount the activationFailureCount value to set + * @return the CodePackageEntryPointStatistics object itself. + */ + public CodePackageEntryPointStatistics withActivationFailureCount(String activationFailureCount) { + this.activationFailureCount = activationFailureCount; + return this; + } + + /** + * Get number of times the entry point continuously failed to run. + * + * @return the continuousActivationFailureCount value + */ + public String continuousActivationFailureCount() { + return this.continuousActivationFailureCount; + } + + /** + * Set number of times the entry point continuously failed to run. + * + * @param continuousActivationFailureCount the continuousActivationFailureCount value to set + * @return the CodePackageEntryPointStatistics object itself. + */ + public CodePackageEntryPointStatistics withContinuousActivationFailureCount(String continuousActivationFailureCount) { + this.continuousActivationFailureCount = continuousActivationFailureCount; + return this; + } + + /** + * Get number of times the entry point finished running. + * + * @return the exitCount value + */ + public String exitCount() { + return this.exitCount; + } + + /** + * Set number of times the entry point finished running. + * + * @param exitCount the exitCount value to set + * @return the CodePackageEntryPointStatistics object itself. + */ + public CodePackageEntryPointStatistics withExitCount(String exitCount) { + this.exitCount = exitCount; + return this; + } + + /** + * Get number of times the entry point failed to exit gracefully. + * + * @return the exitFailureCount value + */ + public String exitFailureCount() { + return this.exitFailureCount; + } + + /** + * Set number of times the entry point failed to exit gracefully. + * + * @param exitFailureCount the exitFailureCount value to set + * @return the CodePackageEntryPointStatistics object itself. + */ + public CodePackageEntryPointStatistics withExitFailureCount(String exitFailureCount) { + this.exitFailureCount = exitFailureCount; + return this; + } + + /** + * Get number of times the entry point continuously failed to exit gracefully. + * + * @return the continuousExitFailureCount value + */ + public String continuousExitFailureCount() { + return this.continuousExitFailureCount; + } + + /** + * Set number of times the entry point continuously failed to exit gracefully. + * + * @param continuousExitFailureCount the continuousExitFailureCount value to set + * @return the CodePackageEntryPointStatistics object itself. + */ + public CodePackageEntryPointStatistics withContinuousExitFailureCount(String continuousExitFailureCount) { + this.continuousExitFailureCount = continuousExitFailureCount; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ComposeDeploymentStatus.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ComposeDeploymentStatus.java new file mode 100644 index 0000000000000..6ce452573903c --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ComposeDeploymentStatus.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ComposeDeploymentStatus. + */ +public final class ComposeDeploymentStatus extends ExpandableStringEnum { + /** Static value Invalid for ComposeDeploymentStatus. */ + public static final ComposeDeploymentStatus INVALID = fromString("Invalid"); + + /** Static value Provisioning for ComposeDeploymentStatus. */ + public static final ComposeDeploymentStatus PROVISIONING = fromString("Provisioning"); + + /** Static value Creating for ComposeDeploymentStatus. */ + public static final ComposeDeploymentStatus CREATING = fromString("Creating"); + + /** Static value Ready for ComposeDeploymentStatus. */ + public static final ComposeDeploymentStatus READY = fromString("Ready"); + + /** Static value Unprovisioning for ComposeDeploymentStatus. */ + public static final ComposeDeploymentStatus UNPROVISIONING = fromString("Unprovisioning"); + + /** Static value Deleting for ComposeDeploymentStatus. */ + public static final ComposeDeploymentStatus DELETING = fromString("Deleting"); + + /** Static value Failed for ComposeDeploymentStatus. */ + public static final ComposeDeploymentStatus FAILED = fromString("Failed"); + + /** Static value Upgrading for ComposeDeploymentStatus. */ + public static final ComposeDeploymentStatus UPGRADING = fromString("Upgrading"); + + /** + * Creates or finds a ComposeDeploymentStatus from its string representation. + * @param name a name to look for + * @return the corresponding ComposeDeploymentStatus + */ + @JsonCreator + public static ComposeDeploymentStatus fromString(String name) { + return fromString(name, ComposeDeploymentStatus.class); + } + + /** + * @return known ComposeDeploymentStatus values + */ + public static Collection values() { + return values(ComposeDeploymentStatus.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ComposeDeploymentUpgradeDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ComposeDeploymentUpgradeDescription.java new file mode 100644 index 0000000000000..640cbcf6e63de --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ComposeDeploymentUpgradeDescription.java @@ -0,0 +1,262 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the parameters for a compose deployment upgrade. + */ +public class ComposeDeploymentUpgradeDescription { + /** + * The name of the deployment. + */ + @JsonProperty(value = "DeploymentName", required = true) + private String deploymentName; + + /** + * The content of the compose file that describes the deployment to create. + */ + @JsonProperty(value = "ComposeFileContent", required = true) + private String composeFileContent; + + /** + * Credential information to connect to container registry. + */ + @JsonProperty(value = "RegistryCredential") + private RegistryCredential registryCredential; + + /** + * The kind of upgrade out of the following possible values. Possible + * values include: 'Invalid', 'Rolling'. + */ + @JsonProperty(value = "UpgradeKind", required = true) + private UpgradeKind upgradeKind; + + /** + * The mode used to monitor health during a rolling upgrade. The values are + * UnmonitoredAuto, UnmonitoredManual, and Monitored. Possible values + * include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored'. + */ + @JsonProperty(value = "RollingUpgradeMode") + private UpgradeMode rollingUpgradeMode; + + /** + * 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). + */ + @JsonProperty(value = "UpgradeReplicaSetCheckTimeoutInSeconds") + private Long upgradeReplicaSetCheckTimeoutInSeconds; + + /** + * If true, then processes are forcefully restarted during upgrade even + * when the code version has not changed (the upgrade only changes + * configuration or data). + */ + @JsonProperty(value = "ForceRestart") + private Boolean forceRestart; + + /** + * Describes the parameters for monitoring an upgrade in Monitored mode. + */ + @JsonProperty(value = "MonitoringPolicy") + private MonitoringPolicyDescription monitoringPolicy; + + /** + * Defines a health policy used to evaluate the health of an application or + * one of its children entities. + */ + @JsonProperty(value = "ApplicationHealthPolicy") + private ApplicationHealthPolicy applicationHealthPolicy; + + /** + * Get the name of the deployment. + * + * @return the deploymentName value + */ + public String deploymentName() { + return this.deploymentName; + } + + /** + * Set the name of the deployment. + * + * @param deploymentName the deploymentName value to set + * @return the ComposeDeploymentUpgradeDescription object itself. + */ + public ComposeDeploymentUpgradeDescription withDeploymentName(String deploymentName) { + this.deploymentName = deploymentName; + return this; + } + + /** + * Get the content of the compose file that describes the deployment to create. + * + * @return the composeFileContent value + */ + public String composeFileContent() { + return this.composeFileContent; + } + + /** + * Set the content of the compose file that describes the deployment to create. + * + * @param composeFileContent the composeFileContent value to set + * @return the ComposeDeploymentUpgradeDescription object itself. + */ + public ComposeDeploymentUpgradeDescription withComposeFileContent(String composeFileContent) { + this.composeFileContent = composeFileContent; + return this; + } + + /** + * Get credential information to connect to container registry. + * + * @return the registryCredential value + */ + public RegistryCredential registryCredential() { + return this.registryCredential; + } + + /** + * Set credential information to connect to container registry. + * + * @param registryCredential the registryCredential value to set + * @return the ComposeDeploymentUpgradeDescription object itself. + */ + public ComposeDeploymentUpgradeDescription withRegistryCredential(RegistryCredential registryCredential) { + this.registryCredential = registryCredential; + return this; + } + + /** + * Get the kind of upgrade out of the following possible values. Possible values include: 'Invalid', 'Rolling'. + * + * @return the upgradeKind value + */ + public UpgradeKind upgradeKind() { + return this.upgradeKind; + } + + /** + * Set the kind of upgrade out of the following possible values. Possible values include: 'Invalid', 'Rolling'. + * + * @param upgradeKind the upgradeKind value to set + * @return the ComposeDeploymentUpgradeDescription object itself. + */ + public ComposeDeploymentUpgradeDescription withUpgradeKind(UpgradeKind upgradeKind) { + this.upgradeKind = upgradeKind; + return this; + } + + /** + * Get the mode used to monitor health during a rolling upgrade. The values are UnmonitoredAuto, UnmonitoredManual, and Monitored. Possible values include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored'. + * + * @return the rollingUpgradeMode value + */ + public UpgradeMode rollingUpgradeMode() { + return this.rollingUpgradeMode; + } + + /** + * Set 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 rollingUpgradeMode the rollingUpgradeMode value to set + * @return the ComposeDeploymentUpgradeDescription object itself. + */ + public ComposeDeploymentUpgradeDescription withRollingUpgradeMode(UpgradeMode rollingUpgradeMode) { + this.rollingUpgradeMode = rollingUpgradeMode; + return this; + } + + /** + * Get 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). + * + * @return the upgradeReplicaSetCheckTimeoutInSeconds value + */ + public Long upgradeReplicaSetCheckTimeoutInSeconds() { + return this.upgradeReplicaSetCheckTimeoutInSeconds; + } + + /** + * Set 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 upgradeReplicaSetCheckTimeoutInSeconds the upgradeReplicaSetCheckTimeoutInSeconds value to set + * @return the ComposeDeploymentUpgradeDescription object itself. + */ + public ComposeDeploymentUpgradeDescription withUpgradeReplicaSetCheckTimeoutInSeconds(Long upgradeReplicaSetCheckTimeoutInSeconds) { + this.upgradeReplicaSetCheckTimeoutInSeconds = upgradeReplicaSetCheckTimeoutInSeconds; + return this; + } + + /** + * Get if true, then processes are forcefully restarted during upgrade even when the code version has not changed (the upgrade only changes configuration or data). + * + * @return the forceRestart value + */ + public Boolean forceRestart() { + return this.forceRestart; + } + + /** + * Set 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 forceRestart the forceRestart value to set + * @return the ComposeDeploymentUpgradeDescription object itself. + */ + public ComposeDeploymentUpgradeDescription withForceRestart(Boolean forceRestart) { + this.forceRestart = forceRestart; + return this; + } + + /** + * Get describes the parameters for monitoring an upgrade in Monitored mode. + * + * @return the monitoringPolicy value + */ + public MonitoringPolicyDescription monitoringPolicy() { + return this.monitoringPolicy; + } + + /** + * Set describes the parameters for monitoring an upgrade in Monitored mode. + * + * @param monitoringPolicy the monitoringPolicy value to set + * @return the ComposeDeploymentUpgradeDescription object itself. + */ + public ComposeDeploymentUpgradeDescription withMonitoringPolicy(MonitoringPolicyDescription monitoringPolicy) { + this.monitoringPolicy = monitoringPolicy; + return this; + } + + /** + * Get defines a health policy used to evaluate the health of an application or one of its children entities. + * + * @return the applicationHealthPolicy value + */ + public ApplicationHealthPolicy applicationHealthPolicy() { + return this.applicationHealthPolicy; + } + + /** + * Set defines a health policy used to evaluate the health of an application or one of its children entities. + * + * @param applicationHealthPolicy the applicationHealthPolicy value to set + * @return the ComposeDeploymentUpgradeDescription object itself. + */ + public ComposeDeploymentUpgradeDescription withApplicationHealthPolicy(ApplicationHealthPolicy applicationHealthPolicy) { + this.applicationHealthPolicy = applicationHealthPolicy; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ComposeDeploymentUpgradeState.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ComposeDeploymentUpgradeState.java new file mode 100644 index 0000000000000..56b37978fb16d --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ComposeDeploymentUpgradeState.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ComposeDeploymentUpgradeState. + */ +public final class ComposeDeploymentUpgradeState extends ExpandableStringEnum { + /** Static value Invalid for ComposeDeploymentUpgradeState. */ + public static final ComposeDeploymentUpgradeState INVALID = fromString("Invalid"); + + /** Static value ProvisioningTarget for ComposeDeploymentUpgradeState. */ + public static final ComposeDeploymentUpgradeState PROVISIONING_TARGET = fromString("ProvisioningTarget"); + + /** Static value RollingForwardInProgress for ComposeDeploymentUpgradeState. */ + public static final ComposeDeploymentUpgradeState ROLLING_FORWARD_IN_PROGRESS = fromString("RollingForwardInProgress"); + + /** Static value RollingForwardPending for ComposeDeploymentUpgradeState. */ + public static final ComposeDeploymentUpgradeState ROLLING_FORWARD_PENDING = fromString("RollingForwardPending"); + + /** Static value UnprovisioningCurrent for ComposeDeploymentUpgradeState. */ + public static final ComposeDeploymentUpgradeState UNPROVISIONING_CURRENT = fromString("UnprovisioningCurrent"); + + /** Static value RollingForwardCompleted for ComposeDeploymentUpgradeState. */ + public static final ComposeDeploymentUpgradeState ROLLING_FORWARD_COMPLETED = fromString("RollingForwardCompleted"); + + /** Static value RollingBackInProgress for ComposeDeploymentUpgradeState. */ + public static final ComposeDeploymentUpgradeState ROLLING_BACK_IN_PROGRESS = fromString("RollingBackInProgress"); + + /** Static value UnprovisioningTarget for ComposeDeploymentUpgradeState. */ + public static final ComposeDeploymentUpgradeState UNPROVISIONING_TARGET = fromString("UnprovisioningTarget"); + + /** Static value RollingBackCompleted for ComposeDeploymentUpgradeState. */ + public static final ComposeDeploymentUpgradeState ROLLING_BACK_COMPLETED = fromString("RollingBackCompleted"); + + /** Static value Failed for ComposeDeploymentUpgradeState. */ + public static final ComposeDeploymentUpgradeState FAILED = fromString("Failed"); + + /** + * Creates or finds a ComposeDeploymentUpgradeState from its string representation. + * @param name a name to look for + * @return the corresponding ComposeDeploymentUpgradeState + */ + @JsonCreator + public static ComposeDeploymentUpgradeState fromString(String name) { + return fromString(name, ComposeDeploymentUpgradeState.class); + } + + /** + * @return known ComposeDeploymentUpgradeState values + */ + public static Collection values() { + return values(ComposeDeploymentUpgradeState.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ContainerApiRequestBody.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ContainerApiRequestBody.java new file mode 100644 index 0000000000000..fbfde40f8a14d --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ContainerApiRequestBody.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * parameters for making container API call. + */ +public class ContainerApiRequestBody { + /** + * HTTP verb of container REST API, defaults to "GET". + */ + @JsonProperty(value = "HttpVerb") + private String httpVerb; + + /** + * URI path of container REST API. + */ + @JsonProperty(value = "UriPath", required = true) + private String uriPath; + + /** + * Content type of container REST API request, defaults to + * "application/json". + */ + @JsonProperty(value = "Content-Type") + private String contentType; + + /** + * HTTP request body of container REST API. + */ + @JsonProperty(value = "Body") + private String body; + + /** + * Get hTTP verb of container REST API, defaults to "GET". + * + * @return the httpVerb value + */ + public String httpVerb() { + return this.httpVerb; + } + + /** + * Set hTTP verb of container REST API, defaults to "GET". + * + * @param httpVerb the httpVerb value to set + * @return the ContainerApiRequestBody object itself. + */ + public ContainerApiRequestBody withHttpVerb(String httpVerb) { + this.httpVerb = httpVerb; + return this; + } + + /** + * Get uRI path of container REST API. + * + * @return the uriPath value + */ + public String uriPath() { + return this.uriPath; + } + + /** + * Set uRI path of container REST API. + * + * @param uriPath the uriPath value to set + * @return the ContainerApiRequestBody object itself. + */ + public ContainerApiRequestBody withUriPath(String uriPath) { + this.uriPath = uriPath; + return this; + } + + /** + * Get content type of container REST API request, defaults to "application/json". + * + * @return the contentType value + */ + public String contentType() { + return this.contentType; + } + + /** + * Set content type of container REST API request, defaults to "application/json". + * + * @param contentType the contentType value to set + * @return the ContainerApiRequestBody object itself. + */ + public ContainerApiRequestBody withContentType(String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Get hTTP request body of container REST API. + * + * @return the body value + */ + public String body() { + return this.body; + } + + /** + * Set hTTP request body of container REST API. + * + * @param body the body value to set + * @return the ContainerApiRequestBody object itself. + */ + public ContainerApiRequestBody withBody(String body) { + this.body = body; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ContainerApiResult.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ContainerApiResult.java new file mode 100644 index 0000000000000..b3c03c76b1aba --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ContainerApiResult.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Container API result. + */ +public class ContainerApiResult { + /** + * HTTP status code returned by the target container API. + */ + @JsonProperty(value = "Status", required = true) + private int status; + + /** + * HTTP content type. + */ + @JsonProperty(value = "Content-Type") + private String contentType; + + /** + * HTTP content encoding. + */ + @JsonProperty(value = "Content-Encoding") + private String contentEncoding; + + /** + * container API result body. + */ + @JsonProperty(value = "Body") + private String body; + + /** + * Get hTTP status code returned by the target container API. + * + * @return the status value + */ + public int status() { + return this.status; + } + + /** + * Set hTTP status code returned by the target container API. + * + * @param status the status value to set + * @return the ContainerApiResult object itself. + */ + public ContainerApiResult withStatus(int status) { + this.status = status; + return this; + } + + /** + * Get hTTP content type. + * + * @return the contentType value + */ + public String contentType() { + return this.contentType; + } + + /** + * Set hTTP content type. + * + * @param contentType the contentType value to set + * @return the ContainerApiResult object itself. + */ + public ContainerApiResult withContentType(String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Get hTTP content encoding. + * + * @return the contentEncoding value + */ + public String contentEncoding() { + return this.contentEncoding; + } + + /** + * Set hTTP content encoding. + * + * @param contentEncoding the contentEncoding value to set + * @return the ContainerApiResult object itself. + */ + public ContainerApiResult withContentEncoding(String contentEncoding) { + this.contentEncoding = contentEncoding; + return this; + } + + /** + * Get container API result body. + * + * @return the body value + */ + public String body() { + return this.body; + } + + /** + * Set container API result body. + * + * @param body the body value to set + * @return the ContainerApiResult object itself. + */ + public ContainerApiResult withBody(String body) { + this.body = body; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ContainerCodePackageProperties.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ContainerCodePackageProperties.java new file mode 100644 index 0000000000000..9030324328116 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ContainerCodePackageProperties.java @@ -0,0 +1,349 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a container and its runtime properties. + */ +public class ContainerCodePackageProperties { + /** + * The name of the code package. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The Container image to use. + */ + @JsonProperty(value = "image", required = true) + private String image; + + /** + * Image registry credential. + */ + @JsonProperty(value = "imageRegistryCredential") + private ImageRegistryCredential imageRegistryCredential; + + /** + * Override for the default entry point in the container. + */ + @JsonProperty(value = "entrypoint") + private String entrypoint; + + /** + * Command array to execute within the container in exec form. + */ + @JsonProperty(value = "commands") + private List commands; + + /** + * The environment variables to set in this container. + */ + @JsonProperty(value = "environmentVariables") + private List environmentVariables; + + /** + * 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". + */ + @JsonProperty(value = "settings") + private List settings; + + /** + * The labels to set in this container. + */ + @JsonProperty(value = "labels") + private List labels; + + /** + * The endpoints exposed by this container. + */ + @JsonProperty(value = "endpoints") + private List endpoints; + + /** + * This type describes the resource requirements for a container or a + * service. + */ + @JsonProperty(value = "resources", required = true) + private ResourceRequirements resources; + + /** + * The volumes to be attached to the container. + */ + @JsonProperty(value = "volumeRefs") + private List volumeRefs; + + /** + * Runtime information of a container instance. + */ + @JsonProperty(value = "instanceView", access = JsonProperty.Access.WRITE_ONLY) + private ContainerInstanceView instanceView; + + /** + * Reference to sinks in DiagnosticsDescription. + */ + @JsonProperty(value = "diagnostics") + private DiagnosticsRef diagnostics; + + /** + * Get the name of the code package. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the code package. + * + * @param name the name value to set + * @return the ContainerCodePackageProperties object itself. + */ + public ContainerCodePackageProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the Container image to use. + * + * @return the image value + */ + public String image() { + return this.image; + } + + /** + * Set the Container image to use. + * + * @param image the image value to set + * @return the ContainerCodePackageProperties object itself. + */ + public ContainerCodePackageProperties withImage(String image) { + this.image = image; + return this; + } + + /** + * Get image registry credential. + * + * @return the imageRegistryCredential value + */ + public ImageRegistryCredential imageRegistryCredential() { + return this.imageRegistryCredential; + } + + /** + * Set image registry credential. + * + * @param imageRegistryCredential the imageRegistryCredential value to set + * @return the ContainerCodePackageProperties object itself. + */ + public ContainerCodePackageProperties withImageRegistryCredential(ImageRegistryCredential imageRegistryCredential) { + this.imageRegistryCredential = imageRegistryCredential; + return this; + } + + /** + * Get override for the default entry point in the container. + * + * @return the entrypoint value + */ + public String entrypoint() { + return this.entrypoint; + } + + /** + * Set override for the default entry point in the container. + * + * @param entrypoint the entrypoint value to set + * @return the ContainerCodePackageProperties object itself. + */ + public ContainerCodePackageProperties withEntrypoint(String entrypoint) { + this.entrypoint = entrypoint; + return this; + } + + /** + * Get command array to execute within the container in exec form. + * + * @return the commands value + */ + public List commands() { + return this.commands; + } + + /** + * Set command array to execute within the container in exec form. + * + * @param commands the commands value to set + * @return the ContainerCodePackageProperties object itself. + */ + public ContainerCodePackageProperties withCommands(List commands) { + this.commands = commands; + return this; + } + + /** + * Get the environment variables to set in this container. + * + * @return the environmentVariables value + */ + public List environmentVariables() { + return this.environmentVariables; + } + + /** + * Set the environment variables to set in this container. + * + * @param environmentVariables the environmentVariables value to set + * @return the ContainerCodePackageProperties object itself. + */ + public ContainerCodePackageProperties withEnvironmentVariables(List environmentVariables) { + this.environmentVariables = environmentVariables; + return this; + } + + /** + * Get 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". + * + * @return the settings value + */ + public List settings() { + return this.settings; + } + + /** + * Set 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". + * + * @param settings the settings value to set + * @return the ContainerCodePackageProperties object itself. + */ + public ContainerCodePackageProperties withSettings(List settings) { + this.settings = settings; + return this; + } + + /** + * Get the labels to set in this container. + * + * @return the labels value + */ + public List labels() { + return this.labels; + } + + /** + * Set the labels to set in this container. + * + * @param labels the labels value to set + * @return the ContainerCodePackageProperties object itself. + */ + public ContainerCodePackageProperties withLabels(List labels) { + this.labels = labels; + return this; + } + + /** + * Get the endpoints exposed by this container. + * + * @return the endpoints value + */ + public List endpoints() { + return this.endpoints; + } + + /** + * Set the endpoints exposed by this container. + * + * @param endpoints the endpoints value to set + * @return the ContainerCodePackageProperties object itself. + */ + public ContainerCodePackageProperties withEndpoints(List endpoints) { + this.endpoints = endpoints; + return this; + } + + /** + * Get this type describes the resource requirements for a container or a service. + * + * @return the resources value + */ + public ResourceRequirements resources() { + return this.resources; + } + + /** + * Set this type describes the resource requirements for a container or a service. + * + * @param resources the resources value to set + * @return the ContainerCodePackageProperties object itself. + */ + public ContainerCodePackageProperties withResources(ResourceRequirements resources) { + this.resources = resources; + return this; + } + + /** + * Get the volumes to be attached to the container. + * + * @return the volumeRefs value + */ + public List volumeRefs() { + return this.volumeRefs; + } + + /** + * Set the volumes to be attached to the container. + * + * @param volumeRefs the volumeRefs value to set + * @return the ContainerCodePackageProperties object itself. + */ + public ContainerCodePackageProperties withVolumeRefs(List volumeRefs) { + this.volumeRefs = volumeRefs; + return this; + } + + /** + * Get runtime information of a container instance. + * + * @return the instanceView value + */ + public ContainerInstanceView instanceView() { + return this.instanceView; + } + + /** + * Get reference to sinks in DiagnosticsDescription. + * + * @return the diagnostics value + */ + public DiagnosticsRef diagnostics() { + return this.diagnostics; + } + + /** + * Set reference to sinks in DiagnosticsDescription. + * + * @param diagnostics the diagnostics value to set + * @return the ContainerCodePackageProperties object itself. + */ + public ContainerCodePackageProperties withDiagnostics(DiagnosticsRef diagnostics) { + this.diagnostics = diagnostics; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ContainerDeactivatedEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ContainerDeactivatedEvent.java new file mode 100644 index 0000000000000..020b990e97e38 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ContainerDeactivatedEvent.java @@ -0,0 +1,335 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ApplicationEventInner; + +/** + * Container Deactivated event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ContainerDeactivated") +public class ContainerDeactivatedEvent extends ApplicationEventInner { + /** + * Name of Service. + */ + @JsonProperty(value = "ServiceName", required = true) + private String serviceName; + + /** + * Name of Service package. + */ + @JsonProperty(value = "ServicePackageName", required = true) + private String servicePackageName; + + /** + * Activation Id of Service package. + */ + @JsonProperty(value = "ServicePackageActivationId", required = true) + private String servicePackageActivationId; + + /** + * Indicates IsExclusive flag. + */ + @JsonProperty(value = "IsExclusive", required = true) + private boolean isExclusive; + + /** + * Name of Code package. + */ + @JsonProperty(value = "CodePackageName", required = true) + private String codePackageName; + + /** + * Type of EntryPoint. + */ + @JsonProperty(value = "EntryPointType", required = true) + private String entryPointType; + + /** + * Name of Container image. + */ + @JsonProperty(value = "ImageName", required = true) + private String imageName; + + /** + * Name of Container. + */ + @JsonProperty(value = "ContainerName", required = true) + private String containerName; + + /** + * Host Id. + */ + @JsonProperty(value = "HostId", required = true) + private String hostId; + + /** + * Exit code of process. + */ + @JsonProperty(value = "ExitCode", required = true) + private long exitCode; + + /** + * Indicates if termination is unexpected. + */ + @JsonProperty(value = "UnexpectedTermination", required = true) + private boolean unexpectedTermination; + + /** + * Start time of process. + */ + @JsonProperty(value = "StartTime", required = true) + private DateTime startTime; + + /** + * Get name of Service. + * + * @return the serviceName value + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set name of Service. + * + * @param serviceName the serviceName value to set + * @return the ContainerDeactivatedEvent object itself. + */ + public ContainerDeactivatedEvent withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Get name of Service package. + * + * @return the servicePackageName value + */ + public String servicePackageName() { + return this.servicePackageName; + } + + /** + * Set name of Service package. + * + * @param servicePackageName the servicePackageName value to set + * @return the ContainerDeactivatedEvent object itself. + */ + public ContainerDeactivatedEvent withServicePackageName(String servicePackageName) { + this.servicePackageName = servicePackageName; + return this; + } + + /** + * Get activation Id of Service package. + * + * @return the servicePackageActivationId value + */ + public String servicePackageActivationId() { + return this.servicePackageActivationId; + } + + /** + * Set activation Id of Service package. + * + * @param servicePackageActivationId the servicePackageActivationId value to set + * @return the ContainerDeactivatedEvent object itself. + */ + public ContainerDeactivatedEvent withServicePackageActivationId(String servicePackageActivationId) { + this.servicePackageActivationId = servicePackageActivationId; + return this; + } + + /** + * Get indicates IsExclusive flag. + * + * @return the isExclusive value + */ + public boolean isExclusive() { + return this.isExclusive; + } + + /** + * Set indicates IsExclusive flag. + * + * @param isExclusive the isExclusive value to set + * @return the ContainerDeactivatedEvent object itself. + */ + public ContainerDeactivatedEvent withIsExclusive(boolean isExclusive) { + this.isExclusive = isExclusive; + return this; + } + + /** + * Get name of Code package. + * + * @return the codePackageName value + */ + public String codePackageName() { + return this.codePackageName; + } + + /** + * Set name of Code package. + * + * @param codePackageName the codePackageName value to set + * @return the ContainerDeactivatedEvent object itself. + */ + public ContainerDeactivatedEvent withCodePackageName(String codePackageName) { + this.codePackageName = codePackageName; + return this; + } + + /** + * Get type of EntryPoint. + * + * @return the entryPointType value + */ + public String entryPointType() { + return this.entryPointType; + } + + /** + * Set type of EntryPoint. + * + * @param entryPointType the entryPointType value to set + * @return the ContainerDeactivatedEvent object itself. + */ + public ContainerDeactivatedEvent withEntryPointType(String entryPointType) { + this.entryPointType = entryPointType; + return this; + } + + /** + * Get name of Container image. + * + * @return the imageName value + */ + public String imageName() { + return this.imageName; + } + + /** + * Set name of Container image. + * + * @param imageName the imageName value to set + * @return the ContainerDeactivatedEvent object itself. + */ + public ContainerDeactivatedEvent withImageName(String imageName) { + this.imageName = imageName; + return this; + } + + /** + * Get name of Container. + * + * @return the containerName value + */ + public String containerName() { + return this.containerName; + } + + /** + * Set name of Container. + * + * @param containerName the containerName value to set + * @return the ContainerDeactivatedEvent object itself. + */ + public ContainerDeactivatedEvent withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + + /** + * Get host Id. + * + * @return the hostId value + */ + public String hostId() { + return this.hostId; + } + + /** + * Set host Id. + * + * @param hostId the hostId value to set + * @return the ContainerDeactivatedEvent object itself. + */ + public ContainerDeactivatedEvent withHostId(String hostId) { + this.hostId = hostId; + return this; + } + + /** + * Get exit code of process. + * + * @return the exitCode value + */ + public long exitCode() { + return this.exitCode; + } + + /** + * Set exit code of process. + * + * @param exitCode the exitCode value to set + * @return the ContainerDeactivatedEvent object itself. + */ + public ContainerDeactivatedEvent withExitCode(long exitCode) { + this.exitCode = exitCode; + return this; + } + + /** + * Get indicates if termination is unexpected. + * + * @return the unexpectedTermination value + */ + public boolean unexpectedTermination() { + return this.unexpectedTermination; + } + + /** + * Set indicates if termination is unexpected. + * + * @param unexpectedTermination the unexpectedTermination value to set + * @return the ContainerDeactivatedEvent object itself. + */ + public ContainerDeactivatedEvent withUnexpectedTermination(boolean unexpectedTermination) { + this.unexpectedTermination = unexpectedTermination; + return this; + } + + /** + * Get start time of process. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set start time of process. + * + * @param startTime the startTime value to set + * @return the ContainerDeactivatedEvent object itself. + */ + public ContainerDeactivatedEvent withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ContainerEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ContainerEvent.java new file mode 100644 index 0000000000000..12ee905bc0828 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ContainerEvent.java @@ -0,0 +1,173 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A container event. + */ +public class ContainerEvent { + /** + * The name of the container event. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The count of the event. + */ + @JsonProperty(value = "count") + private Integer count; + + /** + * Date/time of the first event. + */ + @JsonProperty(value = "firstTimestamp") + private String firstTimestamp; + + /** + * Date/time of the last event. + */ + @JsonProperty(value = "lastTimestamp") + private String lastTimestamp; + + /** + * The event message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * The event type. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the name of the container event. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the container event. + * + * @param name the name value to set + * @return the ContainerEvent object itself. + */ + public ContainerEvent withName(String name) { + this.name = name; + return this; + } + + /** + * Get the count of the event. + * + * @return the count value + */ + public Integer count() { + return this.count; + } + + /** + * Set the count of the event. + * + * @param count the count value to set + * @return the ContainerEvent object itself. + */ + public ContainerEvent withCount(Integer count) { + this.count = count; + return this; + } + + /** + * Get date/time of the first event. + * + * @return the firstTimestamp value + */ + public String firstTimestamp() { + return this.firstTimestamp; + } + + /** + * Set date/time of the first event. + * + * @param firstTimestamp the firstTimestamp value to set + * @return the ContainerEvent object itself. + */ + public ContainerEvent withFirstTimestamp(String firstTimestamp) { + this.firstTimestamp = firstTimestamp; + return this; + } + + /** + * Get date/time of the last event. + * + * @return the lastTimestamp value + */ + public String lastTimestamp() { + return this.lastTimestamp; + } + + /** + * Set date/time of the last event. + * + * @param lastTimestamp the lastTimestamp value to set + * @return the ContainerEvent object itself. + */ + public ContainerEvent withLastTimestamp(String lastTimestamp) { + this.lastTimestamp = lastTimestamp; + return this; + } + + /** + * Get the event message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the event message. + * + * @param message the message value to set + * @return the ContainerEvent object itself. + */ + public ContainerEvent withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the event type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the event type. + * + * @param type the type value to set + * @return the ContainerEvent object itself. + */ + public ContainerEvent withType(String type) { + this.type = type; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ContainerInstanceView.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ContainerInstanceView.java new file mode 100644 index 0000000000000..669e97c768d92 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ContainerInstanceView.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Runtime information of a container instance. + */ +public class ContainerInstanceView { + /** + * The number of times the container has been restarted. + */ + @JsonProperty(value = "restartCount") + private Integer restartCount; + + /** + * Current container instance state. + */ + @JsonProperty(value = "currentState") + private ContainerState currentState; + + /** + * Previous container instance state. + */ + @JsonProperty(value = "previousState") + private ContainerState previousState; + + /** + * The events of this container instance. + */ + @JsonProperty(value = "events") + private List events; + + /** + * Get the number of times the container has been restarted. + * + * @return the restartCount value + */ + public Integer restartCount() { + return this.restartCount; + } + + /** + * Set the number of times the container has been restarted. + * + * @param restartCount the restartCount value to set + * @return the ContainerInstanceView object itself. + */ + public ContainerInstanceView withRestartCount(Integer restartCount) { + this.restartCount = restartCount; + return this; + } + + /** + * Get current container instance state. + * + * @return the currentState value + */ + public ContainerState currentState() { + return this.currentState; + } + + /** + * Set current container instance state. + * + * @param currentState the currentState value to set + * @return the ContainerInstanceView object itself. + */ + public ContainerInstanceView withCurrentState(ContainerState currentState) { + this.currentState = currentState; + return this; + } + + /** + * Get previous container instance state. + * + * @return the previousState value + */ + public ContainerState previousState() { + return this.previousState; + } + + /** + * Set previous container instance state. + * + * @param previousState the previousState value to set + * @return the ContainerInstanceView object itself. + */ + public ContainerInstanceView withPreviousState(ContainerState previousState) { + this.previousState = previousState; + return this; + } + + /** + * Get the events of this container instance. + * + * @return the events value + */ + public List events() { + return this.events; + } + + /** + * Set the events of this container instance. + * + * @param events the events value to set + * @return the ContainerInstanceView object itself. + */ + public ContainerInstanceView withEvents(List events) { + this.events = events; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ContainerLabel.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ContainerLabel.java new file mode 100644 index 0000000000000..fee97355f07dc --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ContainerLabel.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a container label. + */ +public class ContainerLabel { + /** + * The name of the container label. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The value of the container label. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /** + * Get the name of the container label. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the container label. + * + * @param name the name value to set + * @return the ContainerLabel object itself. + */ + public ContainerLabel withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value of the container label. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the value of the container label. + * + * @param value the value value to set + * @return the ContainerLabel object itself. + */ + public ContainerLabel withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ContainerState.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ContainerState.java new file mode 100644 index 0000000000000..cb7a286b5af52 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ContainerState.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The container state. + */ +public class ContainerState { + /** + * The state of this container. + */ + @JsonProperty(value = "state") + private String state; + + /** + * Date/time when the container state started. + */ + @JsonProperty(value = "startTime") + private DateTime startTime; + + /** + * The container exit code. + */ + @JsonProperty(value = "exitCode") + private String exitCode; + + /** + * Date/time when the container state finished. + */ + @JsonProperty(value = "finishTime") + private DateTime finishTime; + + /** + * Human-readable status of this state. + */ + @JsonProperty(value = "detailStatus") + private String detailStatus; + + /** + * Get the state of this container. + * + * @return the state value + */ + public String state() { + return this.state; + } + + /** + * Set the state of this container. + * + * @param state the state value to set + * @return the ContainerState object itself. + */ + public ContainerState withState(String state) { + this.state = state; + return this; + } + + /** + * Get date/time when the container state started. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set date/time when the container state started. + * + * @param startTime the startTime value to set + * @return the ContainerState object itself. + */ + public ContainerState withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the container exit code. + * + * @return the exitCode value + */ + public String exitCode() { + return this.exitCode; + } + + /** + * Set the container exit code. + * + * @param exitCode the exitCode value to set + * @return the ContainerState object itself. + */ + public ContainerState withExitCode(String exitCode) { + this.exitCode = exitCode; + return this; + } + + /** + * Get date/time when the container state finished. + * + * @return the finishTime value + */ + public DateTime finishTime() { + return this.finishTime; + } + + /** + * Set date/time when the container state finished. + * + * @param finishTime the finishTime value to set + * @return the ContainerState object itself. + */ + public ContainerState withFinishTime(DateTime finishTime) { + this.finishTime = finishTime; + return this; + } + + /** + * Get human-readable status of this state. + * + * @return the detailStatus value + */ + public String detailStatus() { + return this.detailStatus; + } + + /** + * Set human-readable status of this state. + * + * @param detailStatus the detailStatus value to set + * @return the ContainerState object itself. + */ + public ContainerState withDetailStatus(String detailStatus) { + this.detailStatus = detailStatus; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ContainerVolume.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ContainerVolume.java new file mode 100644 index 0000000000000..61deeb69b55da --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ContainerVolume.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes how a volume is attached to a container. + */ +public class ContainerVolume { + /** + * Name of the volume. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The flag indicating whether the volume is read only. Default is 'false'. + */ + @JsonProperty(value = "readOnly") + private Boolean readOnly; + + /** + * The path within the container at which the volume should be mounted. + * Only valid path characters are allowed. + */ + @JsonProperty(value = "destinationPath", required = true) + private String destinationPath; + + /** + * Get name of the volume. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the volume. + * + * @param name the name value to set + * @return the ContainerVolume object itself. + */ + public ContainerVolume withName(String name) { + this.name = name; + return this; + } + + /** + * Get the flag indicating whether the volume is read only. Default is 'false'. + * + * @return the readOnly value + */ + public Boolean readOnly() { + return this.readOnly; + } + + /** + * Set the flag indicating whether the volume is read only. Default is 'false'. + * + * @param readOnly the readOnly value to set + * @return the ContainerVolume object itself. + */ + public ContainerVolume withReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + return this; + } + + /** + * Get the path within the container at which the volume should be mounted. Only valid path characters are allowed. + * + * @return the destinationPath value + */ + public String destinationPath() { + return this.destinationPath; + } + + /** + * Set the path within the container at which the volume should be mounted. Only valid path characters are allowed. + * + * @param destinationPath the destinationPath value to set + * @return the ContainerVolume object itself. + */ + public ContainerVolume withDestinationPath(String destinationPath) { + this.destinationPath = destinationPath; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/CreateComposeDeploymentDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/CreateComposeDeploymentDescription.java new file mode 100644 index 0000000000000..8bf25a1e9f176 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/CreateComposeDeploymentDescription.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines description for creating a Service Fabric compose deployment. + */ +public class CreateComposeDeploymentDescription { + /** + * The name of the deployment. + */ + @JsonProperty(value = "DeploymentName", required = true) + private String deploymentName; + + /** + * The content of the compose file that describes the deployment to create. + */ + @JsonProperty(value = "ComposeFileContent", required = true) + private String composeFileContent; + + /** + * Credential information to connect to container registry. + */ + @JsonProperty(value = "RegistryCredential") + private RegistryCredential registryCredential; + + /** + * Get the name of the deployment. + * + * @return the deploymentName value + */ + public String deploymentName() { + return this.deploymentName; + } + + /** + * Set the name of the deployment. + * + * @param deploymentName the deploymentName value to set + * @return the CreateComposeDeploymentDescription object itself. + */ + public CreateComposeDeploymentDescription withDeploymentName(String deploymentName) { + this.deploymentName = deploymentName; + return this; + } + + /** + * Get the content of the compose file that describes the deployment to create. + * + * @return the composeFileContent value + */ + public String composeFileContent() { + return this.composeFileContent; + } + + /** + * Set the content of the compose file that describes the deployment to create. + * + * @param composeFileContent the composeFileContent value to set + * @return the CreateComposeDeploymentDescription object itself. + */ + public CreateComposeDeploymentDescription withComposeFileContent(String composeFileContent) { + this.composeFileContent = composeFileContent; + return this; + } + + /** + * Get credential information to connect to container registry. + * + * @return the registryCredential value + */ + public RegistryCredential registryCredential() { + return this.registryCredential; + } + + /** + * Set credential information to connect to container registry. + * + * @param registryCredential the registryCredential value to set + * @return the CreateComposeDeploymentDescription object itself. + */ + public CreateComposeDeploymentDescription withRegistryCredential(RegistryCredential registryCredential) { + this.registryCredential = registryCredential; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/CreateFabricDump.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/CreateFabricDump.java new file mode 100644 index 0000000000000..4a56b660c3788 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/CreateFabricDump.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for CreateFabricDump. + */ +public final class CreateFabricDump extends ExpandableStringEnum { + /** Static value False for CreateFabricDump. */ + public static final CreateFabricDump FALSE = fromString("False"); + + /** Static value True for CreateFabricDump. */ + public static final CreateFabricDump TRUE = fromString("True"); + + /** + * Creates or finds a CreateFabricDump from its string representation. + * @param name a name to look for + * @return the corresponding CreateFabricDump + */ + @JsonCreator + public static CreateFabricDump fromString(String name) { + return fromString(name, CreateFabricDump.class); + } + + /** + * @return known CreateFabricDump values + */ + public static Collection values() { + return values(CreateFabricDump.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/CurrentUpgradeDomainProgressInfo.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/CurrentUpgradeDomainProgressInfo.java new file mode 100644 index 0000000000000..2ad9bcb0e74f4 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/CurrentUpgradeDomainProgressInfo.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about the current in-progress upgrade domain. + */ +public class CurrentUpgradeDomainProgressInfo { + /** + * The name of the upgrade domain. + */ + @JsonProperty(value = "DomainName") + private String domainName; + + /** + * List of upgrading nodes and their statuses. + */ + @JsonProperty(value = "NodeUpgradeProgressList") + private List nodeUpgradeProgressList; + + /** + * Get the name of the upgrade domain. + * + * @return the domainName value + */ + public String domainName() { + return this.domainName; + } + + /** + * Set the name of the upgrade domain. + * + * @param domainName the domainName value to set + * @return the CurrentUpgradeDomainProgressInfo object itself. + */ + public CurrentUpgradeDomainProgressInfo withDomainName(String domainName) { + this.domainName = domainName; + return this; + } + + /** + * Get list of upgrading nodes and their statuses. + * + * @return the nodeUpgradeProgressList value + */ + public List nodeUpgradeProgressList() { + return this.nodeUpgradeProgressList; + } + + /** + * Set list of upgrading nodes and their statuses. + * + * @param nodeUpgradeProgressList the nodeUpgradeProgressList value to set + * @return the CurrentUpgradeDomainProgressInfo object itself. + */ + public CurrentUpgradeDomainProgressInfo withNodeUpgradeProgressList(List nodeUpgradeProgressList) { + this.nodeUpgradeProgressList = nodeUpgradeProgressList; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DataLossMode.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DataLossMode.java new file mode 100644 index 0000000000000..c87bb92aeed43 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DataLossMode.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DataLossMode. + */ +public final class DataLossMode extends ExpandableStringEnum { + /** Static value Invalid for DataLossMode. */ + public static final DataLossMode INVALID = fromString("Invalid"); + + /** Static value PartialDataLoss for DataLossMode. */ + public static final DataLossMode PARTIAL_DATA_LOSS = fromString("PartialDataLoss"); + + /** Static value FullDataLoss for DataLossMode. */ + public static final DataLossMode FULL_DATA_LOSS = fromString("FullDataLoss"); + + /** + * Creates or finds a DataLossMode from its string representation. + * @param name a name to look for + * @return the corresponding DataLossMode + */ + @JsonCreator + public static DataLossMode fromString(String name) { + return fromString(name, DataLossMode.class); + } + + /** + * @return known DataLossMode values + */ + public static Collection values() { + return values(DataLossMode.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DayOfWeek.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DayOfWeek.java new file mode 100644 index 0000000000000..422ce7967e8fe --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DayOfWeek.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DayOfWeek. + */ +public final class DayOfWeek extends ExpandableStringEnum { + /** Static value Sunday for DayOfWeek. */ + public static final DayOfWeek SUNDAY = fromString("Sunday"); + + /** Static value Monday for DayOfWeek. */ + public static final DayOfWeek MONDAY = fromString("Monday"); + + /** Static value Tuesday for DayOfWeek. */ + public static final DayOfWeek TUESDAY = fromString("Tuesday"); + + /** Static value Wednesday for DayOfWeek. */ + public static final DayOfWeek WEDNESDAY = fromString("Wednesday"); + + /** Static value Thursday for DayOfWeek. */ + public static final DayOfWeek THURSDAY = fromString("Thursday"); + + /** Static value Friday for DayOfWeek. */ + public static final DayOfWeek FRIDAY = fromString("Friday"); + + /** Static value Saturday for DayOfWeek. */ + public static final DayOfWeek SATURDAY = fromString("Saturday"); + + /** + * Creates or finds a DayOfWeek from its string representation. + * @param name a name to look for + * @return the corresponding DayOfWeek + */ + @JsonCreator + public static DayOfWeek fromString(String name) { + return fromString(name, DayOfWeek.class); + } + + /** + * @return known DayOfWeek values + */ + public static Collection values() { + return values(DayOfWeek.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeactivationIntent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeactivationIntent.java new file mode 100644 index 0000000000000..3169238806aba --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeactivationIntent.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DeactivationIntent. + */ +public final class DeactivationIntent extends ExpandableStringEnum { + /** Static value Pause for DeactivationIntent. */ + public static final DeactivationIntent PAUSE = fromString("Pause"); + + /** Static value Restart for DeactivationIntent. */ + public static final DeactivationIntent RESTART = fromString("Restart"); + + /** Static value RemoveData for DeactivationIntent. */ + public static final DeactivationIntent REMOVE_DATA = fromString("RemoveData"); + + /** + * Creates or finds a DeactivationIntent from its string representation. + * @param name a name to look for + * @return the corresponding DeactivationIntent + */ + @JsonCreator + public static DeactivationIntent fromString(String name) { + return fromString(name, DeactivationIntent.class); + } + + /** + * @return known DeactivationIntent values + */ + public static Collection values() { + return values(DeactivationIntent.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeactivationIntentDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeactivationIntentDescription.java new file mode 100644 index 0000000000000..2bbebfeef8917 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeactivationIntentDescription.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the intent or reason for deactivating the node. + */ +public class DeactivationIntentDescription { + /** + * Describes the intent or reason for deactivating the node. The possible + * values are following. + * . Possible values include: 'Pause', 'Restart', 'RemoveData'. + */ + @JsonProperty(value = "DeactivationIntent") + private DeactivationIntent deactivationIntent; + + /** + * Get describes the intent or reason for deactivating the node. The possible values are following. + . Possible values include: 'Pause', 'Restart', 'RemoveData'. + * + * @return the deactivationIntent value + */ + public DeactivationIntent deactivationIntent() { + return this.deactivationIntent; + } + + /** + * Set describes the intent or reason for deactivating the node. The possible values are following. + . Possible values include: 'Pause', 'Restart', 'RemoveData'. + * + * @param deactivationIntent the deactivationIntent value to set + * @return the DeactivationIntentDescription object itself. + */ + public DeactivationIntentDescription withDeactivationIntent(DeactivationIntent deactivationIntent) { + this.deactivationIntent = deactivationIntent; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeletePropertyBatchOperation.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeletePropertyBatchOperation.java new file mode 100644 index 0000000000000..25d06c0a290df --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeletePropertyBatchOperation.java @@ -0,0 +1,23 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * 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. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("Delete") +public class DeletePropertyBatchOperation extends PropertyBatchOperation { +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeltaNodesCheckHealthEvaluation.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeltaNodesCheckHealthEvaluation.java new file mode 100644 index 0000000000000..bc8b1ab07ae72 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeltaNodesCheckHealthEvaluation.java @@ -0,0 +1,162 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents health evaluation for delta nodes, containing health evaluations + * for each unhealthy node that impacted current aggregated health state. + * Can be returned during cluster upgrade when the aggregated health state of + * the cluster is Warning or Error. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("DeltaNodesCheck") +public class DeltaNodesCheckHealthEvaluation extends HealthEvaluation { + /** + * Number of nodes with aggregated heath state Error in the health store at + * the beginning of the cluster upgrade. + */ + @JsonProperty(value = "BaselineErrorCount") + private Long baselineErrorCount; + + /** + * Total number of nodes in the health store at the beginning of the + * cluster upgrade. + */ + @JsonProperty(value = "BaselineTotalCount") + private Long baselineTotalCount; + + /** + * Maximum allowed percentage of delta unhealthy nodes from the + * ClusterUpgradeHealthPolicy. + */ + @JsonProperty(value = "MaxPercentDeltaUnhealthyNodes") + private Integer maxPercentDeltaUnhealthyNodes; + + /** + * Total number of nodes in the health store. + */ + @JsonProperty(value = "TotalCount") + private Long totalCount; + + /** + * List of unhealthy evaluations that led to the aggregated health state. + * Includes all the unhealthy NodeHealthEvaluation that impacted the + * aggregated health. + */ + @JsonProperty(value = "UnhealthyEvaluations") + private List unhealthyEvaluations; + + /** + * Get number of nodes with aggregated heath state Error in the health store at the beginning of the cluster upgrade. + * + * @return the baselineErrorCount value + */ + public Long baselineErrorCount() { + return this.baselineErrorCount; + } + + /** + * Set number of nodes with aggregated heath state Error in the health store at the beginning of the cluster upgrade. + * + * @param baselineErrorCount the baselineErrorCount value to set + * @return the DeltaNodesCheckHealthEvaluation object itself. + */ + public DeltaNodesCheckHealthEvaluation withBaselineErrorCount(Long baselineErrorCount) { + this.baselineErrorCount = baselineErrorCount; + return this; + } + + /** + * Get total number of nodes in the health store at the beginning of the cluster upgrade. + * + * @return the baselineTotalCount value + */ + public Long baselineTotalCount() { + return this.baselineTotalCount; + } + + /** + * Set total number of nodes in the health store at the beginning of the cluster upgrade. + * + * @param baselineTotalCount the baselineTotalCount value to set + * @return the DeltaNodesCheckHealthEvaluation object itself. + */ + public DeltaNodesCheckHealthEvaluation withBaselineTotalCount(Long baselineTotalCount) { + this.baselineTotalCount = baselineTotalCount; + return this; + } + + /** + * Get maximum allowed percentage of delta unhealthy nodes from the ClusterUpgradeHealthPolicy. + * + * @return the maxPercentDeltaUnhealthyNodes value + */ + public Integer maxPercentDeltaUnhealthyNodes() { + return this.maxPercentDeltaUnhealthyNodes; + } + + /** + * Set maximum allowed percentage of delta unhealthy nodes from the ClusterUpgradeHealthPolicy. + * + * @param maxPercentDeltaUnhealthyNodes the maxPercentDeltaUnhealthyNodes value to set + * @return the DeltaNodesCheckHealthEvaluation object itself. + */ + public DeltaNodesCheckHealthEvaluation withMaxPercentDeltaUnhealthyNodes(Integer maxPercentDeltaUnhealthyNodes) { + this.maxPercentDeltaUnhealthyNodes = maxPercentDeltaUnhealthyNodes; + return this; + } + + /** + * Get total number of nodes in the health store. + * + * @return the totalCount value + */ + public Long totalCount() { + return this.totalCount; + } + + /** + * Set total number of nodes in the health store. + * + * @param totalCount the totalCount value to set + * @return the DeltaNodesCheckHealthEvaluation object itself. + */ + public DeltaNodesCheckHealthEvaluation withTotalCount(Long totalCount) { + this.totalCount = totalCount; + return this; + } + + /** + * Get list of unhealthy evaluations that led to the aggregated health state. + Includes all the unhealthy NodeHealthEvaluation that impacted the aggregated health. + * + * @return the unhealthyEvaluations value + */ + public List unhealthyEvaluations() { + return this.unhealthyEvaluations; + } + + /** + * Set list of unhealthy evaluations that led to the aggregated health state. + Includes all the unhealthy NodeHealthEvaluation that impacted the aggregated health. + * + * @param unhealthyEvaluations the unhealthyEvaluations value to set + * @return the DeltaNodesCheckHealthEvaluation object itself. + */ + public DeltaNodesCheckHealthEvaluation withUnhealthyEvaluations(List unhealthyEvaluations) { + this.unhealthyEvaluations = unhealthyEvaluations; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployServicePackageToNodeDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployServicePackageToNodeDescription.java new file mode 100644 index 0000000000000..2d7f58ac3054e --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployServicePackageToNodeDescription.java @@ -0,0 +1,150 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines description for downloading packages associated with a service + * manifest to image cache on a Service Fabric node. + */ +public class DeployServicePackageToNodeDescription { + /** + * The name of service manifest whose packages need to be downloaded. + */ + @JsonProperty(value = "ServiceManifestName", required = true) + private String serviceManifestName; + + /** + * The application type name as defined in the application manifest. + */ + @JsonProperty(value = "ApplicationTypeName", required = true) + private String applicationTypeName; + + /** + * The version of the application type as defined in the application + * manifest. + */ + @JsonProperty(value = "ApplicationTypeVersion", required = true) + private String applicationTypeVersion; + + /** + * The name of a Service Fabric node. + */ + @JsonProperty(value = "NodeName", required = true) + private String nodeName; + + /** + * List of package sharing policy information. + */ + @JsonProperty(value = "PackageSharingPolicy") + private List packageSharingPolicy; + + /** + * Get the name of service manifest whose packages need to be downloaded. + * + * @return the serviceManifestName value + */ + public String serviceManifestName() { + return this.serviceManifestName; + } + + /** + * Set the name of service manifest whose packages need to be downloaded. + * + * @param serviceManifestName the serviceManifestName value to set + * @return the DeployServicePackageToNodeDescription object itself. + */ + public DeployServicePackageToNodeDescription withServiceManifestName(String serviceManifestName) { + this.serviceManifestName = serviceManifestName; + return this; + } + + /** + * Get the application type name as defined in the application manifest. + * + * @return the applicationTypeName value + */ + public String applicationTypeName() { + return this.applicationTypeName; + } + + /** + * Set the application type name as defined in the application manifest. + * + * @param applicationTypeName the applicationTypeName value to set + * @return the DeployServicePackageToNodeDescription object itself. + */ + public DeployServicePackageToNodeDescription withApplicationTypeName(String applicationTypeName) { + this.applicationTypeName = applicationTypeName; + return this; + } + + /** + * Get the version of the application type as defined in the application manifest. + * + * @return the applicationTypeVersion value + */ + public String applicationTypeVersion() { + return this.applicationTypeVersion; + } + + /** + * Set the version of the application type as defined in the application manifest. + * + * @param applicationTypeVersion the applicationTypeVersion value to set + * @return the DeployServicePackageToNodeDescription object itself. + */ + public DeployServicePackageToNodeDescription withApplicationTypeVersion(String applicationTypeVersion) { + this.applicationTypeVersion = applicationTypeVersion; + return this; + } + + /** + * Get the name of a Service Fabric node. + * + * @return the nodeName value + */ + public String nodeName() { + return this.nodeName; + } + + /** + * Set the name of a Service Fabric node. + * + * @param nodeName the nodeName value to set + * @return the DeployServicePackageToNodeDescription object itself. + */ + public DeployServicePackageToNodeDescription withNodeName(String nodeName) { + this.nodeName = nodeName; + return this; + } + + /** + * Get list of package sharing policy information. + * + * @return the packageSharingPolicy value + */ + public List packageSharingPolicy() { + return this.packageSharingPolicy; + } + + /** + * Set list of package sharing policy information. + * + * @param packageSharingPolicy the packageSharingPolicy value to set + * @return the DeployServicePackageToNodeDescription object itself. + */ + public DeployServicePackageToNodeDescription withPackageSharingPolicy(List packageSharingPolicy) { + this.packageSharingPolicy = packageSharingPolicy; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedApplicationHealthEvaluation.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedApplicationHealthEvaluation.java new file mode 100644 index 0000000000000..e0ba320e10008 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedApplicationHealthEvaluation.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents health evaluation for a deployed application, containing + * information about the data and the algorithm used by the health store to + * evaluate health. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("DeployedApplication") +public class DeployedApplicationHealthEvaluation extends HealthEvaluation { + /** + * Name of the node where the application is deployed to. + */ + @JsonProperty(value = "NodeName") + private String nodeName; + + /** + * The name of the application, including the 'fabric:' URI scheme. + */ + @JsonProperty(value = "ApplicationName") + private String applicationName; + + /** + * List of unhealthy evaluations that led to the current aggregated health + * state of the deployed application. + * The types of the unhealthy evaluations can be + * DeployedServicePackagesHealthEvaluation or EventHealthEvaluation. + */ + @JsonProperty(value = "UnhealthyEvaluations") + private List unhealthyEvaluations; + + /** + * Get name of the node where the application is deployed to. + * + * @return the nodeName value + */ + public String nodeName() { + return this.nodeName; + } + + /** + * Set name of the node where the application is deployed to. + * + * @param nodeName the nodeName value to set + * @return the DeployedApplicationHealthEvaluation object itself. + */ + public DeployedApplicationHealthEvaluation withNodeName(String nodeName) { + this.nodeName = nodeName; + return this; + } + + /** + * Get the name of the application, including the 'fabric:' URI scheme. + * + * @return the applicationName value + */ + public String applicationName() { + return this.applicationName; + } + + /** + * Set the name of the application, including the 'fabric:' URI scheme. + * + * @param applicationName the applicationName value to set + * @return the DeployedApplicationHealthEvaluation object itself. + */ + public DeployedApplicationHealthEvaluation withApplicationName(String applicationName) { + this.applicationName = applicationName; + return this; + } + + /** + * Get list of unhealthy evaluations that led to the current aggregated health state of the deployed application. + The types of the unhealthy evaluations can be DeployedServicePackagesHealthEvaluation or EventHealthEvaluation. + * + * @return the unhealthyEvaluations value + */ + public List unhealthyEvaluations() { + return this.unhealthyEvaluations; + } + + /** + * Set list of unhealthy evaluations that led to the current aggregated health state of the deployed application. + The types of the unhealthy evaluations can be DeployedServicePackagesHealthEvaluation or EventHealthEvaluation. + * + * @param unhealthyEvaluations the unhealthyEvaluations value to set + * @return the DeployedApplicationHealthEvaluation object itself. + */ + public DeployedApplicationHealthEvaluation withUnhealthyEvaluations(List unhealthyEvaluations) { + this.unhealthyEvaluations = unhealthyEvaluations; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedApplicationHealthReportCreatedEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedApplicationHealthReportCreatedEvent.java new file mode 100644 index 0000000000000..c1e0c49a232ff --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedApplicationHealthReportCreatedEvent.java @@ -0,0 +1,283 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ApplicationEventInner; + +/** + * Deployed Application Health Report Created event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("DeployedApplicationHealthReportCreated") +public class DeployedApplicationHealthReportCreatedEvent extends ApplicationEventInner { + /** + * Id of Application instance. + */ + @JsonProperty(value = "ApplicationInstanceId", required = true) + private long applicationInstanceId; + + /** + * The name of a Service Fabric node. + */ + @JsonProperty(value = "NodeName", required = true) + private String nodeName; + + /** + * Id of report source. + */ + @JsonProperty(value = "SourceId", required = true) + private String sourceId; + + /** + * Describes the property. + */ + @JsonProperty(value = "Property", required = true) + private String property; + + /** + * Describes the property health state. + */ + @JsonProperty(value = "HealthState", required = true) + private String healthState; + + /** + * Time to live in milli-seconds. + */ + @JsonProperty(value = "TimeToLiveMs", required = true) + private long timeToLiveMs; + + /** + * Sequence number of report. + */ + @JsonProperty(value = "SequenceNumber", required = true) + private long sequenceNumber; + + /** + * Description of report. + */ + @JsonProperty(value = "Description", required = true) + private String description; + + /** + * Indicates the removal when it expires. + */ + @JsonProperty(value = "RemoveWhenExpired", required = true) + private boolean removeWhenExpired; + + /** + * Source time. + */ + @JsonProperty(value = "SourceUtcTimestamp", required = true) + private DateTime sourceUtcTimestamp; + + /** + * Get id of Application instance. + * + * @return the applicationInstanceId value + */ + public long applicationInstanceId() { + return this.applicationInstanceId; + } + + /** + * Set id of Application instance. + * + * @param applicationInstanceId the applicationInstanceId value to set + * @return the DeployedApplicationHealthReportCreatedEvent object itself. + */ + public DeployedApplicationHealthReportCreatedEvent withApplicationInstanceId(long applicationInstanceId) { + this.applicationInstanceId = applicationInstanceId; + return this; + } + + /** + * Get the name of a Service Fabric node. + * + * @return the nodeName value + */ + public String nodeName() { + return this.nodeName; + } + + /** + * Set the name of a Service Fabric node. + * + * @param nodeName the nodeName value to set + * @return the DeployedApplicationHealthReportCreatedEvent object itself. + */ + public DeployedApplicationHealthReportCreatedEvent withNodeName(String nodeName) { + this.nodeName = nodeName; + return this; + } + + /** + * Get id of report source. + * + * @return the sourceId value + */ + public String sourceId() { + return this.sourceId; + } + + /** + * Set id of report source. + * + * @param sourceId the sourceId value to set + * @return the DeployedApplicationHealthReportCreatedEvent object itself. + */ + public DeployedApplicationHealthReportCreatedEvent withSourceId(String sourceId) { + this.sourceId = sourceId; + return this; + } + + /** + * Get describes the property. + * + * @return the property value + */ + public String property() { + return this.property; + } + + /** + * Set describes the property. + * + * @param property the property value to set + * @return the DeployedApplicationHealthReportCreatedEvent object itself. + */ + public DeployedApplicationHealthReportCreatedEvent withProperty(String property) { + this.property = property; + return this; + } + + /** + * Get describes the property health state. + * + * @return the healthState value + */ + public String healthState() { + return this.healthState; + } + + /** + * Set describes the property health state. + * + * @param healthState the healthState value to set + * @return the DeployedApplicationHealthReportCreatedEvent object itself. + */ + public DeployedApplicationHealthReportCreatedEvent withHealthState(String healthState) { + this.healthState = healthState; + return this; + } + + /** + * Get time to live in milli-seconds. + * + * @return the timeToLiveMs value + */ + public long timeToLiveMs() { + return this.timeToLiveMs; + } + + /** + * Set time to live in milli-seconds. + * + * @param timeToLiveMs the timeToLiveMs value to set + * @return the DeployedApplicationHealthReportCreatedEvent object itself. + */ + public DeployedApplicationHealthReportCreatedEvent withTimeToLiveMs(long timeToLiveMs) { + this.timeToLiveMs = timeToLiveMs; + return this; + } + + /** + * Get sequence number of report. + * + * @return the sequenceNumber value + */ + public long sequenceNumber() { + return this.sequenceNumber; + } + + /** + * Set sequence number of report. + * + * @param sequenceNumber the sequenceNumber value to set + * @return the DeployedApplicationHealthReportCreatedEvent object itself. + */ + public DeployedApplicationHealthReportCreatedEvent withSequenceNumber(long sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get description of report. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of report. + * + * @param description the description value to set + * @return the DeployedApplicationHealthReportCreatedEvent object itself. + */ + public DeployedApplicationHealthReportCreatedEvent withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get indicates the removal when it expires. + * + * @return the removeWhenExpired value + */ + public boolean removeWhenExpired() { + return this.removeWhenExpired; + } + + /** + * Set indicates the removal when it expires. + * + * @param removeWhenExpired the removeWhenExpired value to set + * @return the DeployedApplicationHealthReportCreatedEvent object itself. + */ + public DeployedApplicationHealthReportCreatedEvent withRemoveWhenExpired(boolean removeWhenExpired) { + this.removeWhenExpired = removeWhenExpired; + return this; + } + + /** + * Get source time. + * + * @return the sourceUtcTimestamp value + */ + public DateTime sourceUtcTimestamp() { + return this.sourceUtcTimestamp; + } + + /** + * Set source time. + * + * @param sourceUtcTimestamp the sourceUtcTimestamp value to set + * @return the DeployedApplicationHealthReportCreatedEvent object itself. + */ + public DeployedApplicationHealthReportCreatedEvent withSourceUtcTimestamp(DateTime sourceUtcTimestamp) { + this.sourceUtcTimestamp = sourceUtcTimestamp; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedApplicationHealthReportExpiredEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedApplicationHealthReportExpiredEvent.java new file mode 100644 index 0000000000000..bcce5fb04d611 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedApplicationHealthReportExpiredEvent.java @@ -0,0 +1,283 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ApplicationEventInner; + +/** + * Deployed Application Health Report Expired event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("DeployedApplicationHealthReportExpired") +public class DeployedApplicationHealthReportExpiredEvent extends ApplicationEventInner { + /** + * Id of Application instance. + */ + @JsonProperty(value = "ApplicationInstanceId", required = true) + private long applicationInstanceId; + + /** + * The name of a Service Fabric node. + */ + @JsonProperty(value = "NodeName", required = true) + private String nodeName; + + /** + * Id of report source. + */ + @JsonProperty(value = "SourceId", required = true) + private String sourceId; + + /** + * Describes the property. + */ + @JsonProperty(value = "Property", required = true) + private String property; + + /** + * Describes the property health state. + */ + @JsonProperty(value = "HealthState", required = true) + private String healthState; + + /** + * Time to live in milli-seconds. + */ + @JsonProperty(value = "TimeToLiveMs", required = true) + private long timeToLiveMs; + + /** + * Sequence number of report. + */ + @JsonProperty(value = "SequenceNumber", required = true) + private long sequenceNumber; + + /** + * Description of report. + */ + @JsonProperty(value = "Description", required = true) + private String description; + + /** + * Indicates the removal when it expires. + */ + @JsonProperty(value = "RemoveWhenExpired", required = true) + private boolean removeWhenExpired; + + /** + * Source time. + */ + @JsonProperty(value = "SourceUtcTimestamp", required = true) + private DateTime sourceUtcTimestamp; + + /** + * Get id of Application instance. + * + * @return the applicationInstanceId value + */ + public long applicationInstanceId() { + return this.applicationInstanceId; + } + + /** + * Set id of Application instance. + * + * @param applicationInstanceId the applicationInstanceId value to set + * @return the DeployedApplicationHealthReportExpiredEvent object itself. + */ + public DeployedApplicationHealthReportExpiredEvent withApplicationInstanceId(long applicationInstanceId) { + this.applicationInstanceId = applicationInstanceId; + return this; + } + + /** + * Get the name of a Service Fabric node. + * + * @return the nodeName value + */ + public String nodeName() { + return this.nodeName; + } + + /** + * Set the name of a Service Fabric node. + * + * @param nodeName the nodeName value to set + * @return the DeployedApplicationHealthReportExpiredEvent object itself. + */ + public DeployedApplicationHealthReportExpiredEvent withNodeName(String nodeName) { + this.nodeName = nodeName; + return this; + } + + /** + * Get id of report source. + * + * @return the sourceId value + */ + public String sourceId() { + return this.sourceId; + } + + /** + * Set id of report source. + * + * @param sourceId the sourceId value to set + * @return the DeployedApplicationHealthReportExpiredEvent object itself. + */ + public DeployedApplicationHealthReportExpiredEvent withSourceId(String sourceId) { + this.sourceId = sourceId; + return this; + } + + /** + * Get describes the property. + * + * @return the property value + */ + public String property() { + return this.property; + } + + /** + * Set describes the property. + * + * @param property the property value to set + * @return the DeployedApplicationHealthReportExpiredEvent object itself. + */ + public DeployedApplicationHealthReportExpiredEvent withProperty(String property) { + this.property = property; + return this; + } + + /** + * Get describes the property health state. + * + * @return the healthState value + */ + public String healthState() { + return this.healthState; + } + + /** + * Set describes the property health state. + * + * @param healthState the healthState value to set + * @return the DeployedApplicationHealthReportExpiredEvent object itself. + */ + public DeployedApplicationHealthReportExpiredEvent withHealthState(String healthState) { + this.healthState = healthState; + return this; + } + + /** + * Get time to live in milli-seconds. + * + * @return the timeToLiveMs value + */ + public long timeToLiveMs() { + return this.timeToLiveMs; + } + + /** + * Set time to live in milli-seconds. + * + * @param timeToLiveMs the timeToLiveMs value to set + * @return the DeployedApplicationHealthReportExpiredEvent object itself. + */ + public DeployedApplicationHealthReportExpiredEvent withTimeToLiveMs(long timeToLiveMs) { + this.timeToLiveMs = timeToLiveMs; + return this; + } + + /** + * Get sequence number of report. + * + * @return the sequenceNumber value + */ + public long sequenceNumber() { + return this.sequenceNumber; + } + + /** + * Set sequence number of report. + * + * @param sequenceNumber the sequenceNumber value to set + * @return the DeployedApplicationHealthReportExpiredEvent object itself. + */ + public DeployedApplicationHealthReportExpiredEvent withSequenceNumber(long sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get description of report. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of report. + * + * @param description the description value to set + * @return the DeployedApplicationHealthReportExpiredEvent object itself. + */ + public DeployedApplicationHealthReportExpiredEvent withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get indicates the removal when it expires. + * + * @return the removeWhenExpired value + */ + public boolean removeWhenExpired() { + return this.removeWhenExpired; + } + + /** + * Set indicates the removal when it expires. + * + * @param removeWhenExpired the removeWhenExpired value to set + * @return the DeployedApplicationHealthReportExpiredEvent object itself. + */ + public DeployedApplicationHealthReportExpiredEvent withRemoveWhenExpired(boolean removeWhenExpired) { + this.removeWhenExpired = removeWhenExpired; + return this; + } + + /** + * Get source time. + * + * @return the sourceUtcTimestamp value + */ + public DateTime sourceUtcTimestamp() { + return this.sourceUtcTimestamp; + } + + /** + * Set source time. + * + * @param sourceUtcTimestamp the sourceUtcTimestamp value to set + * @return the DeployedApplicationHealthReportExpiredEvent object itself. + */ + public DeployedApplicationHealthReportExpiredEvent withSourceUtcTimestamp(DateTime sourceUtcTimestamp) { + this.sourceUtcTimestamp = sourceUtcTimestamp; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedApplicationHealthState.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedApplicationHealthState.java new file mode 100644 index 0000000000000..d3b24d4473e02 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedApplicationHealthState.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents the health state of a deployed application, which contains the + * entity identifier and the aggregated health state. + */ +public class DeployedApplicationHealthState extends EntityHealthState { + /** + * Name of the node on which the service package is deployed. + */ + @JsonProperty(value = "NodeName") + private String nodeName; + + /** + * The name of the application, including the 'fabric:' URI scheme. + */ + @JsonProperty(value = "ApplicationName") + private String applicationName; + + /** + * Get name of the node on which the service package is deployed. + * + * @return the nodeName value + */ + public String nodeName() { + return this.nodeName; + } + + /** + * Set name of the node on which the service package is deployed. + * + * @param nodeName the nodeName value to set + * @return the DeployedApplicationHealthState object itself. + */ + public DeployedApplicationHealthState withNodeName(String nodeName) { + this.nodeName = nodeName; + return this; + } + + /** + * Get the name of the application, including the 'fabric:' URI scheme. + * + * @return the applicationName value + */ + public String applicationName() { + return this.applicationName; + } + + /** + * Set the name of the application, including the 'fabric:' URI scheme. + * + * @param applicationName the applicationName value to set + * @return the DeployedApplicationHealthState object itself. + */ + public DeployedApplicationHealthState withApplicationName(String applicationName) { + this.applicationName = applicationName; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedApplicationHealthStateChunk.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedApplicationHealthStateChunk.java new file mode 100644 index 0000000000000..517fd4146a332 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedApplicationHealthStateChunk.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents the health state chunk of a deployed application, which contains + * the node where the application is deployed, the aggregated health state and + * any deployed service packages that respect the chunk query description + * filters. + */ +public class DeployedApplicationHealthStateChunk extends EntityHealthStateChunk { + /** + * The name of node where the application is deployed. + */ + @JsonProperty(value = "NodeName") + private String nodeName; + + /** + * The list of deployed service package health state chunks belonging to + * the deployed application that respect the filters in the cluster health + * chunk query description. + */ + @JsonProperty(value = "DeployedServicePackageHealthStateChunks") + private DeployedServicePackageHealthStateChunkList deployedServicePackageHealthStateChunks; + + /** + * Get the name of node where the application is deployed. + * + * @return the nodeName value + */ + public String nodeName() { + return this.nodeName; + } + + /** + * Set the name of node where the application is deployed. + * + * @param nodeName the nodeName value to set + * @return the DeployedApplicationHealthStateChunk object itself. + */ + public DeployedApplicationHealthStateChunk withNodeName(String nodeName) { + this.nodeName = nodeName; + return this; + } + + /** + * Get the list of deployed service package health state chunks belonging to the deployed application that respect the filters in the cluster health chunk query description. + * + * @return the deployedServicePackageHealthStateChunks value + */ + public DeployedServicePackageHealthStateChunkList deployedServicePackageHealthStateChunks() { + return this.deployedServicePackageHealthStateChunks; + } + + /** + * Set the list of deployed service package health state chunks belonging to the deployed application that respect the filters in the cluster health chunk query description. + * + * @param deployedServicePackageHealthStateChunks the deployedServicePackageHealthStateChunks value to set + * @return the DeployedApplicationHealthStateChunk object itself. + */ + public DeployedApplicationHealthStateChunk withDeployedServicePackageHealthStateChunks(DeployedServicePackageHealthStateChunkList deployedServicePackageHealthStateChunks) { + this.deployedServicePackageHealthStateChunks = deployedServicePackageHealthStateChunks; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedApplicationHealthStateChunkList.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedApplicationHealthStateChunkList.java new file mode 100644 index 0000000000000..b135d048916e5 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedApplicationHealthStateChunkList.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list of deployed application health state chunks that respect the input + * filters in the chunk query. Returned by get cluster health state chunks + * query. + */ +public class DeployedApplicationHealthStateChunkList { + /** + * The list of deployed application health state chunks that respect the + * input filters in the chunk query. + */ + @JsonProperty(value = "Items") + private List items; + + /** + * Get the list of deployed application health state chunks that respect the input filters in the chunk query. + * + * @return the items value + */ + public List items() { + return this.items; + } + + /** + * Set the list of deployed application health state chunks that respect the input filters in the chunk query. + * + * @param items the items value to set + * @return the DeployedApplicationHealthStateChunkList object itself. + */ + public DeployedApplicationHealthStateChunkList withItems(List items) { + this.items = items; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedApplicationHealthStateFilter.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedApplicationHealthStateFilter.java new file mode 100644 index 0000000000000..6f48ee9b0f22d --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedApplicationHealthStateFilter.java @@ -0,0 +1,181 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines matching criteria to determine whether a deployed application should + * be included as a child of an application in the cluster health chunk. + * The deployed applications are only returned if the parent application + * matches a filter specified in the cluster health chunk query description. + * One filter can match zero, one or multiple deployed applications, depending + * on its properties. + */ +public class DeployedApplicationHealthStateFilter { + /** + * The name of the node where the application is deployed in order to match + * the filter. + * If specified, the filter is applied only to the application deployed on + * the specified node. + * If the application is not deployed on the node with the specified name, + * no deployed application is returned in the cluster health chunk based on + * this filter. + * Otherwise, the deployed application is included in the cluster health + * chunk if it respects the other filter properties. + * If not specified, all deployed applications that match the parent + * filters (if any) are taken into consideration and matched against the + * other filter members, like health state filter. + */ + @JsonProperty(value = "NodeNameFilter") + private String nodeNameFilter; + + /** + * The filter for the health state of the deployed applications. It allows + * selecting deployed applications if they match the desired health states. + * The possible values are integer value of one of the following health + * states. Only deployed applications that match the filter are returned. + * All deployed applications are used to evaluate the cluster aggregated + * health state. + * If not specified, default value is None, unless the node name is + * specified. If the filter has default value and node name is specified, + * the matching deployed application is returned. + * The state values are flag-based enumeration, so the value could be a + * combination of these values obtained using bitwise 'OR' operator. + * For example, if the provided value is 6, it matches deployed + * applications with HealthState value of OK (2) and Warning (4). + * + * - 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. + */ + @JsonProperty(value = "HealthStateFilter") + private Integer healthStateFilter; + + /** + * Defines a list of filters that specify which deployed service packages + * to be included in the returned cluster health chunk as children of the + * parent deployed application. The deployed service packages are returned + * only if the parent deployed application matches a filter. + * If the list is empty, no deployed service packages are returned. All the + * deployed service packages are used to evaluate the parent deployed + * application aggregated health state, regardless of the input filters. + * The deployed application filter may specify multiple deployed service + * package filters. + * For example, it can specify a filter to return all deployed service + * packages with health state Error and another filter to always include a + * deployed service package on a node. + */ + @JsonProperty(value = "DeployedServicePackageFilters") + private List deployedServicePackageFilters; + + /** + * Get the name of the node where the application is deployed in order to match the filter. + If specified, the filter is applied only to the application deployed on the specified node. + If the application is not deployed on the node with the specified name, no deployed application is returned in the cluster health chunk based on this filter. + Otherwise, the deployed application is included in the cluster health chunk if it respects the other filter properties. + If not specified, all deployed applications that match the parent filters (if any) are taken into consideration and matched against the other filter members, like health state filter. + * + * @return the nodeNameFilter value + */ + public String nodeNameFilter() { + return this.nodeNameFilter; + } + + /** + * Set the name of the node where the application is deployed in order to match the filter. + If specified, the filter is applied only to the application deployed on the specified node. + If the application is not deployed on the node with the specified name, no deployed application is returned in the cluster health chunk based on this filter. + Otherwise, the deployed application is included in the cluster health chunk if it respects the other filter properties. + If not specified, all deployed applications that match the parent filters (if any) are taken into consideration and matched against the other filter members, like health state filter. + * + * @param nodeNameFilter the nodeNameFilter value to set + * @return the DeployedApplicationHealthStateFilter object itself. + */ + public DeployedApplicationHealthStateFilter withNodeNameFilter(String nodeNameFilter) { + this.nodeNameFilter = nodeNameFilter; + return this; + } + + /** + * Get the filter for the health state of the deployed applications. It allows selecting deployed applications if they match the desired health states. + The possible values are integer value of one of the following health states. Only deployed applications that match the filter are returned. All deployed applications are used to evaluate the cluster aggregated health state. + If not specified, default value is None, unless the node name is specified. If the filter has default value and node name is specified, the matching deployed application is returned. + The state values are flag-based enumeration, so the value could be a combination of these values obtained using bitwise 'OR' operator. + For example, if the provided value is 6, it matches deployed applications with HealthState value of OK (2) and Warning (4). + - Default - Default value. Matches any HealthState. The value is zero. + - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given collection of states. The value is 1. + - Ok - Filter that matches input with HealthState value Ok. The value is 2. + - Warning - Filter that matches input with HealthState value Warning. The value is 4. + - Error - Filter that matches input with HealthState value Error. The value is 8. + - All - Filter that matches input with any HealthState value. The value is 65535. + * + * @return the healthStateFilter value + */ + public Integer healthStateFilter() { + return this.healthStateFilter; + } + + /** + * Set the filter for the health state of the deployed applications. It allows selecting deployed applications if they match the desired health states. + The possible values are integer value of one of the following health states. Only deployed applications that match the filter are returned. All deployed applications are used to evaluate the cluster aggregated health state. + If not specified, default value is None, unless the node name is specified. If the filter has default value and node name is specified, the matching deployed application is returned. + The state values are flag-based enumeration, so the value could be a combination of these values obtained using bitwise 'OR' operator. + For example, if the provided value is 6, it matches deployed applications with HealthState value of OK (2) and Warning (4). + - 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 healthStateFilter the healthStateFilter value to set + * @return the DeployedApplicationHealthStateFilter object itself. + */ + public DeployedApplicationHealthStateFilter withHealthStateFilter(Integer healthStateFilter) { + this.healthStateFilter = healthStateFilter; + return this; + } + + /** + * Get defines a list of filters that specify which deployed service packages to be included in the returned cluster health chunk as children of the parent deployed application. The deployed service packages are returned only if the parent deployed application matches a filter. + If the list is empty, no deployed service packages are returned. All the deployed service packages are used to evaluate the parent deployed application aggregated health state, regardless of the input filters. + The deployed application filter may specify multiple deployed service package filters. + For example, it can specify a filter to return all deployed service packages with health state Error and another filter to always include a deployed service package on a node. + * + * @return the deployedServicePackageFilters value + */ + public List deployedServicePackageFilters() { + return this.deployedServicePackageFilters; + } + + /** + * Set defines a list of filters that specify which deployed service packages to be included in the returned cluster health chunk as children of the parent deployed application. The deployed service packages are returned only if the parent deployed application matches a filter. + If the list is empty, no deployed service packages are returned. All the deployed service packages are used to evaluate the parent deployed application aggregated health state, regardless of the input filters. + The deployed application filter may specify multiple deployed service package filters. + For example, it can specify a filter to return all deployed service packages with health state Error and another filter to always include a deployed service package on a node. + * + * @param deployedServicePackageFilters the deployedServicePackageFilters value to set + * @return the DeployedApplicationHealthStateFilter object itself. + */ + public DeployedApplicationHealthStateFilter withDeployedServicePackageFilters(List deployedServicePackageFilters) { + this.deployedServicePackageFilters = deployedServicePackageFilters; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedApplicationStatus.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedApplicationStatus.java new file mode 100644 index 0000000000000..728c8d062d0e7 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedApplicationStatus.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DeployedApplicationStatus. + */ +public final class DeployedApplicationStatus extends ExpandableStringEnum { + /** Static value Invalid for DeployedApplicationStatus. */ + public static final DeployedApplicationStatus INVALID = fromString("Invalid"); + + /** Static value Downloading for DeployedApplicationStatus. */ + public static final DeployedApplicationStatus DOWNLOADING = fromString("Downloading"); + + /** Static value Activating for DeployedApplicationStatus. */ + public static final DeployedApplicationStatus ACTIVATING = fromString("Activating"); + + /** Static value Active for DeployedApplicationStatus. */ + public static final DeployedApplicationStatus ACTIVE = fromString("Active"); + + /** Static value Upgrading for DeployedApplicationStatus. */ + public static final DeployedApplicationStatus UPGRADING = fromString("Upgrading"); + + /** Static value Deactivating for DeployedApplicationStatus. */ + public static final DeployedApplicationStatus DEACTIVATING = fromString("Deactivating"); + + /** + * Creates or finds a DeployedApplicationStatus from its string representation. + * @param name a name to look for + * @return the corresponding DeployedApplicationStatus + */ + @JsonCreator + public static DeployedApplicationStatus fromString(String name) { + return fromString(name, DeployedApplicationStatus.class); + } + + /** + * @return known DeployedApplicationStatus values + */ + public static Collection values() { + return values(DeployedApplicationStatus.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedApplicationsHealthEvaluation.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedApplicationsHealthEvaluation.java new file mode 100644 index 0000000000000..f8ec61c9fa15a --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedApplicationsHealthEvaluation.java @@ -0,0 +1,108 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents health evaluation for deployed applications, containing health + * evaluations for each unhealthy deployed application that impacted current + * aggregated health state. + * Can be returned when evaluating application health and the aggregated health + * state is either Error or Warning. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("DeployedApplications") +public class DeployedApplicationsHealthEvaluation extends HealthEvaluation { + /** + * Maximum allowed percentage of unhealthy deployed applications from the + * ApplicationHealthPolicy. + */ + @JsonProperty(value = "MaxPercentUnhealthyDeployedApplications") + private Integer maxPercentUnhealthyDeployedApplications; + + /** + * Total number of deployed applications of the application in the health + * store. + */ + @JsonProperty(value = "TotalCount") + private Long totalCount; + + /** + * List of unhealthy evaluations that led to the aggregated health state. + * Includes all the unhealthy DeployedApplicationHealthEvaluation that + * impacted the aggregated health. + */ + @JsonProperty(value = "UnhealthyEvaluations") + private List unhealthyEvaluations; + + /** + * Get maximum allowed percentage of unhealthy deployed applications from the ApplicationHealthPolicy. + * + * @return the maxPercentUnhealthyDeployedApplications value + */ + public Integer maxPercentUnhealthyDeployedApplications() { + return this.maxPercentUnhealthyDeployedApplications; + } + + /** + * Set maximum allowed percentage of unhealthy deployed applications from the ApplicationHealthPolicy. + * + * @param maxPercentUnhealthyDeployedApplications the maxPercentUnhealthyDeployedApplications value to set + * @return the DeployedApplicationsHealthEvaluation object itself. + */ + public DeployedApplicationsHealthEvaluation withMaxPercentUnhealthyDeployedApplications(Integer maxPercentUnhealthyDeployedApplications) { + this.maxPercentUnhealthyDeployedApplications = maxPercentUnhealthyDeployedApplications; + return this; + } + + /** + * Get total number of deployed applications of the application in the health store. + * + * @return the totalCount value + */ + public Long totalCount() { + return this.totalCount; + } + + /** + * Set total number of deployed applications of the application in the health store. + * + * @param totalCount the totalCount value to set + * @return the DeployedApplicationsHealthEvaluation object itself. + */ + public DeployedApplicationsHealthEvaluation withTotalCount(Long totalCount) { + this.totalCount = totalCount; + return this; + } + + /** + * Get list of unhealthy evaluations that led to the aggregated health state. Includes all the unhealthy DeployedApplicationHealthEvaluation that impacted the aggregated health. + * + * @return the unhealthyEvaluations value + */ + public List unhealthyEvaluations() { + return this.unhealthyEvaluations; + } + + /** + * Set list of unhealthy evaluations that led to the aggregated health state. Includes all the unhealthy DeployedApplicationHealthEvaluation that impacted the aggregated health. + * + * @param unhealthyEvaluations the unhealthyEvaluations value to set + * @return the DeployedApplicationsHealthEvaluation object itself. + */ + public DeployedApplicationsHealthEvaluation withUnhealthyEvaluations(List unhealthyEvaluations) { + this.unhealthyEvaluations = unhealthyEvaluations; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedServiceHealthReportCreatedEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedServiceHealthReportCreatedEvent.java new file mode 100644 index 0000000000000..1305f278dee66 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedServiceHealthReportCreatedEvent.java @@ -0,0 +1,335 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ApplicationEventInner; + +/** + * Deployed Service Health Report Created event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("DeployedServiceHealthReportCreated") +public class DeployedServiceHealthReportCreatedEvent extends ApplicationEventInner { + /** + * Service manifest name. + */ + @JsonProperty(value = "ServiceManifestName", required = true) + private String serviceManifestName; + + /** + * Id of Service package instance. + */ + @JsonProperty(value = "ServicePackageInstanceId", required = true) + private long servicePackageInstanceId; + + /** + * Id of Service package activation. + */ + @JsonProperty(value = "ServicePackageActivationId", required = true) + private String servicePackageActivationId; + + /** + * The name of a Service Fabric node. + */ + @JsonProperty(value = "NodeName", required = true) + private String nodeName; + + /** + * Id of report source. + */ + @JsonProperty(value = "SourceId", required = true) + private String sourceId; + + /** + * Describes the property. + */ + @JsonProperty(value = "Property", required = true) + private String property; + + /** + * Describes the property health state. + */ + @JsonProperty(value = "HealthState", required = true) + private String healthState; + + /** + * Time to live in milli-seconds. + */ + @JsonProperty(value = "TTLTimespan", required = true) + private long tTLTimespan; + + /** + * Sequence number of report. + */ + @JsonProperty(value = "SequenceNumber", required = true) + private long sequenceNumber; + + /** + * Description of report. + */ + @JsonProperty(value = "Description", required = true) + private String description; + + /** + * Indicates the removal when it expires. + */ + @JsonProperty(value = "RemoveWhenExpired", required = true) + private boolean removeWhenExpired; + + /** + * Source time. + */ + @JsonProperty(value = "SourceUtcTimestamp", required = true) + private DateTime sourceUtcTimestamp; + + /** + * Get service manifest name. + * + * @return the serviceManifestName value + */ + public String serviceManifestName() { + return this.serviceManifestName; + } + + /** + * Set service manifest name. + * + * @param serviceManifestName the serviceManifestName value to set + * @return the DeployedServiceHealthReportCreatedEvent object itself. + */ + public DeployedServiceHealthReportCreatedEvent withServiceManifestName(String serviceManifestName) { + this.serviceManifestName = serviceManifestName; + return this; + } + + /** + * Get id of Service package instance. + * + * @return the servicePackageInstanceId value + */ + public long servicePackageInstanceId() { + return this.servicePackageInstanceId; + } + + /** + * Set id of Service package instance. + * + * @param servicePackageInstanceId the servicePackageInstanceId value to set + * @return the DeployedServiceHealthReportCreatedEvent object itself. + */ + public DeployedServiceHealthReportCreatedEvent withServicePackageInstanceId(long servicePackageInstanceId) { + this.servicePackageInstanceId = servicePackageInstanceId; + return this; + } + + /** + * Get id of Service package activation. + * + * @return the servicePackageActivationId value + */ + public String servicePackageActivationId() { + return this.servicePackageActivationId; + } + + /** + * Set id of Service package activation. + * + * @param servicePackageActivationId the servicePackageActivationId value to set + * @return the DeployedServiceHealthReportCreatedEvent object itself. + */ + public DeployedServiceHealthReportCreatedEvent withServicePackageActivationId(String servicePackageActivationId) { + this.servicePackageActivationId = servicePackageActivationId; + return this; + } + + /** + * Get the name of a Service Fabric node. + * + * @return the nodeName value + */ + public String nodeName() { + return this.nodeName; + } + + /** + * Set the name of a Service Fabric node. + * + * @param nodeName the nodeName value to set + * @return the DeployedServiceHealthReportCreatedEvent object itself. + */ + public DeployedServiceHealthReportCreatedEvent withNodeName(String nodeName) { + this.nodeName = nodeName; + return this; + } + + /** + * Get id of report source. + * + * @return the sourceId value + */ + public String sourceId() { + return this.sourceId; + } + + /** + * Set id of report source. + * + * @param sourceId the sourceId value to set + * @return the DeployedServiceHealthReportCreatedEvent object itself. + */ + public DeployedServiceHealthReportCreatedEvent withSourceId(String sourceId) { + this.sourceId = sourceId; + return this; + } + + /** + * Get describes the property. + * + * @return the property value + */ + public String property() { + return this.property; + } + + /** + * Set describes the property. + * + * @param property the property value to set + * @return the DeployedServiceHealthReportCreatedEvent object itself. + */ + public DeployedServiceHealthReportCreatedEvent withProperty(String property) { + this.property = property; + return this; + } + + /** + * Get describes the property health state. + * + * @return the healthState value + */ + public String healthState() { + return this.healthState; + } + + /** + * Set describes the property health state. + * + * @param healthState the healthState value to set + * @return the DeployedServiceHealthReportCreatedEvent object itself. + */ + public DeployedServiceHealthReportCreatedEvent withHealthState(String healthState) { + this.healthState = healthState; + return this; + } + + /** + * Get time to live in milli-seconds. + * + * @return the tTLTimespan value + */ + public long tTLTimespan() { + return this.tTLTimespan; + } + + /** + * Set time to live in milli-seconds. + * + * @param tTLTimespan the tTLTimespan value to set + * @return the DeployedServiceHealthReportCreatedEvent object itself. + */ + public DeployedServiceHealthReportCreatedEvent withTTLTimespan(long tTLTimespan) { + this.tTLTimespan = tTLTimespan; + return this; + } + + /** + * Get sequence number of report. + * + * @return the sequenceNumber value + */ + public long sequenceNumber() { + return this.sequenceNumber; + } + + /** + * Set sequence number of report. + * + * @param sequenceNumber the sequenceNumber value to set + * @return the DeployedServiceHealthReportCreatedEvent object itself. + */ + public DeployedServiceHealthReportCreatedEvent withSequenceNumber(long sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get description of report. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of report. + * + * @param description the description value to set + * @return the DeployedServiceHealthReportCreatedEvent object itself. + */ + public DeployedServiceHealthReportCreatedEvent withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get indicates the removal when it expires. + * + * @return the removeWhenExpired value + */ + public boolean removeWhenExpired() { + return this.removeWhenExpired; + } + + /** + * Set indicates the removal when it expires. + * + * @param removeWhenExpired the removeWhenExpired value to set + * @return the DeployedServiceHealthReportCreatedEvent object itself. + */ + public DeployedServiceHealthReportCreatedEvent withRemoveWhenExpired(boolean removeWhenExpired) { + this.removeWhenExpired = removeWhenExpired; + return this; + } + + /** + * Get source time. + * + * @return the sourceUtcTimestamp value + */ + public DateTime sourceUtcTimestamp() { + return this.sourceUtcTimestamp; + } + + /** + * Set source time. + * + * @param sourceUtcTimestamp the sourceUtcTimestamp value to set + * @return the DeployedServiceHealthReportCreatedEvent object itself. + */ + public DeployedServiceHealthReportCreatedEvent withSourceUtcTimestamp(DateTime sourceUtcTimestamp) { + this.sourceUtcTimestamp = sourceUtcTimestamp; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedServiceHealthReportExpiredEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedServiceHealthReportExpiredEvent.java new file mode 100644 index 0000000000000..9069009814744 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedServiceHealthReportExpiredEvent.java @@ -0,0 +1,335 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ApplicationEventInner; + +/** + * Deployed Service Health Report Expired event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("DeployedServiceHealthReportExpired") +public class DeployedServiceHealthReportExpiredEvent extends ApplicationEventInner { + /** + * Service manifest name. + */ + @JsonProperty(value = "ServiceManifest", required = true) + private String serviceManifest; + + /** + * Id of Service package instance. + */ + @JsonProperty(value = "ServicePackageInstanceId", required = true) + private long servicePackageInstanceId; + + /** + * Id of Service package activation. + */ + @JsonProperty(value = "ServicePackageActivationId", required = true) + private String servicePackageActivationId; + + /** + * The name of a Service Fabric node. + */ + @JsonProperty(value = "NodeName", required = true) + private String nodeName; + + /** + * Id of report source. + */ + @JsonProperty(value = "SourceId", required = true) + private String sourceId; + + /** + * Describes the property. + */ + @JsonProperty(value = "Property", required = true) + private String property; + + /** + * Describes the property health state. + */ + @JsonProperty(value = "HealthState", required = true) + private String healthState; + + /** + * Time to live in milli-seconds. + */ + @JsonProperty(value = "TTLTimespan", required = true) + private long tTLTimespan; + + /** + * Sequence number of report. + */ + @JsonProperty(value = "SequenceNumber", required = true) + private long sequenceNumber; + + /** + * Description of report. + */ + @JsonProperty(value = "Description", required = true) + private String description; + + /** + * Indicates the removal when it expires. + */ + @JsonProperty(value = "RemoveWhenExpired", required = true) + private boolean removeWhenExpired; + + /** + * Source time. + */ + @JsonProperty(value = "SourceUtcTimestamp", required = true) + private DateTime sourceUtcTimestamp; + + /** + * Get service manifest name. + * + * @return the serviceManifest value + */ + public String serviceManifest() { + return this.serviceManifest; + } + + /** + * Set service manifest name. + * + * @param serviceManifest the serviceManifest value to set + * @return the DeployedServiceHealthReportExpiredEvent object itself. + */ + public DeployedServiceHealthReportExpiredEvent withServiceManifest(String serviceManifest) { + this.serviceManifest = serviceManifest; + return this; + } + + /** + * Get id of Service package instance. + * + * @return the servicePackageInstanceId value + */ + public long servicePackageInstanceId() { + return this.servicePackageInstanceId; + } + + /** + * Set id of Service package instance. + * + * @param servicePackageInstanceId the servicePackageInstanceId value to set + * @return the DeployedServiceHealthReportExpiredEvent object itself. + */ + public DeployedServiceHealthReportExpiredEvent withServicePackageInstanceId(long servicePackageInstanceId) { + this.servicePackageInstanceId = servicePackageInstanceId; + return this; + } + + /** + * Get id of Service package activation. + * + * @return the servicePackageActivationId value + */ + public String servicePackageActivationId() { + return this.servicePackageActivationId; + } + + /** + * Set id of Service package activation. + * + * @param servicePackageActivationId the servicePackageActivationId value to set + * @return the DeployedServiceHealthReportExpiredEvent object itself. + */ + public DeployedServiceHealthReportExpiredEvent withServicePackageActivationId(String servicePackageActivationId) { + this.servicePackageActivationId = servicePackageActivationId; + return this; + } + + /** + * Get the name of a Service Fabric node. + * + * @return the nodeName value + */ + public String nodeName() { + return this.nodeName; + } + + /** + * Set the name of a Service Fabric node. + * + * @param nodeName the nodeName value to set + * @return the DeployedServiceHealthReportExpiredEvent object itself. + */ + public DeployedServiceHealthReportExpiredEvent withNodeName(String nodeName) { + this.nodeName = nodeName; + return this; + } + + /** + * Get id of report source. + * + * @return the sourceId value + */ + public String sourceId() { + return this.sourceId; + } + + /** + * Set id of report source. + * + * @param sourceId the sourceId value to set + * @return the DeployedServiceHealthReportExpiredEvent object itself. + */ + public DeployedServiceHealthReportExpiredEvent withSourceId(String sourceId) { + this.sourceId = sourceId; + return this; + } + + /** + * Get describes the property. + * + * @return the property value + */ + public String property() { + return this.property; + } + + /** + * Set describes the property. + * + * @param property the property value to set + * @return the DeployedServiceHealthReportExpiredEvent object itself. + */ + public DeployedServiceHealthReportExpiredEvent withProperty(String property) { + this.property = property; + return this; + } + + /** + * Get describes the property health state. + * + * @return the healthState value + */ + public String healthState() { + return this.healthState; + } + + /** + * Set describes the property health state. + * + * @param healthState the healthState value to set + * @return the DeployedServiceHealthReportExpiredEvent object itself. + */ + public DeployedServiceHealthReportExpiredEvent withHealthState(String healthState) { + this.healthState = healthState; + return this; + } + + /** + * Get time to live in milli-seconds. + * + * @return the tTLTimespan value + */ + public long tTLTimespan() { + return this.tTLTimespan; + } + + /** + * Set time to live in milli-seconds. + * + * @param tTLTimespan the tTLTimespan value to set + * @return the DeployedServiceHealthReportExpiredEvent object itself. + */ + public DeployedServiceHealthReportExpiredEvent withTTLTimespan(long tTLTimespan) { + this.tTLTimespan = tTLTimespan; + return this; + } + + /** + * Get sequence number of report. + * + * @return the sequenceNumber value + */ + public long sequenceNumber() { + return this.sequenceNumber; + } + + /** + * Set sequence number of report. + * + * @param sequenceNumber the sequenceNumber value to set + * @return the DeployedServiceHealthReportExpiredEvent object itself. + */ + public DeployedServiceHealthReportExpiredEvent withSequenceNumber(long sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get description of report. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of report. + * + * @param description the description value to set + * @return the DeployedServiceHealthReportExpiredEvent object itself. + */ + public DeployedServiceHealthReportExpiredEvent withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get indicates the removal when it expires. + * + * @return the removeWhenExpired value + */ + public boolean removeWhenExpired() { + return this.removeWhenExpired; + } + + /** + * Set indicates the removal when it expires. + * + * @param removeWhenExpired the removeWhenExpired value to set + * @return the DeployedServiceHealthReportExpiredEvent object itself. + */ + public DeployedServiceHealthReportExpiredEvent withRemoveWhenExpired(boolean removeWhenExpired) { + this.removeWhenExpired = removeWhenExpired; + return this; + } + + /** + * Get source time. + * + * @return the sourceUtcTimestamp value + */ + public DateTime sourceUtcTimestamp() { + return this.sourceUtcTimestamp; + } + + /** + * Set source time. + * + * @param sourceUtcTimestamp the sourceUtcTimestamp value to set + * @return the DeployedServiceHealthReportExpiredEvent object itself. + */ + public DeployedServiceHealthReportExpiredEvent withSourceUtcTimestamp(DateTime sourceUtcTimestamp) { + this.sourceUtcTimestamp = sourceUtcTimestamp; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedServicePackageHealthEvaluation.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedServicePackageHealthEvaluation.java new file mode 100644 index 0000000000000..ceba68c6ffff6 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedServicePackageHealthEvaluation.java @@ -0,0 +1,131 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents health evaluation for a deployed service package, 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. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("DeployedServicePackage") +public class DeployedServicePackageHealthEvaluation extends HealthEvaluation { + /** + * The name of a Service Fabric node. + */ + @JsonProperty(value = "NodeName") + private String nodeName; + + /** + * The name of the application, including the 'fabric:' URI scheme. + */ + @JsonProperty(value = "ApplicationName") + private String applicationName; + + /** + * The name of the service manifest. + */ + @JsonProperty(value = "ServiceManifestName") + private String serviceManifestName; + + /** + * List of unhealthy evaluations that led to the current aggregated health + * state. The type of the unhealthy evaluations can be + * EventHealthEvaluation. + */ + @JsonProperty(value = "UnhealthyEvaluations") + private List unhealthyEvaluations; + + /** + * Get the name of a Service Fabric node. + * + * @return the nodeName value + */ + public String nodeName() { + return this.nodeName; + } + + /** + * Set the name of a Service Fabric node. + * + * @param nodeName the nodeName value to set + * @return the DeployedServicePackageHealthEvaluation object itself. + */ + public DeployedServicePackageHealthEvaluation withNodeName(String nodeName) { + this.nodeName = nodeName; + return this; + } + + /** + * Get the name of the application, including the 'fabric:' URI scheme. + * + * @return the applicationName value + */ + public String applicationName() { + return this.applicationName; + } + + /** + * Set the name of the application, including the 'fabric:' URI scheme. + * + * @param applicationName the applicationName value to set + * @return the DeployedServicePackageHealthEvaluation object itself. + */ + public DeployedServicePackageHealthEvaluation withApplicationName(String applicationName) { + this.applicationName = applicationName; + return this; + } + + /** + * Get the name of the service manifest. + * + * @return the serviceManifestName value + */ + public String serviceManifestName() { + return this.serviceManifestName; + } + + /** + * Set the name of the service manifest. + * + * @param serviceManifestName the serviceManifestName value to set + * @return the DeployedServicePackageHealthEvaluation object itself. + */ + public DeployedServicePackageHealthEvaluation withServiceManifestName(String serviceManifestName) { + this.serviceManifestName = serviceManifestName; + return this; + } + + /** + * Get list of unhealthy evaluations that led to the current aggregated health state. The type of the unhealthy evaluations can be EventHealthEvaluation. + * + * @return the unhealthyEvaluations value + */ + public List unhealthyEvaluations() { + return this.unhealthyEvaluations; + } + + /** + * Set list of unhealthy evaluations that led to the current aggregated health state. The type of the unhealthy evaluations can be EventHealthEvaluation. + * + * @param unhealthyEvaluations the unhealthyEvaluations value to set + * @return the DeployedServicePackageHealthEvaluation object itself. + */ + public DeployedServicePackageHealthEvaluation withUnhealthyEvaluations(List unhealthyEvaluations) { + this.unhealthyEvaluations = unhealthyEvaluations; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedServicePackageHealthState.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedServicePackageHealthState.java new file mode 100644 index 0000000000000..1f63af3b23f06 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedServicePackageHealthState.java @@ -0,0 +1,131 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents the health state of a deployed service package, containing the + * entity identifier and the aggregated health state. + */ +public class DeployedServicePackageHealthState extends EntityHealthState { + /** + * Name of the node on which the service package is deployed. + */ + @JsonProperty(value = "NodeName") + private String nodeName; + + /** + * The name of the application, including the 'fabric:' URI scheme. + */ + @JsonProperty(value = "ApplicationName") + private String applicationName; + + /** + * Name of the manifest describing the service package. + */ + @JsonProperty(value = "ServiceManifestName") + private String serviceManifestName; + + /** + * 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. + */ + @JsonProperty(value = "ServicePackageActivationId") + private String servicePackageActivationId; + + /** + * Get name of the node on which the service package is deployed. + * + * @return the nodeName value + */ + public String nodeName() { + return this.nodeName; + } + + /** + * Set name of the node on which the service package is deployed. + * + * @param nodeName the nodeName value to set + * @return the DeployedServicePackageHealthState object itself. + */ + public DeployedServicePackageHealthState withNodeName(String nodeName) { + this.nodeName = nodeName; + return this; + } + + /** + * Get the name of the application, including the 'fabric:' URI scheme. + * + * @return the applicationName value + */ + public String applicationName() { + return this.applicationName; + } + + /** + * Set the name of the application, including the 'fabric:' URI scheme. + * + * @param applicationName the applicationName value to set + * @return the DeployedServicePackageHealthState object itself. + */ + public DeployedServicePackageHealthState withApplicationName(String applicationName) { + this.applicationName = applicationName; + return this; + } + + /** + * Get name of the manifest describing the service package. + * + * @return the serviceManifestName value + */ + public String serviceManifestName() { + return this.serviceManifestName; + } + + /** + * Set name of the manifest describing the service package. + * + * @param serviceManifestName the serviceManifestName value to set + * @return the DeployedServicePackageHealthState object itself. + */ + public DeployedServicePackageHealthState withServiceManifestName(String serviceManifestName) { + this.serviceManifestName = serviceManifestName; + return this; + } + + /** + * Get 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. + * + * @return the servicePackageActivationId value + */ + public String servicePackageActivationId() { + return this.servicePackageActivationId; + } + + /** + * Set 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 servicePackageActivationId the servicePackageActivationId value to set + * @return the DeployedServicePackageHealthState object itself. + */ + public DeployedServicePackageHealthState withServicePackageActivationId(String servicePackageActivationId) { + this.servicePackageActivationId = servicePackageActivationId; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedServicePackageHealthStateChunk.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedServicePackageHealthStateChunk.java new file mode 100644 index 0000000000000..0325ddf93544a --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedServicePackageHealthStateChunk.java @@ -0,0 +1,80 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents the health state chunk of a deployed service package, which + * contains the service manifest name and the service package aggregated health + * state. + */ +public class DeployedServicePackageHealthStateChunk extends EntityHealthStateChunk { + /** + * The name of the service manifest. + */ + @JsonProperty(value = "ServiceManifestName") + private String serviceManifestName; + + /** + * 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. + */ + @JsonProperty(value = "ServicePackageActivationId") + private String servicePackageActivationId; + + /** + * Get the name of the service manifest. + * + * @return the serviceManifestName value + */ + public String serviceManifestName() { + return this.serviceManifestName; + } + + /** + * Set the name of the service manifest. + * + * @param serviceManifestName the serviceManifestName value to set + * @return the DeployedServicePackageHealthStateChunk object itself. + */ + public DeployedServicePackageHealthStateChunk withServiceManifestName(String serviceManifestName) { + this.serviceManifestName = serviceManifestName; + return this; + } + + /** + * Get 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. + * + * @return the servicePackageActivationId value + */ + public String servicePackageActivationId() { + return this.servicePackageActivationId; + } + + /** + * Set 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 servicePackageActivationId the servicePackageActivationId value to set + * @return the DeployedServicePackageHealthStateChunk object itself. + */ + public DeployedServicePackageHealthStateChunk withServicePackageActivationId(String servicePackageActivationId) { + this.servicePackageActivationId = servicePackageActivationId; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedServicePackageHealthStateChunkList.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedServicePackageHealthStateChunkList.java new file mode 100644 index 0000000000000..0087586068eb4 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedServicePackageHealthStateChunkList.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list of deployed service package health state chunks that respect the + * input filters in the chunk query. Returned by get cluster health state + * chunks query. + */ +public class DeployedServicePackageHealthStateChunkList { + /** + * The list of deployed service package health state chunks that respect + * the input filters in the chunk query. + */ + @JsonProperty(value = "Items") + private List items; + + /** + * Get the list of deployed service package health state chunks that respect the input filters in the chunk query. + * + * @return the items value + */ + public List items() { + return this.items; + } + + /** + * Set the list of deployed service package health state chunks that respect the input filters in the chunk query. + * + * @param items the items value to set + * @return the DeployedServicePackageHealthStateChunkList object itself. + */ + public DeployedServicePackageHealthStateChunkList withItems(List items) { + this.items = items; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedServicePackageHealthStateFilter.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedServicePackageHealthStateFilter.java new file mode 100644 index 0000000000000..4ee7d54e644c5 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedServicePackageHealthStateFilter.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines matching criteria to determine whether a deployed service package + * should be included as a child of a deployed application in the cluster + * health chunk. + * The deployed service packages are only returned if the parent entities match + * a filter specified in the cluster health chunk query description. The parent + * deployed application and its parent application must be included in the + * cluster health chunk. + * One filter can match zero, one or multiple deployed service packages, + * depending on its properties. + */ +public class DeployedServicePackageHealthStateFilter { + /** + * The name of the service manifest which identifies the deployed service + * packages that matches the filter. + * If specified, the filter is applied only to the specified deployed + * service packages, if any. + * If no deployed service packages with specified manifest name exist, + * nothing is returned in the cluster health chunk based on this filter. + * If any deployed service package exists, they are included in the cluster + * health chunk if it respects the other filter properties. + * If not specified, all deployed service packages that match the parent + * filters (if any) are taken into consideration and matched against the + * other filter members, like health state filter. + */ + @JsonProperty(value = "ServiceManifestNameFilter") + private String serviceManifestNameFilter; + + /** + * The activation ID of a deployed service package that matches the filter. + * If not specified, the filter applies to all deployed service packages + * that match the other parameters. + * If specified, the filter matches only the deployed service package with + * the specified activation ID. + */ + @JsonProperty(value = "ServicePackageActivationIdFilter") + private String servicePackageActivationIdFilter; + + /** + * The filter for the health state of the deployed service packages. It + * allows selecting deployed service packages if they match the desired + * health states. + * The possible values are 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 parent + * deployed application aggregated health state. + * If not specified, default value is None, unless the deployed service + * package ID is specified. If the filter has default value and deployed + * service package ID is specified, the matching deployed service package + * is returned. + * The state values are flag-based enumeration, so the value could be a + * combination of these values obtained using bitwise 'OR' operator. + * For example, if the provided value is 6, it matches deployed service + * packages with HealthState value of OK (2) and Warning (4). + * + * - 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. + */ + @JsonProperty(value = "HealthStateFilter") + private Integer healthStateFilter; + + /** + * Get the name of the service manifest which identifies the deployed service packages that matches the filter. + If specified, the filter is applied only to the specified deployed service packages, if any. + If no deployed service packages with specified manifest name exist, nothing is returned in the cluster health chunk based on this filter. + If any deployed service package exists, they are included in the cluster health chunk if it respects the other filter properties. + If not specified, all deployed service packages that match the parent filters (if any) are taken into consideration and matched against the other filter members, like health state filter. + * + * @return the serviceManifestNameFilter value + */ + public String serviceManifestNameFilter() { + return this.serviceManifestNameFilter; + } + + /** + * Set the name of the service manifest which identifies the deployed service packages that matches the filter. + If specified, the filter is applied only to the specified deployed service packages, if any. + If no deployed service packages with specified manifest name exist, nothing is returned in the cluster health chunk based on this filter. + If any deployed service package exists, they are included in the cluster health chunk if it respects the other filter properties. + If not specified, all deployed service packages that match the parent filters (if any) are taken into consideration and matched against the other filter members, like health state filter. + * + * @param serviceManifestNameFilter the serviceManifestNameFilter value to set + * @return the DeployedServicePackageHealthStateFilter object itself. + */ + public DeployedServicePackageHealthStateFilter withServiceManifestNameFilter(String serviceManifestNameFilter) { + this.serviceManifestNameFilter = serviceManifestNameFilter; + return this; + } + + /** + * Get the activation ID of a deployed service package that matches the filter. + If not specified, the filter applies to all deployed service packages that match the other parameters. + If specified, the filter matches only the deployed service package with the specified activation ID. + * + * @return the servicePackageActivationIdFilter value + */ + public String servicePackageActivationIdFilter() { + return this.servicePackageActivationIdFilter; + } + + /** + * Set the activation ID of a deployed service package that matches the filter. + If not specified, the filter applies to all deployed service packages that match the other parameters. + If specified, the filter matches only the deployed service package with the specified activation ID. + * + * @param servicePackageActivationIdFilter the servicePackageActivationIdFilter value to set + * @return the DeployedServicePackageHealthStateFilter object itself. + */ + public DeployedServicePackageHealthStateFilter withServicePackageActivationIdFilter(String servicePackageActivationIdFilter) { + this.servicePackageActivationIdFilter = servicePackageActivationIdFilter; + return this; + } + + /** + * Get the filter for the health state of the deployed service packages. It allows selecting deployed service packages if they match the desired health states. + The possible values are 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 parent deployed application aggregated health state. + If not specified, default value is None, unless the deployed service package ID is specified. If the filter has default value and deployed service package ID is specified, the matching deployed service package is returned. + The state values are flag-based enumeration, so the value could be a combination of these values obtained using bitwise 'OR' operator. + For example, if the provided value is 6, it matches deployed service packages with HealthState value of OK (2) and Warning (4). + - Default - Default value. Matches any HealthState. The value is zero. + - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given collection of states. The value is 1. + - Ok - Filter that matches input with HealthState value Ok. The value is 2. + - Warning - Filter that matches input with HealthState value Warning. The value is 4. + - Error - Filter that matches input with HealthState value Error. The value is 8. + - All - Filter that matches input with any HealthState value. The value is 65535. + * + * @return the healthStateFilter value + */ + public Integer healthStateFilter() { + return this.healthStateFilter; + } + + /** + * Set the filter for the health state of the deployed service packages. It allows selecting deployed service packages if they match the desired health states. + The possible values are 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 parent deployed application aggregated health state. + If not specified, default value is None, unless the deployed service package ID is specified. If the filter has default value and deployed service package ID is specified, the matching deployed service package is returned. + The state values are flag-based enumeration, so the value could be a combination of these values obtained using bitwise 'OR' operator. + For example, if the provided value is 6, it matches deployed service packages with HealthState value of OK (2) and Warning (4). + - 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 healthStateFilter the healthStateFilter value to set + * @return the DeployedServicePackageHealthStateFilter object itself. + */ + public DeployedServicePackageHealthStateFilter withHealthStateFilter(Integer healthStateFilter) { + this.healthStateFilter = healthStateFilter; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedServicePackagesHealthEvaluation.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedServicePackagesHealthEvaluation.java new file mode 100644 index 0000000000000..86ea5cfdbde12 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedServicePackagesHealthEvaluation.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents health evaluation for deployed service packages, containing + * health evaluations for each unhealthy deployed service package that impacted + * current aggregated health state. Can be returned when evaluating deployed + * application health and the aggregated health state is either Error or + * Warning. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("DeployedServicePackages") +public class DeployedServicePackagesHealthEvaluation extends HealthEvaluation { + /** + * Total number of deployed service packages of the deployed application in + * the health store. + */ + @JsonProperty(value = "TotalCount") + private Long totalCount; + + /** + * List of unhealthy evaluations that led to the aggregated health state. + * Includes all the unhealthy DeployedServicePackageHealthEvaluation that + * impacted the aggregated health. + */ + @JsonProperty(value = "UnhealthyEvaluations") + private List unhealthyEvaluations; + + /** + * Get total number of deployed service packages of the deployed application in the health store. + * + * @return the totalCount value + */ + public Long totalCount() { + return this.totalCount; + } + + /** + * Set total number of deployed service packages of the deployed application in the health store. + * + * @param totalCount the totalCount value to set + * @return the DeployedServicePackagesHealthEvaluation object itself. + */ + public DeployedServicePackagesHealthEvaluation withTotalCount(Long totalCount) { + this.totalCount = totalCount; + return this; + } + + /** + * Get list of unhealthy evaluations that led to the aggregated health state. Includes all the unhealthy DeployedServicePackageHealthEvaluation that impacted the aggregated health. + * + * @return the unhealthyEvaluations value + */ + public List unhealthyEvaluations() { + return this.unhealthyEvaluations; + } + + /** + * Set list of unhealthy evaluations that led to the aggregated health state. Includes all the unhealthy DeployedServicePackageHealthEvaluation that impacted the aggregated health. + * + * @param unhealthyEvaluations the unhealthyEvaluations value to set + * @return the DeployedServicePackagesHealthEvaluation object itself. + */ + public DeployedServicePackagesHealthEvaluation withUnhealthyEvaluations(List unhealthyEvaluations) { + this.unhealthyEvaluations = unhealthyEvaluations; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedStatefulServiceReplicaDetailInfo.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedStatefulServiceReplicaDetailInfo.java new file mode 100644 index 0000000000000..f2c6ab5ee2e53 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedStatefulServiceReplicaDetailInfo.java @@ -0,0 +1,224 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.DeployedServiceReplicaDetailInfoInner; + +/** + * Information about a stateful replica running in a code package. Note + * DeployedServiceReplicaQueryResult will contain duplicate data like + * ServiceKind, ServiceName, PartitionId and replicaId. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ServiceKind") +@JsonTypeName("Stateful") +public class DeployedStatefulServiceReplicaDetailInfo extends DeployedServiceReplicaDetailInfoInner { + /** + * 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. + */ + @JsonProperty(value = "ReplicaId") + private String replicaId; + + /** + * Specifies the operation currently being executed by the Replicator. + * Possible values include: 'Invalid', 'None', 'Open', 'ChangeRole', + * 'UpdateEpoch', 'Close', 'Abort', 'OnDataLoss', 'WaitForCatchup', + * 'Build'. + */ + @JsonProperty(value = "CurrentReplicatorOperation") + private ReplicatorOperationName currentReplicatorOperation; + + /** + * Specifies the access status of the partition. Possible values include: + * 'Invalid', 'Granted', 'ReconfigurationPending', 'NotPrimary', + * 'NoWriteQuorum'. + */ + @JsonProperty(value = "ReadStatus") + private PartitionAccessStatus readStatus; + + /** + * Specifies the access status of the partition. Possible values include: + * 'Invalid', 'Granted', 'ReconfigurationPending', 'NotPrimary', + * 'NoWriteQuorum'. + */ + @JsonProperty(value = "WriteStatus") + private PartitionAccessStatus writeStatus; + + /** + * 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. + */ + @JsonProperty(value = "ReplicatorStatus") + private ReplicatorStatus replicatorStatus; + + /** + * Key value store related information for the replica. + */ + @JsonProperty(value = "ReplicaStatus") + private KeyValueStoreReplicaStatus replicaStatus; + + /** + * Information about a stateful service replica deployed on a node. + */ + @JsonProperty(value = "DeployedServiceReplicaQueryResult") + private DeployedStatefulServiceReplicaInfo deployedServiceReplicaQueryResult; + + /** + * Get 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. + * + * @return the replicaId value + */ + public String replicaId() { + return this.replicaId; + } + + /** + * Set 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. + * + * @param replicaId the replicaId value to set + * @return the DeployedStatefulServiceReplicaDetailInfo object itself. + */ + public DeployedStatefulServiceReplicaDetailInfo withReplicaId(String replicaId) { + this.replicaId = replicaId; + return this; + } + + /** + * Get specifies the operation currently being executed by the Replicator. Possible values include: 'Invalid', 'None', 'Open', 'ChangeRole', 'UpdateEpoch', 'Close', 'Abort', 'OnDataLoss', 'WaitForCatchup', 'Build'. + * + * @return the currentReplicatorOperation value + */ + public ReplicatorOperationName currentReplicatorOperation() { + return this.currentReplicatorOperation; + } + + /** + * Set specifies the operation currently being executed by the Replicator. Possible values include: 'Invalid', 'None', 'Open', 'ChangeRole', 'UpdateEpoch', 'Close', 'Abort', 'OnDataLoss', 'WaitForCatchup', 'Build'. + * + * @param currentReplicatorOperation the currentReplicatorOperation value to set + * @return the DeployedStatefulServiceReplicaDetailInfo object itself. + */ + public DeployedStatefulServiceReplicaDetailInfo withCurrentReplicatorOperation(ReplicatorOperationName currentReplicatorOperation) { + this.currentReplicatorOperation = currentReplicatorOperation; + return this; + } + + /** + * Get specifies the access status of the partition. Possible values include: 'Invalid', 'Granted', 'ReconfigurationPending', 'NotPrimary', 'NoWriteQuorum'. + * + * @return the readStatus value + */ + public PartitionAccessStatus readStatus() { + return this.readStatus; + } + + /** + * Set specifies the access status of the partition. Possible values include: 'Invalid', 'Granted', 'ReconfigurationPending', 'NotPrimary', 'NoWriteQuorum'. + * + * @param readStatus the readStatus value to set + * @return the DeployedStatefulServiceReplicaDetailInfo object itself. + */ + public DeployedStatefulServiceReplicaDetailInfo withReadStatus(PartitionAccessStatus readStatus) { + this.readStatus = readStatus; + return this; + } + + /** + * Get specifies the access status of the partition. Possible values include: 'Invalid', 'Granted', 'ReconfigurationPending', 'NotPrimary', 'NoWriteQuorum'. + * + * @return the writeStatus value + */ + public PartitionAccessStatus writeStatus() { + return this.writeStatus; + } + + /** + * Set specifies the access status of the partition. Possible values include: 'Invalid', 'Granted', 'ReconfigurationPending', 'NotPrimary', 'NoWriteQuorum'. + * + * @param writeStatus the writeStatus value to set + * @return the DeployedStatefulServiceReplicaDetailInfo object itself. + */ + public DeployedStatefulServiceReplicaDetailInfo withWriteStatus(PartitionAccessStatus writeStatus) { + this.writeStatus = writeStatus; + return this; + } + + /** + * Get 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. + * + * @return the replicatorStatus value + */ + public ReplicatorStatus replicatorStatus() { + return this.replicatorStatus; + } + + /** + * Set 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. + * + * @param replicatorStatus the replicatorStatus value to set + * @return the DeployedStatefulServiceReplicaDetailInfo object itself. + */ + public DeployedStatefulServiceReplicaDetailInfo withReplicatorStatus(ReplicatorStatus replicatorStatus) { + this.replicatorStatus = replicatorStatus; + return this; + } + + /** + * Get key value store related information for the replica. + * + * @return the replicaStatus value + */ + public KeyValueStoreReplicaStatus replicaStatus() { + return this.replicaStatus; + } + + /** + * Set key value store related information for the replica. + * + * @param replicaStatus the replicaStatus value to set + * @return the DeployedStatefulServiceReplicaDetailInfo object itself. + */ + public DeployedStatefulServiceReplicaDetailInfo withReplicaStatus(KeyValueStoreReplicaStatus replicaStatus) { + this.replicaStatus = replicaStatus; + return this; + } + + /** + * Get information about a stateful service replica deployed on a node. + * + * @return the deployedServiceReplicaQueryResult value + */ + public DeployedStatefulServiceReplicaInfo deployedServiceReplicaQueryResult() { + return this.deployedServiceReplicaQueryResult; + } + + /** + * Set information about a stateful service replica deployed on a node. + * + * @param deployedServiceReplicaQueryResult the deployedServiceReplicaQueryResult value to set + * @return the DeployedStatefulServiceReplicaDetailInfo object itself. + */ + public DeployedStatefulServiceReplicaDetailInfo withDeployedServiceReplicaQueryResult(DeployedStatefulServiceReplicaInfo deployedServiceReplicaQueryResult) { + this.deployedServiceReplicaQueryResult = deployedServiceReplicaQueryResult; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedStatefulServiceReplicaInfo.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedStatefulServiceReplicaInfo.java new file mode 100644 index 0000000000000..aa7e55a770b0b --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedStatefulServiceReplicaInfo.java @@ -0,0 +1,108 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.DeployedServiceReplicaInfoInner; + +/** + * Information about a stateful service replica deployed on a node. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ServiceKind") +@JsonTypeName("Stateful") +public class DeployedStatefulServiceReplicaInfo extends DeployedServiceReplicaInfoInner { + /** + * 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. + */ + @JsonProperty(value = "ReplicaId") + private String replicaId; + + /** + * The role of a replica of a stateful service. Possible values include: + * 'Unknown', 'None', 'Primary', 'IdleSecondary', 'ActiveSecondary'. + */ + @JsonProperty(value = "ReplicaRole") + private ReplicaRole replicaRole; + + /** + * Information about current reconfiguration like phase, type, previous + * configuration role of replica and reconfiguration start date time. + */ + @JsonProperty(value = "ReconfigurationInformation") + private ReconfigurationInformation reconfigurationInformation; + + /** + * Get 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. + * + * @return the replicaId value + */ + public String replicaId() { + return this.replicaId; + } + + /** + * Set 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. + * + * @param replicaId the replicaId value to set + * @return the DeployedStatefulServiceReplicaInfo object itself. + */ + public DeployedStatefulServiceReplicaInfo withReplicaId(String replicaId) { + this.replicaId = replicaId; + return this; + } + + /** + * Get the role of a replica of a stateful service. Possible values include: 'Unknown', 'None', 'Primary', 'IdleSecondary', 'ActiveSecondary'. + * + * @return the replicaRole value + */ + public ReplicaRole replicaRole() { + return this.replicaRole; + } + + /** + * Set the role of a replica of a stateful service. Possible values include: 'Unknown', 'None', 'Primary', 'IdleSecondary', 'ActiveSecondary'. + * + * @param replicaRole the replicaRole value to set + * @return the DeployedStatefulServiceReplicaInfo object itself. + */ + public DeployedStatefulServiceReplicaInfo withReplicaRole(ReplicaRole replicaRole) { + this.replicaRole = replicaRole; + return this; + } + + /** + * Get information about current reconfiguration like phase, type, previous configuration role of replica and reconfiguration start date time. + * + * @return the reconfigurationInformation value + */ + public ReconfigurationInformation reconfigurationInformation() { + return this.reconfigurationInformation; + } + + /** + * Set information about current reconfiguration like phase, type, previous configuration role of replica and reconfiguration start date time. + * + * @param reconfigurationInformation the reconfigurationInformation value to set + * @return the DeployedStatefulServiceReplicaInfo object itself. + */ + public DeployedStatefulServiceReplicaInfo withReconfigurationInformation(ReconfigurationInformation reconfigurationInformation) { + this.reconfigurationInformation = reconfigurationInformation; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedStatelessServiceInstanceDetailInfo.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedStatelessServiceInstanceDetailInfo.java new file mode 100644 index 0000000000000..c6ea809f3545a --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedStatelessServiceInstanceDetailInfo.java @@ -0,0 +1,80 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.DeployedServiceReplicaDetailInfoInner; + +/** + * Information about a stateless instance running in a code package. Note that + * DeployedServiceReplicaQueryResult will contain duplicate data like + * ServiceKind, ServiceName, PartitionId and InstanceId. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ServiceKind") +@JsonTypeName("Stateless") +public class DeployedStatelessServiceInstanceDetailInfo extends DeployedServiceReplicaDetailInfoInner { + /** + * 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. + */ + @JsonProperty(value = "InstanceId") + private String instanceId; + + /** + * Information about a stateless service instance deployed on a node. + */ + @JsonProperty(value = "DeployedServiceReplicaQueryResult") + private DeployedStatelessServiceInstanceInfo deployedServiceReplicaQueryResult; + + /** + * Get 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. + * + * @return the instanceId value + */ + public String instanceId() { + return this.instanceId; + } + + /** + * Set 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. + * + * @param instanceId the instanceId value to set + * @return the DeployedStatelessServiceInstanceDetailInfo object itself. + */ + public DeployedStatelessServiceInstanceDetailInfo withInstanceId(String instanceId) { + this.instanceId = instanceId; + return this; + } + + /** + * Get information about a stateless service instance deployed on a node. + * + * @return the deployedServiceReplicaQueryResult value + */ + public DeployedStatelessServiceInstanceInfo deployedServiceReplicaQueryResult() { + return this.deployedServiceReplicaQueryResult; + } + + /** + * Set information about a stateless service instance deployed on a node. + * + * @param deployedServiceReplicaQueryResult the deployedServiceReplicaQueryResult value to set + * @return the DeployedStatelessServiceInstanceDetailInfo object itself. + */ + public DeployedStatelessServiceInstanceDetailInfo withDeployedServiceReplicaQueryResult(DeployedStatelessServiceInstanceInfo deployedServiceReplicaQueryResult) { + this.deployedServiceReplicaQueryResult = deployedServiceReplicaQueryResult; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedStatelessServiceInstanceInfo.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedStatelessServiceInstanceInfo.java new file mode 100644 index 0000000000000..4a9ecc329dfd6 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedStatelessServiceInstanceInfo.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.DeployedServiceReplicaInfoInner; + +/** + * Information about a stateless service instance deployed on a node. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ServiceKind") +@JsonTypeName("Stateless") +public class DeployedStatelessServiceInstanceInfo extends DeployedServiceReplicaInfoInner { + /** + * 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. + */ + @JsonProperty(value = "InstanceId") + private String instanceId; + + /** + * Get 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. + * + * @return the instanceId value + */ + public String instanceId() { + return this.instanceId; + } + + /** + * Set 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. + * + * @param instanceId the instanceId value to set + * @return the DeployedStatelessServiceInstanceInfo object itself. + */ + public DeployedStatelessServiceInstanceInfo withInstanceId(String instanceId) { + this.instanceId = instanceId; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeploymentStatus.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeploymentStatus.java new file mode 100644 index 0000000000000..e77c6c7a8db18 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeploymentStatus.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DeploymentStatus. + */ +public final class DeploymentStatus extends ExpandableStringEnum { + /** Static value Invalid for DeploymentStatus. */ + public static final DeploymentStatus INVALID = fromString("Invalid"); + + /** Static value Downloading for DeploymentStatus. */ + public static final DeploymentStatus DOWNLOADING = fromString("Downloading"); + + /** Static value Activating for DeploymentStatus. */ + public static final DeploymentStatus ACTIVATING = fromString("Activating"); + + /** Static value Active for DeploymentStatus. */ + public static final DeploymentStatus ACTIVE = fromString("Active"); + + /** Static value Upgrading for DeploymentStatus. */ + public static final DeploymentStatus UPGRADING = fromString("Upgrading"); + + /** Static value Deactivating for DeploymentStatus. */ + public static final DeploymentStatus DEACTIVATING = fromString("Deactivating"); + + /** + * Creates or finds a DeploymentStatus from its string representation. + * @param name a name to look for + * @return the corresponding DeploymentStatus + */ + @JsonCreator + public static DeploymentStatus fromString(String name) { + return fromString(name, DeploymentStatus.class); + } + + /** + * @return known DeploymentStatus values + */ + public static Collection values() { + return values(DeploymentStatus.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DiagnosticsDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DiagnosticsDescription.java new file mode 100644 index 0000000000000..7165d7f15a755 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DiagnosticsDescription.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the diagnostics options available. + */ +public class DiagnosticsDescription { + /** + * List of supported sinks that can be referenced. + */ + @JsonProperty(value = "sinks") + private List sinks; + + /** + * Status of whether or not sinks are enabled. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /** + * The sinks to be used if diagnostics is enabled. Sink choices can be + * overridden at the service and code package level. + */ + @JsonProperty(value = "defaultSinkRefs") + private List defaultSinkRefs; + + /** + * Get list of supported sinks that can be referenced. + * + * @return the sinks value + */ + public List sinks() { + return this.sinks; + } + + /** + * Set list of supported sinks that can be referenced. + * + * @param sinks the sinks value to set + * @return the DiagnosticsDescription object itself. + */ + public DiagnosticsDescription withSinks(List sinks) { + this.sinks = sinks; + return this; + } + + /** + * Get status of whether or not sinks are enabled. + * + * @return the enabled value + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set status of whether or not sinks are enabled. + * + * @param enabled the enabled value to set + * @return the DiagnosticsDescription object itself. + */ + public DiagnosticsDescription withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the sinks to be used if diagnostics is enabled. Sink choices can be overridden at the service and code package level. + * + * @return the defaultSinkRefs value + */ + public List defaultSinkRefs() { + return this.defaultSinkRefs; + } + + /** + * Set the sinks to be used if diagnostics is enabled. Sink choices can be overridden at the service and code package level. + * + * @param defaultSinkRefs the defaultSinkRefs value to set + * @return the DiagnosticsDescription object itself. + */ + public DiagnosticsDescription withDefaultSinkRefs(List defaultSinkRefs) { + this.defaultSinkRefs = defaultSinkRefs; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DiagnosticsRef.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DiagnosticsRef.java new file mode 100644 index 0000000000000..6a063d2b180ac --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DiagnosticsRef.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Reference to sinks in DiagnosticsDescription. + */ +public class DiagnosticsRef { + /** + * Status of whether or not sinks are enabled. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /** + * List of sinks to be used if enabled. References the list of sinks in + * DiagnosticsDescription. + */ + @JsonProperty(value = "sinkRefs") + private List sinkRefs; + + /** + * Get status of whether or not sinks are enabled. + * + * @return the enabled value + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set status of whether or not sinks are enabled. + * + * @param enabled the enabled value to set + * @return the DiagnosticsRef object itself. + */ + public DiagnosticsRef withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get list of sinks to be used if enabled. References the list of sinks in DiagnosticsDescription. + * + * @return the sinkRefs value + */ + public List sinkRefs() { + return this.sinkRefs; + } + + /** + * Set list of sinks to be used if enabled. References the list of sinks in DiagnosticsDescription. + * + * @param sinkRefs the sinkRefs value to set + * @return the DiagnosticsRef object itself. + */ + public DiagnosticsRef withSinkRefs(List sinkRefs) { + this.sinkRefs = sinkRefs; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DiagnosticsSinkKind.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DiagnosticsSinkKind.java new file mode 100644 index 0000000000000..4684e447269c0 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DiagnosticsSinkKind.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DiagnosticsSinkKind. + */ +public final class DiagnosticsSinkKind extends ExpandableStringEnum { + /** Static value Invalid for DiagnosticsSinkKind. */ + public static final DiagnosticsSinkKind INVALID = fromString("Invalid"); + + /** Static value AzureInternalMonitoringPipeline for DiagnosticsSinkKind. */ + public static final DiagnosticsSinkKind AZURE_INTERNAL_MONITORING_PIPELINE = fromString("AzureInternalMonitoringPipeline"); + + /** + * Creates or finds a DiagnosticsSinkKind from its string representation. + * @param name a name to look for + * @return the corresponding DiagnosticsSinkKind + */ + @JsonCreator + public static DiagnosticsSinkKind fromString(String name) { + return fromString(name, DiagnosticsSinkKind.class); + } + + /** + * @return known DiagnosticsSinkKind values + */ + public static Collection values() { + return values(DiagnosticsSinkKind.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DiagnosticsSinkProperties.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DiagnosticsSinkProperties.java new file mode 100644 index 0000000000000..7770c6ac40345 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DiagnosticsSinkProperties.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Properties of a DiagnosticsSink. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("DiagnosticsSinkProperties") +public class DiagnosticsSinkProperties { + /** + * Name of the sink. This value is referenced by + * DiagnosticsReferenceDescription. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A description of the sink. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get name of the sink. This value is referenced by DiagnosticsReferenceDescription. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the sink. This value is referenced by DiagnosticsReferenceDescription. + * + * @param name the name value to set + * @return the DiagnosticsSinkProperties object itself. + */ + public DiagnosticsSinkProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get a description of the sink. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set a description of the sink. + * + * @param description the description value to set + * @return the DiagnosticsSinkProperties object itself. + */ + public DiagnosticsSinkProperties withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DoublePropertyValue.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DoublePropertyValue.java new file mode 100644 index 0000000000000..04067119db317 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DoublePropertyValue.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes a Service Fabric property value of type Double. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("Double") +public class DoublePropertyValue extends PropertyValue { + /** + * The data of the property value. + */ + @JsonProperty(value = "Data", required = true) + private double data; + + /** + * Get the data of the property value. + * + * @return the data value + */ + public double data() { + return this.data; + } + + /** + * Set the data of the property value. + * + * @param data the data value to set + * @return the DoublePropertyValue object itself. + */ + public DoublePropertyValue withData(double data) { + this.data = data; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EnableBackupDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EnableBackupDescription.java new file mode 100644 index 0000000000000..622b622fe09fb --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EnableBackupDescription.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies the parameters needed to enable periodic backup. + */ +public class EnableBackupDescription { + /** + * Name of the backup policy to be used for enabling periodic backups. + */ + @JsonProperty(value = "BackupPolicyName", required = true) + private String backupPolicyName; + + /** + * Get name of the backup policy to be used for enabling periodic backups. + * + * @return the backupPolicyName value + */ + public String backupPolicyName() { + return this.backupPolicyName; + } + + /** + * Set name of the backup policy to be used for enabling periodic backups. + * + * @param backupPolicyName the backupPolicyName value to set + * @return the EnableBackupDescription object itself. + */ + public EnableBackupDescription withBackupPolicyName(String backupPolicyName) { + this.backupPolicyName = backupPolicyName; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EndpointProperties.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EndpointProperties.java new file mode 100644 index 0000000000000..1b8bce4891021 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EndpointProperties.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a container endpoint. + */ +public class EndpointProperties { + /** + * The name of the endpoint. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Port used by the container. + */ + @JsonProperty(value = "port") + private Integer port; + + /** + * Get the name of the endpoint. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the endpoint. + * + * @param name the name value to set + * @return the EndpointProperties object itself. + */ + public EndpointProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get port used by the container. + * + * @return the port value + */ + public Integer port() { + return this.port; + } + + /** + * Set port used by the container. + * + * @param port the port value to set + * @return the EndpointProperties object itself. + */ + public EndpointProperties withPort(Integer port) { + this.port = port; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EnsureAvailabilitySafetyCheck.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EnsureAvailabilitySafetyCheck.java new file mode 100644 index 0000000000000..02ca1e0158458 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EnsureAvailabilitySafetyCheck.java @@ -0,0 +1,22 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Safety check that waits to ensure the availability of the partition. It + * waits until there are replicas available such that bringing down this + * replica will not cause availability loss for the partition. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("EnsureAvailability") +public class EnsureAvailabilitySafetyCheck extends PartitionSafetyCheck { +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EnsurePartitionQurumSafetyCheck.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EnsurePartitionQurumSafetyCheck.java new file mode 100644 index 0000000000000..e2cf066f3128f --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EnsurePartitionQurumSafetyCheck.java @@ -0,0 +1,21 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Safety check that ensures that a quorum of replicas are not lost for a + * partition. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("EnsurePartitionQuorum") +public class EnsurePartitionQurumSafetyCheck extends PartitionSafetyCheck { +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EntityHealth.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EntityHealth.java new file mode 100644 index 0000000000000..cd39c5870ffb0 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EntityHealth.java @@ -0,0 +1,137 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Health information common to all entities in the cluster. It contains the + * aggregated health state, health events and unhealthy evaluation. + */ +public class EntityHealth { + /** + * 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'. + */ + @JsonProperty(value = "AggregatedHealthState") + private HealthState aggregatedHealthState; + + /** + * The list of health events reported on the entity. + */ + @JsonProperty(value = "HealthEvents") + private List healthEvents; + + /** + * The unhealthy evaluations that show why the current aggregated health + * state was returned by Health Manager. + */ + @JsonProperty(value = "UnhealthyEvaluations") + private List unhealthyEvaluations; + + /** + * Shows the health statistics for all children types of the queried + * entity. + */ + @JsonProperty(value = "HealthStatistics") + private HealthStatistics healthStatistics; + + /** + * Get 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'. + * + * @return the aggregatedHealthState value + */ + public HealthState aggregatedHealthState() { + return this.aggregatedHealthState; + } + + /** + * Set 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'. + * + * @param aggregatedHealthState the aggregatedHealthState value to set + * @return the EntityHealth object itself. + */ + public EntityHealth withAggregatedHealthState(HealthState aggregatedHealthState) { + this.aggregatedHealthState = aggregatedHealthState; + return this; + } + + /** + * Get the list of health events reported on the entity. + * + * @return the healthEvents value + */ + public List healthEvents() { + return this.healthEvents; + } + + /** + * Set the list of health events reported on the entity. + * + * @param healthEvents the healthEvents value to set + * @return the EntityHealth object itself. + */ + public EntityHealth withHealthEvents(List healthEvents) { + this.healthEvents = healthEvents; + return this; + } + + /** + * Get the unhealthy evaluations that show why the current aggregated health state was returned by Health Manager. + * + * @return the unhealthyEvaluations value + */ + public List unhealthyEvaluations() { + return this.unhealthyEvaluations; + } + + /** + * Set the unhealthy evaluations that show why the current aggregated health state was returned by Health Manager. + * + * @param unhealthyEvaluations the unhealthyEvaluations value to set + * @return the EntityHealth object itself. + */ + public EntityHealth withUnhealthyEvaluations(List unhealthyEvaluations) { + this.unhealthyEvaluations = unhealthyEvaluations; + return this; + } + + /** + * Get shows the health statistics for all children types of the queried entity. + * + * @return the healthStatistics value + */ + public HealthStatistics healthStatistics() { + return this.healthStatistics; + } + + /** + * Set shows the health statistics for all children types of the queried entity. + * + * @param healthStatistics the healthStatistics value to set + * @return the EntityHealth object itself. + */ + public EntityHealth withHealthStatistics(HealthStatistics healthStatistics) { + this.healthStatistics = healthStatistics; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EntityHealthState.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EntityHealthState.java new file mode 100644 index 0000000000000..6da5d3e456842 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EntityHealthState.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A base type for the health state of various entities in the cluster. It + * contains the aggregated health state. + */ +public class EntityHealthState { + /** + * 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'. + */ + @JsonProperty(value = "AggregatedHealthState") + private HealthState aggregatedHealthState; + + /** + * Get 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'. + * + * @return the aggregatedHealthState value + */ + public HealthState aggregatedHealthState() { + return this.aggregatedHealthState; + } + + /** + * Set 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 aggregatedHealthState the aggregatedHealthState value to set + * @return the EntityHealthState object itself. + */ + public EntityHealthState withAggregatedHealthState(HealthState aggregatedHealthState) { + this.aggregatedHealthState = aggregatedHealthState; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EntityHealthStateChunk.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EntityHealthStateChunk.java new file mode 100644 index 0000000000000..e429711d607d7 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EntityHealthStateChunk.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A base type for the health state chunk of various entities in the cluster. + * It contains the aggregated health state. + */ +public class EntityHealthStateChunk { + /** + * 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'. + */ + @JsonProperty(value = "HealthState") + private HealthState healthState; + + /** + * Get 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'. + * + * @return the healthState value + */ + public HealthState healthState() { + return this.healthState; + } + + /** + * Set 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 healthState the healthState value to set + * @return the EntityHealthStateChunk object itself. + */ + public EntityHealthStateChunk withHealthState(HealthState healthState) { + this.healthState = healthState; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EntityHealthStateChunkList.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EntityHealthStateChunkList.java new file mode 100644 index 0000000000000..1bd75d3a981b1 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EntityHealthStateChunkList.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A base type for the list of health state chunks found in the cluster. It + * contains the total number of health states that match the input filters. + */ +public class EntityHealthStateChunkList { + /** + * Total number of entity health state objects that match the specified + * filters from the cluster health chunk query description. + */ + @JsonProperty(value = "TotalCount") + private Long totalCount; + + /** + * Get total number of entity health state objects that match the specified filters from the cluster health chunk query description. + * + * @return the totalCount value + */ + public Long totalCount() { + return this.totalCount; + } + + /** + * Set total number of entity health state objects that match the specified filters from the cluster health chunk query description. + * + * @param totalCount the totalCount value to set + * @return the EntityHealthStateChunkList object itself. + */ + public EntityHealthStateChunkList withTotalCount(Long totalCount) { + this.totalCount = totalCount; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EntityKind.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EntityKind.java new file mode 100644 index 0000000000000..9ec5c0d9700cc --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EntityKind.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for EntityKind. + */ +public final class EntityKind extends ExpandableStringEnum { + /** Static value Invalid for EntityKind. */ + public static final EntityKind INVALID = fromString("Invalid"); + + /** Static value Node for EntityKind. */ + public static final EntityKind NODE = fromString("Node"); + + /** Static value Partition for EntityKind. */ + public static final EntityKind PARTITION = fromString("Partition"); + + /** Static value Service for EntityKind. */ + public static final EntityKind SERVICE = fromString("Service"); + + /** Static value Application for EntityKind. */ + public static final EntityKind APPLICATION = fromString("Application"); + + /** Static value Replica for EntityKind. */ + public static final EntityKind REPLICA = fromString("Replica"); + + /** Static value DeployedApplication for EntityKind. */ + public static final EntityKind DEPLOYED_APPLICATION = fromString("DeployedApplication"); + + /** Static value DeployedServicePackage for EntityKind. */ + public static final EntityKind DEPLOYED_SERVICE_PACKAGE = fromString("DeployedServicePackage"); + + /** Static value Cluster for EntityKind. */ + public static final EntityKind CLUSTER = fromString("Cluster"); + + /** + * Creates or finds a EntityKind from its string representation. + * @param name a name to look for + * @return the corresponding EntityKind + */ + @JsonCreator + public static EntityKind fromString(String name) { + return fromString(name, EntityKind.class); + } + + /** + * @return known EntityKind values + */ + public static Collection values() { + return values(EntityKind.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EntityKindHealthStateCount.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EntityKindHealthStateCount.java new file mode 100644 index 0000000000000..8dca722c82e16 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EntityKindHealthStateCount.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents health state count for entities of the specified entity kind. + */ +public class EntityKindHealthStateCount { + /** + * The entity kind for which health states are evaluated. Possible values + * include: 'Invalid', 'Node', 'Partition', 'Service', 'Application', + * 'Replica', 'DeployedApplication', 'DeployedServicePackage', 'Cluster'. + */ + @JsonProperty(value = "EntityKind") + private EntityKind entityKind; + + /** + * The health state count for the entities of the specified kind. + */ + @JsonProperty(value = "HealthStateCount") + private HealthStateCount healthStateCount; + + /** + * Get the entity kind for which health states are evaluated. Possible values include: 'Invalid', 'Node', 'Partition', 'Service', 'Application', 'Replica', 'DeployedApplication', 'DeployedServicePackage', 'Cluster'. + * + * @return the entityKind value + */ + public EntityKind entityKind() { + return this.entityKind; + } + + /** + * Set the entity kind for which health states are evaluated. Possible values include: 'Invalid', 'Node', 'Partition', 'Service', 'Application', 'Replica', 'DeployedApplication', 'DeployedServicePackage', 'Cluster'. + * + * @param entityKind the entityKind value to set + * @return the EntityKindHealthStateCount object itself. + */ + public EntityKindHealthStateCount withEntityKind(EntityKind entityKind) { + this.entityKind = entityKind; + return this; + } + + /** + * Get the health state count for the entities of the specified kind. + * + * @return the healthStateCount value + */ + public HealthStateCount healthStateCount() { + return this.healthStateCount; + } + + /** + * Set the health state count for the entities of the specified kind. + * + * @param healthStateCount the healthStateCount value to set + * @return the EntityKindHealthStateCount object itself. + */ + public EntityKindHealthStateCount withHealthStateCount(HealthStateCount healthStateCount) { + this.healthStateCount = healthStateCount; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EntryPointStatus.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EntryPointStatus.java new file mode 100644 index 0000000000000..6786922ac03cd --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EntryPointStatus.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for EntryPointStatus. + */ +public final class EntryPointStatus extends ExpandableStringEnum { + /** Static value Invalid for EntryPointStatus. */ + public static final EntryPointStatus INVALID = fromString("Invalid"); + + /** Static value Pending for EntryPointStatus. */ + public static final EntryPointStatus PENDING = fromString("Pending"); + + /** Static value Starting for EntryPointStatus. */ + public static final EntryPointStatus STARTING = fromString("Starting"); + + /** Static value Started for EntryPointStatus. */ + public static final EntryPointStatus STARTED = fromString("Started"); + + /** Static value Stopping for EntryPointStatus. */ + public static final EntryPointStatus STOPPING = fromString("Stopping"); + + /** Static value Stopped for EntryPointStatus. */ + public static final EntryPointStatus STOPPED = fromString("Stopped"); + + /** + * Creates or finds a EntryPointStatus from its string representation. + * @param name a name to look for + * @return the corresponding EntryPointStatus + */ + @JsonCreator + public static EntryPointStatus fromString(String name) { + return fromString(name, EntryPointStatus.class); + } + + /** + * @return known EntryPointStatus values + */ + public static Collection values() { + return values(EntryPointStatus.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EnvironmentVariable.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EnvironmentVariable.java new file mode 100644 index 0000000000000..f9c8b530f85db --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EnvironmentVariable.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes an environment variable for the container. + */ +public class EnvironmentVariable { + /** + * The name of the environment variable. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The value of the environment variable. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the name of the environment variable. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the environment variable. + * + * @param name the name value to set + * @return the EnvironmentVariable object itself. + */ + public EnvironmentVariable withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value of the environment variable. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the value of the environment variable. + * + * @param value the value value to set + * @return the EnvironmentVariable object itself. + */ + public EnvironmentVariable withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/Epoch.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/Epoch.java new file mode 100644 index 0000000000000..0629c511dab40 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/Epoch.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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. + */ +public class Epoch { + /** + * 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. + */ + @JsonProperty(value = "ConfigurationVersion") + private String configurationVersion; + + /** + * 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. + */ + @JsonProperty(value = "DataLossVersion") + private String dataLossVersion; + + /** + * Get 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. + * + * @return the configurationVersion value + */ + public String configurationVersion() { + return this.configurationVersion; + } + + /** + * Set 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. + * + * @param configurationVersion the configurationVersion value to set + * @return the Epoch object itself. + */ + public Epoch withConfigurationVersion(String configurationVersion) { + this.configurationVersion = configurationVersion; + return this; + } + + /** + * Get 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. + * + * @return the dataLossVersion value + */ + public String dataLossVersion() { + return this.dataLossVersion; + } + + /** + * Set 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. + * + * @param dataLossVersion the dataLossVersion value to set + * @return the Epoch object itself. + */ + public Epoch withDataLossVersion(String dataLossVersion) { + this.dataLossVersion = dataLossVersion; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EventHealthEvaluation.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EventHealthEvaluation.java new file mode 100644 index 0000000000000..d73d36036e6db --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EventHealthEvaluation.java @@ -0,0 +1,79 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents health evaluation of a HealthEvent that was reported on the + * entity. + * The health evaluation is returned when evaluating health of an entity + * results in Error or Warning. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("Event") +public class EventHealthEvaluation extends HealthEvaluation { + /** + * Indicates whether warnings are treated with the same severity as errors. + * The field is specified in the health policy used to evaluate the entity. + */ + @JsonProperty(value = "ConsiderWarningAsError") + private Boolean considerWarningAsError; + + /** + * Represents health information reported on a health entity, such as + * cluster, application or node, with additional metadata added by the + * Health Manager. + */ + @JsonProperty(value = "UnhealthyEvent") + private HealthEvent unhealthyEvent; + + /** + * Get indicates whether warnings are treated with the same severity as errors. The field is specified in the health policy used to evaluate the entity. + * + * @return the considerWarningAsError value + */ + public Boolean considerWarningAsError() { + return this.considerWarningAsError; + } + + /** + * Set indicates whether warnings are treated with the same severity as errors. The field is specified in the health policy used to evaluate the entity. + * + * @param considerWarningAsError the considerWarningAsError value to set + * @return the EventHealthEvaluation object itself. + */ + public EventHealthEvaluation withConsiderWarningAsError(Boolean considerWarningAsError) { + this.considerWarningAsError = considerWarningAsError; + return this; + } + + /** + * Get represents health information reported on a health entity, such as cluster, application or node, with additional metadata added by the Health Manager. + * + * @return the unhealthyEvent value + */ + public HealthEvent unhealthyEvent() { + return this.unhealthyEvent; + } + + /** + * Set represents health information reported on a health entity, such as cluster, application or node, with additional metadata added by the Health Manager. + * + * @param unhealthyEvent the unhealthyEvent value to set + * @return the EventHealthEvaluation object itself. + */ + public EventHealthEvaluation withUnhealthyEvent(HealthEvent unhealthyEvent) { + this.unhealthyEvent = unhealthyEvent; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ExecutingFaultsChaosEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ExecutingFaultsChaosEvent.java new file mode 100644 index 0000000000000..dcd6d7800dd01 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ExecutingFaultsChaosEvent.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes a Chaos event that gets generated when Chaos has decided on the + * faults for an iteration. This Chaos event contains the details of the faults + * as a list of strings. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ExecutingFaults") +public class ExecutingFaultsChaosEvent extends ChaosEvent { + /** + * List of string description of the faults that Chaos decided to execute + * in an iteration. + */ + @JsonProperty(value = "Faults") + private List faults; + + /** + * Get list of string description of the faults that Chaos decided to execute in an iteration. + * + * @return the faults value + */ + public List faults() { + return this.faults; + } + + /** + * Set list of string description of the faults that Chaos decided to execute in an iteration. + * + * @param faults the faults value to set + * @return the ExecutingFaultsChaosEvent object itself. + */ + public ExecutingFaultsChaosEvent withFaults(List faults) { + this.faults = faults; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ExternalStoreProvisionApplicationTypeDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ExternalStoreProvisionApplicationTypeDescription.java new file mode 100644 index 0000000000000..f89e500685e84 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ExternalStoreProvisionApplicationTypeDescription.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the operation to register or provision an application type using + * an application package from an external store instead of a package uploaded + * to the Service Fabric image store. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ExternalStore") +public class ExternalStoreProvisionApplicationTypeDescription extends ProvisionApplicationTypeDescriptionBase { + /** + * The path to the '.sfpkg' application package from where the application + * package can be downloaded using HTTP or HTTPS protocols. The application + * package can be stored in an external store that provides GET operation + * to download the file. Supported protocols are HTTP and HTTPS, and the + * path must allow READ access. + */ + @JsonProperty(value = "ApplicationPackageDownloadUri", required = true) + private String applicationPackageDownloadUri; + + /** + * The application type name represents the name of the application type + * found in the application manifest. + */ + @JsonProperty(value = "ApplicationTypeName", required = true) + private String applicationTypeName; + + /** + * The application type version represents the version of the application + * type found in the application manifest. + */ + @JsonProperty(value = "ApplicationTypeVersion", required = true) + private String applicationTypeVersion; + + /** + * Get the path to the '.sfpkg' application package from where the application package can be downloaded using HTTP or HTTPS protocols. The application package can be stored in an external store that provides GET operation to download the file. Supported protocols are HTTP and HTTPS, and the path must allow READ access. + * + * @return the applicationPackageDownloadUri value + */ + public String applicationPackageDownloadUri() { + return this.applicationPackageDownloadUri; + } + + /** + * Set the path to the '.sfpkg' application package from where the application package can be downloaded using HTTP or HTTPS protocols. The application package can be stored in an external store that provides GET operation to download the file. Supported protocols are HTTP and HTTPS, and the path must allow READ access. + * + * @param applicationPackageDownloadUri the applicationPackageDownloadUri value to set + * @return the ExternalStoreProvisionApplicationTypeDescription object itself. + */ + public ExternalStoreProvisionApplicationTypeDescription withApplicationPackageDownloadUri(String applicationPackageDownloadUri) { + this.applicationPackageDownloadUri = applicationPackageDownloadUri; + return this; + } + + /** + * Get the application type name represents the name of the application type found in the application manifest. + * + * @return the applicationTypeName value + */ + public String applicationTypeName() { + return this.applicationTypeName; + } + + /** + * Set the application type name represents the name of the application type found in the application manifest. + * + * @param applicationTypeName the applicationTypeName value to set + * @return the ExternalStoreProvisionApplicationTypeDescription object itself. + */ + public ExternalStoreProvisionApplicationTypeDescription withApplicationTypeName(String applicationTypeName) { + this.applicationTypeName = applicationTypeName; + return this; + } + + /** + * Get the application type version represents the version of the application type found in the application manifest. + * + * @return the applicationTypeVersion value + */ + public String applicationTypeVersion() { + return this.applicationTypeVersion; + } + + /** + * Set the application type version represents the version of the application type found in the application manifest. + * + * @param applicationTypeVersion the applicationTypeVersion value to set + * @return the ExternalStoreProvisionApplicationTypeDescription object itself. + */ + public ExternalStoreProvisionApplicationTypeDescription withApplicationTypeVersion(String applicationTypeVersion) { + this.applicationTypeVersion = applicationTypeVersion; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FabricError.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FabricError.java new file mode 100644 index 0000000000000..6c7db05838d31 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FabricError.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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. + */ +public class FabricError { + /** + * Error object containing error code and error message. + */ + @JsonProperty(value = "Error", required = true) + private FabricErrorError error; + + /** + * Get error object containing error code and error message. + * + * @return the error value + */ + public FabricErrorError error() { + return this.error; + } + + /** + * Set error object containing error code and error message. + * + * @param error the error value to set + * @return the FabricError object itself. + */ + public FabricError withError(FabricErrorError error) { + this.error = error; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FabricErrorCodes.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FabricErrorCodes.java new file mode 100644 index 0000000000000..533453189cb6e --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FabricErrorCodes.java @@ -0,0 +1,284 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for FabricErrorCodes. + */ +public final class FabricErrorCodes extends ExpandableStringEnum { + /** Static value FABRIC_E_INVALID_PARTITION_KEY for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_INVALID_PARTITION_KEY = fromString("FABRIC_E_INVALID_PARTITION_KEY"); + + /** Static value FABRIC_E_IMAGEBUILDER_VALIDATION_ERROR for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_IMAGEBUILDER_VALIDATION_ERROR = fromString("FABRIC_E_IMAGEBUILDER_VALIDATION_ERROR"); + + /** Static value FABRIC_E_INVALID_ADDRESS for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_INVALID_ADDRESS = fromString("FABRIC_E_INVALID_ADDRESS"); + + /** Static value FABRIC_E_APPLICATION_NOT_UPGRADING for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_APPLICATION_NOT_UPGRADING = fromString("FABRIC_E_APPLICATION_NOT_UPGRADING"); + + /** Static value FABRIC_E_APPLICATION_UPGRADE_VALIDATION_ERROR for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_APPLICATION_UPGRADE_VALIDATION_ERROR = fromString("FABRIC_E_APPLICATION_UPGRADE_VALIDATION_ERROR"); + + /** Static value FABRIC_E_FABRIC_NOT_UPGRADING for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_FABRIC_NOT_UPGRADING = fromString("FABRIC_E_FABRIC_NOT_UPGRADING"); + + /** Static value FABRIC_E_FABRIC_UPGRADE_VALIDATION_ERROR for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_FABRIC_UPGRADE_VALIDATION_ERROR = fromString("FABRIC_E_FABRIC_UPGRADE_VALIDATION_ERROR"); + + /** Static value FABRIC_E_INVALID_CONFIGURATION for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_INVALID_CONFIGURATION = fromString("FABRIC_E_INVALID_CONFIGURATION"); + + /** Static value FABRIC_E_INVALID_NAME_URI for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_INVALID_NAME_URI = fromString("FABRIC_E_INVALID_NAME_URI"); + + /** Static value FABRIC_E_PATH_TOO_LONG for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_PATH_TOO_LONG = fromString("FABRIC_E_PATH_TOO_LONG"); + + /** Static value FABRIC_E_KEY_TOO_LARGE for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_KEY_TOO_LARGE = fromString("FABRIC_E_KEY_TOO_LARGE"); + + /** Static value FABRIC_E_SERVICE_AFFINITY_CHAIN_NOT_SUPPORTED for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_SERVICE_AFFINITY_CHAIN_NOT_SUPPORTED = fromString("FABRIC_E_SERVICE_AFFINITY_CHAIN_NOT_SUPPORTED"); + + /** Static value FABRIC_E_INVALID_ATOMIC_GROUP for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_INVALID_ATOMIC_GROUP = fromString("FABRIC_E_INVALID_ATOMIC_GROUP"); + + /** Static value FABRIC_E_VALUE_EMPTY for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_VALUE_EMPTY = fromString("FABRIC_E_VALUE_EMPTY"); + + /** Static value FABRIC_E_NODE_NOT_FOUND for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_NODE_NOT_FOUND = fromString("FABRIC_E_NODE_NOT_FOUND"); + + /** Static value FABRIC_E_APPLICATION_TYPE_NOT_FOUND for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_APPLICATION_TYPE_NOT_FOUND = fromString("FABRIC_E_APPLICATION_TYPE_NOT_FOUND"); + + /** Static value FABRIC_E_APPLICATION_NOT_FOUND for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_APPLICATION_NOT_FOUND = fromString("FABRIC_E_APPLICATION_NOT_FOUND"); + + /** Static value FABRIC_E_SERVICE_TYPE_NOT_FOUND for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_SERVICE_TYPE_NOT_FOUND = fromString("FABRIC_E_SERVICE_TYPE_NOT_FOUND"); + + /** Static value FABRIC_E_SERVICE_DOES_NOT_EXIST for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_SERVICE_DOES_NOT_EXIST = fromString("FABRIC_E_SERVICE_DOES_NOT_EXIST"); + + /** Static value FABRIC_E_SERVICE_TYPE_TEMPLATE_NOT_FOUND for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_SERVICE_TYPE_TEMPLATE_NOT_FOUND = fromString("FABRIC_E_SERVICE_TYPE_TEMPLATE_NOT_FOUND"); + + /** Static value FABRIC_E_CONFIGURATION_SECTION_NOT_FOUND for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_CONFIGURATION_SECTION_NOT_FOUND = fromString("FABRIC_E_CONFIGURATION_SECTION_NOT_FOUND"); + + /** Static value FABRIC_E_PARTITION_NOT_FOUND for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_PARTITION_NOT_FOUND = fromString("FABRIC_E_PARTITION_NOT_FOUND"); + + /** Static value FABRIC_E_REPLICA_DOES_NOT_EXIST for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_REPLICA_DOES_NOT_EXIST = fromString("FABRIC_E_REPLICA_DOES_NOT_EXIST"); + + /** Static value FABRIC_E_SERVICE_GROUP_DOES_NOT_EXIST for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_SERVICE_GROUP_DOES_NOT_EXIST = fromString("FABRIC_E_SERVICE_GROUP_DOES_NOT_EXIST"); + + /** Static value FABRIC_E_CONFIGURATION_PARAMETER_NOT_FOUND for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_CONFIGURATION_PARAMETER_NOT_FOUND = fromString("FABRIC_E_CONFIGURATION_PARAMETER_NOT_FOUND"); + + /** Static value FABRIC_E_DIRECTORY_NOT_FOUND for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_DIRECTORY_NOT_FOUND = fromString("FABRIC_E_DIRECTORY_NOT_FOUND"); + + /** Static value FABRIC_E_FABRIC_VERSION_NOT_FOUND for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_FABRIC_VERSION_NOT_FOUND = fromString("FABRIC_E_FABRIC_VERSION_NOT_FOUND"); + + /** Static value FABRIC_E_FILE_NOT_FOUND for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_FILE_NOT_FOUND = fromString("FABRIC_E_FILE_NOT_FOUND"); + + /** Static value FABRIC_E_NAME_DOES_NOT_EXIST for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_NAME_DOES_NOT_EXIST = fromString("FABRIC_E_NAME_DOES_NOT_EXIST"); + + /** Static value FABRIC_E_PROPERTY_DOES_NOT_EXIST for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_PROPERTY_DOES_NOT_EXIST = fromString("FABRIC_E_PROPERTY_DOES_NOT_EXIST"); + + /** Static value FABRIC_E_ENUMERATION_COMPLETED for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_ENUMERATION_COMPLETED = fromString("FABRIC_E_ENUMERATION_COMPLETED"); + + /** Static value FABRIC_E_SERVICE_MANIFEST_NOT_FOUND for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_SERVICE_MANIFEST_NOT_FOUND = fromString("FABRIC_E_SERVICE_MANIFEST_NOT_FOUND"); + + /** Static value FABRIC_E_KEY_NOT_FOUND for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_KEY_NOT_FOUND = fromString("FABRIC_E_KEY_NOT_FOUND"); + + /** Static value FABRIC_E_HEALTH_ENTITY_NOT_FOUND for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_HEALTH_ENTITY_NOT_FOUND = fromString("FABRIC_E_HEALTH_ENTITY_NOT_FOUND"); + + /** Static value FABRIC_E_APPLICATION_TYPE_ALREADY_EXISTS for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_APPLICATION_TYPE_ALREADY_EXISTS = fromString("FABRIC_E_APPLICATION_TYPE_ALREADY_EXISTS"); + + /** Static value FABRIC_E_APPLICATION_ALREADY_EXISTS for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_APPLICATION_ALREADY_EXISTS = fromString("FABRIC_E_APPLICATION_ALREADY_EXISTS"); + + /** Static value FABRIC_E_APPLICATION_ALREADY_IN_TARGET_VERSION for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_APPLICATION_ALREADY_IN_TARGET_VERSION = fromString("FABRIC_E_APPLICATION_ALREADY_IN_TARGET_VERSION"); + + /** Static value FABRIC_E_APPLICATION_TYPE_PROVISION_IN_PROGRESS for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_APPLICATION_TYPE_PROVISION_IN_PROGRESS = fromString("FABRIC_E_APPLICATION_TYPE_PROVISION_IN_PROGRESS"); + + /** Static value FABRIC_E_APPLICATION_UPGRADE_IN_PROGRESS for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_APPLICATION_UPGRADE_IN_PROGRESS = fromString("FABRIC_E_APPLICATION_UPGRADE_IN_PROGRESS"); + + /** Static value FABRIC_E_SERVICE_ALREADY_EXISTS for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_SERVICE_ALREADY_EXISTS = fromString("FABRIC_E_SERVICE_ALREADY_EXISTS"); + + /** Static value FABRIC_E_SERVICE_GROUP_ALREADY_EXISTS for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_SERVICE_GROUP_ALREADY_EXISTS = fromString("FABRIC_E_SERVICE_GROUP_ALREADY_EXISTS"); + + /** Static value FABRIC_E_APPLICATION_TYPE_IN_USE for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_APPLICATION_TYPE_IN_USE = fromString("FABRIC_E_APPLICATION_TYPE_IN_USE"); + + /** Static value FABRIC_E_FABRIC_ALREADY_IN_TARGET_VERSION for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_FABRIC_ALREADY_IN_TARGET_VERSION = fromString("FABRIC_E_FABRIC_ALREADY_IN_TARGET_VERSION"); + + /** Static value FABRIC_E_FABRIC_VERSION_ALREADY_EXISTS for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_FABRIC_VERSION_ALREADY_EXISTS = fromString("FABRIC_E_FABRIC_VERSION_ALREADY_EXISTS"); + + /** Static value FABRIC_E_FABRIC_VERSION_IN_USE for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_FABRIC_VERSION_IN_USE = fromString("FABRIC_E_FABRIC_VERSION_IN_USE"); + + /** Static value FABRIC_E_FABRIC_UPGRADE_IN_PROGRESS for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_FABRIC_UPGRADE_IN_PROGRESS = fromString("FABRIC_E_FABRIC_UPGRADE_IN_PROGRESS"); + + /** Static value FABRIC_E_NAME_ALREADY_EXISTS for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_NAME_ALREADY_EXISTS = fromString("FABRIC_E_NAME_ALREADY_EXISTS"); + + /** Static value FABRIC_E_NAME_NOT_EMPTY for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_NAME_NOT_EMPTY = fromString("FABRIC_E_NAME_NOT_EMPTY"); + + /** Static value FABRIC_E_PROPERTY_CHECK_FAILED for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_PROPERTY_CHECK_FAILED = fromString("FABRIC_E_PROPERTY_CHECK_FAILED"); + + /** Static value FABRIC_E_SERVICE_METADATA_MISMATCH for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_SERVICE_METADATA_MISMATCH = fromString("FABRIC_E_SERVICE_METADATA_MISMATCH"); + + /** Static value FABRIC_E_SERVICE_TYPE_MISMATCH for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_SERVICE_TYPE_MISMATCH = fromString("FABRIC_E_SERVICE_TYPE_MISMATCH"); + + /** Static value FABRIC_E_HEALTH_STALE_REPORT for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_HEALTH_STALE_REPORT = fromString("FABRIC_E_HEALTH_STALE_REPORT"); + + /** Static value FABRIC_E_SEQUENCE_NUMBER_CHECK_FAILED for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_SEQUENCE_NUMBER_CHECK_FAILED = fromString("FABRIC_E_SEQUENCE_NUMBER_CHECK_FAILED"); + + /** Static value FABRIC_E_NODE_HAS_NOT_STOPPED_YET for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_NODE_HAS_NOT_STOPPED_YET = fromString("FABRIC_E_NODE_HAS_NOT_STOPPED_YET"); + + /** Static value FABRIC_E_INSTANCE_ID_MISMATCH for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_INSTANCE_ID_MISMATCH = fromString("FABRIC_E_INSTANCE_ID_MISMATCH"); + + /** Static value FABRIC_E_VALUE_TOO_LARGE for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_VALUE_TOO_LARGE = fromString("FABRIC_E_VALUE_TOO_LARGE"); + + /** Static value FABRIC_E_NO_WRITE_QUORUM for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_NO_WRITE_QUORUM = fromString("FABRIC_E_NO_WRITE_QUORUM"); + + /** Static value FABRIC_E_NOT_PRIMARY for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_NOT_PRIMARY = fromString("FABRIC_E_NOT_PRIMARY"); + + /** Static value FABRIC_E_NOT_READY for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_NOT_READY = fromString("FABRIC_E_NOT_READY"); + + /** Static value FABRIC_E_RECONFIGURATION_PENDING for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_RECONFIGURATION_PENDING = fromString("FABRIC_E_RECONFIGURATION_PENDING"); + + /** Static value FABRIC_E_SERVICE_OFFLINE for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_SERVICE_OFFLINE = fromString("FABRIC_E_SERVICE_OFFLINE"); + + /** Static value E_ABORT for FabricErrorCodes. */ + public static final FabricErrorCodes E_ABORT = fromString("E_ABORT"); + + /** Static value FABRIC_E_COMMUNICATION_ERROR for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_COMMUNICATION_ERROR = fromString("FABRIC_E_COMMUNICATION_ERROR"); + + /** Static value FABRIC_E_OPERATION_NOT_COMPLETE for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_OPERATION_NOT_COMPLETE = fromString("FABRIC_E_OPERATION_NOT_COMPLETE"); + + /** Static value FABRIC_E_TIMEOUT for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_TIMEOUT = fromString("FABRIC_E_TIMEOUT"); + + /** Static value FABRIC_E_NODE_IS_UP for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_NODE_IS_UP = fromString("FABRIC_E_NODE_IS_UP"); + + /** Static value E_FAIL for FabricErrorCodes. */ + public static final FabricErrorCodes E_FAIL = fromString("E_FAIL"); + + /** Static value FABRIC_E_BACKUP_IS_ENABLED for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_BACKUP_IS_ENABLED = fromString("FABRIC_E_BACKUP_IS_ENABLED"); + + /** Static value FABRIC_E_RESTORE_SOURCE_TARGET_PARTITION_MISMATCH for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_RESTORE_SOURCE_TARGET_PARTITION_MISMATCH = fromString("FABRIC_E_RESTORE_SOURCE_TARGET_PARTITION_MISMATCH"); + + /** Static value FABRIC_E_INVALID_FOR_STATELESS_SERVICES for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_INVALID_FOR_STATELESS_SERVICES = fromString("FABRIC_E_INVALID_FOR_STATELESS_SERVICES"); + + /** Static value FABRIC_E_BACKUP_NOT_ENABLED for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_BACKUP_NOT_ENABLED = fromString("FABRIC_E_BACKUP_NOT_ENABLED"); + + /** Static value FABRIC_E_BACKUP_POLICY_NOT_EXISTING for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_BACKUP_POLICY_NOT_EXISTING = fromString("FABRIC_E_BACKUP_POLICY_NOT_EXISTING"); + + /** Static value FABRIC_E_FAULT_ANALYSIS_SERVICE_NOT_EXISTING for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_FAULT_ANALYSIS_SERVICE_NOT_EXISTING = fromString("FABRIC_E_FAULT_ANALYSIS_SERVICE_NOT_EXISTING"); + + /** Static value FABRIC_E_BACKUP_IN_PROGRESS for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_BACKUP_IN_PROGRESS = fromString("FABRIC_E_BACKUP_IN_PROGRESS"); + + /** Static value FABRIC_E_RESTORE_IN_PROGRESS for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_RESTORE_IN_PROGRESS = fromString("FABRIC_E_RESTORE_IN_PROGRESS"); + + /** Static value FABRIC_E_BACKUP_POLICY_ALREADY_EXISTING for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_BACKUP_POLICY_ALREADY_EXISTING = fromString("FABRIC_E_BACKUP_POLICY_ALREADY_EXISTING"); + + /** Static value FABRIC_E_INVALID_SERVICE_SCALING_POLICY for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_INVALID_SERVICE_SCALING_POLICY = fromString("FABRIC_E_INVALID_SERVICE_SCALING_POLICY"); + + /** Static value E_INVALIDARG for FabricErrorCodes. */ + public static final FabricErrorCodes E_INVALIDARG = fromString("E_INVALIDARG"); + + /** Static value FABRIC_E_SINGLE_INSTANCE_APPLICATION_ALREADY_EXISTS for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_SINGLE_INSTANCE_APPLICATION_ALREADY_EXISTS = fromString("FABRIC_E_SINGLE_INSTANCE_APPLICATION_ALREADY_EXISTS"); + + /** Static value FABRIC_E_SINGLE_INSTANCE_APPLICATION_NOT_FOUND for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_SINGLE_INSTANCE_APPLICATION_NOT_FOUND = fromString("FABRIC_E_SINGLE_INSTANCE_APPLICATION_NOT_FOUND"); + + /** Static value FABRIC_E_VOLUME_ALREADY_EXISTS for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_VOLUME_ALREADY_EXISTS = fromString("FABRIC_E_VOLUME_ALREADY_EXISTS"); + + /** Static value FABRIC_E_VOLUME_NOT_FOUND for FabricErrorCodes. */ + public static final FabricErrorCodes FABRIC_E_VOLUME_NOT_FOUND = fromString("FABRIC_E_VOLUME_NOT_FOUND"); + + /** Static value SerializationError for FabricErrorCodes. */ + public static final FabricErrorCodes SERIALIZATION_ERROR = fromString("SerializationError"); + + /** + * Creates or finds a FabricErrorCodes from its string representation. + * @param name a name to look for + * @return the corresponding FabricErrorCodes + */ + @JsonCreator + public static FabricErrorCodes fromString(String name) { + return fromString(name, FabricErrorCodes.class); + } + + /** + * @return known FabricErrorCodes values + */ + public static Collection values() { + return values(FabricErrorCodes.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FabricErrorError.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FabricErrorError.java new file mode 100644 index 0000000000000..2e76f9c2364c1 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FabricErrorError.java @@ -0,0 +1,415 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error object containing error code and error message. + */ +public class FabricErrorError { + /** + * Defines the fabric error codes that be returned as part of the error + * object in response to Service Fabric API operations that are not + * successful. Following are the error code values that can be returned for + * a specific HTTP status code. + * + * - Possible values of the error code for HTTP status code 400 (Bad + * Request) + * - "FABRIC_E_INVALID_PARTITION_KEY" + * - "FABRIC_E_IMAGEBUILDER_VALIDATION_ERROR" + * - "FABRIC_E_INVALID_ADDRESS" + * - "FABRIC_E_APPLICATION_NOT_UPGRADING" + * - "FABRIC_E_APPLICATION_UPGRADE_VALIDATION_ERROR" + * - "FABRIC_E_FABRIC_NOT_UPGRADING" + * - "FABRIC_E_FABRIC_UPGRADE_VALIDATION_ERROR" + * - "FABRIC_E_INVALID_CONFIGURATION" + * - "FABRIC_E_INVALID_NAME_URI" + * - "FABRIC_E_PATH_TOO_LONG" + * - "FABRIC_E_KEY_TOO_LARGE" + * - "FABRIC_E_SERVICE_AFFINITY_CHAIN_NOT_SUPPORTED" + * - "FABRIC_E_INVALID_ATOMIC_GROUP" + * - "FABRIC_E_VALUE_EMPTY" + * - "FABRIC_E_BACKUP_IS_ENABLED" + * - "FABRIC_E_RESTORE_SOURCE_TARGET_PARTITION_MISMATCH" + * - "FABRIC_E_INVALID_FOR_STATELESS_SERVICES" + * - "FABRIC_E_INVALID_SERVICE_SCALING_POLICY" + * - "E_INVALIDARG" + * + * - Possible values of the error code for HTTP status code 404 (Not Found) + * - "FABRIC_E_NODE_NOT_FOUND" + * - "FABRIC_E_APPLICATION_TYPE_NOT_FOUND" + * - "FABRIC_E_APPLICATION_NOT_FOUND" + * - "FABRIC_E_SERVICE_TYPE_NOT_FOUND" + * - "FABRIC_E_SERVICE_DOES_NOT_EXIST" + * - "FABRIC_E_SERVICE_TYPE_TEMPLATE_NOT_FOUND" + * - "FABRIC_E_CONFIGURATION_SECTION_NOT_FOUND" + * - "FABRIC_E_PARTITION_NOT_FOUND" + * - "FABRIC_E_REPLICA_DOES_NOT_EXIST" + * - "FABRIC_E_SERVICE_GROUP_DOES_NOT_EXIST" + * - "FABRIC_E_CONFIGURATION_PARAMETER_NOT_FOUND" + * - "FABRIC_E_DIRECTORY_NOT_FOUND" + * - "FABRIC_E_FABRIC_VERSION_NOT_FOUND" + * - "FABRIC_E_FILE_NOT_FOUND" + * - "FABRIC_E_NAME_DOES_NOT_EXIST" + * - "FABRIC_E_PROPERTY_DOES_NOT_EXIST" + * - "FABRIC_E_ENUMERATION_COMPLETED" + * - "FABRIC_E_SERVICE_MANIFEST_NOT_FOUND" + * - "FABRIC_E_KEY_NOT_FOUND" + * - "FABRIC_E_HEALTH_ENTITY_NOT_FOUND" + * - "FABRIC_E_BACKUP_NOT_ENABLED" + * - "FABRIC_E_BACKUP_POLICY_NOT_EXISTING" + * - "FABRIC_E_FAULT_ANALYSIS_SERVICE_NOT_EXISTING" + * + * - Possible values of the error code for HTTP status code 409 (Conflict) + * - "FABRIC_E_APPLICATION_TYPE_ALREADY_EXISTS" + * - "FABRIC_E_APPLICATION_ALREADY_EXISTS" + * - "FABRIC_E_APPLICATION_ALREADY_IN_TARGET_VERSION" + * - "FABRIC_E_APPLICATION_TYPE_PROVISION_IN_PROGRESS" + * - "FABRIC_E_APPLICATION_UPGRADE_IN_PROGRESS" + * - "FABRIC_E_SERVICE_ALREADY_EXISTS" + * - "FABRIC_E_SERVICE_GROUP_ALREADY_EXISTS" + * - "FABRIC_E_APPLICATION_TYPE_IN_USE" + * - "FABRIC_E_FABRIC_ALREADY_IN_TARGET_VERSION" + * - "FABRIC_E_FABRIC_VERSION_ALREADY_EXISTS" + * - "FABRIC_E_FABRIC_VERSION_IN_USE" + * - "FABRIC_E_FABRIC_UPGRADE_IN_PROGRESS" + * - "FABRIC_E_NAME_ALREADY_EXISTS" + * - "FABRIC_E_NAME_NOT_EMPTY" + * - "FABRIC_E_PROPERTY_CHECK_FAILED" + * - "FABRIC_E_SERVICE_METADATA_MISMATCH" + * - "FABRIC_E_SERVICE_TYPE_MISMATCH" + * - "FABRIC_E_HEALTH_STALE_REPORT" + * - "FABRIC_E_SEQUENCE_NUMBER_CHECK_FAILED" + * - "FABRIC_E_NODE_HAS_NOT_STOPPED_YET" + * - "FABRIC_E_INSTANCE_ID_MISMATCH" + * - "FABRIC_E_BACKUP_IN_PROGRESS" + * - "FABRIC_E_RESTORE_IN_PROGRESS" + * - "FABRIC_E_BACKUP_POLICY_ALREADY_EXISTING" + * + * - Possible values of the error code for HTTP status code 413 (Request + * Entity Too Large) + * - "FABRIC_E_VALUE_TOO_LARGE" + * + * - Possible values of the error code for HTTP status code 500 (Internal + * Server Error) + * - "FABRIC_E_NODE_IS_UP" + * - "E_FAIL" + * - "FABRIC_E_SINGLE_INSTANCE_APPLICATION_ALREADY_EXISTS" + * - "FABRIC_E_SINGLE_INSTANCE_APPLICATION_NOT_FOUND" + * - "FABRIC_E_VOLUME_ALREADY_EXISTS" + * - "ABRIC_E_VOLUME_NOT_FOUND" + * - "SerializationError" + * + * - Possible values of the error code for HTTP status code 503 (Service + * Unavailable) + * - "FABRIC_E_NO_WRITE_QUORUM" + * - "FABRIC_E_NOT_PRIMARY" + * - "FABRIC_E_NOT_READY" + * - "FABRIC_E_RECONFIGURATION_PENDING" + * - "FABRIC_E_SERVICE_OFFLINE" + * - "E_ABORT" + * - "FABRIC_E_VALUE_TOO_LARGE" + * + * - Possible values of the error code for HTTP status code 504 (Gateway + * Timeout) + * - "FABRIC_E_COMMUNICATION_ERROR" + * - "FABRIC_E_OPERATION_NOT_COMPLETE" + * - "FABRIC_E_TIMEOUT" + * . Possible values include: 'FABRIC_E_INVALID_PARTITION_KEY', + * 'FABRIC_E_IMAGEBUILDER_VALIDATION_ERROR', 'FABRIC_E_INVALID_ADDRESS', + * 'FABRIC_E_APPLICATION_NOT_UPGRADING', + * 'FABRIC_E_APPLICATION_UPGRADE_VALIDATION_ERROR', + * 'FABRIC_E_FABRIC_NOT_UPGRADING', + * 'FABRIC_E_FABRIC_UPGRADE_VALIDATION_ERROR', + * 'FABRIC_E_INVALID_CONFIGURATION', 'FABRIC_E_INVALID_NAME_URI', + * 'FABRIC_E_PATH_TOO_LONG', 'FABRIC_E_KEY_TOO_LARGE', + * 'FABRIC_E_SERVICE_AFFINITY_CHAIN_NOT_SUPPORTED', + * 'FABRIC_E_INVALID_ATOMIC_GROUP', 'FABRIC_E_VALUE_EMPTY', + * 'FABRIC_E_NODE_NOT_FOUND', 'FABRIC_E_APPLICATION_TYPE_NOT_FOUND', + * 'FABRIC_E_APPLICATION_NOT_FOUND', 'FABRIC_E_SERVICE_TYPE_NOT_FOUND', + * 'FABRIC_E_SERVICE_DOES_NOT_EXIST', + * 'FABRIC_E_SERVICE_TYPE_TEMPLATE_NOT_FOUND', + * 'FABRIC_E_CONFIGURATION_SECTION_NOT_FOUND', + * 'FABRIC_E_PARTITION_NOT_FOUND', 'FABRIC_E_REPLICA_DOES_NOT_EXIST', + * 'FABRIC_E_SERVICE_GROUP_DOES_NOT_EXIST', + * 'FABRIC_E_CONFIGURATION_PARAMETER_NOT_FOUND', + * 'FABRIC_E_DIRECTORY_NOT_FOUND', 'FABRIC_E_FABRIC_VERSION_NOT_FOUND', + * 'FABRIC_E_FILE_NOT_FOUND', 'FABRIC_E_NAME_DOES_NOT_EXIST', + * 'FABRIC_E_PROPERTY_DOES_NOT_EXIST', 'FABRIC_E_ENUMERATION_COMPLETED', + * 'FABRIC_E_SERVICE_MANIFEST_NOT_FOUND', 'FABRIC_E_KEY_NOT_FOUND', + * 'FABRIC_E_HEALTH_ENTITY_NOT_FOUND', + * 'FABRIC_E_APPLICATION_TYPE_ALREADY_EXISTS', + * 'FABRIC_E_APPLICATION_ALREADY_EXISTS', + * 'FABRIC_E_APPLICATION_ALREADY_IN_TARGET_VERSION', + * 'FABRIC_E_APPLICATION_TYPE_PROVISION_IN_PROGRESS', + * 'FABRIC_E_APPLICATION_UPGRADE_IN_PROGRESS', + * 'FABRIC_E_SERVICE_ALREADY_EXISTS', + * 'FABRIC_E_SERVICE_GROUP_ALREADY_EXISTS', + * 'FABRIC_E_APPLICATION_TYPE_IN_USE', + * 'FABRIC_E_FABRIC_ALREADY_IN_TARGET_VERSION', + * 'FABRIC_E_FABRIC_VERSION_ALREADY_EXISTS', + * 'FABRIC_E_FABRIC_VERSION_IN_USE', 'FABRIC_E_FABRIC_UPGRADE_IN_PROGRESS', + * 'FABRIC_E_NAME_ALREADY_EXISTS', 'FABRIC_E_NAME_NOT_EMPTY', + * 'FABRIC_E_PROPERTY_CHECK_FAILED', 'FABRIC_E_SERVICE_METADATA_MISMATCH', + * 'FABRIC_E_SERVICE_TYPE_MISMATCH', 'FABRIC_E_HEALTH_STALE_REPORT', + * 'FABRIC_E_SEQUENCE_NUMBER_CHECK_FAILED', + * 'FABRIC_E_NODE_HAS_NOT_STOPPED_YET', 'FABRIC_E_INSTANCE_ID_MISMATCH', + * 'FABRIC_E_VALUE_TOO_LARGE', 'FABRIC_E_NO_WRITE_QUORUM', + * 'FABRIC_E_NOT_PRIMARY', 'FABRIC_E_NOT_READY', + * 'FABRIC_E_RECONFIGURATION_PENDING', 'FABRIC_E_SERVICE_OFFLINE', + * 'E_ABORT', 'FABRIC_E_COMMUNICATION_ERROR', + * 'FABRIC_E_OPERATION_NOT_COMPLETE', 'FABRIC_E_TIMEOUT', + * 'FABRIC_E_NODE_IS_UP', 'E_FAIL', 'FABRIC_E_BACKUP_IS_ENABLED', + * 'FABRIC_E_RESTORE_SOURCE_TARGET_PARTITION_MISMATCH', + * 'FABRIC_E_INVALID_FOR_STATELESS_SERVICES', + * 'FABRIC_E_BACKUP_NOT_ENABLED', 'FABRIC_E_BACKUP_POLICY_NOT_EXISTING', + * 'FABRIC_E_FAULT_ANALYSIS_SERVICE_NOT_EXISTING', + * 'FABRIC_E_BACKUP_IN_PROGRESS', 'FABRIC_E_RESTORE_IN_PROGRESS', + * 'FABRIC_E_BACKUP_POLICY_ALREADY_EXISTING', + * 'FABRIC_E_INVALID_SERVICE_SCALING_POLICY', 'E_INVALIDARG', + * 'FABRIC_E_SINGLE_INSTANCE_APPLICATION_ALREADY_EXISTS', + * 'FABRIC_E_SINGLE_INSTANCE_APPLICATION_NOT_FOUND', + * 'FABRIC_E_VOLUME_ALREADY_EXISTS', 'FABRIC_E_VOLUME_NOT_FOUND', + * 'SerializationError'. + */ + @JsonProperty(value = "Code", required = true) + private FabricErrorCodes code; + + /** + * Error message. + */ + @JsonProperty(value = "Message") + private String message; + + /** + * Get defines the fabric error codes that be returned as part of the error object in response to Service Fabric API operations that are not successful. Following are the error code values that can be returned for a specific HTTP status code. + - Possible values of the error code for HTTP status code 400 (Bad Request) + - "FABRIC_E_INVALID_PARTITION_KEY" + - "FABRIC_E_IMAGEBUILDER_VALIDATION_ERROR" + - "FABRIC_E_INVALID_ADDRESS" + - "FABRIC_E_APPLICATION_NOT_UPGRADING" + - "FABRIC_E_APPLICATION_UPGRADE_VALIDATION_ERROR" + - "FABRIC_E_FABRIC_NOT_UPGRADING" + - "FABRIC_E_FABRIC_UPGRADE_VALIDATION_ERROR" + - "FABRIC_E_INVALID_CONFIGURATION" + - "FABRIC_E_INVALID_NAME_URI" + - "FABRIC_E_PATH_TOO_LONG" + - "FABRIC_E_KEY_TOO_LARGE" + - "FABRIC_E_SERVICE_AFFINITY_CHAIN_NOT_SUPPORTED" + - "FABRIC_E_INVALID_ATOMIC_GROUP" + - "FABRIC_E_VALUE_EMPTY" + - "FABRIC_E_BACKUP_IS_ENABLED" + - "FABRIC_E_RESTORE_SOURCE_TARGET_PARTITION_MISMATCH" + - "FABRIC_E_INVALID_FOR_STATELESS_SERVICES" + - "FABRIC_E_INVALID_SERVICE_SCALING_POLICY" + - "E_INVALIDARG" + - Possible values of the error code for HTTP status code 404 (Not Found) + - "FABRIC_E_NODE_NOT_FOUND" + - "FABRIC_E_APPLICATION_TYPE_NOT_FOUND" + - "FABRIC_E_APPLICATION_NOT_FOUND" + - "FABRIC_E_SERVICE_TYPE_NOT_FOUND" + - "FABRIC_E_SERVICE_DOES_NOT_EXIST" + - "FABRIC_E_SERVICE_TYPE_TEMPLATE_NOT_FOUND" + - "FABRIC_E_CONFIGURATION_SECTION_NOT_FOUND" + - "FABRIC_E_PARTITION_NOT_FOUND" + - "FABRIC_E_REPLICA_DOES_NOT_EXIST" + - "FABRIC_E_SERVICE_GROUP_DOES_NOT_EXIST" + - "FABRIC_E_CONFIGURATION_PARAMETER_NOT_FOUND" + - "FABRIC_E_DIRECTORY_NOT_FOUND" + - "FABRIC_E_FABRIC_VERSION_NOT_FOUND" + - "FABRIC_E_FILE_NOT_FOUND" + - "FABRIC_E_NAME_DOES_NOT_EXIST" + - "FABRIC_E_PROPERTY_DOES_NOT_EXIST" + - "FABRIC_E_ENUMERATION_COMPLETED" + - "FABRIC_E_SERVICE_MANIFEST_NOT_FOUND" + - "FABRIC_E_KEY_NOT_FOUND" + - "FABRIC_E_HEALTH_ENTITY_NOT_FOUND" + - "FABRIC_E_BACKUP_NOT_ENABLED" + - "FABRIC_E_BACKUP_POLICY_NOT_EXISTING" + - "FABRIC_E_FAULT_ANALYSIS_SERVICE_NOT_EXISTING" + - Possible values of the error code for HTTP status code 409 (Conflict) + - "FABRIC_E_APPLICATION_TYPE_ALREADY_EXISTS" + - "FABRIC_E_APPLICATION_ALREADY_EXISTS" + - "FABRIC_E_APPLICATION_ALREADY_IN_TARGET_VERSION" + - "FABRIC_E_APPLICATION_TYPE_PROVISION_IN_PROGRESS" + - "FABRIC_E_APPLICATION_UPGRADE_IN_PROGRESS" + - "FABRIC_E_SERVICE_ALREADY_EXISTS" + - "FABRIC_E_SERVICE_GROUP_ALREADY_EXISTS" + - "FABRIC_E_APPLICATION_TYPE_IN_USE" + - "FABRIC_E_FABRIC_ALREADY_IN_TARGET_VERSION" + - "FABRIC_E_FABRIC_VERSION_ALREADY_EXISTS" + - "FABRIC_E_FABRIC_VERSION_IN_USE" + - "FABRIC_E_FABRIC_UPGRADE_IN_PROGRESS" + - "FABRIC_E_NAME_ALREADY_EXISTS" + - "FABRIC_E_NAME_NOT_EMPTY" + - "FABRIC_E_PROPERTY_CHECK_FAILED" + - "FABRIC_E_SERVICE_METADATA_MISMATCH" + - "FABRIC_E_SERVICE_TYPE_MISMATCH" + - "FABRIC_E_HEALTH_STALE_REPORT" + - "FABRIC_E_SEQUENCE_NUMBER_CHECK_FAILED" + - "FABRIC_E_NODE_HAS_NOT_STOPPED_YET" + - "FABRIC_E_INSTANCE_ID_MISMATCH" + - "FABRIC_E_BACKUP_IN_PROGRESS" + - "FABRIC_E_RESTORE_IN_PROGRESS" + - "FABRIC_E_BACKUP_POLICY_ALREADY_EXISTING" + - Possible values of the error code for HTTP status code 413 (Request Entity Too Large) + - "FABRIC_E_VALUE_TOO_LARGE" + - Possible values of the error code for HTTP status code 500 (Internal Server Error) + - "FABRIC_E_NODE_IS_UP" + - "E_FAIL" + - "FABRIC_E_SINGLE_INSTANCE_APPLICATION_ALREADY_EXISTS" + - "FABRIC_E_SINGLE_INSTANCE_APPLICATION_NOT_FOUND" + - "FABRIC_E_VOLUME_ALREADY_EXISTS" + - "ABRIC_E_VOLUME_NOT_FOUND" + - "SerializationError" + - Possible values of the error code for HTTP status code 503 (Service Unavailable) + - "FABRIC_E_NO_WRITE_QUORUM" + - "FABRIC_E_NOT_PRIMARY" + - "FABRIC_E_NOT_READY" + - "FABRIC_E_RECONFIGURATION_PENDING" + - "FABRIC_E_SERVICE_OFFLINE" + - "E_ABORT" + - "FABRIC_E_VALUE_TOO_LARGE" + - Possible values of the error code for HTTP status code 504 (Gateway Timeout) + - "FABRIC_E_COMMUNICATION_ERROR" + - "FABRIC_E_OPERATION_NOT_COMPLETE" + - "FABRIC_E_TIMEOUT" + . Possible values include: 'FABRIC_E_INVALID_PARTITION_KEY', 'FABRIC_E_IMAGEBUILDER_VALIDATION_ERROR', 'FABRIC_E_INVALID_ADDRESS', 'FABRIC_E_APPLICATION_NOT_UPGRADING', 'FABRIC_E_APPLICATION_UPGRADE_VALIDATION_ERROR', 'FABRIC_E_FABRIC_NOT_UPGRADING', 'FABRIC_E_FABRIC_UPGRADE_VALIDATION_ERROR', 'FABRIC_E_INVALID_CONFIGURATION', 'FABRIC_E_INVALID_NAME_URI', 'FABRIC_E_PATH_TOO_LONG', 'FABRIC_E_KEY_TOO_LARGE', 'FABRIC_E_SERVICE_AFFINITY_CHAIN_NOT_SUPPORTED', 'FABRIC_E_INVALID_ATOMIC_GROUP', 'FABRIC_E_VALUE_EMPTY', 'FABRIC_E_NODE_NOT_FOUND', 'FABRIC_E_APPLICATION_TYPE_NOT_FOUND', 'FABRIC_E_APPLICATION_NOT_FOUND', 'FABRIC_E_SERVICE_TYPE_NOT_FOUND', 'FABRIC_E_SERVICE_DOES_NOT_EXIST', 'FABRIC_E_SERVICE_TYPE_TEMPLATE_NOT_FOUND', 'FABRIC_E_CONFIGURATION_SECTION_NOT_FOUND', 'FABRIC_E_PARTITION_NOT_FOUND', 'FABRIC_E_REPLICA_DOES_NOT_EXIST', 'FABRIC_E_SERVICE_GROUP_DOES_NOT_EXIST', 'FABRIC_E_CONFIGURATION_PARAMETER_NOT_FOUND', 'FABRIC_E_DIRECTORY_NOT_FOUND', 'FABRIC_E_FABRIC_VERSION_NOT_FOUND', 'FABRIC_E_FILE_NOT_FOUND', 'FABRIC_E_NAME_DOES_NOT_EXIST', 'FABRIC_E_PROPERTY_DOES_NOT_EXIST', 'FABRIC_E_ENUMERATION_COMPLETED', 'FABRIC_E_SERVICE_MANIFEST_NOT_FOUND', 'FABRIC_E_KEY_NOT_FOUND', 'FABRIC_E_HEALTH_ENTITY_NOT_FOUND', 'FABRIC_E_APPLICATION_TYPE_ALREADY_EXISTS', 'FABRIC_E_APPLICATION_ALREADY_EXISTS', 'FABRIC_E_APPLICATION_ALREADY_IN_TARGET_VERSION', 'FABRIC_E_APPLICATION_TYPE_PROVISION_IN_PROGRESS', 'FABRIC_E_APPLICATION_UPGRADE_IN_PROGRESS', 'FABRIC_E_SERVICE_ALREADY_EXISTS', 'FABRIC_E_SERVICE_GROUP_ALREADY_EXISTS', 'FABRIC_E_APPLICATION_TYPE_IN_USE', 'FABRIC_E_FABRIC_ALREADY_IN_TARGET_VERSION', 'FABRIC_E_FABRIC_VERSION_ALREADY_EXISTS', 'FABRIC_E_FABRIC_VERSION_IN_USE', 'FABRIC_E_FABRIC_UPGRADE_IN_PROGRESS', 'FABRIC_E_NAME_ALREADY_EXISTS', 'FABRIC_E_NAME_NOT_EMPTY', 'FABRIC_E_PROPERTY_CHECK_FAILED', 'FABRIC_E_SERVICE_METADATA_MISMATCH', 'FABRIC_E_SERVICE_TYPE_MISMATCH', 'FABRIC_E_HEALTH_STALE_REPORT', 'FABRIC_E_SEQUENCE_NUMBER_CHECK_FAILED', 'FABRIC_E_NODE_HAS_NOT_STOPPED_YET', 'FABRIC_E_INSTANCE_ID_MISMATCH', 'FABRIC_E_VALUE_TOO_LARGE', 'FABRIC_E_NO_WRITE_QUORUM', 'FABRIC_E_NOT_PRIMARY', 'FABRIC_E_NOT_READY', 'FABRIC_E_RECONFIGURATION_PENDING', 'FABRIC_E_SERVICE_OFFLINE', 'E_ABORT', 'FABRIC_E_COMMUNICATION_ERROR', 'FABRIC_E_OPERATION_NOT_COMPLETE', 'FABRIC_E_TIMEOUT', 'FABRIC_E_NODE_IS_UP', 'E_FAIL', 'FABRIC_E_BACKUP_IS_ENABLED', 'FABRIC_E_RESTORE_SOURCE_TARGET_PARTITION_MISMATCH', 'FABRIC_E_INVALID_FOR_STATELESS_SERVICES', 'FABRIC_E_BACKUP_NOT_ENABLED', 'FABRIC_E_BACKUP_POLICY_NOT_EXISTING', 'FABRIC_E_FAULT_ANALYSIS_SERVICE_NOT_EXISTING', 'FABRIC_E_BACKUP_IN_PROGRESS', 'FABRIC_E_RESTORE_IN_PROGRESS', 'FABRIC_E_BACKUP_POLICY_ALREADY_EXISTING', 'FABRIC_E_INVALID_SERVICE_SCALING_POLICY', 'E_INVALIDARG', 'FABRIC_E_SINGLE_INSTANCE_APPLICATION_ALREADY_EXISTS', 'FABRIC_E_SINGLE_INSTANCE_APPLICATION_NOT_FOUND', 'FABRIC_E_VOLUME_ALREADY_EXISTS', 'FABRIC_E_VOLUME_NOT_FOUND', 'SerializationError'. + * + * @return the code value + */ + public FabricErrorCodes code() { + return this.code; + } + + /** + * Set defines the fabric error codes that be returned as part of the error object in response to Service Fabric API operations that are not successful. Following are the error code values that can be returned for a specific HTTP status code. + - Possible values of the error code for HTTP status code 400 (Bad Request) + - "FABRIC_E_INVALID_PARTITION_KEY" + - "FABRIC_E_IMAGEBUILDER_VALIDATION_ERROR" + - "FABRIC_E_INVALID_ADDRESS" + - "FABRIC_E_APPLICATION_NOT_UPGRADING" + - "FABRIC_E_APPLICATION_UPGRADE_VALIDATION_ERROR" + - "FABRIC_E_FABRIC_NOT_UPGRADING" + - "FABRIC_E_FABRIC_UPGRADE_VALIDATION_ERROR" + - "FABRIC_E_INVALID_CONFIGURATION" + - "FABRIC_E_INVALID_NAME_URI" + - "FABRIC_E_PATH_TOO_LONG" + - "FABRIC_E_KEY_TOO_LARGE" + - "FABRIC_E_SERVICE_AFFINITY_CHAIN_NOT_SUPPORTED" + - "FABRIC_E_INVALID_ATOMIC_GROUP" + - "FABRIC_E_VALUE_EMPTY" + - "FABRIC_E_BACKUP_IS_ENABLED" + - "FABRIC_E_RESTORE_SOURCE_TARGET_PARTITION_MISMATCH" + - "FABRIC_E_INVALID_FOR_STATELESS_SERVICES" + - "FABRIC_E_INVALID_SERVICE_SCALING_POLICY" + - "E_INVALIDARG" + - Possible values of the error code for HTTP status code 404 (Not Found) + - "FABRIC_E_NODE_NOT_FOUND" + - "FABRIC_E_APPLICATION_TYPE_NOT_FOUND" + - "FABRIC_E_APPLICATION_NOT_FOUND" + - "FABRIC_E_SERVICE_TYPE_NOT_FOUND" + - "FABRIC_E_SERVICE_DOES_NOT_EXIST" + - "FABRIC_E_SERVICE_TYPE_TEMPLATE_NOT_FOUND" + - "FABRIC_E_CONFIGURATION_SECTION_NOT_FOUND" + - "FABRIC_E_PARTITION_NOT_FOUND" + - "FABRIC_E_REPLICA_DOES_NOT_EXIST" + - "FABRIC_E_SERVICE_GROUP_DOES_NOT_EXIST" + - "FABRIC_E_CONFIGURATION_PARAMETER_NOT_FOUND" + - "FABRIC_E_DIRECTORY_NOT_FOUND" + - "FABRIC_E_FABRIC_VERSION_NOT_FOUND" + - "FABRIC_E_FILE_NOT_FOUND" + - "FABRIC_E_NAME_DOES_NOT_EXIST" + - "FABRIC_E_PROPERTY_DOES_NOT_EXIST" + - "FABRIC_E_ENUMERATION_COMPLETED" + - "FABRIC_E_SERVICE_MANIFEST_NOT_FOUND" + - "FABRIC_E_KEY_NOT_FOUND" + - "FABRIC_E_HEALTH_ENTITY_NOT_FOUND" + - "FABRIC_E_BACKUP_NOT_ENABLED" + - "FABRIC_E_BACKUP_POLICY_NOT_EXISTING" + - "FABRIC_E_FAULT_ANALYSIS_SERVICE_NOT_EXISTING" + - Possible values of the error code for HTTP status code 409 (Conflict) + - "FABRIC_E_APPLICATION_TYPE_ALREADY_EXISTS" + - "FABRIC_E_APPLICATION_ALREADY_EXISTS" + - "FABRIC_E_APPLICATION_ALREADY_IN_TARGET_VERSION" + - "FABRIC_E_APPLICATION_TYPE_PROVISION_IN_PROGRESS" + - "FABRIC_E_APPLICATION_UPGRADE_IN_PROGRESS" + - "FABRIC_E_SERVICE_ALREADY_EXISTS" + - "FABRIC_E_SERVICE_GROUP_ALREADY_EXISTS" + - "FABRIC_E_APPLICATION_TYPE_IN_USE" + - "FABRIC_E_FABRIC_ALREADY_IN_TARGET_VERSION" + - "FABRIC_E_FABRIC_VERSION_ALREADY_EXISTS" + - "FABRIC_E_FABRIC_VERSION_IN_USE" + - "FABRIC_E_FABRIC_UPGRADE_IN_PROGRESS" + - "FABRIC_E_NAME_ALREADY_EXISTS" + - "FABRIC_E_NAME_NOT_EMPTY" + - "FABRIC_E_PROPERTY_CHECK_FAILED" + - "FABRIC_E_SERVICE_METADATA_MISMATCH" + - "FABRIC_E_SERVICE_TYPE_MISMATCH" + - "FABRIC_E_HEALTH_STALE_REPORT" + - "FABRIC_E_SEQUENCE_NUMBER_CHECK_FAILED" + - "FABRIC_E_NODE_HAS_NOT_STOPPED_YET" + - "FABRIC_E_INSTANCE_ID_MISMATCH" + - "FABRIC_E_BACKUP_IN_PROGRESS" + - "FABRIC_E_RESTORE_IN_PROGRESS" + - "FABRIC_E_BACKUP_POLICY_ALREADY_EXISTING" + - Possible values of the error code for HTTP status code 413 (Request Entity Too Large) + - "FABRIC_E_VALUE_TOO_LARGE" + - Possible values of the error code for HTTP status code 500 (Internal Server Error) + - "FABRIC_E_NODE_IS_UP" + - "E_FAIL" + - "FABRIC_E_SINGLE_INSTANCE_APPLICATION_ALREADY_EXISTS" + - "FABRIC_E_SINGLE_INSTANCE_APPLICATION_NOT_FOUND" + - "FABRIC_E_VOLUME_ALREADY_EXISTS" + - "ABRIC_E_VOLUME_NOT_FOUND" + - "SerializationError" + - Possible values of the error code for HTTP status code 503 (Service Unavailable) + - "FABRIC_E_NO_WRITE_QUORUM" + - "FABRIC_E_NOT_PRIMARY" + - "FABRIC_E_NOT_READY" + - "FABRIC_E_RECONFIGURATION_PENDING" + - "FABRIC_E_SERVICE_OFFLINE" + - "E_ABORT" + - "FABRIC_E_VALUE_TOO_LARGE" + - Possible values of the error code for HTTP status code 504 (Gateway Timeout) + - "FABRIC_E_COMMUNICATION_ERROR" + - "FABRIC_E_OPERATION_NOT_COMPLETE" + - "FABRIC_E_TIMEOUT" + . Possible values include: 'FABRIC_E_INVALID_PARTITION_KEY', 'FABRIC_E_IMAGEBUILDER_VALIDATION_ERROR', 'FABRIC_E_INVALID_ADDRESS', 'FABRIC_E_APPLICATION_NOT_UPGRADING', 'FABRIC_E_APPLICATION_UPGRADE_VALIDATION_ERROR', 'FABRIC_E_FABRIC_NOT_UPGRADING', 'FABRIC_E_FABRIC_UPGRADE_VALIDATION_ERROR', 'FABRIC_E_INVALID_CONFIGURATION', 'FABRIC_E_INVALID_NAME_URI', 'FABRIC_E_PATH_TOO_LONG', 'FABRIC_E_KEY_TOO_LARGE', 'FABRIC_E_SERVICE_AFFINITY_CHAIN_NOT_SUPPORTED', 'FABRIC_E_INVALID_ATOMIC_GROUP', 'FABRIC_E_VALUE_EMPTY', 'FABRIC_E_NODE_NOT_FOUND', 'FABRIC_E_APPLICATION_TYPE_NOT_FOUND', 'FABRIC_E_APPLICATION_NOT_FOUND', 'FABRIC_E_SERVICE_TYPE_NOT_FOUND', 'FABRIC_E_SERVICE_DOES_NOT_EXIST', 'FABRIC_E_SERVICE_TYPE_TEMPLATE_NOT_FOUND', 'FABRIC_E_CONFIGURATION_SECTION_NOT_FOUND', 'FABRIC_E_PARTITION_NOT_FOUND', 'FABRIC_E_REPLICA_DOES_NOT_EXIST', 'FABRIC_E_SERVICE_GROUP_DOES_NOT_EXIST', 'FABRIC_E_CONFIGURATION_PARAMETER_NOT_FOUND', 'FABRIC_E_DIRECTORY_NOT_FOUND', 'FABRIC_E_FABRIC_VERSION_NOT_FOUND', 'FABRIC_E_FILE_NOT_FOUND', 'FABRIC_E_NAME_DOES_NOT_EXIST', 'FABRIC_E_PROPERTY_DOES_NOT_EXIST', 'FABRIC_E_ENUMERATION_COMPLETED', 'FABRIC_E_SERVICE_MANIFEST_NOT_FOUND', 'FABRIC_E_KEY_NOT_FOUND', 'FABRIC_E_HEALTH_ENTITY_NOT_FOUND', 'FABRIC_E_APPLICATION_TYPE_ALREADY_EXISTS', 'FABRIC_E_APPLICATION_ALREADY_EXISTS', 'FABRIC_E_APPLICATION_ALREADY_IN_TARGET_VERSION', 'FABRIC_E_APPLICATION_TYPE_PROVISION_IN_PROGRESS', 'FABRIC_E_APPLICATION_UPGRADE_IN_PROGRESS', 'FABRIC_E_SERVICE_ALREADY_EXISTS', 'FABRIC_E_SERVICE_GROUP_ALREADY_EXISTS', 'FABRIC_E_APPLICATION_TYPE_IN_USE', 'FABRIC_E_FABRIC_ALREADY_IN_TARGET_VERSION', 'FABRIC_E_FABRIC_VERSION_ALREADY_EXISTS', 'FABRIC_E_FABRIC_VERSION_IN_USE', 'FABRIC_E_FABRIC_UPGRADE_IN_PROGRESS', 'FABRIC_E_NAME_ALREADY_EXISTS', 'FABRIC_E_NAME_NOT_EMPTY', 'FABRIC_E_PROPERTY_CHECK_FAILED', 'FABRIC_E_SERVICE_METADATA_MISMATCH', 'FABRIC_E_SERVICE_TYPE_MISMATCH', 'FABRIC_E_HEALTH_STALE_REPORT', 'FABRIC_E_SEQUENCE_NUMBER_CHECK_FAILED', 'FABRIC_E_NODE_HAS_NOT_STOPPED_YET', 'FABRIC_E_INSTANCE_ID_MISMATCH', 'FABRIC_E_VALUE_TOO_LARGE', 'FABRIC_E_NO_WRITE_QUORUM', 'FABRIC_E_NOT_PRIMARY', 'FABRIC_E_NOT_READY', 'FABRIC_E_RECONFIGURATION_PENDING', 'FABRIC_E_SERVICE_OFFLINE', 'E_ABORT', 'FABRIC_E_COMMUNICATION_ERROR', 'FABRIC_E_OPERATION_NOT_COMPLETE', 'FABRIC_E_TIMEOUT', 'FABRIC_E_NODE_IS_UP', 'E_FAIL', 'FABRIC_E_BACKUP_IS_ENABLED', 'FABRIC_E_RESTORE_SOURCE_TARGET_PARTITION_MISMATCH', 'FABRIC_E_INVALID_FOR_STATELESS_SERVICES', 'FABRIC_E_BACKUP_NOT_ENABLED', 'FABRIC_E_BACKUP_POLICY_NOT_EXISTING', 'FABRIC_E_FAULT_ANALYSIS_SERVICE_NOT_EXISTING', 'FABRIC_E_BACKUP_IN_PROGRESS', 'FABRIC_E_RESTORE_IN_PROGRESS', 'FABRIC_E_BACKUP_POLICY_ALREADY_EXISTING', 'FABRIC_E_INVALID_SERVICE_SCALING_POLICY', 'E_INVALIDARG', 'FABRIC_E_SINGLE_INSTANCE_APPLICATION_ALREADY_EXISTS', 'FABRIC_E_SINGLE_INSTANCE_APPLICATION_NOT_FOUND', 'FABRIC_E_VOLUME_ALREADY_EXISTS', 'FABRIC_E_VOLUME_NOT_FOUND', 'SerializationError'. + * + * @param code the code value to set + * @return the FabricErrorError object itself. + */ + public FabricErrorError withCode(FabricErrorCodes code) { + this.code = code; + return this; + } + + /** + * Get error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set error message. + * + * @param message the message value to set + * @return the FabricErrorError object itself. + */ + public FabricErrorError withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FabricErrorException.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FabricErrorException.java new file mode 100644 index 0000000000000..8aa53623cb0dd --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FabricErrorException.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with FabricError information. + */ +public class FabricErrorException extends RestException { + /** + * Initializes a new instance of the FabricErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public FabricErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the FabricErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public FabricErrorException(final String message, final Response response, final FabricError body) { + super(message, response, body); + } + + @Override + public FabricError body() { + return (FabricError) super.body(); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FabricEventKind.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FabricEventKind.java new file mode 100644 index 0000000000000..f432d25782ba6 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FabricEventKind.java @@ -0,0 +1,239 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for FabricEventKind. + */ +public final class FabricEventKind extends ExpandableStringEnum { + /** Static value ClusterEvent for FabricEventKind. */ + public static final FabricEventKind CLUSTER_EVENT = fromString("ClusterEvent"); + + /** Static value ContainerInstanceEvent for FabricEventKind. */ + public static final FabricEventKind CONTAINER_INSTANCE_EVENT = fromString("ContainerInstanceEvent"); + + /** Static value NodeEvent for FabricEventKind. */ + public static final FabricEventKind NODE_EVENT = fromString("NodeEvent"); + + /** Static value ApplicationEvent for FabricEventKind. */ + public static final FabricEventKind APPLICATION_EVENT = fromString("ApplicationEvent"); + + /** Static value ServiceEvent for FabricEventKind. */ + public static final FabricEventKind SERVICE_EVENT = fromString("ServiceEvent"); + + /** Static value PartitionEvent for FabricEventKind. */ + public static final FabricEventKind PARTITION_EVENT = fromString("PartitionEvent"); + + /** Static value ReplicaEvent for FabricEventKind. */ + public static final FabricEventKind REPLICA_EVENT = fromString("ReplicaEvent"); + + /** Static value PartitionAnalysisEvent for FabricEventKind. */ + public static final FabricEventKind PARTITION_ANALYSIS_EVENT = fromString("PartitionAnalysisEvent"); + + /** Static value ApplicationCreated for FabricEventKind. */ + public static final FabricEventKind APPLICATION_CREATED = fromString("ApplicationCreated"); + + /** Static value ApplicationDeleted for FabricEventKind. */ + public static final FabricEventKind APPLICATION_DELETED = fromString("ApplicationDeleted"); + + /** Static value ApplicationHealthReportCreated for FabricEventKind. */ + public static final FabricEventKind APPLICATION_HEALTH_REPORT_CREATED = fromString("ApplicationHealthReportCreated"); + + /** Static value ApplicationHealthReportExpired for FabricEventKind. */ + public static final FabricEventKind APPLICATION_HEALTH_REPORT_EXPIRED = fromString("ApplicationHealthReportExpired"); + + /** Static value ApplicationUpgradeComplete for FabricEventKind. */ + public static final FabricEventKind APPLICATION_UPGRADE_COMPLETE = fromString("ApplicationUpgradeComplete"); + + /** Static value ApplicationUpgradeDomainComplete for FabricEventKind. */ + public static final FabricEventKind APPLICATION_UPGRADE_DOMAIN_COMPLETE = fromString("ApplicationUpgradeDomainComplete"); + + /** Static value ApplicationUpgradeRollbackComplete for FabricEventKind. */ + public static final FabricEventKind APPLICATION_UPGRADE_ROLLBACK_COMPLETE = fromString("ApplicationUpgradeRollbackComplete"); + + /** Static value ApplicationUpgradeRollbackStart for FabricEventKind. */ + public static final FabricEventKind APPLICATION_UPGRADE_ROLLBACK_START = fromString("ApplicationUpgradeRollbackStart"); + + /** Static value ApplicationUpgradeStart for FabricEventKind. */ + public static final FabricEventKind APPLICATION_UPGRADE_START = fromString("ApplicationUpgradeStart"); + + /** Static value DeployedApplicationHealthReportCreated for FabricEventKind. */ + public static final FabricEventKind DEPLOYED_APPLICATION_HEALTH_REPORT_CREATED = fromString("DeployedApplicationHealthReportCreated"); + + /** Static value DeployedApplicationHealthReportExpired for FabricEventKind. */ + public static final FabricEventKind DEPLOYED_APPLICATION_HEALTH_REPORT_EXPIRED = fromString("DeployedApplicationHealthReportExpired"); + + /** Static value ProcessDeactivated for FabricEventKind. */ + public static final FabricEventKind PROCESS_DEACTIVATED = fromString("ProcessDeactivated"); + + /** Static value ContainerDeactivated for FabricEventKind. */ + public static final FabricEventKind CONTAINER_DEACTIVATED = fromString("ContainerDeactivated"); + + /** Static value NodeAborted for FabricEventKind. */ + public static final FabricEventKind NODE_ABORTED = fromString("NodeAborted"); + + /** Static value NodeAborting for FabricEventKind. */ + public static final FabricEventKind NODE_ABORTING = fromString("NodeAborting"); + + /** Static value NodeAdded for FabricEventKind. */ + public static final FabricEventKind NODE_ADDED = fromString("NodeAdded"); + + /** Static value NodeClose for FabricEventKind. */ + public static final FabricEventKind NODE_CLOSE = fromString("NodeClose"); + + /** Static value NodeClosing for FabricEventKind. */ + public static final FabricEventKind NODE_CLOSING = fromString("NodeClosing"); + + /** Static value NodeDeactivateComplete for FabricEventKind. */ + public static final FabricEventKind NODE_DEACTIVATE_COMPLETE = fromString("NodeDeactivateComplete"); + + /** Static value NodeDeactivateStart for FabricEventKind. */ + public static final FabricEventKind NODE_DEACTIVATE_START = fromString("NodeDeactivateStart"); + + /** Static value NodeDown for FabricEventKind. */ + public static final FabricEventKind NODE_DOWN = fromString("NodeDown"); + + /** Static value NodeHealthReportCreated for FabricEventKind. */ + public static final FabricEventKind NODE_HEALTH_REPORT_CREATED = fromString("NodeHealthReportCreated"); + + /** Static value NodeHealthReportExpired for FabricEventKind. */ + public static final FabricEventKind NODE_HEALTH_REPORT_EXPIRED = fromString("NodeHealthReportExpired"); + + /** Static value NodeOpenedSuccess for FabricEventKind. */ + public static final FabricEventKind NODE_OPENED_SUCCESS = fromString("NodeOpenedSuccess"); + + /** Static value NodeOpenFailed for FabricEventKind. */ + public static final FabricEventKind NODE_OPEN_FAILED = fromString("NodeOpenFailed"); + + /** Static value NodeOpening for FabricEventKind. */ + public static final FabricEventKind NODE_OPENING = fromString("NodeOpening"); + + /** Static value NodeRemoved for FabricEventKind. */ + public static final FabricEventKind NODE_REMOVED = fromString("NodeRemoved"); + + /** Static value NodeUp for FabricEventKind. */ + public static final FabricEventKind NODE_UP = fromString("NodeUp"); + + /** Static value PartitionHealthReportCreated for FabricEventKind. */ + public static final FabricEventKind PARTITION_HEALTH_REPORT_CREATED = fromString("PartitionHealthReportCreated"); + + /** Static value PartitionHealthReportExpired for FabricEventKind. */ + public static final FabricEventKind PARTITION_HEALTH_REPORT_EXPIRED = fromString("PartitionHealthReportExpired"); + + /** Static value PartitionReconfigurationCompleted for FabricEventKind. */ + public static final FabricEventKind PARTITION_RECONFIGURATION_COMPLETED = fromString("PartitionReconfigurationCompleted"); + + /** Static value PartitionPrimaryMoveAnalysis for FabricEventKind. */ + public static final FabricEventKind PARTITION_PRIMARY_MOVE_ANALYSIS = fromString("PartitionPrimaryMoveAnalysis"); + + /** Static value ServiceCreated for FabricEventKind. */ + public static final FabricEventKind SERVICE_CREATED = fromString("ServiceCreated"); + + /** Static value ServiceDeleted for FabricEventKind. */ + public static final FabricEventKind SERVICE_DELETED = fromString("ServiceDeleted"); + + /** Static value ServiceHealthReportCreated for FabricEventKind. */ + public static final FabricEventKind SERVICE_HEALTH_REPORT_CREATED = fromString("ServiceHealthReportCreated"); + + /** Static value ServiceHealthReportExpired for FabricEventKind. */ + public static final FabricEventKind SERVICE_HEALTH_REPORT_EXPIRED = fromString("ServiceHealthReportExpired"); + + /** Static value DeployedServiceHealthReportCreated for FabricEventKind. */ + public static final FabricEventKind DEPLOYED_SERVICE_HEALTH_REPORT_CREATED = fromString("DeployedServiceHealthReportCreated"); + + /** Static value DeployedServiceHealthReportExpired for FabricEventKind. */ + public static final FabricEventKind DEPLOYED_SERVICE_HEALTH_REPORT_EXPIRED = fromString("DeployedServiceHealthReportExpired"); + + /** Static value StatefulReplicaHealthReportCreated for FabricEventKind. */ + public static final FabricEventKind STATEFUL_REPLICA_HEALTH_REPORT_CREATED = fromString("StatefulReplicaHealthReportCreated"); + + /** Static value StatefulReplicaHealthReportExpired for FabricEventKind. */ + public static final FabricEventKind STATEFUL_REPLICA_HEALTH_REPORT_EXPIRED = fromString("StatefulReplicaHealthReportExpired"); + + /** Static value StatelessReplicaHealthReportCreated for FabricEventKind. */ + public static final FabricEventKind STATELESS_REPLICA_HEALTH_REPORT_CREATED = fromString("StatelessReplicaHealthReportCreated"); + + /** Static value StatelessReplicaHealthReportExpired for FabricEventKind. */ + public static final FabricEventKind STATELESS_REPLICA_HEALTH_REPORT_EXPIRED = fromString("StatelessReplicaHealthReportExpired"); + + /** Static value ClusterHealthReportCreated for FabricEventKind. */ + public static final FabricEventKind CLUSTER_HEALTH_REPORT_CREATED = fromString("ClusterHealthReportCreated"); + + /** Static value ClusterHealthReportExpired for FabricEventKind. */ + public static final FabricEventKind CLUSTER_HEALTH_REPORT_EXPIRED = fromString("ClusterHealthReportExpired"); + + /** Static value ClusterUpgradeComplete for FabricEventKind. */ + public static final FabricEventKind CLUSTER_UPGRADE_COMPLETE = fromString("ClusterUpgradeComplete"); + + /** Static value ClusterUpgradeDomainComplete for FabricEventKind. */ + public static final FabricEventKind CLUSTER_UPGRADE_DOMAIN_COMPLETE = fromString("ClusterUpgradeDomainComplete"); + + /** Static value ClusterUpgradeRollbackComplete for FabricEventKind. */ + public static final FabricEventKind CLUSTER_UPGRADE_ROLLBACK_COMPLETE = fromString("ClusterUpgradeRollbackComplete"); + + /** Static value ClusterUpgradeRollbackStart for FabricEventKind. */ + public static final FabricEventKind CLUSTER_UPGRADE_ROLLBACK_START = fromString("ClusterUpgradeRollbackStart"); + + /** Static value ClusterUpgradeStart for FabricEventKind. */ + public static final FabricEventKind CLUSTER_UPGRADE_START = fromString("ClusterUpgradeStart"); + + /** Static value ChaosStopped for FabricEventKind. */ + public static final FabricEventKind CHAOS_STOPPED = fromString("ChaosStopped"); + + /** Static value ChaosStarted for FabricEventKind. */ + public static final FabricEventKind CHAOS_STARTED = fromString("ChaosStarted"); + + /** Static value ChaosRestartNodeFaultCompleted for FabricEventKind. */ + public static final FabricEventKind CHAOS_RESTART_NODE_FAULT_COMPLETED = fromString("ChaosRestartNodeFaultCompleted"); + + /** Static value ChaosRestartCodePackageFaultScheduled for FabricEventKind. */ + public static final FabricEventKind CHAOS_RESTART_CODE_PACKAGE_FAULT_SCHEDULED = fromString("ChaosRestartCodePackageFaultScheduled"); + + /** Static value ChaosRestartCodePackageFaultCompleted for FabricEventKind. */ + public static final FabricEventKind CHAOS_RESTART_CODE_PACKAGE_FAULT_COMPLETED = fromString("ChaosRestartCodePackageFaultCompleted"); + + /** Static value ChaosRemoveReplicaFaultScheduled for FabricEventKind. */ + public static final FabricEventKind CHAOS_REMOVE_REPLICA_FAULT_SCHEDULED = fromString("ChaosRemoveReplicaFaultScheduled"); + + /** Static value ChaosRemoveReplicaFaultCompleted for FabricEventKind. */ + public static final FabricEventKind CHAOS_REMOVE_REPLICA_FAULT_COMPLETED = fromString("ChaosRemoveReplicaFaultCompleted"); + + /** Static value ChaosMoveSecondaryFaultScheduled for FabricEventKind. */ + public static final FabricEventKind CHAOS_MOVE_SECONDARY_FAULT_SCHEDULED = fromString("ChaosMoveSecondaryFaultScheduled"); + + /** Static value ChaosMovePrimaryFaultScheduled for FabricEventKind. */ + public static final FabricEventKind CHAOS_MOVE_PRIMARY_FAULT_SCHEDULED = fromString("ChaosMovePrimaryFaultScheduled"); + + /** Static value ChaosRestartReplicaFaultScheduled for FabricEventKind. */ + public static final FabricEventKind CHAOS_RESTART_REPLICA_FAULT_SCHEDULED = fromString("ChaosRestartReplicaFaultScheduled"); + + /** Static value ChaosRestartNodeFaultScheduled for FabricEventKind. */ + public static final FabricEventKind CHAOS_RESTART_NODE_FAULT_SCHEDULED = fromString("ChaosRestartNodeFaultScheduled"); + + /** + * Creates or finds a FabricEventKind from its string representation. + * @param name a name to look for + * @return the corresponding FabricEventKind + */ + @JsonCreator + public static FabricEventKind fromString(String name) { + return fromString(name, FabricEventKind.class); + } + + /** + * @return known FabricEventKind values + */ + public static Collection values() { + return values(FabricEventKind.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FabricReplicaStatus.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FabricReplicaStatus.java new file mode 100644 index 0000000000000..0f83cebfb69f0 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FabricReplicaStatus.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for FabricReplicaStatus. + */ +public final class FabricReplicaStatus extends ExpandableStringEnum { + /** Static value Invalid for FabricReplicaStatus. */ + public static final FabricReplicaStatus INVALID = fromString("Invalid"); + + /** Static value Down for FabricReplicaStatus. */ + public static final FabricReplicaStatus DOWN = fromString("Down"); + + /** Static value Up for FabricReplicaStatus. */ + public static final FabricReplicaStatus UP = fromString("Up"); + + /** + * Creates or finds a FabricReplicaStatus from its string representation. + * @param name a name to look for + * @return the corresponding FabricReplicaStatus + */ + @JsonCreator + public static FabricReplicaStatus fromString(String name) { + return fromString(name, FabricReplicaStatus.class); + } + + /** + * @return known FabricReplicaStatus values + */ + public static Collection values() { + return values(FabricReplicaStatus.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FailedUpgradeDomainProgressObject.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FailedUpgradeDomainProgressObject.java new file mode 100644 index 0000000000000..cda880c93a220 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FailedUpgradeDomainProgressObject.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The detailed upgrade progress for nodes in the current upgrade domain at the + * point of failure. + */ +public class FailedUpgradeDomainProgressObject { + /** + * The name of the upgrade domain. + */ + @JsonProperty(value = "DomainName") + private String domainName; + + /** + * List of upgrading nodes and their statuses. + */ + @JsonProperty(value = "NodeUpgradeProgressList") + private List nodeUpgradeProgressList; + + /** + * Get the name of the upgrade domain. + * + * @return the domainName value + */ + public String domainName() { + return this.domainName; + } + + /** + * Set the name of the upgrade domain. + * + * @param domainName the domainName value to set + * @return the FailedUpgradeDomainProgressObject object itself. + */ + public FailedUpgradeDomainProgressObject withDomainName(String domainName) { + this.domainName = domainName; + return this; + } + + /** + * Get list of upgrading nodes and their statuses. + * + * @return the nodeUpgradeProgressList value + */ + public List nodeUpgradeProgressList() { + return this.nodeUpgradeProgressList; + } + + /** + * Set list of upgrading nodes and their statuses. + * + * @param nodeUpgradeProgressList the nodeUpgradeProgressList value to set + * @return the FailedUpgradeDomainProgressObject object itself. + */ + public FailedUpgradeDomainProgressObject withNodeUpgradeProgressList(List nodeUpgradeProgressList) { + this.nodeUpgradeProgressList = nodeUpgradeProgressList; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FailureAction.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FailureAction.java new file mode 100644 index 0000000000000..c86ca2eca4b17 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FailureAction.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for FailureAction. + */ +public final class FailureAction extends ExpandableStringEnum { + /** Static value Invalid for FailureAction. */ + public static final FailureAction INVALID = fromString("Invalid"); + + /** Static value Rollback for FailureAction. */ + public static final FailureAction ROLLBACK = fromString("Rollback"); + + /** Static value Manual for FailureAction. */ + public static final FailureAction MANUAL = fromString("Manual"); + + /** + * Creates or finds a FailureAction from its string representation. + * @param name a name to look for + * @return the corresponding FailureAction + */ + @JsonCreator + public static FailureAction fromString(String name) { + return fromString(name, FailureAction.class); + } + + /** + * @return known FailureAction values + */ + public static Collection values() { + return values(FailureAction.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FailureReason.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FailureReason.java new file mode 100644 index 0000000000000..584f3ea04f96b --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FailureReason.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for FailureReason. + */ +public final class FailureReason extends ExpandableStringEnum { + /** Static value None for FailureReason. */ + public static final FailureReason NONE = fromString("None"); + + /** Static value Interrupted for FailureReason. */ + public static final FailureReason INTERRUPTED = fromString("Interrupted"); + + /** Static value HealthCheck for FailureReason. */ + public static final FailureReason HEALTH_CHECK = fromString("HealthCheck"); + + /** Static value UpgradeDomainTimeout for FailureReason. */ + public static final FailureReason UPGRADE_DOMAIN_TIMEOUT = fromString("UpgradeDomainTimeout"); + + /** Static value OverallUpgradeTimeout for FailureReason. */ + public static final FailureReason OVERALL_UPGRADE_TIMEOUT = fromString("OverallUpgradeTimeout"); + + /** + * Creates or finds a FailureReason from its string representation. + * @param name a name to look for + * @return the corresponding FailureReason + */ + @JsonCreator + public static FailureReason fromString(String name) { + return fromString(name, FailureReason.class); + } + + /** + * @return known FailureReason values + */ + public static Collection values() { + return values(FailureReason.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FailureUpgradeDomainProgressInfo.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FailureUpgradeDomainProgressInfo.java new file mode 100644 index 0000000000000..66f1b9b2d2d8b --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FailureUpgradeDomainProgressInfo.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about the upgrade domain progress at the time of upgrade + * failure. + */ +public class FailureUpgradeDomainProgressInfo { + /** + * The name of the upgrade domain. + */ + @JsonProperty(value = "DomainName") + private String domainName; + + /** + * List of upgrading nodes and their statuses. + */ + @JsonProperty(value = "NodeUpgradeProgressList") + private List nodeUpgradeProgressList; + + /** + * Get the name of the upgrade domain. + * + * @return the domainName value + */ + public String domainName() { + return this.domainName; + } + + /** + * Set the name of the upgrade domain. + * + * @param domainName the domainName value to set + * @return the FailureUpgradeDomainProgressInfo object itself. + */ + public FailureUpgradeDomainProgressInfo withDomainName(String domainName) { + this.domainName = domainName; + return this; + } + + /** + * Get list of upgrading nodes and their statuses. + * + * @return the nodeUpgradeProgressList value + */ + public List nodeUpgradeProgressList() { + return this.nodeUpgradeProgressList; + } + + /** + * Set list of upgrading nodes and their statuses. + * + * @param nodeUpgradeProgressList the nodeUpgradeProgressList value to set + * @return the FailureUpgradeDomainProgressInfo object itself. + */ + public FailureUpgradeDomainProgressInfo withNodeUpgradeProgressList(List nodeUpgradeProgressList) { + this.nodeUpgradeProgressList = nodeUpgradeProgressList; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FileInfo.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FileInfo.java new file mode 100644 index 0000000000000..6573244721d58 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FileInfo.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about a image store file. + */ +public class FileInfo { + /** + * The size of file in bytes. + */ + @JsonProperty(value = "FileSize") + private String fileSize; + + /** + * Information about the version of image store file. + */ + @JsonProperty(value = "FileVersion") + private FileVersion fileVersion; + + /** + * The date and time when the image store file was last modified. + */ + @JsonProperty(value = "ModifiedDate") + private DateTime modifiedDate; + + /** + * The file path relative to the image store root path. + */ + @JsonProperty(value = "StoreRelativePath") + private String storeRelativePath; + + /** + * Get the size of file in bytes. + * + * @return the fileSize value + */ + public String fileSize() { + return this.fileSize; + } + + /** + * Set the size of file in bytes. + * + * @param fileSize the fileSize value to set + * @return the FileInfo object itself. + */ + public FileInfo withFileSize(String fileSize) { + this.fileSize = fileSize; + return this; + } + + /** + * Get information about the version of image store file. + * + * @return the fileVersion value + */ + public FileVersion fileVersion() { + return this.fileVersion; + } + + /** + * Set information about the version of image store file. + * + * @param fileVersion the fileVersion value to set + * @return the FileInfo object itself. + */ + public FileInfo withFileVersion(FileVersion fileVersion) { + this.fileVersion = fileVersion; + return this; + } + + /** + * Get the date and time when the image store file was last modified. + * + * @return the modifiedDate value + */ + public DateTime modifiedDate() { + return this.modifiedDate; + } + + /** + * Set the date and time when the image store file was last modified. + * + * @param modifiedDate the modifiedDate value to set + * @return the FileInfo object itself. + */ + public FileInfo withModifiedDate(DateTime modifiedDate) { + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Get the file path relative to the image store root path. + * + * @return the storeRelativePath value + */ + public String storeRelativePath() { + return this.storeRelativePath; + } + + /** + * Set the file path relative to the image store root path. + * + * @param storeRelativePath the storeRelativePath value to set + * @return the FileInfo object itself. + */ + public FileInfo withStoreRelativePath(String storeRelativePath) { + this.storeRelativePath = storeRelativePath; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FileShareBackupStorageDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FileShareBackupStorageDescription.java new file mode 100644 index 0000000000000..a34a303395a2d --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FileShareBackupStorageDescription.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the parameters for file share storage used for storing or + * enumerating backups. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "StorageKind") +@JsonTypeName("FileShare") +public class FileShareBackupStorageDescription extends BackupStorageDescription { + /** + * UNC path of the file share where to store or enumerate backups from. + */ + @JsonProperty(value = "Path", required = true) + private String path; + + /** + * Primary user name to access the file share. + */ + @JsonProperty(value = "PrimaryUserName") + private String primaryUserName; + + /** + * Primary password to access the share location. + */ + @JsonProperty(value = "PrimaryPassword") + private String primaryPassword; + + /** + * Secondary user name to access the file share. + */ + @JsonProperty(value = "SecondaryUserName") + private String secondaryUserName; + + /** + * Secondary password to access the share location. + */ + @JsonProperty(value = "SecondaryPassword") + private String secondaryPassword; + + /** + * Get uNC path of the file share where to store or enumerate backups from. + * + * @return the path value + */ + public String path() { + return this.path; + } + + /** + * Set uNC path of the file share where to store or enumerate backups from. + * + * @param path the path value to set + * @return the FileShareBackupStorageDescription object itself. + */ + public FileShareBackupStorageDescription withPath(String path) { + this.path = path; + return this; + } + + /** + * Get primary user name to access the file share. + * + * @return the primaryUserName value + */ + public String primaryUserName() { + return this.primaryUserName; + } + + /** + * Set primary user name to access the file share. + * + * @param primaryUserName the primaryUserName value to set + * @return the FileShareBackupStorageDescription object itself. + */ + public FileShareBackupStorageDescription withPrimaryUserName(String primaryUserName) { + this.primaryUserName = primaryUserName; + return this; + } + + /** + * Get primary password to access the share location. + * + * @return the primaryPassword value + */ + public String primaryPassword() { + return this.primaryPassword; + } + + /** + * Set primary password to access the share location. + * + * @param primaryPassword the primaryPassword value to set + * @return the FileShareBackupStorageDescription object itself. + */ + public FileShareBackupStorageDescription withPrimaryPassword(String primaryPassword) { + this.primaryPassword = primaryPassword; + return this; + } + + /** + * Get secondary user name to access the file share. + * + * @return the secondaryUserName value + */ + public String secondaryUserName() { + return this.secondaryUserName; + } + + /** + * Set secondary user name to access the file share. + * + * @param secondaryUserName the secondaryUserName value to set + * @return the FileShareBackupStorageDescription object itself. + */ + public FileShareBackupStorageDescription withSecondaryUserName(String secondaryUserName) { + this.secondaryUserName = secondaryUserName; + return this; + } + + /** + * Get secondary password to access the share location. + * + * @return the secondaryPassword value + */ + public String secondaryPassword() { + return this.secondaryPassword; + } + + /** + * Set secondary password to access the share location. + * + * @param secondaryPassword the secondaryPassword value to set + * @return the FileShareBackupStorageDescription object itself. + */ + public FileShareBackupStorageDescription withSecondaryPassword(String secondaryPassword) { + this.secondaryPassword = secondaryPassword; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FileVersion.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FileVersion.java new file mode 100644 index 0000000000000..644a8bac8ff73 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FileVersion.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about the version of image store file. + */ +public class FileVersion { + /** + * The current image store version number for the file is used in image + * store for checking whether it need to be updated. + */ + @JsonProperty(value = "VersionNumber") + private String versionNumber; + + /** + * The epoch data loss number of image store replica when this file entry + * was updated or created. + */ + @JsonProperty(value = "EpochDataLossNumber") + private String epochDataLossNumber; + + /** + * The epoch configuration version number of the image store replica when + * this file entry was created or updated. + */ + @JsonProperty(value = "EpochConfigurationNumber") + private String epochConfigurationNumber; + + /** + * Get the current image store version number for the file is used in image store for checking whether it need to be updated. + * + * @return the versionNumber value + */ + public String versionNumber() { + return this.versionNumber; + } + + /** + * Set the current image store version number for the file is used in image store for checking whether it need to be updated. + * + * @param versionNumber the versionNumber value to set + * @return the FileVersion object itself. + */ + public FileVersion withVersionNumber(String versionNumber) { + this.versionNumber = versionNumber; + return this; + } + + /** + * Get the epoch data loss number of image store replica when this file entry was updated or created. + * + * @return the epochDataLossNumber value + */ + public String epochDataLossNumber() { + return this.epochDataLossNumber; + } + + /** + * Set the epoch data loss number of image store replica when this file entry was updated or created. + * + * @param epochDataLossNumber the epochDataLossNumber value to set + * @return the FileVersion object itself. + */ + public FileVersion withEpochDataLossNumber(String epochDataLossNumber) { + this.epochDataLossNumber = epochDataLossNumber; + return this; + } + + /** + * Get the epoch configuration version number of the image store replica when this file entry was created or updated. + * + * @return the epochConfigurationNumber value + */ + public String epochConfigurationNumber() { + return this.epochConfigurationNumber; + } + + /** + * Set the epoch configuration version number of the image store replica when this file entry was created or updated. + * + * @param epochConfigurationNumber the epochConfigurationNumber value to set + * @return the FileVersion object itself. + */ + public FileVersion withEpochConfigurationNumber(String epochConfigurationNumber) { + this.epochConfigurationNumber = epochConfigurationNumber; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FolderInfo.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FolderInfo.java new file mode 100644 index 0000000000000..43f6b14286296 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FolderInfo.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about a image store folder. It includes how many files this + * folder contains and its image store relative path. + */ +public class FolderInfo { + /** + * The remote location within image store. This path is relative to the + * image store root. + */ + @JsonProperty(value = "StoreRelativePath") + private String storeRelativePath; + + /** + * The number of files from within the image store folder. + */ + @JsonProperty(value = "FileCount") + private String fileCount; + + /** + * Get the remote location within image store. This path is relative to the image store root. + * + * @return the storeRelativePath value + */ + public String storeRelativePath() { + return this.storeRelativePath; + } + + /** + * Set the remote location within image store. This path is relative to the image store root. + * + * @param storeRelativePath the storeRelativePath value to set + * @return the FolderInfo object itself. + */ + public FolderInfo withStoreRelativePath(String storeRelativePath) { + this.storeRelativePath = storeRelativePath; + return this; + } + + /** + * Get the number of files from within the image store folder. + * + * @return the fileCount value + */ + public String fileCount() { + return this.fileCount; + } + + /** + * Set the number of files from within the image store folder. + * + * @param fileCount the fileCount value to set + * @return the FolderInfo object itself. + */ + public FolderInfo withFileCount(String fileCount) { + this.fileCount = fileCount; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FrequencyBasedBackupScheduleDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FrequencyBasedBackupScheduleDescription.java new file mode 100644 index 0000000000000..bea51e6ab8f8f --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FrequencyBasedBackupScheduleDescription.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.Period; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the frequency based backup schedule. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ScheduleKind") +@JsonTypeName("FrequencyBased") +public class FrequencyBasedBackupScheduleDescription extends BackupScheduleDescription { + /** + * 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. + */ + @JsonProperty(value = "Interval", required = true) + private Period interval; + + /** + * Get 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. + * + * @return the interval value + */ + public Period interval() { + return this.interval; + } + + /** + * Set 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. + * + * @param interval the interval value to set + * @return the FrequencyBasedBackupScheduleDescription object itself. + */ + public FrequencyBasedBackupScheduleDescription withInterval(Period interval) { + this.interval = interval; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/GetBackupByStorageQueryDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/GetBackupByStorageQueryDescription.java new file mode 100644 index 0000000000000..381ff774f3f26 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/GetBackupByStorageQueryDescription.java @@ -0,0 +1,156 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes additional filters to be applied, while listing backups, and + * backup storage details from where to fetch the backups. + */ +public class GetBackupByStorageQueryDescription { + /** + * Specifies the start date time in ISO8601 from which to enumerate + * backups. If not specified, backups are enumerated from the beginning. + */ + @JsonProperty(value = "StartDateTimeFilter") + private DateTime startDateTimeFilter; + + /** + * Specifies the end date time in ISO8601 till which to enumerate backups. + * If not specified, backups are enumerated till the end. + */ + @JsonProperty(value = "EndDateTimeFilter") + private DateTime endDateTimeFilter; + + /** + * If specified as true, gets the most recent backup (within the specified + * time range) for every partition under the specified backup entity. + */ + @JsonProperty(value = "Latest") + private Boolean latest; + + /** + * 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. + */ + @JsonProperty(value = "Storage", required = true) + private BackupStorageDescription storage; + + /** + * Indicates the entity for which to enumerate backups. + */ + @JsonProperty(value = "BackupEntity", required = true) + private BackupEntity backupEntity; + + /** + * Get specifies the start date time in ISO8601 from which to enumerate backups. If not specified, backups are enumerated from the beginning. + * + * @return the startDateTimeFilter value + */ + public DateTime startDateTimeFilter() { + return this.startDateTimeFilter; + } + + /** + * Set specifies the start date time in ISO8601 from which to enumerate backups. If not specified, backups are enumerated from the beginning. + * + * @param startDateTimeFilter the startDateTimeFilter value to set + * @return the GetBackupByStorageQueryDescription object itself. + */ + public GetBackupByStorageQueryDescription withStartDateTimeFilter(DateTime startDateTimeFilter) { + this.startDateTimeFilter = startDateTimeFilter; + return this; + } + + /** + * Get specifies the end date time in ISO8601 till which to enumerate backups. If not specified, backups are enumerated till the end. + * + * @return the endDateTimeFilter value + */ + public DateTime endDateTimeFilter() { + return this.endDateTimeFilter; + } + + /** + * Set specifies the end date time in ISO8601 till which to enumerate backups. If not specified, backups are enumerated till the end. + * + * @param endDateTimeFilter the endDateTimeFilter value to set + * @return the GetBackupByStorageQueryDescription object itself. + */ + public GetBackupByStorageQueryDescription withEndDateTimeFilter(DateTime endDateTimeFilter) { + this.endDateTimeFilter = endDateTimeFilter; + return this; + } + + /** + * Get if specified as true, gets the most recent backup (within the specified time range) for every partition under the specified backup entity. + * + * @return the latest value + */ + public Boolean latest() { + return this.latest; + } + + /** + * Set if specified as true, gets the most recent backup (within the specified time range) for every partition under the specified backup entity. + * + * @param latest the latest value to set + * @return the GetBackupByStorageQueryDescription object itself. + */ + public GetBackupByStorageQueryDescription withLatest(Boolean latest) { + this.latest = latest; + return this; + } + + /** + * Get 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. + * + * @return the storage value + */ + public BackupStorageDescription storage() { + return this.storage; + } + + /** + * Set 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 storage the storage value to set + * @return the GetBackupByStorageQueryDescription object itself. + */ + public GetBackupByStorageQueryDescription withStorage(BackupStorageDescription storage) { + this.storage = storage; + return this; + } + + /** + * Get indicates the entity for which to enumerate backups. + * + * @return the backupEntity value + */ + public BackupEntity backupEntity() { + return this.backupEntity; + } + + /** + * Set indicates the entity for which to enumerate backups. + * + * @param backupEntity the backupEntity value to set + * @return the GetBackupByStorageQueryDescription object itself. + */ + public GetBackupByStorageQueryDescription withBackupEntity(BackupEntity backupEntity) { + this.backupEntity = backupEntity; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/GetPropertyBatchOperation.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/GetPropertyBatchOperation.java new file mode 100644 index 0000000000000..cd6abcfa2a289 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/GetPropertyBatchOperation.java @@ -0,0 +1,54 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * 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. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("Get") +public class GetPropertyBatchOperation extends PropertyBatchOperation { + /** + * 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. + */ + @JsonProperty(value = "IncludeValue") + private Boolean includeValue; + + /** + * Get 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. + * + * @return the includeValue value + */ + public Boolean includeValue() { + return this.includeValue; + } + + /** + * Set 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. + * + * @param includeValue the includeValue value to set + * @return the GetPropertyBatchOperation object itself. + */ + public GetPropertyBatchOperation withIncludeValue(Boolean includeValue) { + this.includeValue = includeValue; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/GuidPropertyValue.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/GuidPropertyValue.java new file mode 100644 index 0000000000000..29f73b46ade31 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/GuidPropertyValue.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes a Service Fabric property value of type Guid. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("Guid") +public class GuidPropertyValue extends PropertyValue { + /** + * The data of the property value. + */ + @JsonProperty(value = "Data", required = true) + private UUID data; + + /** + * Get the data of the property value. + * + * @return the data value + */ + public UUID data() { + return this.data; + } + + /** + * Set the data of the property value. + * + * @param data the data value to set + * @return the GuidPropertyValue object itself. + */ + public GuidPropertyValue withData(UUID data) { + this.data = data; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HealthEvaluation.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HealthEvaluation.java new file mode 100644 index 0000000000000..360ff90520ae2 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HealthEvaluation.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Represents a health evaluation which describes the data and the algorithm + * used by health manager to evaluate the health of an entity. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("HealthEvaluation") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Application", value = ApplicationHealthEvaluation.class), + @JsonSubTypes.Type(name = "Applications", value = ApplicationsHealthEvaluation.class), + @JsonSubTypes.Type(name = "ApplicationTypeApplications", value = ApplicationTypeApplicationsHealthEvaluation.class), + @JsonSubTypes.Type(name = "DeltaNodesCheck", value = DeltaNodesCheckHealthEvaluation.class), + @JsonSubTypes.Type(name = "DeployedApplication", value = DeployedApplicationHealthEvaluation.class), + @JsonSubTypes.Type(name = "DeployedApplications", value = DeployedApplicationsHealthEvaluation.class), + @JsonSubTypes.Type(name = "DeployedServicePackage", value = DeployedServicePackageHealthEvaluation.class), + @JsonSubTypes.Type(name = "DeployedServicePackages", value = DeployedServicePackagesHealthEvaluation.class), + @JsonSubTypes.Type(name = "Event", value = EventHealthEvaluation.class), + @JsonSubTypes.Type(name = "Node", value = NodeHealthEvaluation.class), + @JsonSubTypes.Type(name = "Nodes", value = NodesHealthEvaluation.class), + @JsonSubTypes.Type(name = "Partition", value = PartitionHealthEvaluation.class), + @JsonSubTypes.Type(name = "Partitions", value = PartitionsHealthEvaluation.class), + @JsonSubTypes.Type(name = "Replica", value = ReplicaHealthEvaluation.class), + @JsonSubTypes.Type(name = "Replicas", value = ReplicasHealthEvaluation.class), + @JsonSubTypes.Type(name = "Service", value = ServiceHealthEvaluation.class), + @JsonSubTypes.Type(name = "Services", value = ServicesHealthEvaluation.class), + @JsonSubTypes.Type(name = "SystemApplication", value = SystemApplicationHealthEvaluation.class), + @JsonSubTypes.Type(name = "UpgradeDomainDeltaNodesCheck", value = UpgradeDomainDeltaNodesCheckHealthEvaluation.class), + @JsonSubTypes.Type(name = "UpgradeDomainNodes", value = UpgradeDomainNodesHealthEvaluation.class) +}) +public class HealthEvaluation { + /** + * 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'. + */ + @JsonProperty(value = "AggregatedHealthState") + private HealthState aggregatedHealthState; + + /** + * Description of the health evaluation, which represents a summary of the + * evaluation process. + */ + @JsonProperty(value = "Description") + private String description; + + /** + * Get 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'. + * + * @return the aggregatedHealthState value + */ + public HealthState aggregatedHealthState() { + return this.aggregatedHealthState; + } + + /** + * Set 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 aggregatedHealthState the aggregatedHealthState value to set + * @return the HealthEvaluation object itself. + */ + public HealthEvaluation withAggregatedHealthState(HealthState aggregatedHealthState) { + this.aggregatedHealthState = aggregatedHealthState; + return this; + } + + /** + * Get description of the health evaluation, which represents a summary of the evaluation process. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of the health evaluation, which represents a summary of the evaluation process. + * + * @param description the description value to set + * @return the HealthEvaluation object itself. + */ + public HealthEvaluation withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HealthEvaluationKind.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HealthEvaluationKind.java new file mode 100644 index 0000000000000..998e62952e4b1 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HealthEvaluationKind.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for HealthEvaluationKind. + */ +public final class HealthEvaluationKind extends ExpandableStringEnum { + /** Static value Invalid for HealthEvaluationKind. */ + public static final HealthEvaluationKind INVALID = fromString("Invalid"); + + /** Static value Event for HealthEvaluationKind. */ + public static final HealthEvaluationKind EVENT = fromString("Event"); + + /** Static value Replicas for HealthEvaluationKind. */ + public static final HealthEvaluationKind REPLICAS = fromString("Replicas"); + + /** Static value Partitions for HealthEvaluationKind. */ + public static final HealthEvaluationKind PARTITIONS = fromString("Partitions"); + + /** Static value DeployedServicePackages for HealthEvaluationKind. */ + public static final HealthEvaluationKind DEPLOYED_SERVICE_PACKAGES = fromString("DeployedServicePackages"); + + /** Static value DeployedApplications for HealthEvaluationKind. */ + public static final HealthEvaluationKind DEPLOYED_APPLICATIONS = fromString("DeployedApplications"); + + /** Static value Services for HealthEvaluationKind. */ + public static final HealthEvaluationKind SERVICES = fromString("Services"); + + /** Static value Nodes for HealthEvaluationKind. */ + public static final HealthEvaluationKind NODES = fromString("Nodes"); + + /** Static value Applications for HealthEvaluationKind. */ + public static final HealthEvaluationKind APPLICATIONS = fromString("Applications"); + + /** Static value SystemApplication for HealthEvaluationKind. */ + public static final HealthEvaluationKind SYSTEM_APPLICATION = fromString("SystemApplication"); + + /** Static value UpgradeDomainDeployedApplications for HealthEvaluationKind. */ + public static final HealthEvaluationKind UPGRADE_DOMAIN_DEPLOYED_APPLICATIONS = fromString("UpgradeDomainDeployedApplications"); + + /** Static value UpgradeDomainNodes for HealthEvaluationKind. */ + public static final HealthEvaluationKind UPGRADE_DOMAIN_NODES = fromString("UpgradeDomainNodes"); + + /** Static value Replica for HealthEvaluationKind. */ + public static final HealthEvaluationKind REPLICA = fromString("Replica"); + + /** Static value Partition for HealthEvaluationKind. */ + public static final HealthEvaluationKind PARTITION = fromString("Partition"); + + /** Static value DeployedServicePackage for HealthEvaluationKind. */ + public static final HealthEvaluationKind DEPLOYED_SERVICE_PACKAGE = fromString("DeployedServicePackage"); + + /** Static value DeployedApplication for HealthEvaluationKind. */ + public static final HealthEvaluationKind DEPLOYED_APPLICATION = fromString("DeployedApplication"); + + /** Static value Service for HealthEvaluationKind. */ + public static final HealthEvaluationKind SERVICE = fromString("Service"); + + /** Static value Node for HealthEvaluationKind. */ + public static final HealthEvaluationKind NODE = fromString("Node"); + + /** Static value Application for HealthEvaluationKind. */ + public static final HealthEvaluationKind APPLICATION = fromString("Application"); + + /** Static value DeltaNodesCheck for HealthEvaluationKind. */ + public static final HealthEvaluationKind DELTA_NODES_CHECK = fromString("DeltaNodesCheck"); + + /** Static value UpgradeDomainDeltaNodesCheck for HealthEvaluationKind. */ + public static final HealthEvaluationKind UPGRADE_DOMAIN_DELTA_NODES_CHECK = fromString("UpgradeDomainDeltaNodesCheck"); + + /** Static value ApplicationTypeApplications for HealthEvaluationKind. */ + public static final HealthEvaluationKind APPLICATION_TYPE_APPLICATIONS = fromString("ApplicationTypeApplications"); + + /** + * Creates or finds a HealthEvaluationKind from its string representation. + * @param name a name to look for + * @return the corresponding HealthEvaluationKind + */ + @JsonCreator + public static HealthEvaluationKind fromString(String name) { + return fromString(name, HealthEvaluationKind.class); + } + + /** + * @return known HealthEvaluationKind values + */ + public static Collection values() { + return values(HealthEvaluationKind.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HealthEvaluationWrapper.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HealthEvaluationWrapper.java new file mode 100644 index 0000000000000..22511a4d37378 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HealthEvaluationWrapper.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Wrapper object for health evaluation. + */ +public class HealthEvaluationWrapper { + /** + * Represents a health evaluation which describes the data and the + * algorithm used by health manager to evaluate the health of an entity. + */ + @JsonProperty(value = "HealthEvaluation") + private HealthEvaluation healthEvaluation; + + /** + * Get represents a health evaluation which describes the data and the algorithm used by health manager to evaluate the health of an entity. + * + * @return the healthEvaluation value + */ + public HealthEvaluation healthEvaluation() { + return this.healthEvaluation; + } + + /** + * Set represents a health evaluation which describes the data and the algorithm used by health manager to evaluate the health of an entity. + * + * @param healthEvaluation the healthEvaluation value to set + * @return the HealthEvaluationWrapper object itself. + */ + public HealthEvaluationWrapper withHealthEvaluation(HealthEvaluation healthEvaluation) { + this.healthEvaluation = healthEvaluation; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HealthEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HealthEvent.java new file mode 100644 index 0000000000000..2f25e5d3e6d16 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HealthEvent.java @@ -0,0 +1,224 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents health information reported on a health entity, such as cluster, + * application or node, with additional metadata added by the Health Manager. + */ +public class HealthEvent extends HealthInformation { + /** + * Returns true if the health event is expired, otherwise false. + */ + @JsonProperty(value = "IsExpired") + private Boolean isExpired; + + /** + * The date and time when the health report was sent by the source. + */ + @JsonProperty(value = "SourceUtcTimestamp") + private DateTime sourceUtcTimestamp; + + /** + * The date and time when the health report was last modified by the health + * store. + */ + @JsonProperty(value = "LastModifiedUtcTimestamp") + private DateTime lastModifiedUtcTimestamp; + + /** + * If the current health state is 'Ok', this property returns the time at + * which the health report was first reported with 'Ok'. + * For periodic reporting, many reports with the same state may have been + * generated. + * This property returns the date and time when the first 'Ok' health + * report was received. + * + * If the current health state is 'Error' or 'Warning', returns the date + * and time at which the health state was last in 'Ok', before + * transitioning to a different state. + * + * If the health state was never 'Ok', the value will be zero date-time. + */ + @JsonProperty(value = "LastOkTransitionAt") + private DateTime lastOkTransitionAt; + + /** + * If the current health state is 'Warning', this property returns the time + * at which the health report was first reported with 'Warning'. For + * periodic reporting, many reports with the same state may have been + * generated however, this property returns only the date and time at the + * first 'Warning' health report was received. + * + * If the current health state is 'Ok' or 'Error', returns the date and + * time at which the health state was last in 'Warning', before + * transitioning to a different state. + * + * If the health state was never 'Warning', the value will be zero + * date-time. + */ + @JsonProperty(value = "LastWarningTransitionAt") + private DateTime lastWarningTransitionAt; + + /** + * If the current health state is 'Error', this property returns the time + * at which the health report was first reported with 'Error'. For periodic + * reporting, many reports with the same state may have been generated + * however, this property returns only the date and time at the first + * 'Error' health report was received. + * + * If the current health state is 'Ok' or 'Warning', returns the date and + * time at which the health state was last in 'Error', before transitioning + * to a different state. + * + * If the health state was never 'Error', the value will be zero date-time. + */ + @JsonProperty(value = "LastErrorTransitionAt") + private DateTime lastErrorTransitionAt; + + /** + * Get returns true if the health event is expired, otherwise false. + * + * @return the isExpired value + */ + public Boolean isExpired() { + return this.isExpired; + } + + /** + * Set returns true if the health event is expired, otherwise false. + * + * @param isExpired the isExpired value to set + * @return the HealthEvent object itself. + */ + public HealthEvent withIsExpired(Boolean isExpired) { + this.isExpired = isExpired; + return this; + } + + /** + * Get the date and time when the health report was sent by the source. + * + * @return the sourceUtcTimestamp value + */ + public DateTime sourceUtcTimestamp() { + return this.sourceUtcTimestamp; + } + + /** + * Set the date and time when the health report was sent by the source. + * + * @param sourceUtcTimestamp the sourceUtcTimestamp value to set + * @return the HealthEvent object itself. + */ + public HealthEvent withSourceUtcTimestamp(DateTime sourceUtcTimestamp) { + this.sourceUtcTimestamp = sourceUtcTimestamp; + return this; + } + + /** + * Get the date and time when the health report was last modified by the health store. + * + * @return the lastModifiedUtcTimestamp value + */ + public DateTime lastModifiedUtcTimestamp() { + return this.lastModifiedUtcTimestamp; + } + + /** + * Set the date and time when the health report was last modified by the health store. + * + * @param lastModifiedUtcTimestamp the lastModifiedUtcTimestamp value to set + * @return the HealthEvent object itself. + */ + public HealthEvent withLastModifiedUtcTimestamp(DateTime lastModifiedUtcTimestamp) { + this.lastModifiedUtcTimestamp = lastModifiedUtcTimestamp; + return this; + } + + /** + * Get if the current health state is 'Ok', this property returns the time at which the health report was first reported with 'Ok'. + For periodic reporting, many reports with the same state may have been generated. + This property returns the date and time when the first 'Ok' health report was received. + If the current health state is 'Error' or 'Warning', returns the date and time at which the health state was last in 'Ok', before transitioning to a different state. + If the health state was never 'Ok', the value will be zero date-time. + * + * @return the lastOkTransitionAt value + */ + public DateTime lastOkTransitionAt() { + return this.lastOkTransitionAt; + } + + /** + * Set if the current health state is 'Ok', this property returns the time at which the health report was first reported with 'Ok'. + For periodic reporting, many reports with the same state may have been generated. + This property returns the date and time when the first 'Ok' health report was received. + If the current health state is 'Error' or 'Warning', returns the date and time at which the health state was last in 'Ok', before transitioning to a different state. + If the health state was never 'Ok', the value will be zero date-time. + * + * @param lastOkTransitionAt the lastOkTransitionAt value to set + * @return the HealthEvent object itself. + */ + public HealthEvent withLastOkTransitionAt(DateTime lastOkTransitionAt) { + this.lastOkTransitionAt = lastOkTransitionAt; + return this; + } + + /** + * Get if the current health state is 'Warning', this property returns the time at which the health report was first reported with 'Warning'. For periodic reporting, many reports with the same state may have been generated however, this property returns only the date and time at the first 'Warning' health report was received. + If the current health state is 'Ok' or 'Error', returns the date and time at which the health state was last in 'Warning', before transitioning to a different state. + If the health state was never 'Warning', the value will be zero date-time. + * + * @return the lastWarningTransitionAt value + */ + public DateTime lastWarningTransitionAt() { + return this.lastWarningTransitionAt; + } + + /** + * Set if the current health state is 'Warning', this property returns the time at which the health report was first reported with 'Warning'. For periodic reporting, many reports with the same state may have been generated however, this property returns only the date and time at the first 'Warning' health report was received. + If the current health state is 'Ok' or 'Error', returns the date and time at which the health state was last in 'Warning', before transitioning to a different state. + If the health state was never 'Warning', the value will be zero date-time. + * + * @param lastWarningTransitionAt the lastWarningTransitionAt value to set + * @return the HealthEvent object itself. + */ + public HealthEvent withLastWarningTransitionAt(DateTime lastWarningTransitionAt) { + this.lastWarningTransitionAt = lastWarningTransitionAt; + return this; + } + + /** + * Get if the current health state is 'Error', this property returns the time at which the health report was first reported with 'Error'. For periodic reporting, many reports with the same state may have been generated however, this property returns only the date and time at the first 'Error' health report was received. + If the current health state is 'Ok' or 'Warning', returns the date and time at which the health state was last in 'Error', before transitioning to a different state. + If the health state was never 'Error', the value will be zero date-time. + * + * @return the lastErrorTransitionAt value + */ + public DateTime lastErrorTransitionAt() { + return this.lastErrorTransitionAt; + } + + /** + * Set if the current health state is 'Error', this property returns the time at which the health report was first reported with 'Error'. For periodic reporting, many reports with the same state may have been generated however, this property returns only the date and time at the first 'Error' health report was received. + If the current health state is 'Ok' or 'Warning', returns the date and time at which the health state was last in 'Error', before transitioning to a different state. + If the health state was never 'Error', the value will be zero date-time. + * + * @param lastErrorTransitionAt the lastErrorTransitionAt value to set + * @return the HealthEvent object itself. + */ + public HealthEvent withLastErrorTransitionAt(DateTime lastErrorTransitionAt) { + this.lastErrorTransitionAt = lastErrorTransitionAt; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HealthInformation.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HealthInformation.java new file mode 100644 index 0000000000000..819f86d7dfb01 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HealthInformation.java @@ -0,0 +1,298 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.Period; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents common health report information. It is included in all health + * reports sent to health store and in all health events returned by health + * queries. + */ +public class HealthInformation { + /** + * The source name that identifies the client/watchdog/system component + * that generated the health information. + */ + @JsonProperty(value = "SourceId", required = true) + private String sourceId; + + /** + * 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. + */ + @JsonProperty(value = "Property", required = true) + private String property; + + /** + * 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'. + */ + @JsonProperty(value = "HealthState", required = true) + private HealthState healthState; + + /** + * 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. + */ + @JsonProperty(value = "TimeToLiveInMilliSeconds") + private Period timeToLiveInMilliSeconds; + + /** + * 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. + */ + @JsonProperty(value = "Description") + private String description; + + /** + * 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. + */ + @JsonProperty(value = "SequenceNumber") + private String sequenceNumber; + + /** + * 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. + */ + @JsonProperty(value = "RemoveWhenExpired") + private Boolean removeWhenExpired; + + /** + * Get the source name that identifies the client/watchdog/system component that generated the health information. + * + * @return the sourceId value + */ + public String sourceId() { + return this.sourceId; + } + + /** + * Set the source name that identifies the client/watchdog/system component that generated the health information. + * + * @param sourceId the sourceId value to set + * @return the HealthInformation object itself. + */ + public HealthInformation withSourceId(String sourceId) { + this.sourceId = sourceId; + return this; + } + + /** + * Get 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. + * + * @return the property value + */ + public String property() { + return this.property; + } + + /** + * Set 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 property the property value to set + * @return the HealthInformation object itself. + */ + public HealthInformation withProperty(String property) { + this.property = property; + return this; + } + + /** + * Get 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'. + * + * @return the healthState value + */ + public HealthState healthState() { + return this.healthState; + } + + /** + * Set 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 healthState the healthState value to set + * @return the HealthInformation object itself. + */ + public HealthInformation withHealthState(HealthState healthState) { + this.healthState = healthState; + return this; + } + + /** + * Get 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. + * + * @return the timeToLiveInMilliSeconds value + */ + public Period timeToLiveInMilliSeconds() { + return this.timeToLiveInMilliSeconds; + } + + /** + * Set 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 timeToLiveInMilliSeconds the timeToLiveInMilliSeconds value to set + * @return the HealthInformation object itself. + */ + public HealthInformation withTimeToLiveInMilliSeconds(Period timeToLiveInMilliSeconds) { + this.timeToLiveInMilliSeconds = timeToLiveInMilliSeconds; + return this; + } + + /** + * Get 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. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set 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 description the description value to set + * @return the HealthInformation object itself. + */ + public HealthInformation withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get 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. + * + * @return the sequenceNumber value + */ + public String sequenceNumber() { + return this.sequenceNumber; + } + + /** + * Set 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 sequenceNumber the sequenceNumber value to set + * @return the HealthInformation object itself. + */ + public HealthInformation withSequenceNumber(String sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get 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. + * + * @return the removeWhenExpired value + */ + public Boolean removeWhenExpired() { + return this.removeWhenExpired; + } + + /** + * Set 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 removeWhenExpired the removeWhenExpired value to set + * @return the HealthInformation object itself. + */ + public HealthInformation withRemoveWhenExpired(Boolean removeWhenExpired) { + this.removeWhenExpired = removeWhenExpired; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HealthState.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HealthState.java new file mode 100644 index 0000000000000..e490f22f707d9 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HealthState.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for HealthState. + */ +public final class HealthState extends ExpandableStringEnum { + /** Static value Invalid for HealthState. */ + public static final HealthState INVALID = fromString("Invalid"); + + /** Static value Ok for HealthState. */ + public static final HealthState OK = fromString("Ok"); + + /** Static value Warning for HealthState. */ + public static final HealthState WARNING = fromString("Warning"); + + /** Static value Error for HealthState. */ + public static final HealthState ERROR = fromString("Error"); + + /** Static value Unknown for HealthState. */ + public static final HealthState UNKNOWN = fromString("Unknown"); + + /** + * Creates or finds a HealthState from its string representation. + * @param name a name to look for + * @return the corresponding HealthState + */ + @JsonCreator + public static HealthState fromString(String name) { + return fromString(name, HealthState.class); + } + + /** + * @return known HealthState values + */ + public static Collection values() { + return values(HealthState.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HealthStateCount.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HealthStateCount.java new file mode 100644 index 0000000000000..44ca8dc1d1da9 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HealthStateCount.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents information about how many health entities are in Ok, Warning and + * Error health state. + */ +public class HealthStateCount { + /** + * The number of health entities with aggregated health state Ok. + */ + @JsonProperty(value = "OkCount") + private Long okCount; + + /** + * The number of health entities with aggregated health state Warning. + */ + @JsonProperty(value = "WarningCount") + private Long warningCount; + + /** + * The number of health entities with aggregated health state Error. + */ + @JsonProperty(value = "ErrorCount") + private Long errorCount; + + /** + * Get the number of health entities with aggregated health state Ok. + * + * @return the okCount value + */ + public Long okCount() { + return this.okCount; + } + + /** + * Set the number of health entities with aggregated health state Ok. + * + * @param okCount the okCount value to set + * @return the HealthStateCount object itself. + */ + public HealthStateCount withOkCount(Long okCount) { + this.okCount = okCount; + return this; + } + + /** + * Get the number of health entities with aggregated health state Warning. + * + * @return the warningCount value + */ + public Long warningCount() { + return this.warningCount; + } + + /** + * Set the number of health entities with aggregated health state Warning. + * + * @param warningCount the warningCount value to set + * @return the HealthStateCount object itself. + */ + public HealthStateCount withWarningCount(Long warningCount) { + this.warningCount = warningCount; + return this; + } + + /** + * Get the number of health entities with aggregated health state Error. + * + * @return the errorCount value + */ + public Long errorCount() { + return this.errorCount; + } + + /** + * Set the number of health entities with aggregated health state Error. + * + * @param errorCount the errorCount value to set + * @return the HealthStateCount object itself. + */ + public HealthStateCount withErrorCount(Long errorCount) { + this.errorCount = errorCount; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HealthStatistics.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HealthStatistics.java new file mode 100644 index 0000000000000..f1749e499dcf1 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HealthStatistics.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The health statistics of an entity, returned as part of the health query + * result when the query description is configured to include statistics. + * The statistics include health state counts for all children types of the + * current entity. + * For example, for cluster, the health statistics include health state counts + * for nodes, applications, services, partitions, replicas, deployed + * applications and deployed service packages. + * For partition, the health statistics include health counts for replicas. + */ +public class HealthStatistics { + /** + * 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. + */ + @JsonProperty(value = "HealthStateCountList") + private List healthStateCountList; + + /** + * Get 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. + * + * @return the healthStateCountList value + */ + public List healthStateCountList() { + return this.healthStateCountList; + } + + /** + * Set 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. + * + * @param healthStateCountList the healthStateCountList value to set + * @return the HealthStatistics object itself. + */ + public HealthStatistics withHealthStateCountList(List healthStateCountList) { + this.healthStateCountList = healthStateCountList; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HostIsolationMode.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HostIsolationMode.java new file mode 100644 index 0000000000000..98595a231d71f --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HostIsolationMode.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for HostIsolationMode. + */ +public final class HostIsolationMode extends ExpandableStringEnum { + /** Static value None for HostIsolationMode. */ + public static final HostIsolationMode NONE = fromString("None"); + + /** Static value Process for HostIsolationMode. */ + public static final HostIsolationMode PROCESS = fromString("Process"); + + /** Static value HyperV for HostIsolationMode. */ + public static final HostIsolationMode HYPERV = fromString("HyperV"); + + /** + * Creates or finds a HostIsolationMode from its string representation. + * @param name a name to look for + * @return the corresponding HostIsolationMode + */ + @JsonCreator + public static HostIsolationMode fromString(String name) { + return fromString(name, HostIsolationMode.class); + } + + /** + * @return known HostIsolationMode values + */ + public static Collection values() { + return values(HostIsolationMode.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HostType.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HostType.java new file mode 100644 index 0000000000000..3bc99cc0af303 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HostType.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for HostType. + */ +public final class HostType extends ExpandableStringEnum { + /** Static value Invalid for HostType. */ + public static final HostType INVALID = fromString("Invalid"); + + /** Static value ExeHost for HostType. */ + public static final HostType EXE_HOST = fromString("ExeHost"); + + /** Static value ContainerHost for HostType. */ + public static final HostType CONTAINER_HOST = fromString("ContainerHost"); + + /** + * Creates or finds a HostType from its string representation. + * @param name a name to look for + * @return the corresponding HostType + */ + @JsonCreator + public static HostType fromString(String name) { + return fromString(name, HostType.class); + } + + /** + * @return known HostType values + */ + public static Collection values() { + return values(HostType.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ImageRegistryCredential.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ImageRegistryCredential.java new file mode 100644 index 0000000000000..981d485e04338 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ImageRegistryCredential.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Image registry credential. + */ +public class ImageRegistryCredential { + /** + * Docker image registry server, without protocol such as `http` and + * `https`. + */ + @JsonProperty(value = "server", required = true) + private String server; + + /** + * The username for the private registry. + */ + @JsonProperty(value = "username", required = true) + private String username; + + /** + * The password for the private registry. + */ + @JsonProperty(value = "password") + private String password; + + /** + * Get docker image registry server, without protocol such as `http` and `https`. + * + * @return the server value + */ + public String server() { + return this.server; + } + + /** + * Set docker image registry server, without protocol such as `http` and `https`. + * + * @param server the server value to set + * @return the ImageRegistryCredential object itself. + */ + public ImageRegistryCredential withServer(String server) { + this.server = server; + return this; + } + + /** + * Get the username for the private registry. + * + * @return the username value + */ + public String username() { + return this.username; + } + + /** + * Set the username for the private registry. + * + * @param username the username value to set + * @return the ImageRegistryCredential object itself. + */ + public ImageRegistryCredential withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password for the private registry. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set the password for the private registry. + * + * @param password the password value to set + * @return the ImageRegistryCredential object itself. + */ + public ImageRegistryCredential withPassword(String password) { + this.password = password; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ImageStoreCopyDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ImageStoreCopyDescription.java new file mode 100644 index 0000000000000..2eb068615675e --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ImageStoreCopyDescription.java @@ -0,0 +1,126 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about how to copy image store content from one image store + * relative path to another image store relative path. + */ +public class ImageStoreCopyDescription { + /** + * The relative path of source image store content to be copied from. + */ + @JsonProperty(value = "RemoteSource", required = true) + private String remoteSource; + + /** + * The relative path of destination image store content to be copied to. + */ + @JsonProperty(value = "RemoteDestination", required = true) + private String remoteDestination; + + /** + * The list of the file names to be skipped for copying. + */ + @JsonProperty(value = "SkipFiles") + private List skipFiles; + + /** + * 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. + */ + @JsonProperty(value = "CheckMarkFile") + private Boolean checkMarkFile; + + /** + * Get the relative path of source image store content to be copied from. + * + * @return the remoteSource value + */ + public String remoteSource() { + return this.remoteSource; + } + + /** + * Set the relative path of source image store content to be copied from. + * + * @param remoteSource the remoteSource value to set + * @return the ImageStoreCopyDescription object itself. + */ + public ImageStoreCopyDescription withRemoteSource(String remoteSource) { + this.remoteSource = remoteSource; + return this; + } + + /** + * Get the relative path of destination image store content to be copied to. + * + * @return the remoteDestination value + */ + public String remoteDestination() { + return this.remoteDestination; + } + + /** + * Set the relative path of destination image store content to be copied to. + * + * @param remoteDestination the remoteDestination value to set + * @return the ImageStoreCopyDescription object itself. + */ + public ImageStoreCopyDescription withRemoteDestination(String remoteDestination) { + this.remoteDestination = remoteDestination; + return this; + } + + /** + * Get the list of the file names to be skipped for copying. + * + * @return the skipFiles value + */ + public List skipFiles() { + return this.skipFiles; + } + + /** + * Set the list of the file names to be skipped for copying. + * + * @param skipFiles the skipFiles value to set + * @return the ImageStoreCopyDescription object itself. + */ + public ImageStoreCopyDescription withSkipFiles(List skipFiles) { + this.skipFiles = skipFiles; + return this; + } + + /** + * Get 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. + * + * @return the checkMarkFile value + */ + public Boolean checkMarkFile() { + return this.checkMarkFile; + } + + /** + * Set 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 checkMarkFile the checkMarkFile value to set + * @return the ImageStoreCopyDescription object itself. + */ + public ImageStoreCopyDescription withCheckMarkFile(Boolean checkMarkFile) { + this.checkMarkFile = checkMarkFile; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ImpactLevel.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ImpactLevel.java new file mode 100644 index 0000000000000..fb292152b876c --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ImpactLevel.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ImpactLevel. + */ +public final class ImpactLevel extends ExpandableStringEnum { + /** Static value Invalid for ImpactLevel. */ + public static final ImpactLevel INVALID = fromString("Invalid"); + + /** Static value None for ImpactLevel. */ + public static final ImpactLevel NONE = fromString("None"); + + /** Static value Restart for ImpactLevel. */ + public static final ImpactLevel RESTART = fromString("Restart"); + + /** Static value RemoveData for ImpactLevel. */ + public static final ImpactLevel REMOVE_DATA = fromString("RemoveData"); + + /** Static value RemoveNode for ImpactLevel. */ + public static final ImpactLevel REMOVE_NODE = fromString("RemoveNode"); + + /** + * Creates or finds a ImpactLevel from its string representation. + * @param name a name to look for + * @return the corresponding ImpactLevel + */ + @JsonCreator + public static ImpactLevel fromString(String name) { + return fromString(name, ImpactLevel.class); + } + + /** + * @return known ImpactLevel values + */ + public static Collection values() { + return values(ImpactLevel.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/Int64PropertyValue.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/Int64PropertyValue.java new file mode 100644 index 0000000000000..516ab48cb2c6a --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/Int64PropertyValue.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes a Service Fabric property value of type Int64. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("Int64") +public class Int64PropertyValue extends PropertyValue { + /** + * The data of the property value. + */ + @JsonProperty(value = "Data", required = true) + private String data; + + /** + * Get the data of the property value. + * + * @return the data value + */ + public String data() { + return this.data; + } + + /** + * Set the data of the property value. + * + * @param data the data value to set + * @return the Int64PropertyValue object itself. + */ + public Int64PropertyValue withData(String data) { + this.data = data; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/Int64RangePartitionInformation.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/Int64RangePartitionInformation.java new file mode 100644 index 0000000000000..bb5ec2d6afe00 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/Int64RangePartitionInformation.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the partition information for the integer range that is based on + * partition schemes. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ServicePartitionKind") +@JsonTypeName("Int64Range") +public class Int64RangePartitionInformation extends PartitionInformation { + /** + * Specifies the minimum key value handled by this partition. + */ + @JsonProperty(value = "LowKey") + private String lowKey; + + /** + * Specifies the maximum key value handled by this partition. + */ + @JsonProperty(value = "HighKey") + private String highKey; + + /** + * Get specifies the minimum key value handled by this partition. + * + * @return the lowKey value + */ + public String lowKey() { + return this.lowKey; + } + + /** + * Set specifies the minimum key value handled by this partition. + * + * @param lowKey the lowKey value to set + * @return the Int64RangePartitionInformation object itself. + */ + public Int64RangePartitionInformation withLowKey(String lowKey) { + this.lowKey = lowKey; + return this; + } + + /** + * Get specifies the maximum key value handled by this partition. + * + * @return the highKey value + */ + public String highKey() { + return this.highKey; + } + + /** + * Set specifies the maximum key value handled by this partition. + * + * @param highKey the highKey value to set + * @return the Int64RangePartitionInformation object itself. + */ + public Int64RangePartitionInformation withHighKey(String highKey) { + this.highKey = highKey; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/InvokeDataLossResult.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/InvokeDataLossResult.java new file mode 100644 index 0000000000000..55f80dacadd53 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/InvokeDataLossResult.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents information about an operation in a terminal state (Completed or + * Faulted). + */ +public class InvokeDataLossResult { + /** + * If OperationState is Completed, this is 0. If OperationState is + * Faulted, this is an error code indicating the reason. + */ + @JsonProperty(value = "ErrorCode") + private Integer errorCode; + + /** + * This class returns information about the partition that the user-induced + * operation acted upon. + */ + @JsonProperty(value = "SelectedPartition") + private SelectedPartition selectedPartition; + + /** + * Get if OperationState is Completed, this is 0. If OperationState is Faulted, this is an error code indicating the reason. + * + * @return the errorCode value + */ + public Integer errorCode() { + return this.errorCode; + } + + /** + * Set if OperationState is Completed, this is 0. If OperationState is Faulted, this is an error code indicating the reason. + * + * @param errorCode the errorCode value to set + * @return the InvokeDataLossResult object itself. + */ + public InvokeDataLossResult withErrorCode(Integer errorCode) { + this.errorCode = errorCode; + return this; + } + + /** + * Get this class returns information about the partition that the user-induced operation acted upon. + * + * @return the selectedPartition value + */ + public SelectedPartition selectedPartition() { + return this.selectedPartition; + } + + /** + * Set this class returns information about the partition that the user-induced operation acted upon. + * + * @param selectedPartition the selectedPartition value to set + * @return the InvokeDataLossResult object itself. + */ + public InvokeDataLossResult withSelectedPartition(SelectedPartition selectedPartition) { + this.selectedPartition = selectedPartition; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/InvokeQuorumLossResult.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/InvokeQuorumLossResult.java new file mode 100644 index 0000000000000..ec28d708ef5a5 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/InvokeQuorumLossResult.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents information about an operation in a terminal state (Completed or + * Faulted). + */ +public class InvokeQuorumLossResult { + /** + * If OperationState is Completed, this is 0. If OperationState is + * Faulted, this is an error code indicating the reason. + */ + @JsonProperty(value = "ErrorCode") + private Integer errorCode; + + /** + * This class returns information about the partition that the user-induced + * operation acted upon. + */ + @JsonProperty(value = "SelectedPartition") + private SelectedPartition selectedPartition; + + /** + * Get if OperationState is Completed, this is 0. If OperationState is Faulted, this is an error code indicating the reason. + * + * @return the errorCode value + */ + public Integer errorCode() { + return this.errorCode; + } + + /** + * Set if OperationState is Completed, this is 0. If OperationState is Faulted, this is an error code indicating the reason. + * + * @param errorCode the errorCode value to set + * @return the InvokeQuorumLossResult object itself. + */ + public InvokeQuorumLossResult withErrorCode(Integer errorCode) { + this.errorCode = errorCode; + return this; + } + + /** + * Get this class returns information about the partition that the user-induced operation acted upon. + * + * @return the selectedPartition value + */ + public SelectedPartition selectedPartition() { + return this.selectedPartition; + } + + /** + * Set this class returns information about the partition that the user-induced operation acted upon. + * + * @param selectedPartition the selectedPartition value to set + * @return the InvokeQuorumLossResult object itself. + */ + public InvokeQuorumLossResult withSelectedPartition(SelectedPartition selectedPartition) { + this.selectedPartition = selectedPartition; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/KeyValueStoreReplicaStatus.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/KeyValueStoreReplicaStatus.java new file mode 100644 index 0000000000000..d197e29127f17 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/KeyValueStoreReplicaStatus.java @@ -0,0 +1,154 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Key value store related information for the replica. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("KeyValueStore") +public class KeyValueStoreReplicaStatus extends ReplicaStatusBase { + /** + * Value indicating the estimated number of rows in the underlying + * database. + */ + @JsonProperty(value = "DatabaseRowCountEstimate") + private String databaseRowCountEstimate; + + /** + * Value indicating the estimated size of the underlying database. + */ + @JsonProperty(value = "DatabaseLogicalSizeEstimate") + private String databaseLogicalSizeEstimate; + + /** + * Value indicating the latest key-prefix filter applied to enumeration + * during the callback. Null if there is no pending callback. + */ + @JsonProperty(value = "CopyNotificationCurrentKeyFilter") + private String copyNotificationCurrentKeyFilter; + + /** + * Value indicating the latest number of keys enumerated during the + * callback. 0 if there is no pending callback. + */ + @JsonProperty(value = "CopyNotificationCurrentProgress") + private String copyNotificationCurrentProgress; + + /** + * Value indicating the current status details of the replica. + */ + @JsonProperty(value = "StatusDetails") + private String statusDetails; + + /** + * Get value indicating the estimated number of rows in the underlying database. + * + * @return the databaseRowCountEstimate value + */ + public String databaseRowCountEstimate() { + return this.databaseRowCountEstimate; + } + + /** + * Set value indicating the estimated number of rows in the underlying database. + * + * @param databaseRowCountEstimate the databaseRowCountEstimate value to set + * @return the KeyValueStoreReplicaStatus object itself. + */ + public KeyValueStoreReplicaStatus withDatabaseRowCountEstimate(String databaseRowCountEstimate) { + this.databaseRowCountEstimate = databaseRowCountEstimate; + return this; + } + + /** + * Get value indicating the estimated size of the underlying database. + * + * @return the databaseLogicalSizeEstimate value + */ + public String databaseLogicalSizeEstimate() { + return this.databaseLogicalSizeEstimate; + } + + /** + * Set value indicating the estimated size of the underlying database. + * + * @param databaseLogicalSizeEstimate the databaseLogicalSizeEstimate value to set + * @return the KeyValueStoreReplicaStatus object itself. + */ + public KeyValueStoreReplicaStatus withDatabaseLogicalSizeEstimate(String databaseLogicalSizeEstimate) { + this.databaseLogicalSizeEstimate = databaseLogicalSizeEstimate; + return this; + } + + /** + * Get value indicating the latest key-prefix filter applied to enumeration during the callback. Null if there is no pending callback. + * + * @return the copyNotificationCurrentKeyFilter value + */ + public String copyNotificationCurrentKeyFilter() { + return this.copyNotificationCurrentKeyFilter; + } + + /** + * Set value indicating the latest key-prefix filter applied to enumeration during the callback. Null if there is no pending callback. + * + * @param copyNotificationCurrentKeyFilter the copyNotificationCurrentKeyFilter value to set + * @return the KeyValueStoreReplicaStatus object itself. + */ + public KeyValueStoreReplicaStatus withCopyNotificationCurrentKeyFilter(String copyNotificationCurrentKeyFilter) { + this.copyNotificationCurrentKeyFilter = copyNotificationCurrentKeyFilter; + return this; + } + + /** + * Get value indicating the latest number of keys enumerated during the callback. 0 if there is no pending callback. + * + * @return the copyNotificationCurrentProgress value + */ + public String copyNotificationCurrentProgress() { + return this.copyNotificationCurrentProgress; + } + + /** + * Set value indicating the latest number of keys enumerated during the callback. 0 if there is no pending callback. + * + * @param copyNotificationCurrentProgress the copyNotificationCurrentProgress value to set + * @return the KeyValueStoreReplicaStatus object itself. + */ + public KeyValueStoreReplicaStatus withCopyNotificationCurrentProgress(String copyNotificationCurrentProgress) { + this.copyNotificationCurrentProgress = copyNotificationCurrentProgress; + return this; + } + + /** + * Get value indicating the current status details of the replica. + * + * @return the statusDetails value + */ + public String statusDetails() { + return this.statusDetails; + } + + /** + * Set value indicating the current status details of the replica. + * + * @param statusDetails the statusDetails value to set + * @return the KeyValueStoreReplicaStatus object itself. + */ + public KeyValueStoreReplicaStatus withStatusDetails(String statusDetails) { + this.statusDetails = statusDetails; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/LoadMetricReport.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/LoadMetricReport.java new file mode 100644 index 0000000000000..39903421dffa0 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/LoadMetricReport.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents the load metric report which contains the time metric was + * reported, its name and value. + */ +public class LoadMetricReport { + /** + * Gets the UTC time when the load was reported. + */ + @JsonProperty(value = "LastReportedUtc") + private DateTime lastReportedUtc; + + /** + * The name of the load metric. + */ + @JsonProperty(value = "Name") + private String name; + + /** + * The value of the load metric. + */ + @JsonProperty(value = "Value") + private String value; + + /** + * Get gets the UTC time when the load was reported. + * + * @return the lastReportedUtc value + */ + public DateTime lastReportedUtc() { + return this.lastReportedUtc; + } + + /** + * Set gets the UTC time when the load was reported. + * + * @param lastReportedUtc the lastReportedUtc value to set + * @return the LoadMetricReport object itself. + */ + public LoadMetricReport withLastReportedUtc(DateTime lastReportedUtc) { + this.lastReportedUtc = lastReportedUtc; + return this; + } + + /** + * Get the name of the load metric. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the load metric. + * + * @param name the name value to set + * @return the LoadMetricReport object itself. + */ + public LoadMetricReport withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value of the load metric. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the value of the load metric. + * + * @param value the value value to set + * @return the LoadMetricReport object itself. + */ + public LoadMetricReport withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/LoadMetricReportInfo.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/LoadMetricReportInfo.java new file mode 100644 index 0000000000000..2e152d1d58513 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/LoadMetricReportInfo.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about load reported by replica. + */ +public class LoadMetricReportInfo { + /** + * The name of the metric. + */ + @JsonProperty(value = "Name") + private String name; + + /** + * The value of the load for the metric.. + */ + @JsonProperty(value = "Value") + private Integer value; + + /** + * The UTC time when the load is reported. + */ + @JsonProperty(value = "LastReportedUtc") + private DateTime lastReportedUtc; + + /** + * Get the name of the metric. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the metric. + * + * @param name the name value to set + * @return the LoadMetricReportInfo object itself. + */ + public LoadMetricReportInfo withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value of the load for the metric.. + * + * @return the value value + */ + public Integer value() { + return this.value; + } + + /** + * Set the value of the load for the metric.. + * + * @param value the value value to set + * @return the LoadMetricReportInfo object itself. + */ + public LoadMetricReportInfo withValue(Integer value) { + this.value = value; + return this; + } + + /** + * Get the UTC time when the load is reported. + * + * @return the lastReportedUtc value + */ + public DateTime lastReportedUtc() { + return this.lastReportedUtc; + } + + /** + * Set the UTC time when the load is reported. + * + * @param lastReportedUtc the lastReportedUtc value to set + * @return the LoadMetricReportInfo object itself. + */ + public LoadMetricReportInfo withLastReportedUtc(DateTime lastReportedUtc) { + this.lastReportedUtc = lastReportedUtc; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/MonitoringPolicyDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/MonitoringPolicyDescription.java new file mode 100644 index 0000000000000..414c57a2766a9 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/MonitoringPolicyDescription.java @@ -0,0 +1,202 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the parameters for monitoring an upgrade in Monitored mode. + */ +public class MonitoringPolicyDescription { + /** + * 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'. + */ + @JsonProperty(value = "FailureAction") + private FailureAction failureAction; + + /** + * 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. + */ + @JsonProperty(value = "HealthCheckWaitDurationInMilliseconds") + private String healthCheckWaitDurationInMilliseconds; + + /** + * 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. + */ + @JsonProperty(value = "HealthCheckStableDurationInMilliseconds") + private String healthCheckStableDurationInMilliseconds; + + /** + * 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. + */ + @JsonProperty(value = "HealthCheckRetryTimeoutInMilliseconds") + private String healthCheckRetryTimeoutInMilliseconds; + + /** + * 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. + */ + @JsonProperty(value = "UpgradeTimeoutInMilliseconds") + private String upgradeTimeoutInMilliseconds; + + /** + * 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. + */ + @JsonProperty(value = "UpgradeDomainTimeoutInMilliseconds") + private String upgradeDomainTimeoutInMilliseconds; + + /** + * Get 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'. + * + * @return the failureAction value + */ + public FailureAction failureAction() { + return this.failureAction; + } + + /** + * Set 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 failureAction the failureAction value to set + * @return the MonitoringPolicyDescription object itself. + */ + public MonitoringPolicyDescription withFailureAction(FailureAction failureAction) { + this.failureAction = failureAction; + return this; + } + + /** + * Get 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. + * + * @return the healthCheckWaitDurationInMilliseconds value + */ + public String healthCheckWaitDurationInMilliseconds() { + return this.healthCheckWaitDurationInMilliseconds; + } + + /** + * Set 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 healthCheckWaitDurationInMilliseconds the healthCheckWaitDurationInMilliseconds value to set + * @return the MonitoringPolicyDescription object itself. + */ + public MonitoringPolicyDescription withHealthCheckWaitDurationInMilliseconds(String healthCheckWaitDurationInMilliseconds) { + this.healthCheckWaitDurationInMilliseconds = healthCheckWaitDurationInMilliseconds; + return this; + } + + /** + * Get 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. + * + * @return the healthCheckStableDurationInMilliseconds value + */ + public String healthCheckStableDurationInMilliseconds() { + return this.healthCheckStableDurationInMilliseconds; + } + + /** + * Set 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 healthCheckStableDurationInMilliseconds the healthCheckStableDurationInMilliseconds value to set + * @return the MonitoringPolicyDescription object itself. + */ + public MonitoringPolicyDescription withHealthCheckStableDurationInMilliseconds(String healthCheckStableDurationInMilliseconds) { + this.healthCheckStableDurationInMilliseconds = healthCheckStableDurationInMilliseconds; + return this; + } + + /** + * Get 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. + * + * @return the healthCheckRetryTimeoutInMilliseconds value + */ + public String healthCheckRetryTimeoutInMilliseconds() { + return this.healthCheckRetryTimeoutInMilliseconds; + } + + /** + * Set 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 healthCheckRetryTimeoutInMilliseconds the healthCheckRetryTimeoutInMilliseconds value to set + * @return the MonitoringPolicyDescription object itself. + */ + public MonitoringPolicyDescription withHealthCheckRetryTimeoutInMilliseconds(String healthCheckRetryTimeoutInMilliseconds) { + this.healthCheckRetryTimeoutInMilliseconds = healthCheckRetryTimeoutInMilliseconds; + return this; + } + + /** + * Get 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. + * + * @return the upgradeTimeoutInMilliseconds value + */ + public String upgradeTimeoutInMilliseconds() { + return this.upgradeTimeoutInMilliseconds; + } + + /** + * Set 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 upgradeTimeoutInMilliseconds the upgradeTimeoutInMilliseconds value to set + * @return the MonitoringPolicyDescription object itself. + */ + public MonitoringPolicyDescription withUpgradeTimeoutInMilliseconds(String upgradeTimeoutInMilliseconds) { + this.upgradeTimeoutInMilliseconds = upgradeTimeoutInMilliseconds; + return this; + } + + /** + * Get 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. + * + * @return the upgradeDomainTimeoutInMilliseconds value + */ + public String upgradeDomainTimeoutInMilliseconds() { + return this.upgradeDomainTimeoutInMilliseconds; + } + + /** + * Set 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 upgradeDomainTimeoutInMilliseconds the upgradeDomainTimeoutInMilliseconds value to set + * @return the MonitoringPolicyDescription object itself. + */ + public MonitoringPolicyDescription withUpgradeDomainTimeoutInMilliseconds(String upgradeDomainTimeoutInMilliseconds) { + this.upgradeDomainTimeoutInMilliseconds = upgradeDomainTimeoutInMilliseconds; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/MoveCost.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/MoveCost.java new file mode 100644 index 0000000000000..ca9270d2840fb --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/MoveCost.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for MoveCost. + */ +public final class MoveCost extends ExpandableStringEnum { + /** Static value Zero for MoveCost. */ + public static final MoveCost ZERO = fromString("Zero"); + + /** Static value Low for MoveCost. */ + public static final MoveCost LOW = fromString("Low"); + + /** Static value Medium for MoveCost. */ + public static final MoveCost MEDIUM = fromString("Medium"); + + /** Static value High for MoveCost. */ + public static final MoveCost HIGH = fromString("High"); + + /** + * Creates or finds a MoveCost from its string representation. + * @param name a name to look for + * @return the corresponding MoveCost + */ + @JsonCreator + public static MoveCost fromString(String name) { + return fromString(name, MoveCost.class); + } + + /** + * @return known MoveCost values + */ + public static Collection values() { + return values(MoveCost.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NameDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NameDescription.java new file mode 100644 index 0000000000000..d80df03b43931 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NameDescription.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a Service Fabric name. + */ +public class NameDescription { + /** + * The Service Fabric name, including the 'fabric:' URI scheme. + */ + @JsonProperty(value = "Name", required = true) + private String name; + + /** + * Get the Service Fabric name, including the 'fabric:' URI scheme. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the Service Fabric name, including the 'fabric:' URI scheme. + * + * @param name the name value to set + * @return the NameDescription object itself. + */ + public NameDescription withName(String name) { + this.name = name; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NamedPartitionInformation.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NamedPartitionInformation.java new file mode 100644 index 0000000000000..9245ff7377d0e --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NamedPartitionInformation.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the partition information for the name as a string that is based + * on partition schemes. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ServicePartitionKind") +@JsonTypeName("Named") +public class NamedPartitionInformation extends PartitionInformation { + /** + * Name of the partition. + */ + @JsonProperty(value = "Name") + private String name; + + /** + * Get name of the partition. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the partition. + * + * @param name the name value to set + * @return the NamedPartitionInformation object itself. + */ + public NamedPartitionInformation withName(String name) { + this.name = name; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NamedPartitionSchemeDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NamedPartitionSchemeDescription.java new file mode 100644 index 0000000000000..6b49907982e3c --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NamedPartitionSchemeDescription.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the named partition scheme of the service. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "PartitionScheme") +@JsonTypeName("Named") +public class NamedPartitionSchemeDescription extends PartitionSchemeDescription { + /** + * The number of partitions. + */ + @JsonProperty(value = "Count", required = true) + private int count; + + /** + * Array of size specified by the ‘Count’ parameter, for the names of the + * partitions. + */ + @JsonProperty(value = "Names", required = true) + private List names; + + /** + * Get the number of partitions. + * + * @return the count value + */ + public int count() { + return this.count; + } + + /** + * Set the number of partitions. + * + * @param count the count value to set + * @return the NamedPartitionSchemeDescription object itself. + */ + public NamedPartitionSchemeDescription withCount(int count) { + this.count = count; + return this; + } + + /** + * Get array of size specified by the ‘Count’ parameter, for the names of the partitions. + * + * @return the names value + */ + public List names() { + return this.names; + } + + /** + * Set array of size specified by the ‘Count’ parameter, for the names of the partitions. + * + * @param names the names value to set + * @return the NamedPartitionSchemeDescription object itself. + */ + public NamedPartitionSchemeDescription withNames(List names) { + this.names = names; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NetworkRef.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NetworkRef.java new file mode 100644 index 0000000000000..441a63282b5c3 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NetworkRef.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a network reference in a service. + */ +public class NetworkRef { + /** + * Name of the network. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get name of the network. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the network. + * + * @param name the name value to set + * @return the NetworkRef object itself. + */ + public NetworkRef withName(String name) { + this.name = name; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeAbortedEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeAbortedEvent.java new file mode 100644 index 0000000000000..5264160b98323 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeAbortedEvent.java @@ -0,0 +1,230 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.NodeEventInner; + +/** + * Node Aborted event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("NodeAborted") +public class NodeAbortedEvent extends NodeEventInner { + /** + * Id of Node instance. + */ + @JsonProperty(value = "NodeInstance", required = true) + private long nodeInstance; + + /** + * Id of Node. + */ + @JsonProperty(value = "NodeId", required = true) + private String nodeId; + + /** + * Upgrade domain of Node. + */ + @JsonProperty(value = "UpgradeDomain", required = true) + private String upgradeDomain; + + /** + * Fault domain of Node. + */ + @JsonProperty(value = "FaultDomain", required = true) + private String faultDomain; + + /** + * IP address or FQDN. + */ + @JsonProperty(value = "IpAddressOrFQDN", required = true) + private String ipAddressOrFQDN; + + /** + * Name of Host. + */ + @JsonProperty(value = "Hostname", required = true) + private String hostname; + + /** + * Indicates if it is seed node. + */ + @JsonProperty(value = "IsSeedNode", required = true) + private boolean isSeedNode; + + /** + * Version of Node. + */ + @JsonProperty(value = "NodeVersion", required = true) + private String nodeVersion; + + /** + * Get id of Node instance. + * + * @return the nodeInstance value + */ + public long nodeInstance() { + return this.nodeInstance; + } + + /** + * Set id of Node instance. + * + * @param nodeInstance the nodeInstance value to set + * @return the NodeAbortedEvent object itself. + */ + public NodeAbortedEvent withNodeInstance(long nodeInstance) { + this.nodeInstance = nodeInstance; + return this; + } + + /** + * Get id of Node. + * + * @return the nodeId value + */ + public String nodeId() { + return this.nodeId; + } + + /** + * Set id of Node. + * + * @param nodeId the nodeId value to set + * @return the NodeAbortedEvent object itself. + */ + public NodeAbortedEvent withNodeId(String nodeId) { + this.nodeId = nodeId; + return this; + } + + /** + * Get upgrade domain of Node. + * + * @return the upgradeDomain value + */ + public String upgradeDomain() { + return this.upgradeDomain; + } + + /** + * Set upgrade domain of Node. + * + * @param upgradeDomain the upgradeDomain value to set + * @return the NodeAbortedEvent object itself. + */ + public NodeAbortedEvent withUpgradeDomain(String upgradeDomain) { + this.upgradeDomain = upgradeDomain; + return this; + } + + /** + * Get fault domain of Node. + * + * @return the faultDomain value + */ + public String faultDomain() { + return this.faultDomain; + } + + /** + * Set fault domain of Node. + * + * @param faultDomain the faultDomain value to set + * @return the NodeAbortedEvent object itself. + */ + public NodeAbortedEvent withFaultDomain(String faultDomain) { + this.faultDomain = faultDomain; + return this; + } + + /** + * Get iP address or FQDN. + * + * @return the ipAddressOrFQDN value + */ + public String ipAddressOrFQDN() { + return this.ipAddressOrFQDN; + } + + /** + * Set iP address or FQDN. + * + * @param ipAddressOrFQDN the ipAddressOrFQDN value to set + * @return the NodeAbortedEvent object itself. + */ + public NodeAbortedEvent withIpAddressOrFQDN(String ipAddressOrFQDN) { + this.ipAddressOrFQDN = ipAddressOrFQDN; + return this; + } + + /** + * Get name of Host. + * + * @return the hostname value + */ + public String hostname() { + return this.hostname; + } + + /** + * Set name of Host. + * + * @param hostname the hostname value to set + * @return the NodeAbortedEvent object itself. + */ + public NodeAbortedEvent withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Get indicates if it is seed node. + * + * @return the isSeedNode value + */ + public boolean isSeedNode() { + return this.isSeedNode; + } + + /** + * Set indicates if it is seed node. + * + * @param isSeedNode the isSeedNode value to set + * @return the NodeAbortedEvent object itself. + */ + public NodeAbortedEvent withIsSeedNode(boolean isSeedNode) { + this.isSeedNode = isSeedNode; + return this; + } + + /** + * Get version of Node. + * + * @return the nodeVersion value + */ + public String nodeVersion() { + return this.nodeVersion; + } + + /** + * Set version of Node. + * + * @param nodeVersion the nodeVersion value to set + * @return the NodeAbortedEvent object itself. + */ + public NodeAbortedEvent withNodeVersion(String nodeVersion) { + this.nodeVersion = nodeVersion; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeAbortingEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeAbortingEvent.java new file mode 100644 index 0000000000000..d1e6d19ca0d02 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeAbortingEvent.java @@ -0,0 +1,230 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.NodeEventInner; + +/** + * Node Aborting event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("NodeAborting") +public class NodeAbortingEvent extends NodeEventInner { + /** + * Id of Node instance. + */ + @JsonProperty(value = "NodeInstance", required = true) + private long nodeInstance; + + /** + * Id of Node. + */ + @JsonProperty(value = "NodeId", required = true) + private String nodeId; + + /** + * Upgrade domain of Node. + */ + @JsonProperty(value = "UpgradeDomain", required = true) + private String upgradeDomain; + + /** + * Fault domain of Node. + */ + @JsonProperty(value = "FaultDomain", required = true) + private String faultDomain; + + /** + * IP address or FQDN. + */ + @JsonProperty(value = "IpAddressOrFQDN", required = true) + private String ipAddressOrFQDN; + + /** + * Name of Host. + */ + @JsonProperty(value = "Hostname", required = true) + private String hostname; + + /** + * Indicates if it is seed node. + */ + @JsonProperty(value = "IsSeedNode", required = true) + private boolean isSeedNode; + + /** + * Version of Node. + */ + @JsonProperty(value = "NodeVersion", required = true) + private String nodeVersion; + + /** + * Get id of Node instance. + * + * @return the nodeInstance value + */ + public long nodeInstance() { + return this.nodeInstance; + } + + /** + * Set id of Node instance. + * + * @param nodeInstance the nodeInstance value to set + * @return the NodeAbortingEvent object itself. + */ + public NodeAbortingEvent withNodeInstance(long nodeInstance) { + this.nodeInstance = nodeInstance; + return this; + } + + /** + * Get id of Node. + * + * @return the nodeId value + */ + public String nodeId() { + return this.nodeId; + } + + /** + * Set id of Node. + * + * @param nodeId the nodeId value to set + * @return the NodeAbortingEvent object itself. + */ + public NodeAbortingEvent withNodeId(String nodeId) { + this.nodeId = nodeId; + return this; + } + + /** + * Get upgrade domain of Node. + * + * @return the upgradeDomain value + */ + public String upgradeDomain() { + return this.upgradeDomain; + } + + /** + * Set upgrade domain of Node. + * + * @param upgradeDomain the upgradeDomain value to set + * @return the NodeAbortingEvent object itself. + */ + public NodeAbortingEvent withUpgradeDomain(String upgradeDomain) { + this.upgradeDomain = upgradeDomain; + return this; + } + + /** + * Get fault domain of Node. + * + * @return the faultDomain value + */ + public String faultDomain() { + return this.faultDomain; + } + + /** + * Set fault domain of Node. + * + * @param faultDomain the faultDomain value to set + * @return the NodeAbortingEvent object itself. + */ + public NodeAbortingEvent withFaultDomain(String faultDomain) { + this.faultDomain = faultDomain; + return this; + } + + /** + * Get iP address or FQDN. + * + * @return the ipAddressOrFQDN value + */ + public String ipAddressOrFQDN() { + return this.ipAddressOrFQDN; + } + + /** + * Set iP address or FQDN. + * + * @param ipAddressOrFQDN the ipAddressOrFQDN value to set + * @return the NodeAbortingEvent object itself. + */ + public NodeAbortingEvent withIpAddressOrFQDN(String ipAddressOrFQDN) { + this.ipAddressOrFQDN = ipAddressOrFQDN; + return this; + } + + /** + * Get name of Host. + * + * @return the hostname value + */ + public String hostname() { + return this.hostname; + } + + /** + * Set name of Host. + * + * @param hostname the hostname value to set + * @return the NodeAbortingEvent object itself. + */ + public NodeAbortingEvent withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Get indicates if it is seed node. + * + * @return the isSeedNode value + */ + public boolean isSeedNode() { + return this.isSeedNode; + } + + /** + * Set indicates if it is seed node. + * + * @param isSeedNode the isSeedNode value to set + * @return the NodeAbortingEvent object itself. + */ + public NodeAbortingEvent withIsSeedNode(boolean isSeedNode) { + this.isSeedNode = isSeedNode; + return this; + } + + /** + * Get version of Node. + * + * @return the nodeVersion value + */ + public String nodeVersion() { + return this.nodeVersion; + } + + /** + * Set version of Node. + * + * @param nodeVersion the nodeVersion value to set + * @return the NodeAbortingEvent object itself. + */ + public NodeAbortingEvent withNodeVersion(String nodeVersion) { + this.nodeVersion = nodeVersion; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeAddedEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeAddedEvent.java new file mode 100644 index 0000000000000..db533e80a044d --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeAddedEvent.java @@ -0,0 +1,178 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.NodeEventInner; + +/** + * Node Added event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("NodeAdded") +public class NodeAddedEvent extends NodeEventInner { + /** + * Id of Node. + */ + @JsonProperty(value = "NodeId", required = true) + private String nodeId; + + /** + * Id of Node instance. + */ + @JsonProperty(value = "NodeInstance", required = true) + private long nodeInstance; + + /** + * Type of Node. + */ + @JsonProperty(value = "NodeType", required = true) + private String nodeType; + + /** + * Fabric version. + */ + @JsonProperty(value = "FabricVersion", required = true) + private String fabricVersion; + + /** + * IP address or FQDN. + */ + @JsonProperty(value = "IpAddressOrFQDN", required = true) + private String ipAddressOrFQDN; + + /** + * Capacities. + */ + @JsonProperty(value = "NodeCapacities", required = true) + private String nodeCapacities; + + /** + * Get id of Node. + * + * @return the nodeId value + */ + public String nodeId() { + return this.nodeId; + } + + /** + * Set id of Node. + * + * @param nodeId the nodeId value to set + * @return the NodeAddedEvent object itself. + */ + public NodeAddedEvent withNodeId(String nodeId) { + this.nodeId = nodeId; + return this; + } + + /** + * Get id of Node instance. + * + * @return the nodeInstance value + */ + public long nodeInstance() { + return this.nodeInstance; + } + + /** + * Set id of Node instance. + * + * @param nodeInstance the nodeInstance value to set + * @return the NodeAddedEvent object itself. + */ + public NodeAddedEvent withNodeInstance(long nodeInstance) { + this.nodeInstance = nodeInstance; + return this; + } + + /** + * Get type of Node. + * + * @return the nodeType value + */ + public String nodeType() { + return this.nodeType; + } + + /** + * Set type of Node. + * + * @param nodeType the nodeType value to set + * @return the NodeAddedEvent object itself. + */ + public NodeAddedEvent withNodeType(String nodeType) { + this.nodeType = nodeType; + return this; + } + + /** + * Get fabric version. + * + * @return the fabricVersion value + */ + public String fabricVersion() { + return this.fabricVersion; + } + + /** + * Set fabric version. + * + * @param fabricVersion the fabricVersion value to set + * @return the NodeAddedEvent object itself. + */ + public NodeAddedEvent withFabricVersion(String fabricVersion) { + this.fabricVersion = fabricVersion; + return this; + } + + /** + * Get iP address or FQDN. + * + * @return the ipAddressOrFQDN value + */ + public String ipAddressOrFQDN() { + return this.ipAddressOrFQDN; + } + + /** + * Set iP address or FQDN. + * + * @param ipAddressOrFQDN the ipAddressOrFQDN value to set + * @return the NodeAddedEvent object itself. + */ + public NodeAddedEvent withIpAddressOrFQDN(String ipAddressOrFQDN) { + this.ipAddressOrFQDN = ipAddressOrFQDN; + return this; + } + + /** + * Get capacities. + * + * @return the nodeCapacities value + */ + public String nodeCapacities() { + return this.nodeCapacities; + } + + /** + * Set capacities. + * + * @param nodeCapacities the nodeCapacities value to set + * @return the NodeAddedEvent object itself. + */ + public NodeAddedEvent withNodeCapacities(String nodeCapacities) { + this.nodeCapacities = nodeCapacities; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeCloseEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeCloseEvent.java new file mode 100644 index 0000000000000..57f83a56c1bcd --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeCloseEvent.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.NodeEventInner; + +/** + * Node Close event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("NodeClose") +public class NodeCloseEvent extends NodeEventInner { + /** + * Id of Node. + */ + @JsonProperty(value = "NodeId", required = true) + private String nodeId; + + /** + * Id of Node instance. + */ + @JsonProperty(value = "NodeInstance", required = true) + private String nodeInstance; + + /** + * Describes error. + */ + @JsonProperty(value = "Error", required = true) + private String error; + + /** + * Get id of Node. + * + * @return the nodeId value + */ + public String nodeId() { + return this.nodeId; + } + + /** + * Set id of Node. + * + * @param nodeId the nodeId value to set + * @return the NodeCloseEvent object itself. + */ + public NodeCloseEvent withNodeId(String nodeId) { + this.nodeId = nodeId; + return this; + } + + /** + * Get id of Node instance. + * + * @return the nodeInstance value + */ + public String nodeInstance() { + return this.nodeInstance; + } + + /** + * Set id of Node instance. + * + * @param nodeInstance the nodeInstance value to set + * @return the NodeCloseEvent object itself. + */ + public NodeCloseEvent withNodeInstance(String nodeInstance) { + this.nodeInstance = nodeInstance; + return this; + } + + /** + * Get describes error. + * + * @return the error value + */ + public String error() { + return this.error; + } + + /** + * Set describes error. + * + * @param error the error value to set + * @return the NodeCloseEvent object itself. + */ + public NodeCloseEvent withError(String error) { + this.error = error; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeClosingEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeClosingEvent.java new file mode 100644 index 0000000000000..f69820bb389a8 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeClosingEvent.java @@ -0,0 +1,230 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.NodeEventInner; + +/** + * Node Closing event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("NodeClosing") +public class NodeClosingEvent extends NodeEventInner { + /** + * Id of Node instance. + */ + @JsonProperty(value = "NodeInstance", required = true) + private long nodeInstance; + + /** + * Id of Node. + */ + @JsonProperty(value = "NodeId", required = true) + private String nodeId; + + /** + * Upgrade domain of Node. + */ + @JsonProperty(value = "UpgradeDomain", required = true) + private String upgradeDomain; + + /** + * Fault domain of Node. + */ + @JsonProperty(value = "FaultDomain", required = true) + private String faultDomain; + + /** + * IP address or FQDN. + */ + @JsonProperty(value = "IpAddressOrFQDN", required = true) + private String ipAddressOrFQDN; + + /** + * Name of Host. + */ + @JsonProperty(value = "Hostname", required = true) + private String hostname; + + /** + * Indicates if it is seed node. + */ + @JsonProperty(value = "IsSeedNode", required = true) + private boolean isSeedNode; + + /** + * Version of Node. + */ + @JsonProperty(value = "NodeVersion", required = true) + private String nodeVersion; + + /** + * Get id of Node instance. + * + * @return the nodeInstance value + */ + public long nodeInstance() { + return this.nodeInstance; + } + + /** + * Set id of Node instance. + * + * @param nodeInstance the nodeInstance value to set + * @return the NodeClosingEvent object itself. + */ + public NodeClosingEvent withNodeInstance(long nodeInstance) { + this.nodeInstance = nodeInstance; + return this; + } + + /** + * Get id of Node. + * + * @return the nodeId value + */ + public String nodeId() { + return this.nodeId; + } + + /** + * Set id of Node. + * + * @param nodeId the nodeId value to set + * @return the NodeClosingEvent object itself. + */ + public NodeClosingEvent withNodeId(String nodeId) { + this.nodeId = nodeId; + return this; + } + + /** + * Get upgrade domain of Node. + * + * @return the upgradeDomain value + */ + public String upgradeDomain() { + return this.upgradeDomain; + } + + /** + * Set upgrade domain of Node. + * + * @param upgradeDomain the upgradeDomain value to set + * @return the NodeClosingEvent object itself. + */ + public NodeClosingEvent withUpgradeDomain(String upgradeDomain) { + this.upgradeDomain = upgradeDomain; + return this; + } + + /** + * Get fault domain of Node. + * + * @return the faultDomain value + */ + public String faultDomain() { + return this.faultDomain; + } + + /** + * Set fault domain of Node. + * + * @param faultDomain the faultDomain value to set + * @return the NodeClosingEvent object itself. + */ + public NodeClosingEvent withFaultDomain(String faultDomain) { + this.faultDomain = faultDomain; + return this; + } + + /** + * Get iP address or FQDN. + * + * @return the ipAddressOrFQDN value + */ + public String ipAddressOrFQDN() { + return this.ipAddressOrFQDN; + } + + /** + * Set iP address or FQDN. + * + * @param ipAddressOrFQDN the ipAddressOrFQDN value to set + * @return the NodeClosingEvent object itself. + */ + public NodeClosingEvent withIpAddressOrFQDN(String ipAddressOrFQDN) { + this.ipAddressOrFQDN = ipAddressOrFQDN; + return this; + } + + /** + * Get name of Host. + * + * @return the hostname value + */ + public String hostname() { + return this.hostname; + } + + /** + * Set name of Host. + * + * @param hostname the hostname value to set + * @return the NodeClosingEvent object itself. + */ + public NodeClosingEvent withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Get indicates if it is seed node. + * + * @return the isSeedNode value + */ + public boolean isSeedNode() { + return this.isSeedNode; + } + + /** + * Set indicates if it is seed node. + * + * @param isSeedNode the isSeedNode value to set + * @return the NodeClosingEvent object itself. + */ + public NodeClosingEvent withIsSeedNode(boolean isSeedNode) { + this.isSeedNode = isSeedNode; + return this; + } + + /** + * Get version of Node. + * + * @return the nodeVersion value + */ + public String nodeVersion() { + return this.nodeVersion; + } + + /** + * Set version of Node. + * + * @param nodeVersion the nodeVersion value to set + * @return the NodeClosingEvent object itself. + */ + public NodeClosingEvent withNodeVersion(String nodeVersion) { + this.nodeVersion = nodeVersion; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeDeactivateCompleteEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeDeactivateCompleteEvent.java new file mode 100644 index 0000000000000..9589f813e9ea6 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeDeactivateCompleteEvent.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.NodeEventInner; + +/** + * Node Deactivate Complete event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("NodeDeactivateComplete") +public class NodeDeactivateCompleteEvent extends NodeEventInner { + /** + * Id of Node instance. + */ + @JsonProperty(value = "NodeInstance", required = true) + private long nodeInstance; + + /** + * Describes deactivate intent. + */ + @JsonProperty(value = "EffectiveDeactivateIntent", required = true) + private String effectiveDeactivateIntent; + + /** + * Batch Ids. + */ + @JsonProperty(value = "BatchIdsWithDeactivateIntent", required = true) + private String batchIdsWithDeactivateIntent; + + /** + * Start time. + */ + @JsonProperty(value = "StartTime", required = true) + private DateTime startTime; + + /** + * Get id of Node instance. + * + * @return the nodeInstance value + */ + public long nodeInstance() { + return this.nodeInstance; + } + + /** + * Set id of Node instance. + * + * @param nodeInstance the nodeInstance value to set + * @return the NodeDeactivateCompleteEvent object itself. + */ + public NodeDeactivateCompleteEvent withNodeInstance(long nodeInstance) { + this.nodeInstance = nodeInstance; + return this; + } + + /** + * Get describes deactivate intent. + * + * @return the effectiveDeactivateIntent value + */ + public String effectiveDeactivateIntent() { + return this.effectiveDeactivateIntent; + } + + /** + * Set describes deactivate intent. + * + * @param effectiveDeactivateIntent the effectiveDeactivateIntent value to set + * @return the NodeDeactivateCompleteEvent object itself. + */ + public NodeDeactivateCompleteEvent withEffectiveDeactivateIntent(String effectiveDeactivateIntent) { + this.effectiveDeactivateIntent = effectiveDeactivateIntent; + return this; + } + + /** + * Get batch Ids. + * + * @return the batchIdsWithDeactivateIntent value + */ + public String batchIdsWithDeactivateIntent() { + return this.batchIdsWithDeactivateIntent; + } + + /** + * Set batch Ids. + * + * @param batchIdsWithDeactivateIntent the batchIdsWithDeactivateIntent value to set + * @return the NodeDeactivateCompleteEvent object itself. + */ + public NodeDeactivateCompleteEvent withBatchIdsWithDeactivateIntent(String batchIdsWithDeactivateIntent) { + this.batchIdsWithDeactivateIntent = batchIdsWithDeactivateIntent; + return this; + } + + /** + * Get start time. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set start time. + * + * @param startTime the startTime value to set + * @return the NodeDeactivateCompleteEvent object itself. + */ + public NodeDeactivateCompleteEvent withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeDeactivateStartEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeDeactivateStartEvent.java new file mode 100644 index 0000000000000..cfa0f15961fc5 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeDeactivateStartEvent.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.NodeEventInner; + +/** + * Node Deactivate Start event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("NodeDeactivateStart") +public class NodeDeactivateStartEvent extends NodeEventInner { + /** + * Id of Node instance. + */ + @JsonProperty(value = "NodeInstance", required = true) + private long nodeInstance; + + /** + * Batch Id. + */ + @JsonProperty(value = "BatchId", required = true) + private String batchId; + + /** + * Describes deactivate intent. + */ + @JsonProperty(value = "DeactivateIntent", required = true) + private String deactivateIntent; + + /** + * Get id of Node instance. + * + * @return the nodeInstance value + */ + public long nodeInstance() { + return this.nodeInstance; + } + + /** + * Set id of Node instance. + * + * @param nodeInstance the nodeInstance value to set + * @return the NodeDeactivateStartEvent object itself. + */ + public NodeDeactivateStartEvent withNodeInstance(long nodeInstance) { + this.nodeInstance = nodeInstance; + return this; + } + + /** + * Get batch Id. + * + * @return the batchId value + */ + public String batchId() { + return this.batchId; + } + + /** + * Set batch Id. + * + * @param batchId the batchId value to set + * @return the NodeDeactivateStartEvent object itself. + */ + public NodeDeactivateStartEvent withBatchId(String batchId) { + this.batchId = batchId; + return this; + } + + /** + * Get describes deactivate intent. + * + * @return the deactivateIntent value + */ + public String deactivateIntent() { + return this.deactivateIntent; + } + + /** + * Set describes deactivate intent. + * + * @param deactivateIntent the deactivateIntent value to set + * @return the NodeDeactivateStartEvent object itself. + */ + public NodeDeactivateStartEvent withDeactivateIntent(String deactivateIntent) { + this.deactivateIntent = deactivateIntent; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeDeactivationInfo.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeDeactivationInfo.java new file mode 100644 index 0000000000000..77c02b1b93db9 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeDeactivationInfo.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about the node deactivation. This information is valid for a + * node that is undergoing deactivation or has already been deactivated. + */ +public class NodeDeactivationInfo { + /** + * The intent or the reason for deactivating the node. Following are the + * possible values for it. Possible values include: 'Invalid', 'Pause', + * 'Restart', 'RemoveData', 'RemoveNode'. + */ + @JsonProperty(value = "NodeDeactivationIntent") + private NodeDeactivationIntent nodeDeactivationIntent; + + /** + * The status of node deactivation operation. Following are the possible + * values. Possible values include: 'None', 'SafetyCheckInProgress', + * 'SafetyCheckComplete', 'Completed'. + */ + @JsonProperty(value = "NodeDeactivationStatus") + private NodeDeactivationStatus nodeDeactivationStatus; + + /** + * List of tasks representing the deactivation operation on the node. + */ + @JsonProperty(value = "NodeDeactivationTask") + private List nodeDeactivationTask; + + /** + * List of pending safety checks. + */ + @JsonProperty(value = "PendingSafetyChecks") + private List pendingSafetyChecks; + + /** + * Get the intent or the reason for deactivating the node. Following are the possible values for it. Possible values include: 'Invalid', 'Pause', 'Restart', 'RemoveData', 'RemoveNode'. + * + * @return the nodeDeactivationIntent value + */ + public NodeDeactivationIntent nodeDeactivationIntent() { + return this.nodeDeactivationIntent; + } + + /** + * Set the intent or the reason for deactivating the node. Following are the possible values for it. Possible values include: 'Invalid', 'Pause', 'Restart', 'RemoveData', 'RemoveNode'. + * + * @param nodeDeactivationIntent the nodeDeactivationIntent value to set + * @return the NodeDeactivationInfo object itself. + */ + public NodeDeactivationInfo withNodeDeactivationIntent(NodeDeactivationIntent nodeDeactivationIntent) { + this.nodeDeactivationIntent = nodeDeactivationIntent; + return this; + } + + /** + * Get the status of node deactivation operation. Following are the possible values. Possible values include: 'None', 'SafetyCheckInProgress', 'SafetyCheckComplete', 'Completed'. + * + * @return the nodeDeactivationStatus value + */ + public NodeDeactivationStatus nodeDeactivationStatus() { + return this.nodeDeactivationStatus; + } + + /** + * Set the status of node deactivation operation. Following are the possible values. Possible values include: 'None', 'SafetyCheckInProgress', 'SafetyCheckComplete', 'Completed'. + * + * @param nodeDeactivationStatus the nodeDeactivationStatus value to set + * @return the NodeDeactivationInfo object itself. + */ + public NodeDeactivationInfo withNodeDeactivationStatus(NodeDeactivationStatus nodeDeactivationStatus) { + this.nodeDeactivationStatus = nodeDeactivationStatus; + return this; + } + + /** + * Get list of tasks representing the deactivation operation on the node. + * + * @return the nodeDeactivationTask value + */ + public List nodeDeactivationTask() { + return this.nodeDeactivationTask; + } + + /** + * Set list of tasks representing the deactivation operation on the node. + * + * @param nodeDeactivationTask the nodeDeactivationTask value to set + * @return the NodeDeactivationInfo object itself. + */ + public NodeDeactivationInfo withNodeDeactivationTask(List nodeDeactivationTask) { + this.nodeDeactivationTask = nodeDeactivationTask; + return this; + } + + /** + * Get list of pending safety checks. + * + * @return the pendingSafetyChecks value + */ + public List pendingSafetyChecks() { + return this.pendingSafetyChecks; + } + + /** + * Set list of pending safety checks. + * + * @param pendingSafetyChecks the pendingSafetyChecks value to set + * @return the NodeDeactivationInfo object itself. + */ + public NodeDeactivationInfo withPendingSafetyChecks(List pendingSafetyChecks) { + this.pendingSafetyChecks = pendingSafetyChecks; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeDeactivationIntent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeDeactivationIntent.java new file mode 100644 index 0000000000000..b57a75135126d --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeDeactivationIntent.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for NodeDeactivationIntent. + */ +public final class NodeDeactivationIntent extends ExpandableStringEnum { + /** Static value Invalid for NodeDeactivationIntent. */ + public static final NodeDeactivationIntent INVALID = fromString("Invalid"); + + /** Static value Pause for NodeDeactivationIntent. */ + public static final NodeDeactivationIntent PAUSE = fromString("Pause"); + + /** Static value Restart for NodeDeactivationIntent. */ + public static final NodeDeactivationIntent RESTART = fromString("Restart"); + + /** Static value RemoveData for NodeDeactivationIntent. */ + public static final NodeDeactivationIntent REMOVE_DATA = fromString("RemoveData"); + + /** Static value RemoveNode for NodeDeactivationIntent. */ + public static final NodeDeactivationIntent REMOVE_NODE = fromString("RemoveNode"); + + /** + * Creates or finds a NodeDeactivationIntent from its string representation. + * @param name a name to look for + * @return the corresponding NodeDeactivationIntent + */ + @JsonCreator + public static NodeDeactivationIntent fromString(String name) { + return fromString(name, NodeDeactivationIntent.class); + } + + /** + * @return known NodeDeactivationIntent values + */ + public static Collection values() { + return values(NodeDeactivationIntent.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeDeactivationStatus.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeDeactivationStatus.java new file mode 100644 index 0000000000000..209cd9d96c925 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeDeactivationStatus.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for NodeDeactivationStatus. + */ +public final class NodeDeactivationStatus extends ExpandableStringEnum { + /** Static value None for NodeDeactivationStatus. */ + public static final NodeDeactivationStatus NONE = fromString("None"); + + /** Static value SafetyCheckInProgress for NodeDeactivationStatus. */ + public static final NodeDeactivationStatus SAFETY_CHECK_IN_PROGRESS = fromString("SafetyCheckInProgress"); + + /** Static value SafetyCheckComplete for NodeDeactivationStatus. */ + public static final NodeDeactivationStatus SAFETY_CHECK_COMPLETE = fromString("SafetyCheckComplete"); + + /** Static value Completed for NodeDeactivationStatus. */ + public static final NodeDeactivationStatus COMPLETED = fromString("Completed"); + + /** + * Creates or finds a NodeDeactivationStatus from its string representation. + * @param name a name to look for + * @return the corresponding NodeDeactivationStatus + */ + @JsonCreator + public static NodeDeactivationStatus fromString(String name) { + return fromString(name, NodeDeactivationStatus.class); + } + + /** + * @return known NodeDeactivationStatus values + */ + public static Collection values() { + return values(NodeDeactivationStatus.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeDeactivationTask.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeDeactivationTask.java new file mode 100644 index 0000000000000..ace0cdd2868c3 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeDeactivationTask.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The task representing the deactivation operation on the node. + */ +public class NodeDeactivationTask { + /** + * Identity of the task related to deactivation operation on the node. + */ + @JsonProperty(value = "NodeDeactivationTaskId") + private NodeDeactivationTaskId nodeDeactivationTaskId; + + /** + * The intent or the reason for deactivating the node. Following are the + * possible values for it. Possible values include: 'Invalid', 'Pause', + * 'Restart', 'RemoveData', 'RemoveNode'. + */ + @JsonProperty(value = "NodeDeactivationIntent") + private NodeDeactivationIntent nodeDeactivationIntent; + + /** + * Get identity of the task related to deactivation operation on the node. + * + * @return the nodeDeactivationTaskId value + */ + public NodeDeactivationTaskId nodeDeactivationTaskId() { + return this.nodeDeactivationTaskId; + } + + /** + * Set identity of the task related to deactivation operation on the node. + * + * @param nodeDeactivationTaskId the nodeDeactivationTaskId value to set + * @return the NodeDeactivationTask object itself. + */ + public NodeDeactivationTask withNodeDeactivationTaskId(NodeDeactivationTaskId nodeDeactivationTaskId) { + this.nodeDeactivationTaskId = nodeDeactivationTaskId; + return this; + } + + /** + * Get the intent or the reason for deactivating the node. Following are the possible values for it. Possible values include: 'Invalid', 'Pause', 'Restart', 'RemoveData', 'RemoveNode'. + * + * @return the nodeDeactivationIntent value + */ + public NodeDeactivationIntent nodeDeactivationIntent() { + return this.nodeDeactivationIntent; + } + + /** + * Set the intent or the reason for deactivating the node. Following are the possible values for it. Possible values include: 'Invalid', 'Pause', 'Restart', 'RemoveData', 'RemoveNode'. + * + * @param nodeDeactivationIntent the nodeDeactivationIntent value to set + * @return the NodeDeactivationTask object itself. + */ + public NodeDeactivationTask withNodeDeactivationIntent(NodeDeactivationIntent nodeDeactivationIntent) { + this.nodeDeactivationIntent = nodeDeactivationIntent; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeDeactivationTaskId.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeDeactivationTaskId.java new file mode 100644 index 0000000000000..4e9486b1783ac --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeDeactivationTaskId.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Identity of the task related to deactivation operation on the node. + */ +public class NodeDeactivationTaskId { + /** + * Value of the task id. + */ + @JsonProperty(value = "Id") + private String id; + + /** + * The type of the task that performed the node deactivation. Following are + * the possible values. Possible values include: 'Invalid', + * 'Infrastructure', 'Repair', 'Client'. + */ + @JsonProperty(value = "NodeDeactivationTaskType") + private NodeDeactivationTaskType nodeDeactivationTaskType; + + /** + * Get value of the task id. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set value of the task id. + * + * @param id the id value to set + * @return the NodeDeactivationTaskId object itself. + */ + public NodeDeactivationTaskId withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type of the task that performed the node deactivation. Following are the possible values. Possible values include: 'Invalid', 'Infrastructure', 'Repair', 'Client'. + * + * @return the nodeDeactivationTaskType value + */ + public NodeDeactivationTaskType nodeDeactivationTaskType() { + return this.nodeDeactivationTaskType; + } + + /** + * Set the type of the task that performed the node deactivation. Following are the possible values. Possible values include: 'Invalid', 'Infrastructure', 'Repair', 'Client'. + * + * @param nodeDeactivationTaskType the nodeDeactivationTaskType value to set + * @return the NodeDeactivationTaskId object itself. + */ + public NodeDeactivationTaskId withNodeDeactivationTaskType(NodeDeactivationTaskType nodeDeactivationTaskType) { + this.nodeDeactivationTaskType = nodeDeactivationTaskType; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeDeactivationTaskType.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeDeactivationTaskType.java new file mode 100644 index 0000000000000..cd35ed459ede2 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeDeactivationTaskType.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for NodeDeactivationTaskType. + */ +public final class NodeDeactivationTaskType extends ExpandableStringEnum { + /** Static value Invalid for NodeDeactivationTaskType. */ + public static final NodeDeactivationTaskType INVALID = fromString("Invalid"); + + /** Static value Infrastructure for NodeDeactivationTaskType. */ + public static final NodeDeactivationTaskType INFRASTRUCTURE = fromString("Infrastructure"); + + /** Static value Repair for NodeDeactivationTaskType. */ + public static final NodeDeactivationTaskType REPAIR = fromString("Repair"); + + /** Static value Client for NodeDeactivationTaskType. */ + public static final NodeDeactivationTaskType CLIENT = fromString("Client"); + + /** + * Creates or finds a NodeDeactivationTaskType from its string representation. + * @param name a name to look for + * @return the corresponding NodeDeactivationTaskType + */ + @JsonCreator + public static NodeDeactivationTaskType fromString(String name) { + return fromString(name, NodeDeactivationTaskType.class); + } + + /** + * @return known NodeDeactivationTaskType values + */ + public static Collection values() { + return values(NodeDeactivationTaskType.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeDownEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeDownEvent.java new file mode 100644 index 0000000000000..9fbed3fbe3217 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeDownEvent.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.NodeEventInner; + +/** + * Node Down event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("NodeDown") +public class NodeDownEvent extends NodeEventInner { + /** + * Id of Node instance. + */ + @JsonProperty(value = "NodeInstance", required = true) + private long nodeInstance; + + /** + * Time when Node was last up. + */ + @JsonProperty(value = "LastNodeUpAt", required = true) + private DateTime lastNodeUpAt; + + /** + * Get id of Node instance. + * + * @return the nodeInstance value + */ + public long nodeInstance() { + return this.nodeInstance; + } + + /** + * Set id of Node instance. + * + * @param nodeInstance the nodeInstance value to set + * @return the NodeDownEvent object itself. + */ + public NodeDownEvent withNodeInstance(long nodeInstance) { + this.nodeInstance = nodeInstance; + return this; + } + + /** + * Get time when Node was last up. + * + * @return the lastNodeUpAt value + */ + public DateTime lastNodeUpAt() { + return this.lastNodeUpAt; + } + + /** + * Set time when Node was last up. + * + * @param lastNodeUpAt the lastNodeUpAt value to set + * @return the NodeDownEvent object itself. + */ + public NodeDownEvent withLastNodeUpAt(DateTime lastNodeUpAt) { + this.lastNodeUpAt = lastNodeUpAt; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeHealthEvaluation.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeHealthEvaluation.java new file mode 100644 index 0000000000000..07d066dc81206 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeHealthEvaluation.java @@ -0,0 +1,79 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * 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. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("Node") +public class NodeHealthEvaluation extends HealthEvaluation { + /** + * The name of a Service Fabric node. + */ + @JsonProperty(value = "NodeName") + private String nodeName; + + /** + * List of unhealthy evaluations that led to the current aggregated health + * state of the node. The types of the unhealthy evaluations can be + * EventHealthEvaluation. + */ + @JsonProperty(value = "UnhealthyEvaluations") + private List unhealthyEvaluations; + + /** + * Get the name of a Service Fabric node. + * + * @return the nodeName value + */ + public String nodeName() { + return this.nodeName; + } + + /** + * Set the name of a Service Fabric node. + * + * @param nodeName the nodeName value to set + * @return the NodeHealthEvaluation object itself. + */ + public NodeHealthEvaluation withNodeName(String nodeName) { + this.nodeName = nodeName; + return this; + } + + /** + * Get list of unhealthy evaluations that led to the current aggregated health state of the node. The types of the unhealthy evaluations can be EventHealthEvaluation. + * + * @return the unhealthyEvaluations value + */ + public List unhealthyEvaluations() { + return this.unhealthyEvaluations; + } + + /** + * Set list of unhealthy evaluations that led to the current aggregated health state of the node. The types of the unhealthy evaluations can be EventHealthEvaluation. + * + * @param unhealthyEvaluations the unhealthyEvaluations value to set + * @return the NodeHealthEvaluation object itself. + */ + public NodeHealthEvaluation withUnhealthyEvaluations(List unhealthyEvaluations) { + this.unhealthyEvaluations = unhealthyEvaluations; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeHealthReportCreatedEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeHealthReportCreatedEvent.java new file mode 100644 index 0000000000000..440264586fe45 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeHealthReportCreatedEvent.java @@ -0,0 +1,257 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.NodeEventInner; + +/** + * Node Health Report Created event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("NodeHealthReportCreated") +public class NodeHealthReportCreatedEvent extends NodeEventInner { + /** + * Id of Node instance. + */ + @JsonProperty(value = "NodeInstanceId", required = true) + private long nodeInstanceId; + + /** + * Id of report source. + */ + @JsonProperty(value = "SourceId", required = true) + private String sourceId; + + /** + * Describes the property. + */ + @JsonProperty(value = "Property", required = true) + private String property; + + /** + * Describes the property health state. + */ + @JsonProperty(value = "HealthState", required = true) + private String healthState; + + /** + * Time to live in milli-seconds. + */ + @JsonProperty(value = "TimeToLiveMs", required = true) + private long timeToLiveMs; + + /** + * Sequence number of report. + */ + @JsonProperty(value = "SequenceNumber", required = true) + private long sequenceNumber; + + /** + * Description of report. + */ + @JsonProperty(value = "Description", required = true) + private String description; + + /** + * Indicates the removal when it expires. + */ + @JsonProperty(value = "RemoveWhenExpired", required = true) + private boolean removeWhenExpired; + + /** + * Source time. + */ + @JsonProperty(value = "SourceUtcTimestamp", required = true) + private DateTime sourceUtcTimestamp; + + /** + * Get id of Node instance. + * + * @return the nodeInstanceId value + */ + public long nodeInstanceId() { + return this.nodeInstanceId; + } + + /** + * Set id of Node instance. + * + * @param nodeInstanceId the nodeInstanceId value to set + * @return the NodeHealthReportCreatedEvent object itself. + */ + public NodeHealthReportCreatedEvent withNodeInstanceId(long nodeInstanceId) { + this.nodeInstanceId = nodeInstanceId; + return this; + } + + /** + * Get id of report source. + * + * @return the sourceId value + */ + public String sourceId() { + return this.sourceId; + } + + /** + * Set id of report source. + * + * @param sourceId the sourceId value to set + * @return the NodeHealthReportCreatedEvent object itself. + */ + public NodeHealthReportCreatedEvent withSourceId(String sourceId) { + this.sourceId = sourceId; + return this; + } + + /** + * Get describes the property. + * + * @return the property value + */ + public String property() { + return this.property; + } + + /** + * Set describes the property. + * + * @param property the property value to set + * @return the NodeHealthReportCreatedEvent object itself. + */ + public NodeHealthReportCreatedEvent withProperty(String property) { + this.property = property; + return this; + } + + /** + * Get describes the property health state. + * + * @return the healthState value + */ + public String healthState() { + return this.healthState; + } + + /** + * Set describes the property health state. + * + * @param healthState the healthState value to set + * @return the NodeHealthReportCreatedEvent object itself. + */ + public NodeHealthReportCreatedEvent withHealthState(String healthState) { + this.healthState = healthState; + return this; + } + + /** + * Get time to live in milli-seconds. + * + * @return the timeToLiveMs value + */ + public long timeToLiveMs() { + return this.timeToLiveMs; + } + + /** + * Set time to live in milli-seconds. + * + * @param timeToLiveMs the timeToLiveMs value to set + * @return the NodeHealthReportCreatedEvent object itself. + */ + public NodeHealthReportCreatedEvent withTimeToLiveMs(long timeToLiveMs) { + this.timeToLiveMs = timeToLiveMs; + return this; + } + + /** + * Get sequence number of report. + * + * @return the sequenceNumber value + */ + public long sequenceNumber() { + return this.sequenceNumber; + } + + /** + * Set sequence number of report. + * + * @param sequenceNumber the sequenceNumber value to set + * @return the NodeHealthReportCreatedEvent object itself. + */ + public NodeHealthReportCreatedEvent withSequenceNumber(long sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get description of report. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of report. + * + * @param description the description value to set + * @return the NodeHealthReportCreatedEvent object itself. + */ + public NodeHealthReportCreatedEvent withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get indicates the removal when it expires. + * + * @return the removeWhenExpired value + */ + public boolean removeWhenExpired() { + return this.removeWhenExpired; + } + + /** + * Set indicates the removal when it expires. + * + * @param removeWhenExpired the removeWhenExpired value to set + * @return the NodeHealthReportCreatedEvent object itself. + */ + public NodeHealthReportCreatedEvent withRemoveWhenExpired(boolean removeWhenExpired) { + this.removeWhenExpired = removeWhenExpired; + return this; + } + + /** + * Get source time. + * + * @return the sourceUtcTimestamp value + */ + public DateTime sourceUtcTimestamp() { + return this.sourceUtcTimestamp; + } + + /** + * Set source time. + * + * @param sourceUtcTimestamp the sourceUtcTimestamp value to set + * @return the NodeHealthReportCreatedEvent object itself. + */ + public NodeHealthReportCreatedEvent withSourceUtcTimestamp(DateTime sourceUtcTimestamp) { + this.sourceUtcTimestamp = sourceUtcTimestamp; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeHealthReportExpiredEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeHealthReportExpiredEvent.java new file mode 100644 index 0000000000000..471371469ccb5 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeHealthReportExpiredEvent.java @@ -0,0 +1,257 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.NodeEventInner; + +/** + * Node Health Report Expired event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("NodeHealthReportExpired") +public class NodeHealthReportExpiredEvent extends NodeEventInner { + /** + * Id of Node instance. + */ + @JsonProperty(value = "NodeInstanceId", required = true) + private long nodeInstanceId; + + /** + * Id of report source. + */ + @JsonProperty(value = "SourceId", required = true) + private String sourceId; + + /** + * Describes the property. + */ + @JsonProperty(value = "Property", required = true) + private String property; + + /** + * Describes the property health state. + */ + @JsonProperty(value = "HealthState", required = true) + private String healthState; + + /** + * Time to live in milli-seconds. + */ + @JsonProperty(value = "TimeToLiveMs", required = true) + private long timeToLiveMs; + + /** + * Sequence number of report. + */ + @JsonProperty(value = "SequenceNumber", required = true) + private long sequenceNumber; + + /** + * Description of report. + */ + @JsonProperty(value = "Description", required = true) + private String description; + + /** + * Indicates the removal when it expires. + */ + @JsonProperty(value = "RemoveWhenExpired", required = true) + private boolean removeWhenExpired; + + /** + * Source time. + */ + @JsonProperty(value = "SourceUtcTimestamp", required = true) + private DateTime sourceUtcTimestamp; + + /** + * Get id of Node instance. + * + * @return the nodeInstanceId value + */ + public long nodeInstanceId() { + return this.nodeInstanceId; + } + + /** + * Set id of Node instance. + * + * @param nodeInstanceId the nodeInstanceId value to set + * @return the NodeHealthReportExpiredEvent object itself. + */ + public NodeHealthReportExpiredEvent withNodeInstanceId(long nodeInstanceId) { + this.nodeInstanceId = nodeInstanceId; + return this; + } + + /** + * Get id of report source. + * + * @return the sourceId value + */ + public String sourceId() { + return this.sourceId; + } + + /** + * Set id of report source. + * + * @param sourceId the sourceId value to set + * @return the NodeHealthReportExpiredEvent object itself. + */ + public NodeHealthReportExpiredEvent withSourceId(String sourceId) { + this.sourceId = sourceId; + return this; + } + + /** + * Get describes the property. + * + * @return the property value + */ + public String property() { + return this.property; + } + + /** + * Set describes the property. + * + * @param property the property value to set + * @return the NodeHealthReportExpiredEvent object itself. + */ + public NodeHealthReportExpiredEvent withProperty(String property) { + this.property = property; + return this; + } + + /** + * Get describes the property health state. + * + * @return the healthState value + */ + public String healthState() { + return this.healthState; + } + + /** + * Set describes the property health state. + * + * @param healthState the healthState value to set + * @return the NodeHealthReportExpiredEvent object itself. + */ + public NodeHealthReportExpiredEvent withHealthState(String healthState) { + this.healthState = healthState; + return this; + } + + /** + * Get time to live in milli-seconds. + * + * @return the timeToLiveMs value + */ + public long timeToLiveMs() { + return this.timeToLiveMs; + } + + /** + * Set time to live in milli-seconds. + * + * @param timeToLiveMs the timeToLiveMs value to set + * @return the NodeHealthReportExpiredEvent object itself. + */ + public NodeHealthReportExpiredEvent withTimeToLiveMs(long timeToLiveMs) { + this.timeToLiveMs = timeToLiveMs; + return this; + } + + /** + * Get sequence number of report. + * + * @return the sequenceNumber value + */ + public long sequenceNumber() { + return this.sequenceNumber; + } + + /** + * Set sequence number of report. + * + * @param sequenceNumber the sequenceNumber value to set + * @return the NodeHealthReportExpiredEvent object itself. + */ + public NodeHealthReportExpiredEvent withSequenceNumber(long sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get description of report. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of report. + * + * @param description the description value to set + * @return the NodeHealthReportExpiredEvent object itself. + */ + public NodeHealthReportExpiredEvent withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get indicates the removal when it expires. + * + * @return the removeWhenExpired value + */ + public boolean removeWhenExpired() { + return this.removeWhenExpired; + } + + /** + * Set indicates the removal when it expires. + * + * @param removeWhenExpired the removeWhenExpired value to set + * @return the NodeHealthReportExpiredEvent object itself. + */ + public NodeHealthReportExpiredEvent withRemoveWhenExpired(boolean removeWhenExpired) { + this.removeWhenExpired = removeWhenExpired; + return this; + } + + /** + * Get source time. + * + * @return the sourceUtcTimestamp value + */ + public DateTime sourceUtcTimestamp() { + return this.sourceUtcTimestamp; + } + + /** + * Set source time. + * + * @param sourceUtcTimestamp the sourceUtcTimestamp value to set + * @return the NodeHealthReportExpiredEvent object itself. + */ + public NodeHealthReportExpiredEvent withSourceUtcTimestamp(DateTime sourceUtcTimestamp) { + this.sourceUtcTimestamp = sourceUtcTimestamp; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeHealthState.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeHealthState.java new file mode 100644 index 0000000000000..48826805702bb --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeHealthState.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents the health state of a node, which contains the node identifier + * and its aggregated health state. + */ +public class NodeHealthState extends EntityHealthState { + /** + * The name of a Service Fabric node. + */ + @JsonProperty(value = "Name") + private String name; + + /** + * An internal ID used by Service Fabric to uniquely identify a node. Node + * Id is deterministically generated from node name. + */ + @JsonProperty(value = "Id") + private NodeId id; + + /** + * Get the name of a Service Fabric node. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of a Service Fabric node. + * + * @param name the name value to set + * @return the NodeHealthState object itself. + */ + public NodeHealthState withName(String name) { + this.name = name; + return this; + } + + /** + * Get an internal ID used by Service Fabric to uniquely identify a node. Node Id is deterministically generated from node name. + * + * @return the id value + */ + public NodeId id() { + return this.id; + } + + /** + * Set an internal ID used by Service Fabric to uniquely identify a node. Node Id is deterministically generated from node name. + * + * @param id the id value to set + * @return the NodeHealthState object itself. + */ + public NodeHealthState withId(NodeId id) { + this.id = id; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeHealthStateChunk.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeHealthStateChunk.java new file mode 100644 index 0000000000000..ea60e5b5e6428 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeHealthStateChunk.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents the health state chunk of a node, which contains the node name + * and its aggregated health state. + */ +public class NodeHealthStateChunk extends EntityHealthStateChunk { + /** + * The name of a Service Fabric node. + */ + @JsonProperty(value = "NodeName") + private String nodeName; + + /** + * Get the name of a Service Fabric node. + * + * @return the nodeName value + */ + public String nodeName() { + return this.nodeName; + } + + /** + * Set the name of a Service Fabric node. + * + * @param nodeName the nodeName value to set + * @return the NodeHealthStateChunk object itself. + */ + public NodeHealthStateChunk withNodeName(String nodeName) { + this.nodeName = nodeName; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeHealthStateChunkList.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeHealthStateChunkList.java new file mode 100644 index 0000000000000..55e5aa6cc0ec0 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeHealthStateChunkList.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list of node health state chunks in the cluster that respect the input + * filters in the chunk query. Returned by get cluster health state chunks + * query. + */ +public class NodeHealthStateChunkList extends EntityHealthStateChunkList { + /** + * The list of node health state chunks that respect the input filters in + * the chunk query. + */ + @JsonProperty(value = "Items") + private List items; + + /** + * Get the list of node health state chunks that respect the input filters in the chunk query. + * + * @return the items value + */ + public List items() { + return this.items; + } + + /** + * Set the list of node health state chunks that respect the input filters in the chunk query. + * + * @param items the items value to set + * @return the NodeHealthStateChunkList object itself. + */ + public NodeHealthStateChunkList withItems(List items) { + this.items = items; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeHealthStateFilter.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeHealthStateFilter.java new file mode 100644 index 0000000000000..38272dcf15b71 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeHealthStateFilter.java @@ -0,0 +1,130 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines matching criteria to determine whether a node should be included in + * the returned cluster health chunk. + * One filter can match zero, one or multiple nodes, depending on its + * properties. + * Can be specified in the cluster health chunk query description. + */ +public class NodeHealthStateFilter { + /** + * Name of the node that matches the filter. The filter is applied only to + * the specified node, if it exists. + * If the node doesn't exist, no node is returned in the cluster health + * chunk based on this filter. + * If the node exists, it is included in the cluster health chunk if the + * health state matches the other filter properties. + * If not specified, all nodes that match the parent filters (if any) are + * taken into consideration and matched against the other filter members, + * like health state filter. + */ + @JsonProperty(value = "NodeNameFilter") + private String nodeNameFilter; + + /** + * The filter for the health state of the nodes. It allows selecting nodes + * if they match the desired health states. + * The possible values are integer value of one of the following health + * states. Only nodes that match the filter are returned. All nodes are + * used to evaluate the cluster aggregated health state. + * If not specified, default value is None, unless the node name is + * specified. If the filter has default value and node name is specified, + * the matching node is returned. + * The state values are flag-based enumeration, so the value could be a + * combination of these values obtained using bitwise 'OR' operator. + * For example, if the provided value is 6, it matches nodes with + * HealthState value of OK (2) and Warning (4). + * + * - 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. + */ + @JsonProperty(value = "HealthStateFilter") + private Integer healthStateFilter; + + /** + * Get name of the node that matches the filter. The filter is applied only to the specified node, if it exists. + If the node doesn't exist, no node is returned in the cluster health chunk based on this filter. + If the node exists, it is included in the cluster health chunk if the health state matches the other filter properties. + If not specified, all nodes that match the parent filters (if any) are taken into consideration and matched against the other filter members, like health state filter. + * + * @return the nodeNameFilter value + */ + public String nodeNameFilter() { + return this.nodeNameFilter; + } + + /** + * Set name of the node that matches the filter. The filter is applied only to the specified node, if it exists. + If the node doesn't exist, no node is returned in the cluster health chunk based on this filter. + If the node exists, it is included in the cluster health chunk if the health state matches the other filter properties. + If not specified, all nodes that match the parent filters (if any) are taken into consideration and matched against the other filter members, like health state filter. + * + * @param nodeNameFilter the nodeNameFilter value to set + * @return the NodeHealthStateFilter object itself. + */ + public NodeHealthStateFilter withNodeNameFilter(String nodeNameFilter) { + this.nodeNameFilter = nodeNameFilter; + return this; + } + + /** + * Get the filter for the health state of the nodes. It allows selecting nodes if they match the desired health states. + The possible values are integer value of one of the following health states. Only nodes that match the filter are returned. All nodes are used to evaluate the cluster aggregated health state. + If not specified, default value is None, unless the node name is specified. If the filter has default value and node name is specified, the matching node is returned. + The state values are flag-based enumeration, so the value could be a combination of these values obtained using bitwise 'OR' operator. + For example, if the provided value is 6, it matches nodes with HealthState value of OK (2) and Warning (4). + - Default - Default value. Matches any HealthState. The value is zero. + - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given collection of states. The value is 1. + - Ok - Filter that matches input with HealthState value Ok. The value is 2. + - Warning - Filter that matches input with HealthState value Warning. The value is 4. + - Error - Filter that matches input with HealthState value Error. The value is 8. + - All - Filter that matches input with any HealthState value. The value is 65535. + * + * @return the healthStateFilter value + */ + public Integer healthStateFilter() { + return this.healthStateFilter; + } + + /** + * Set the filter for the health state of the nodes. It allows selecting nodes if they match the desired health states. + The possible values are integer value of one of the following health states. Only nodes that match the filter are returned. All nodes are used to evaluate the cluster aggregated health state. + If not specified, default value is None, unless the node name is specified. If the filter has default value and node name is specified, the matching node is returned. + The state values are flag-based enumeration, so the value could be a combination of these values obtained using bitwise 'OR' operator. + For example, if the provided value is 6, it matches nodes with HealthState value of OK (2) and Warning (4). + - 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 healthStateFilter the healthStateFilter value to set + * @return the NodeHealthStateFilter object itself. + */ + public NodeHealthStateFilter withHealthStateFilter(Integer healthStateFilter) { + this.healthStateFilter = healthStateFilter; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeId.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeId.java new file mode 100644 index 0000000000000..e16ccfd051851 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeId.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An internal ID used by Service Fabric to uniquely identify a node. Node Id + * is deterministically generated from node name. + */ +public class NodeId { + /** + * Value of the node Id. This is a 128 bit integer. + */ + @JsonProperty(value = "Id") + private String id; + + /** + * Get value of the node Id. This is a 128 bit integer. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set value of the node Id. This is a 128 bit integer. + * + * @param id the id value to set + * @return the NodeId object itself. + */ + public NodeId withId(String id) { + this.id = id; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeImpact.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeImpact.java new file mode 100644 index 0000000000000..904225c34e4b5 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeImpact.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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. + */ +public class NodeImpact { + /** + * The name of the impacted node. + */ + @JsonProperty(value = "NodeName", required = true) + private String nodeName; + + /** + * The level of impact expected. Possible values include: 'Invalid', + * 'None', 'Restart', 'RemoveData', 'RemoveNode'. + */ + @JsonProperty(value = "ImpactLevel") + private ImpactLevel impactLevel; + + /** + * Get the name of the impacted node. + * + * @return the nodeName value + */ + public String nodeName() { + return this.nodeName; + } + + /** + * Set the name of the impacted node. + * + * @param nodeName the nodeName value to set + * @return the NodeImpact object itself. + */ + public NodeImpact withNodeName(String nodeName) { + this.nodeName = nodeName; + return this; + } + + /** + * Get the level of impact expected. Possible values include: 'Invalid', 'None', 'Restart', 'RemoveData', 'RemoveNode'. + * + * @return the impactLevel value + */ + public ImpactLevel impactLevel() { + return this.impactLevel; + } + + /** + * Set the level of impact expected. Possible values include: 'Invalid', 'None', 'Restart', 'RemoveData', 'RemoveNode'. + * + * @param impactLevel the impactLevel value to set + * @return the NodeImpact object itself. + */ + public NodeImpact withImpactLevel(ImpactLevel impactLevel) { + this.impactLevel = impactLevel; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeLoadMetricInformation.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeLoadMetricInformation.java new file mode 100644 index 0000000000000..87c5771ff6519 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeLoadMetricInformation.java @@ -0,0 +1,201 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents data structure that contains load information for a certain + * metric on a node. + */ +public class NodeLoadMetricInformation { + /** + * Name of the metric for which this load information is provided. + */ + @JsonProperty(value = "Name") + private String name; + + /** + * Total capacity on the node for this metric. + */ + @JsonProperty(value = "NodeCapacity") + private String nodeCapacity; + + /** + * Current load on the node for this metric. + */ + @JsonProperty(value = "NodeLoad") + private String nodeLoad; + + /** + * The remaining capacity on the node for this metric. + */ + @JsonProperty(value = "NodeRemainingCapacity") + private String nodeRemainingCapacity; + + /** + * Indicates if there is a capacity violation for this metric on the node. + */ + @JsonProperty(value = "IsCapacityViolation") + private Boolean isCapacityViolation; + + /** + * The value that indicates the reserved capacity for this metric on the + * node. + */ + @JsonProperty(value = "NodeBufferedCapacity") + private String nodeBufferedCapacity; + + /** + * The remaining reserved capacity for this metric on the node. + */ + @JsonProperty(value = "NodeRemainingBufferedCapacity") + private String nodeRemainingBufferedCapacity; + + /** + * Get name of the metric for which this load information is provided. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the metric for which this load information is provided. + * + * @param name the name value to set + * @return the NodeLoadMetricInformation object itself. + */ + public NodeLoadMetricInformation withName(String name) { + this.name = name; + return this; + } + + /** + * Get total capacity on the node for this metric. + * + * @return the nodeCapacity value + */ + public String nodeCapacity() { + return this.nodeCapacity; + } + + /** + * Set total capacity on the node for this metric. + * + * @param nodeCapacity the nodeCapacity value to set + * @return the NodeLoadMetricInformation object itself. + */ + public NodeLoadMetricInformation withNodeCapacity(String nodeCapacity) { + this.nodeCapacity = nodeCapacity; + return this; + } + + /** + * Get current load on the node for this metric. + * + * @return the nodeLoad value + */ + public String nodeLoad() { + return this.nodeLoad; + } + + /** + * Set current load on the node for this metric. + * + * @param nodeLoad the nodeLoad value to set + * @return the NodeLoadMetricInformation object itself. + */ + public NodeLoadMetricInformation withNodeLoad(String nodeLoad) { + this.nodeLoad = nodeLoad; + return this; + } + + /** + * Get the remaining capacity on the node for this metric. + * + * @return the nodeRemainingCapacity value + */ + public String nodeRemainingCapacity() { + return this.nodeRemainingCapacity; + } + + /** + * Set the remaining capacity on the node for this metric. + * + * @param nodeRemainingCapacity the nodeRemainingCapacity value to set + * @return the NodeLoadMetricInformation object itself. + */ + public NodeLoadMetricInformation withNodeRemainingCapacity(String nodeRemainingCapacity) { + this.nodeRemainingCapacity = nodeRemainingCapacity; + return this; + } + + /** + * Get indicates if there is a capacity violation for this metric on the node. + * + * @return the isCapacityViolation value + */ + public Boolean isCapacityViolation() { + return this.isCapacityViolation; + } + + /** + * Set indicates if there is a capacity violation for this metric on the node. + * + * @param isCapacityViolation the isCapacityViolation value to set + * @return the NodeLoadMetricInformation object itself. + */ + public NodeLoadMetricInformation withIsCapacityViolation(Boolean isCapacityViolation) { + this.isCapacityViolation = isCapacityViolation; + return this; + } + + /** + * Get the value that indicates the reserved capacity for this metric on the node. + * + * @return the nodeBufferedCapacity value + */ + public String nodeBufferedCapacity() { + return this.nodeBufferedCapacity; + } + + /** + * Set the value that indicates the reserved capacity for this metric on the node. + * + * @param nodeBufferedCapacity the nodeBufferedCapacity value to set + * @return the NodeLoadMetricInformation object itself. + */ + public NodeLoadMetricInformation withNodeBufferedCapacity(String nodeBufferedCapacity) { + this.nodeBufferedCapacity = nodeBufferedCapacity; + return this; + } + + /** + * Get the remaining reserved capacity for this metric on the node. + * + * @return the nodeRemainingBufferedCapacity value + */ + public String nodeRemainingBufferedCapacity() { + return this.nodeRemainingBufferedCapacity; + } + + /** + * Set the remaining reserved capacity for this metric on the node. + * + * @param nodeRemainingBufferedCapacity the nodeRemainingBufferedCapacity value to set + * @return the NodeLoadMetricInformation object itself. + */ + public NodeLoadMetricInformation withNodeRemainingBufferedCapacity(String nodeRemainingBufferedCapacity) { + this.nodeRemainingBufferedCapacity = nodeRemainingBufferedCapacity; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeOpenFailedEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeOpenFailedEvent.java new file mode 100644 index 0000000000000..2ffef709d3591 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeOpenFailedEvent.java @@ -0,0 +1,256 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.NodeEventInner; + +/** + * Node Open Failed event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("NodeOpenFailed") +public class NodeOpenFailedEvent extends NodeEventInner { + /** + * Id of Node instance. + */ + @JsonProperty(value = "NodeInstance", required = true) + private long nodeInstance; + + /** + * Id of Node. + */ + @JsonProperty(value = "NodeId", required = true) + private String nodeId; + + /** + * Upgrade domain of Node. + */ + @JsonProperty(value = "UpgradeDomain", required = true) + private String upgradeDomain; + + /** + * Fault domain of Node. + */ + @JsonProperty(value = "FaultDomain", required = true) + private String faultDomain; + + /** + * IP address or FQDN. + */ + @JsonProperty(value = "IpAddressOrFQDN", required = true) + private String ipAddressOrFQDN; + + /** + * Name of Host. + */ + @JsonProperty(value = "Hostname", required = true) + private String hostname; + + /** + * Indicates if it is seed node. + */ + @JsonProperty(value = "IsSeedNode", required = true) + private boolean isSeedNode; + + /** + * Version of Node. + */ + @JsonProperty(value = "NodeVersion", required = true) + private String nodeVersion; + + /** + * Describes the error. + */ + @JsonProperty(value = "Error", required = true) + private String error; + + /** + * Get id of Node instance. + * + * @return the nodeInstance value + */ + public long nodeInstance() { + return this.nodeInstance; + } + + /** + * Set id of Node instance. + * + * @param nodeInstance the nodeInstance value to set + * @return the NodeOpenFailedEvent object itself. + */ + public NodeOpenFailedEvent withNodeInstance(long nodeInstance) { + this.nodeInstance = nodeInstance; + return this; + } + + /** + * Get id of Node. + * + * @return the nodeId value + */ + public String nodeId() { + return this.nodeId; + } + + /** + * Set id of Node. + * + * @param nodeId the nodeId value to set + * @return the NodeOpenFailedEvent object itself. + */ + public NodeOpenFailedEvent withNodeId(String nodeId) { + this.nodeId = nodeId; + return this; + } + + /** + * Get upgrade domain of Node. + * + * @return the upgradeDomain value + */ + public String upgradeDomain() { + return this.upgradeDomain; + } + + /** + * Set upgrade domain of Node. + * + * @param upgradeDomain the upgradeDomain value to set + * @return the NodeOpenFailedEvent object itself. + */ + public NodeOpenFailedEvent withUpgradeDomain(String upgradeDomain) { + this.upgradeDomain = upgradeDomain; + return this; + } + + /** + * Get fault domain of Node. + * + * @return the faultDomain value + */ + public String faultDomain() { + return this.faultDomain; + } + + /** + * Set fault domain of Node. + * + * @param faultDomain the faultDomain value to set + * @return the NodeOpenFailedEvent object itself. + */ + public NodeOpenFailedEvent withFaultDomain(String faultDomain) { + this.faultDomain = faultDomain; + return this; + } + + /** + * Get iP address or FQDN. + * + * @return the ipAddressOrFQDN value + */ + public String ipAddressOrFQDN() { + return this.ipAddressOrFQDN; + } + + /** + * Set iP address or FQDN. + * + * @param ipAddressOrFQDN the ipAddressOrFQDN value to set + * @return the NodeOpenFailedEvent object itself. + */ + public NodeOpenFailedEvent withIpAddressOrFQDN(String ipAddressOrFQDN) { + this.ipAddressOrFQDN = ipAddressOrFQDN; + return this; + } + + /** + * Get name of Host. + * + * @return the hostname value + */ + public String hostname() { + return this.hostname; + } + + /** + * Set name of Host. + * + * @param hostname the hostname value to set + * @return the NodeOpenFailedEvent object itself. + */ + public NodeOpenFailedEvent withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Get indicates if it is seed node. + * + * @return the isSeedNode value + */ + public boolean isSeedNode() { + return this.isSeedNode; + } + + /** + * Set indicates if it is seed node. + * + * @param isSeedNode the isSeedNode value to set + * @return the NodeOpenFailedEvent object itself. + */ + public NodeOpenFailedEvent withIsSeedNode(boolean isSeedNode) { + this.isSeedNode = isSeedNode; + return this; + } + + /** + * Get version of Node. + * + * @return the nodeVersion value + */ + public String nodeVersion() { + return this.nodeVersion; + } + + /** + * Set version of Node. + * + * @param nodeVersion the nodeVersion value to set + * @return the NodeOpenFailedEvent object itself. + */ + public NodeOpenFailedEvent withNodeVersion(String nodeVersion) { + this.nodeVersion = nodeVersion; + return this; + } + + /** + * Get describes the error. + * + * @return the error value + */ + public String error() { + return this.error; + } + + /** + * Set describes the error. + * + * @param error the error value to set + * @return the NodeOpenFailedEvent object itself. + */ + public NodeOpenFailedEvent withError(String error) { + this.error = error; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeOpenedSuccessEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeOpenedSuccessEvent.java new file mode 100644 index 0000000000000..58d82ddc1fbe1 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeOpenedSuccessEvent.java @@ -0,0 +1,230 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.NodeEventInner; + +/** + * Node Opened Success event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("NodeOpenedSuccess") +public class NodeOpenedSuccessEvent extends NodeEventInner { + /** + * Id of Node instance. + */ + @JsonProperty(value = "NodeInstance", required = true) + private long nodeInstance; + + /** + * Id of Node. + */ + @JsonProperty(value = "NodeId", required = true) + private String nodeId; + + /** + * Upgrade domain of Node. + */ + @JsonProperty(value = "UpgradeDomain", required = true) + private String upgradeDomain; + + /** + * Fault domain of Node. + */ + @JsonProperty(value = "FaultDomain", required = true) + private String faultDomain; + + /** + * IP address or FQDN. + */ + @JsonProperty(value = "IpAddressOrFQDN", required = true) + private String ipAddressOrFQDN; + + /** + * Name of Host. + */ + @JsonProperty(value = "Hostname", required = true) + private String hostname; + + /** + * Indicates if it is seed node. + */ + @JsonProperty(value = "IsSeedNode", required = true) + private boolean isSeedNode; + + /** + * Version of Node. + */ + @JsonProperty(value = "NodeVersion", required = true) + private String nodeVersion; + + /** + * Get id of Node instance. + * + * @return the nodeInstance value + */ + public long nodeInstance() { + return this.nodeInstance; + } + + /** + * Set id of Node instance. + * + * @param nodeInstance the nodeInstance value to set + * @return the NodeOpenedSuccessEvent object itself. + */ + public NodeOpenedSuccessEvent withNodeInstance(long nodeInstance) { + this.nodeInstance = nodeInstance; + return this; + } + + /** + * Get id of Node. + * + * @return the nodeId value + */ + public String nodeId() { + return this.nodeId; + } + + /** + * Set id of Node. + * + * @param nodeId the nodeId value to set + * @return the NodeOpenedSuccessEvent object itself. + */ + public NodeOpenedSuccessEvent withNodeId(String nodeId) { + this.nodeId = nodeId; + return this; + } + + /** + * Get upgrade domain of Node. + * + * @return the upgradeDomain value + */ + public String upgradeDomain() { + return this.upgradeDomain; + } + + /** + * Set upgrade domain of Node. + * + * @param upgradeDomain the upgradeDomain value to set + * @return the NodeOpenedSuccessEvent object itself. + */ + public NodeOpenedSuccessEvent withUpgradeDomain(String upgradeDomain) { + this.upgradeDomain = upgradeDomain; + return this; + } + + /** + * Get fault domain of Node. + * + * @return the faultDomain value + */ + public String faultDomain() { + return this.faultDomain; + } + + /** + * Set fault domain of Node. + * + * @param faultDomain the faultDomain value to set + * @return the NodeOpenedSuccessEvent object itself. + */ + public NodeOpenedSuccessEvent withFaultDomain(String faultDomain) { + this.faultDomain = faultDomain; + return this; + } + + /** + * Get iP address or FQDN. + * + * @return the ipAddressOrFQDN value + */ + public String ipAddressOrFQDN() { + return this.ipAddressOrFQDN; + } + + /** + * Set iP address or FQDN. + * + * @param ipAddressOrFQDN the ipAddressOrFQDN value to set + * @return the NodeOpenedSuccessEvent object itself. + */ + public NodeOpenedSuccessEvent withIpAddressOrFQDN(String ipAddressOrFQDN) { + this.ipAddressOrFQDN = ipAddressOrFQDN; + return this; + } + + /** + * Get name of Host. + * + * @return the hostname value + */ + public String hostname() { + return this.hostname; + } + + /** + * Set name of Host. + * + * @param hostname the hostname value to set + * @return the NodeOpenedSuccessEvent object itself. + */ + public NodeOpenedSuccessEvent withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Get indicates if it is seed node. + * + * @return the isSeedNode value + */ + public boolean isSeedNode() { + return this.isSeedNode; + } + + /** + * Set indicates if it is seed node. + * + * @param isSeedNode the isSeedNode value to set + * @return the NodeOpenedSuccessEvent object itself. + */ + public NodeOpenedSuccessEvent withIsSeedNode(boolean isSeedNode) { + this.isSeedNode = isSeedNode; + return this; + } + + /** + * Get version of Node. + * + * @return the nodeVersion value + */ + public String nodeVersion() { + return this.nodeVersion; + } + + /** + * Set version of Node. + * + * @param nodeVersion the nodeVersion value to set + * @return the NodeOpenedSuccessEvent object itself. + */ + public NodeOpenedSuccessEvent withNodeVersion(String nodeVersion) { + this.nodeVersion = nodeVersion; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeOpeningEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeOpeningEvent.java new file mode 100644 index 0000000000000..e302788d59d14 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeOpeningEvent.java @@ -0,0 +1,230 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.NodeEventInner; + +/** + * Node Opening event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("NodeOpening") +public class NodeOpeningEvent extends NodeEventInner { + /** + * Id of Node instance. + */ + @JsonProperty(value = "NodeInstance", required = true) + private long nodeInstance; + + /** + * Id of Node. + */ + @JsonProperty(value = "NodeId", required = true) + private String nodeId; + + /** + * Upgrade domain of Node. + */ + @JsonProperty(value = "UpgradeDomain", required = true) + private String upgradeDomain; + + /** + * Fault domain of Node. + */ + @JsonProperty(value = "FaultDomain", required = true) + private String faultDomain; + + /** + * IP address or FQDN. + */ + @JsonProperty(value = "IpAddressOrFQDN", required = true) + private String ipAddressOrFQDN; + + /** + * Name of Host. + */ + @JsonProperty(value = "Hostname", required = true) + private String hostname; + + /** + * Indicates if it is seed node. + */ + @JsonProperty(value = "IsSeedNode", required = true) + private boolean isSeedNode; + + /** + * Version of Node. + */ + @JsonProperty(value = "NodeVersion", required = true) + private String nodeVersion; + + /** + * Get id of Node instance. + * + * @return the nodeInstance value + */ + public long nodeInstance() { + return this.nodeInstance; + } + + /** + * Set id of Node instance. + * + * @param nodeInstance the nodeInstance value to set + * @return the NodeOpeningEvent object itself. + */ + public NodeOpeningEvent withNodeInstance(long nodeInstance) { + this.nodeInstance = nodeInstance; + return this; + } + + /** + * Get id of Node. + * + * @return the nodeId value + */ + public String nodeId() { + return this.nodeId; + } + + /** + * Set id of Node. + * + * @param nodeId the nodeId value to set + * @return the NodeOpeningEvent object itself. + */ + public NodeOpeningEvent withNodeId(String nodeId) { + this.nodeId = nodeId; + return this; + } + + /** + * Get upgrade domain of Node. + * + * @return the upgradeDomain value + */ + public String upgradeDomain() { + return this.upgradeDomain; + } + + /** + * Set upgrade domain of Node. + * + * @param upgradeDomain the upgradeDomain value to set + * @return the NodeOpeningEvent object itself. + */ + public NodeOpeningEvent withUpgradeDomain(String upgradeDomain) { + this.upgradeDomain = upgradeDomain; + return this; + } + + /** + * Get fault domain of Node. + * + * @return the faultDomain value + */ + public String faultDomain() { + return this.faultDomain; + } + + /** + * Set fault domain of Node. + * + * @param faultDomain the faultDomain value to set + * @return the NodeOpeningEvent object itself. + */ + public NodeOpeningEvent withFaultDomain(String faultDomain) { + this.faultDomain = faultDomain; + return this; + } + + /** + * Get iP address or FQDN. + * + * @return the ipAddressOrFQDN value + */ + public String ipAddressOrFQDN() { + return this.ipAddressOrFQDN; + } + + /** + * Set iP address or FQDN. + * + * @param ipAddressOrFQDN the ipAddressOrFQDN value to set + * @return the NodeOpeningEvent object itself. + */ + public NodeOpeningEvent withIpAddressOrFQDN(String ipAddressOrFQDN) { + this.ipAddressOrFQDN = ipAddressOrFQDN; + return this; + } + + /** + * Get name of Host. + * + * @return the hostname value + */ + public String hostname() { + return this.hostname; + } + + /** + * Set name of Host. + * + * @param hostname the hostname value to set + * @return the NodeOpeningEvent object itself. + */ + public NodeOpeningEvent withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Get indicates if it is seed node. + * + * @return the isSeedNode value + */ + public boolean isSeedNode() { + return this.isSeedNode; + } + + /** + * Set indicates if it is seed node. + * + * @param isSeedNode the isSeedNode value to set + * @return the NodeOpeningEvent object itself. + */ + public NodeOpeningEvent withIsSeedNode(boolean isSeedNode) { + this.isSeedNode = isSeedNode; + return this; + } + + /** + * Get version of Node. + * + * @return the nodeVersion value + */ + public String nodeVersion() { + return this.nodeVersion; + } + + /** + * Set version of Node. + * + * @param nodeVersion the nodeVersion value to set + * @return the NodeOpeningEvent object itself. + */ + public NodeOpeningEvent withNodeVersion(String nodeVersion) { + this.nodeVersion = nodeVersion; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeRemovedEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeRemovedEvent.java new file mode 100644 index 0000000000000..c9d61ad3acf0c --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeRemovedEvent.java @@ -0,0 +1,178 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.NodeEventInner; + +/** + * Node Removed event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("NodeRemoved") +public class NodeRemovedEvent extends NodeEventInner { + /** + * Id of Node. + */ + @JsonProperty(value = "NodeId", required = true) + private String nodeId; + + /** + * Id of Node instance. + */ + @JsonProperty(value = "NodeInstance", required = true) + private long nodeInstance; + + /** + * Type of Node. + */ + @JsonProperty(value = "NodeType", required = true) + private String nodeType; + + /** + * Fabric version. + */ + @JsonProperty(value = "FabricVersion", required = true) + private String fabricVersion; + + /** + * IP address or FQDN. + */ + @JsonProperty(value = "IpAddressOrFQDN", required = true) + private String ipAddressOrFQDN; + + /** + * Capacities. + */ + @JsonProperty(value = "NodeCapacities", required = true) + private String nodeCapacities; + + /** + * Get id of Node. + * + * @return the nodeId value + */ + public String nodeId() { + return this.nodeId; + } + + /** + * Set id of Node. + * + * @param nodeId the nodeId value to set + * @return the NodeRemovedEvent object itself. + */ + public NodeRemovedEvent withNodeId(String nodeId) { + this.nodeId = nodeId; + return this; + } + + /** + * Get id of Node instance. + * + * @return the nodeInstance value + */ + public long nodeInstance() { + return this.nodeInstance; + } + + /** + * Set id of Node instance. + * + * @param nodeInstance the nodeInstance value to set + * @return the NodeRemovedEvent object itself. + */ + public NodeRemovedEvent withNodeInstance(long nodeInstance) { + this.nodeInstance = nodeInstance; + return this; + } + + /** + * Get type of Node. + * + * @return the nodeType value + */ + public String nodeType() { + return this.nodeType; + } + + /** + * Set type of Node. + * + * @param nodeType the nodeType value to set + * @return the NodeRemovedEvent object itself. + */ + public NodeRemovedEvent withNodeType(String nodeType) { + this.nodeType = nodeType; + return this; + } + + /** + * Get fabric version. + * + * @return the fabricVersion value + */ + public String fabricVersion() { + return this.fabricVersion; + } + + /** + * Set fabric version. + * + * @param fabricVersion the fabricVersion value to set + * @return the NodeRemovedEvent object itself. + */ + public NodeRemovedEvent withFabricVersion(String fabricVersion) { + this.fabricVersion = fabricVersion; + return this; + } + + /** + * Get iP address or FQDN. + * + * @return the ipAddressOrFQDN value + */ + public String ipAddressOrFQDN() { + return this.ipAddressOrFQDN; + } + + /** + * Set iP address or FQDN. + * + * @param ipAddressOrFQDN the ipAddressOrFQDN value to set + * @return the NodeRemovedEvent object itself. + */ + public NodeRemovedEvent withIpAddressOrFQDN(String ipAddressOrFQDN) { + this.ipAddressOrFQDN = ipAddressOrFQDN; + return this; + } + + /** + * Get capacities. + * + * @return the nodeCapacities value + */ + public String nodeCapacities() { + return this.nodeCapacities; + } + + /** + * Set capacities. + * + * @param nodeCapacities the nodeCapacities value to set + * @return the NodeRemovedEvent object itself. + */ + public NodeRemovedEvent withNodeCapacities(String nodeCapacities) { + this.nodeCapacities = nodeCapacities; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeRepairImpactDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeRepairImpactDescription.java new file mode 100644 index 0000000000000..9f1b62a0d6044 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeRepairImpactDescription.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * 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. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("Node") +public class NodeRepairImpactDescription extends RepairImpactDescriptionBase { + /** + * The list of nodes impacted by a repair action and their respective + * expected impact. + */ + @JsonProperty(value = "NodeImpactList") + private List nodeImpactList; + + /** + * Get the list of nodes impacted by a repair action and their respective expected impact. + * + * @return the nodeImpactList value + */ + public List nodeImpactList() { + return this.nodeImpactList; + } + + /** + * Set the list of nodes impacted by a repair action and their respective expected impact. + * + * @param nodeImpactList the nodeImpactList value to set + * @return the NodeRepairImpactDescription object itself. + */ + public NodeRepairImpactDescription withNodeImpactList(List nodeImpactList) { + this.nodeImpactList = nodeImpactList; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeRepairTargetDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeRepairTargetDescription.java new file mode 100644 index 0000000000000..511194da21e77 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeRepairTargetDescription.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * 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. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("Node") +public class NodeRepairTargetDescription extends RepairTargetDescriptionBase { + /** + * The list of nodes targeted by a repair action. + */ + @JsonProperty(value = "NodeNames") + private List nodeNames; + + /** + * Get the list of nodes targeted by a repair action. + * + * @return the nodeNames value + */ + public List nodeNames() { + return this.nodeNames; + } + + /** + * Set the list of nodes targeted by a repair action. + * + * @param nodeNames the nodeNames value to set + * @return the NodeRepairTargetDescription object itself. + */ + public NodeRepairTargetDescription withNodeNames(List nodeNames) { + this.nodeNames = nodeNames; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeResult.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeResult.java new file mode 100644 index 0000000000000..cd37a4cb9caed --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeResult.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains information about a node that was targeted by a user-induced + * operation. + */ +public class NodeResult { + /** + * The name of a Service Fabric node. + */ + @JsonProperty(value = "NodeName") + private String nodeName; + + /** + * The node instance id. + */ + @JsonProperty(value = "NodeInstanceId") + private String nodeInstanceId; + + /** + * Get the name of a Service Fabric node. + * + * @return the nodeName value + */ + public String nodeName() { + return this.nodeName; + } + + /** + * Set the name of a Service Fabric node. + * + * @param nodeName the nodeName value to set + * @return the NodeResult object itself. + */ + public NodeResult withNodeName(String nodeName) { + this.nodeName = nodeName; + return this; + } + + /** + * Get the node instance id. + * + * @return the nodeInstanceId value + */ + public String nodeInstanceId() { + return this.nodeInstanceId; + } + + /** + * Set the node instance id. + * + * @param nodeInstanceId the nodeInstanceId value to set + * @return the NodeResult object itself. + */ + public NodeResult withNodeInstanceId(String nodeInstanceId) { + this.nodeInstanceId = nodeInstanceId; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeStatus.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeStatus.java new file mode 100644 index 0000000000000..12ea516c7e02b --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeStatus.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for NodeStatus. + */ +public final class NodeStatus extends ExpandableStringEnum { + /** Static value Invalid for NodeStatus. */ + public static final NodeStatus INVALID = fromString("Invalid"); + + /** Static value Up for NodeStatus. */ + public static final NodeStatus UP = fromString("Up"); + + /** Static value Down for NodeStatus. */ + public static final NodeStatus DOWN = fromString("Down"); + + /** Static value Enabling for NodeStatus. */ + public static final NodeStatus ENABLING = fromString("Enabling"); + + /** Static value Disabling for NodeStatus. */ + public static final NodeStatus DISABLING = fromString("Disabling"); + + /** Static value Disabled for NodeStatus. */ + public static final NodeStatus DISABLED = fromString("Disabled"); + + /** Static value Unknown for NodeStatus. */ + public static final NodeStatus UNKNOWN = fromString("Unknown"); + + /** Static value Removed for NodeStatus. */ + public static final NodeStatus REMOVED = fromString("Removed"); + + /** + * Creates or finds a NodeStatus from its string representation. + * @param name a name to look for + * @return the corresponding NodeStatus + */ + @JsonCreator + public static NodeStatus fromString(String name) { + return fromString(name, NodeStatus.class); + } + + /** + * @return known NodeStatus values + */ + public static Collection values() { + return values(NodeStatus.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeStatusFilter.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeStatusFilter.java new file mode 100644 index 0000000000000..fd0877d65ba64 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeStatusFilter.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for NodeStatusFilter. + */ +public final class NodeStatusFilter extends ExpandableStringEnum { + /** Static value default for NodeStatusFilter. */ + public static final NodeStatusFilter DEFAULT = fromString("default"); + + /** Static value all for NodeStatusFilter. */ + public static final NodeStatusFilter ALL = fromString("all"); + + /** Static value up for NodeStatusFilter. */ + public static final NodeStatusFilter UP = fromString("up"); + + /** Static value down for NodeStatusFilter. */ + public static final NodeStatusFilter DOWN = fromString("down"); + + /** Static value enabling for NodeStatusFilter. */ + public static final NodeStatusFilter ENABLING = fromString("enabling"); + + /** Static value disabling for NodeStatusFilter. */ + public static final NodeStatusFilter DISABLING = fromString("disabling"); + + /** Static value disabled for NodeStatusFilter. */ + public static final NodeStatusFilter DISABLED = fromString("disabled"); + + /** Static value unknown for NodeStatusFilter. */ + public static final NodeStatusFilter UNKNOWN = fromString("unknown"); + + /** Static value removed for NodeStatusFilter. */ + public static final NodeStatusFilter REMOVED = fromString("removed"); + + /** + * Creates or finds a NodeStatusFilter from its string representation. + * @param name a name to look for + * @return the corresponding NodeStatusFilter + */ + @JsonCreator + public static NodeStatusFilter fromString(String name) { + return fromString(name, NodeStatusFilter.class); + } + + /** + * @return known NodeStatusFilter values + */ + public static Collection values() { + return values(NodeStatusFilter.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeTransitionResult.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeTransitionResult.java new file mode 100644 index 0000000000000..d71d8a099419b --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeTransitionResult.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents information about an operation in a terminal state (Completed or + * Faulted). + */ +public class NodeTransitionResult { + /** + * If OperationState is Completed, this is 0. If OperationState is + * Faulted, this is an error code indicating the reason. + */ + @JsonProperty(value = "ErrorCode") + private Integer errorCode; + + /** + * Contains information about a node that was targeted by a user-induced + * operation. + */ + @JsonProperty(value = "NodeResult") + private NodeResult nodeResult; + + /** + * Get if OperationState is Completed, this is 0. If OperationState is Faulted, this is an error code indicating the reason. + * + * @return the errorCode value + */ + public Integer errorCode() { + return this.errorCode; + } + + /** + * Set if OperationState is Completed, this is 0. If OperationState is Faulted, this is an error code indicating the reason. + * + * @param errorCode the errorCode value to set + * @return the NodeTransitionResult object itself. + */ + public NodeTransitionResult withErrorCode(Integer errorCode) { + this.errorCode = errorCode; + return this; + } + + /** + * Get contains information about a node that was targeted by a user-induced operation. + * + * @return the nodeResult value + */ + public NodeResult nodeResult() { + return this.nodeResult; + } + + /** + * Set contains information about a node that was targeted by a user-induced operation. + * + * @param nodeResult the nodeResult value to set + * @return the NodeTransitionResult object itself. + */ + public NodeTransitionResult withNodeResult(NodeResult nodeResult) { + this.nodeResult = nodeResult; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeTransitionType.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeTransitionType.java new file mode 100644 index 0000000000000..398ca2632e715 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeTransitionType.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for NodeTransitionType. + */ +public final class NodeTransitionType extends ExpandableStringEnum { + /** Static value Invalid for NodeTransitionType. */ + public static final NodeTransitionType INVALID = fromString("Invalid"); + + /** Static value Start for NodeTransitionType. */ + public static final NodeTransitionType START = fromString("Start"); + + /** Static value Stop for NodeTransitionType. */ + public static final NodeTransitionType STOP = fromString("Stop"); + + /** + * Creates or finds a NodeTransitionType from its string representation. + * @param name a name to look for + * @return the corresponding NodeTransitionType + */ + @JsonCreator + public static NodeTransitionType fromString(String name) { + return fromString(name, NodeTransitionType.class); + } + + /** + * @return known NodeTransitionType values + */ + public static Collection values() { + return values(NodeTransitionType.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeUpEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeUpEvent.java new file mode 100644 index 0000000000000..f51c2887f0c75 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeUpEvent.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.NodeEventInner; + +/** + * Node Up event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("NodeUp") +public class NodeUpEvent extends NodeEventInner { + /** + * Id of Node instance. + */ + @JsonProperty(value = "NodeInstance", required = true) + private long nodeInstance; + + /** + * Time when Node was last down. + */ + @JsonProperty(value = "LastNodeDownAt", required = true) + private DateTime lastNodeDownAt; + + /** + * Get id of Node instance. + * + * @return the nodeInstance value + */ + public long nodeInstance() { + return this.nodeInstance; + } + + /** + * Set id of Node instance. + * + * @param nodeInstance the nodeInstance value to set + * @return the NodeUpEvent object itself. + */ + public NodeUpEvent withNodeInstance(long nodeInstance) { + this.nodeInstance = nodeInstance; + return this; + } + + /** + * Get time when Node was last down. + * + * @return the lastNodeDownAt value + */ + public DateTime lastNodeDownAt() { + return this.lastNodeDownAt; + } + + /** + * Set time when Node was last down. + * + * @param lastNodeDownAt the lastNodeDownAt value to set + * @return the NodeUpEvent object itself. + */ + public NodeUpEvent withLastNodeDownAt(DateTime lastNodeDownAt) { + this.lastNodeDownAt = lastNodeDownAt; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeUpgradePhase.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeUpgradePhase.java new file mode 100644 index 0000000000000..374ae42c92e32 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeUpgradePhase.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for NodeUpgradePhase. + */ +public final class NodeUpgradePhase extends ExpandableStringEnum { + /** Static value Invalid for NodeUpgradePhase. */ + public static final NodeUpgradePhase INVALID = fromString("Invalid"); + + /** Static value PreUpgradeSafetyCheck for NodeUpgradePhase. */ + public static final NodeUpgradePhase PRE_UPGRADE_SAFETY_CHECK = fromString("PreUpgradeSafetyCheck"); + + /** Static value Upgrading for NodeUpgradePhase. */ + public static final NodeUpgradePhase UPGRADING = fromString("Upgrading"); + + /** Static value PostUpgradeSafetyCheck for NodeUpgradePhase. */ + public static final NodeUpgradePhase POST_UPGRADE_SAFETY_CHECK = fromString("PostUpgradeSafetyCheck"); + + /** + * Creates or finds a NodeUpgradePhase from its string representation. + * @param name a name to look for + * @return the corresponding NodeUpgradePhase + */ + @JsonCreator + public static NodeUpgradePhase fromString(String name) { + return fromString(name, NodeUpgradePhase.class); + } + + /** + * @return known NodeUpgradePhase values + */ + public static Collection values() { + return values(NodeUpgradePhase.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeUpgradeProgressInfo.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeUpgradeProgressInfo.java new file mode 100644 index 0000000000000..3fd3aadbfde1a --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeUpgradeProgressInfo.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about the upgrading node and its status. + */ +public class NodeUpgradeProgressInfo { + /** + * The name of a Service Fabric node. + */ + @JsonProperty(value = "NodeName") + private String nodeName; + + /** + * The state of the upgrading node. Possible values include: 'Invalid', + * 'PreUpgradeSafetyCheck', 'Upgrading', 'PostUpgradeSafetyCheck'. + */ + @JsonProperty(value = "UpgradePhase") + private NodeUpgradePhase upgradePhase; + + /** + * List of pending safety checks. + */ + @JsonProperty(value = "PendingSafetyChecks") + private List pendingSafetyChecks; + + /** + * Get the name of a Service Fabric node. + * + * @return the nodeName value + */ + public String nodeName() { + return this.nodeName; + } + + /** + * Set the name of a Service Fabric node. + * + * @param nodeName the nodeName value to set + * @return the NodeUpgradeProgressInfo object itself. + */ + public NodeUpgradeProgressInfo withNodeName(String nodeName) { + this.nodeName = nodeName; + return this; + } + + /** + * Get the state of the upgrading node. Possible values include: 'Invalid', 'PreUpgradeSafetyCheck', 'Upgrading', 'PostUpgradeSafetyCheck'. + * + * @return the upgradePhase value + */ + public NodeUpgradePhase upgradePhase() { + return this.upgradePhase; + } + + /** + * Set the state of the upgrading node. Possible values include: 'Invalid', 'PreUpgradeSafetyCheck', 'Upgrading', 'PostUpgradeSafetyCheck'. + * + * @param upgradePhase the upgradePhase value to set + * @return the NodeUpgradeProgressInfo object itself. + */ + public NodeUpgradeProgressInfo withUpgradePhase(NodeUpgradePhase upgradePhase) { + this.upgradePhase = upgradePhase; + return this; + } + + /** + * Get list of pending safety checks. + * + * @return the pendingSafetyChecks value + */ + public List pendingSafetyChecks() { + return this.pendingSafetyChecks; + } + + /** + * Set list of pending safety checks. + * + * @param pendingSafetyChecks the pendingSafetyChecks value to set + * @return the NodeUpgradeProgressInfo object itself. + */ + public NodeUpgradeProgressInfo withPendingSafetyChecks(List pendingSafetyChecks) { + this.pendingSafetyChecks = pendingSafetyChecks; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodesHealthEvaluation.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodesHealthEvaluation.java new file mode 100644 index 0000000000000..2477f6af3a089 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodesHealthEvaluation.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents health evaluation for nodes, containing health evaluations for + * each unhealthy node that impacted current aggregated health state. Can be + * returned when evaluating cluster health and the aggregated health state is + * either Error or Warning. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("Nodes") +public class NodesHealthEvaluation extends HealthEvaluation { + /** + * Maximum allowed percentage of unhealthy nodes from the + * ClusterHealthPolicy. + */ + @JsonProperty(value = "MaxPercentUnhealthyNodes") + private Integer maxPercentUnhealthyNodes; + + /** + * Total number of nodes found in the health store. + */ + @JsonProperty(value = "TotalCount") + private Long totalCount; + + /** + * List of unhealthy evaluations that led to the aggregated health state. + * Includes all the unhealthy NodeHealthEvaluation that impacted the + * aggregated health. + */ + @JsonProperty(value = "UnhealthyEvaluations") + private List unhealthyEvaluations; + + /** + * Get maximum allowed percentage of unhealthy nodes from the ClusterHealthPolicy. + * + * @return the maxPercentUnhealthyNodes value + */ + public Integer maxPercentUnhealthyNodes() { + return this.maxPercentUnhealthyNodes; + } + + /** + * Set maximum allowed percentage of unhealthy nodes from the ClusterHealthPolicy. + * + * @param maxPercentUnhealthyNodes the maxPercentUnhealthyNodes value to set + * @return the NodesHealthEvaluation object itself. + */ + public NodesHealthEvaluation withMaxPercentUnhealthyNodes(Integer maxPercentUnhealthyNodes) { + this.maxPercentUnhealthyNodes = maxPercentUnhealthyNodes; + return this; + } + + /** + * Get total number of nodes found in the health store. + * + * @return the totalCount value + */ + public Long totalCount() { + return this.totalCount; + } + + /** + * Set total number of nodes found in the health store. + * + * @param totalCount the totalCount value to set + * @return the NodesHealthEvaluation object itself. + */ + public NodesHealthEvaluation withTotalCount(Long totalCount) { + this.totalCount = totalCount; + return this; + } + + /** + * Get list of unhealthy evaluations that led to the aggregated health state. Includes all the unhealthy NodeHealthEvaluation that impacted the aggregated health. + * + * @return the unhealthyEvaluations value + */ + public List unhealthyEvaluations() { + return this.unhealthyEvaluations; + } + + /** + * Set list of unhealthy evaluations that led to the aggregated health state. Includes all the unhealthy NodeHealthEvaluation that impacted the aggregated health. + * + * @param unhealthyEvaluations the unhealthyEvaluations value to set + * @return the NodesHealthEvaluation object itself. + */ + public NodesHealthEvaluation withUnhealthyEvaluations(List unhealthyEvaluations) { + this.unhealthyEvaluations = unhealthyEvaluations; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/OperatingSystemTypes.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/OperatingSystemTypes.java new file mode 100644 index 0000000000000..923c69542f4eb --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/OperatingSystemTypes.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for OperatingSystemTypes. + */ +public final class OperatingSystemTypes extends ExpandableStringEnum { + /** Static value Linux for OperatingSystemTypes. */ + public static final OperatingSystemTypes LINUX = fromString("Linux"); + + /** Static value Windows for OperatingSystemTypes. */ + public static final OperatingSystemTypes WINDOWS = fromString("Windows"); + + /** + * Creates or finds a OperatingSystemTypes from its string representation. + * @param name a name to look for + * @return the corresponding OperatingSystemTypes + */ + @JsonCreator + public static OperatingSystemTypes fromString(String name) { + return fromString(name, OperatingSystemTypes.class); + } + + /** + * @return known OperatingSystemTypes values + */ + public static Collection values() { + return values(OperatingSystemTypes.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/OperationState.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/OperationState.java new file mode 100644 index 0000000000000..888184f83c8f1 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/OperationState.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for OperationState. + */ +public final class OperationState extends ExpandableStringEnum { + /** Static value Invalid for OperationState. */ + public static final OperationState INVALID = fromString("Invalid"); + + /** Static value Running for OperationState. */ + public static final OperationState RUNNING = fromString("Running"); + + /** Static value RollingBack for OperationState. */ + public static final OperationState ROLLING_BACK = fromString("RollingBack"); + + /** Static value Completed for OperationState. */ + public static final OperationState COMPLETED = fromString("Completed"); + + /** Static value Faulted for OperationState. */ + public static final OperationState FAULTED = fromString("Faulted"); + + /** Static value Cancelled for OperationState. */ + public static final OperationState CANCELLED = fromString("Cancelled"); + + /** Static value ForceCancelled for OperationState. */ + public static final OperationState FORCE_CANCELLED = fromString("ForceCancelled"); + + /** + * Creates or finds a OperationState from its string representation. + * @param name a name to look for + * @return the corresponding OperationState + */ + @JsonCreator + public static OperationState fromString(String name) { + return fromString(name, OperationState.class); + } + + /** + * @return known OperationState values + */ + public static Collection values() { + return values(OperationState.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/OperationType.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/OperationType.java new file mode 100644 index 0000000000000..ac91593e1fe9b --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/OperationType.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for OperationType. + */ +public final class OperationType extends ExpandableStringEnum { + /** Static value Invalid for OperationType. */ + public static final OperationType INVALID = fromString("Invalid"); + + /** Static value PartitionDataLoss for OperationType. */ + public static final OperationType PARTITION_DATA_LOSS = fromString("PartitionDataLoss"); + + /** Static value PartitionQuorumLoss for OperationType. */ + public static final OperationType PARTITION_QUORUM_LOSS = fromString("PartitionQuorumLoss"); + + /** Static value PartitionRestart for OperationType. */ + public static final OperationType PARTITION_RESTART = fromString("PartitionRestart"); + + /** Static value NodeTransition for OperationType. */ + public static final OperationType NODE_TRANSITION = fromString("NodeTransition"); + + /** + * Creates or finds a OperationType from its string representation. + * @param name a name to look for + * @return the corresponding OperationType + */ + @JsonCreator + public static OperationType fromString(String name) { + return fromString(name, OperationType.class); + } + + /** + * @return known OperationType values + */ + public static Collection values() { + return values(OperationType.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PackageSharingPolicyInfo.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PackageSharingPolicyInfo.java new file mode 100644 index 0000000000000..37e2351119d62 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PackageSharingPolicyInfo.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents a policy for the package sharing. + */ +public class PackageSharingPolicyInfo { + /** + * The name of code, configuration or data package that should be shared. + */ + @JsonProperty(value = "SharedPackageName") + private String sharedPackageName; + + /** + * Represents the scope for PackageSharingPolicy. This is specified during + * DeployServicePackageToNode operation. Possible values include: 'None', + * 'All', 'Code', 'Config', 'Data'. + */ + @JsonProperty(value = "PackageSharingScope") + private PackageSharingPolicyScope packageSharingScope; + + /** + * Get the name of code, configuration or data package that should be shared. + * + * @return the sharedPackageName value + */ + public String sharedPackageName() { + return this.sharedPackageName; + } + + /** + * Set the name of code, configuration or data package that should be shared. + * + * @param sharedPackageName the sharedPackageName value to set + * @return the PackageSharingPolicyInfo object itself. + */ + public PackageSharingPolicyInfo withSharedPackageName(String sharedPackageName) { + this.sharedPackageName = sharedPackageName; + return this; + } + + /** + * Get represents the scope for PackageSharingPolicy. This is specified during DeployServicePackageToNode operation. Possible values include: 'None', 'All', 'Code', 'Config', 'Data'. + * + * @return the packageSharingScope value + */ + public PackageSharingPolicyScope packageSharingScope() { + return this.packageSharingScope; + } + + /** + * Set represents the scope for PackageSharingPolicy. This is specified during DeployServicePackageToNode operation. Possible values include: 'None', 'All', 'Code', 'Config', 'Data'. + * + * @param packageSharingScope the packageSharingScope value to set + * @return the PackageSharingPolicyInfo object itself. + */ + public PackageSharingPolicyInfo withPackageSharingScope(PackageSharingPolicyScope packageSharingScope) { + this.packageSharingScope = packageSharingScope; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PackageSharingPolicyScope.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PackageSharingPolicyScope.java new file mode 100644 index 0000000000000..4578db7920ca1 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PackageSharingPolicyScope.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PackageSharingPolicyScope. + */ +public final class PackageSharingPolicyScope extends ExpandableStringEnum { + /** Static value None for PackageSharingPolicyScope. */ + public static final PackageSharingPolicyScope NONE = fromString("None"); + + /** Static value All for PackageSharingPolicyScope. */ + public static final PackageSharingPolicyScope ALL = fromString("All"); + + /** Static value Code for PackageSharingPolicyScope. */ + public static final PackageSharingPolicyScope CODE = fromString("Code"); + + /** Static value Config for PackageSharingPolicyScope. */ + public static final PackageSharingPolicyScope CONFIG = fromString("Config"); + + /** Static value Data for PackageSharingPolicyScope. */ + public static final PackageSharingPolicyScope DATA = fromString("Data"); + + /** + * Creates or finds a PackageSharingPolicyScope from its string representation. + * @param name a name to look for + * @return the corresponding PackageSharingPolicyScope + */ + @JsonCreator + public static PackageSharingPolicyScope fromString(String name) { + return fromString(name, PackageSharingPolicyScope.class); + } + + /** + * @return known PackageSharingPolicyScope values + */ + public static Collection values() { + return values(PackageSharingPolicyScope.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionAccessStatus.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionAccessStatus.java new file mode 100644 index 0000000000000..472a15c1a95e7 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionAccessStatus.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PartitionAccessStatus. + */ +public final class PartitionAccessStatus extends ExpandableStringEnum { + /** Static value Invalid for PartitionAccessStatus. */ + public static final PartitionAccessStatus INVALID = fromString("Invalid"); + + /** Static value Granted for PartitionAccessStatus. */ + public static final PartitionAccessStatus GRANTED = fromString("Granted"); + + /** Static value ReconfigurationPending for PartitionAccessStatus. */ + public static final PartitionAccessStatus RECONFIGURATION_PENDING = fromString("ReconfigurationPending"); + + /** Static value NotPrimary for PartitionAccessStatus. */ + public static final PartitionAccessStatus NOT_PRIMARY = fromString("NotPrimary"); + + /** Static value NoWriteQuorum for PartitionAccessStatus. */ + public static final PartitionAccessStatus NO_WRITE_QUORUM = fromString("NoWriteQuorum"); + + /** + * Creates or finds a PartitionAccessStatus from its string representation. + * @param name a name to look for + * @return the corresponding PartitionAccessStatus + */ + @JsonCreator + public static PartitionAccessStatus fromString(String name) { + return fromString(name, PartitionAccessStatus.class); + } + + /** + * @return known PartitionAccessStatus values + */ + public static Collection values() { + return values(PartitionAccessStatus.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionAnalysisEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionAnalysisEvent.java new file mode 100644 index 0000000000000..22d750f872c54 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionAnalysisEvent.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.microsoft.azure.servicefabric.implementation.PartitionEventInner; + +/** + * Represents the base for all Partition Analysis Events. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("PartitionAnalysisEvent") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "PartitionPrimaryMoveAnalysis", value = PartitionPrimaryMoveAnalysisEvent.class) +}) +public class PartitionAnalysisEvent extends PartitionEventInner { + /** + * Metadata about an Analysis Event. + */ + @JsonProperty(value = "Metadata", required = true) + private AnalysisEventMetadata metadata; + + /** + * Get metadata about an Analysis Event. + * + * @return the metadata value + */ + public AnalysisEventMetadata metadata() { + return this.metadata; + } + + /** + * Set metadata about an Analysis Event. + * + * @param metadata the metadata value to set + * @return the PartitionAnalysisEvent object itself. + */ + public PartitionAnalysisEvent withMetadata(AnalysisEventMetadata metadata) { + this.metadata = metadata; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionBackupEntity.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionBackupEntity.java new file mode 100644 index 0000000000000..e9d4be26766bb --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionBackupEntity.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Identifies the Service Fabric stateful partition which is being backed up. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "EntityKind") +@JsonTypeName("Partition") +public class PartitionBackupEntity extends BackupEntity { + /** + * The full name of the service with 'fabric:' URI scheme. + */ + @JsonProperty(value = "ServiceName") + private String serviceName; + + /** + * 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. + */ + @JsonProperty(value = "PartitionId") + private UUID partitionId; + + /** + * Get the full name of the service with 'fabric:' URI scheme. + * + * @return the serviceName value + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set the full name of the service with 'fabric:' URI scheme. + * + * @param serviceName the serviceName value to set + * @return the PartitionBackupEntity object itself. + */ + public PartitionBackupEntity withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Get 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. + * + * @return the partitionId value + */ + public UUID partitionId() { + return this.partitionId; + } + + /** + * Set 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. + * + * @param partitionId the partitionId value to set + * @return the PartitionBackupEntity object itself. + */ + public PartitionBackupEntity withPartitionId(UUID partitionId) { + this.partitionId = partitionId; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionHealthEvaluation.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionHealthEvaluation.java new file mode 100644 index 0000000000000..b55f1a9afbe49 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionHealthEvaluation.java @@ -0,0 +1,80 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.UUID; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents health evaluation for a partition, 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. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("Partition") +public class PartitionHealthEvaluation extends HealthEvaluation { + /** + * Id of the partition whose health evaluation is described by this object. + */ + @JsonProperty(value = "PartitionId") + private UUID partitionId; + + /** + * List of unhealthy evaluations that led to the current aggregated health + * state of the partition. The types of the unhealthy evaluations can be + * ReplicasHealthEvaluation or EventHealthEvaluation. + */ + @JsonProperty(value = "UnhealthyEvaluations") + private List unhealthyEvaluations; + + /** + * Get id of the partition whose health evaluation is described by this object. + * + * @return the partitionId value + */ + public UUID partitionId() { + return this.partitionId; + } + + /** + * Set id of the partition whose health evaluation is described by this object. + * + * @param partitionId the partitionId value to set + * @return the PartitionHealthEvaluation object itself. + */ + public PartitionHealthEvaluation withPartitionId(UUID partitionId) { + this.partitionId = partitionId; + return this; + } + + /** + * Get list of unhealthy evaluations that led to the current aggregated health state of the partition. The types of the unhealthy evaluations can be ReplicasHealthEvaluation or EventHealthEvaluation. + * + * @return the unhealthyEvaluations value + */ + public List unhealthyEvaluations() { + return this.unhealthyEvaluations; + } + + /** + * Set list of unhealthy evaluations that led to the current aggregated health state of the partition. The types of the unhealthy evaluations can be ReplicasHealthEvaluation or EventHealthEvaluation. + * + * @param unhealthyEvaluations the unhealthyEvaluations value to set + * @return the PartitionHealthEvaluation object itself. + */ + public PartitionHealthEvaluation withUnhealthyEvaluations(List unhealthyEvaluations) { + this.unhealthyEvaluations = unhealthyEvaluations; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionHealthReportCreatedEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionHealthReportCreatedEvent.java new file mode 100644 index 0000000000000..8c5e5dc61e915 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionHealthReportCreatedEvent.java @@ -0,0 +1,231 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.PartitionEventInner; + +/** + * Partition Health Report Created event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("PartitionHealthReportCreated") +public class PartitionHealthReportCreatedEvent extends PartitionEventInner { + /** + * Id of report source. + */ + @JsonProperty(value = "SourceId", required = true) + private String sourceId; + + /** + * Describes the property. + */ + @JsonProperty(value = "Property", required = true) + private String property; + + /** + * Describes the property health state. + */ + @JsonProperty(value = "HealthState", required = true) + private String healthState; + + /** + * Time to live in milli-seconds. + */ + @JsonProperty(value = "TimeToLiveMs", required = true) + private long timeToLiveMs; + + /** + * Sequence number of report. + */ + @JsonProperty(value = "SequenceNumber", required = true) + private long sequenceNumber; + + /** + * Description of report. + */ + @JsonProperty(value = "Description", required = true) + private String description; + + /** + * Indicates the removal when it expires. + */ + @JsonProperty(value = "RemoveWhenExpired", required = true) + private boolean removeWhenExpired; + + /** + * Source time. + */ + @JsonProperty(value = "SourceUtcTimestamp", required = true) + private DateTime sourceUtcTimestamp; + + /** + * Get id of report source. + * + * @return the sourceId value + */ + public String sourceId() { + return this.sourceId; + } + + /** + * Set id of report source. + * + * @param sourceId the sourceId value to set + * @return the PartitionHealthReportCreatedEvent object itself. + */ + public PartitionHealthReportCreatedEvent withSourceId(String sourceId) { + this.sourceId = sourceId; + return this; + } + + /** + * Get describes the property. + * + * @return the property value + */ + public String property() { + return this.property; + } + + /** + * Set describes the property. + * + * @param property the property value to set + * @return the PartitionHealthReportCreatedEvent object itself. + */ + public PartitionHealthReportCreatedEvent withProperty(String property) { + this.property = property; + return this; + } + + /** + * Get describes the property health state. + * + * @return the healthState value + */ + public String healthState() { + return this.healthState; + } + + /** + * Set describes the property health state. + * + * @param healthState the healthState value to set + * @return the PartitionHealthReportCreatedEvent object itself. + */ + public PartitionHealthReportCreatedEvent withHealthState(String healthState) { + this.healthState = healthState; + return this; + } + + /** + * Get time to live in milli-seconds. + * + * @return the timeToLiveMs value + */ + public long timeToLiveMs() { + return this.timeToLiveMs; + } + + /** + * Set time to live in milli-seconds. + * + * @param timeToLiveMs the timeToLiveMs value to set + * @return the PartitionHealthReportCreatedEvent object itself. + */ + public PartitionHealthReportCreatedEvent withTimeToLiveMs(long timeToLiveMs) { + this.timeToLiveMs = timeToLiveMs; + return this; + } + + /** + * Get sequence number of report. + * + * @return the sequenceNumber value + */ + public long sequenceNumber() { + return this.sequenceNumber; + } + + /** + * Set sequence number of report. + * + * @param sequenceNumber the sequenceNumber value to set + * @return the PartitionHealthReportCreatedEvent object itself. + */ + public PartitionHealthReportCreatedEvent withSequenceNumber(long sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get description of report. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of report. + * + * @param description the description value to set + * @return the PartitionHealthReportCreatedEvent object itself. + */ + public PartitionHealthReportCreatedEvent withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get indicates the removal when it expires. + * + * @return the removeWhenExpired value + */ + public boolean removeWhenExpired() { + return this.removeWhenExpired; + } + + /** + * Set indicates the removal when it expires. + * + * @param removeWhenExpired the removeWhenExpired value to set + * @return the PartitionHealthReportCreatedEvent object itself. + */ + public PartitionHealthReportCreatedEvent withRemoveWhenExpired(boolean removeWhenExpired) { + this.removeWhenExpired = removeWhenExpired; + return this; + } + + /** + * Get source time. + * + * @return the sourceUtcTimestamp value + */ + public DateTime sourceUtcTimestamp() { + return this.sourceUtcTimestamp; + } + + /** + * Set source time. + * + * @param sourceUtcTimestamp the sourceUtcTimestamp value to set + * @return the PartitionHealthReportCreatedEvent object itself. + */ + public PartitionHealthReportCreatedEvent withSourceUtcTimestamp(DateTime sourceUtcTimestamp) { + this.sourceUtcTimestamp = sourceUtcTimestamp; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionHealthReportExpiredEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionHealthReportExpiredEvent.java new file mode 100644 index 0000000000000..606510008bcc1 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionHealthReportExpiredEvent.java @@ -0,0 +1,231 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.PartitionEventInner; + +/** + * Partition Health Report Expired event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("PartitionHealthReportExpired") +public class PartitionHealthReportExpiredEvent extends PartitionEventInner { + /** + * Id of report source. + */ + @JsonProperty(value = "SourceId", required = true) + private String sourceId; + + /** + * Describes the property. + */ + @JsonProperty(value = "Property", required = true) + private String property; + + /** + * Describes the property health state. + */ + @JsonProperty(value = "HealthState", required = true) + private String healthState; + + /** + * Time to live in milli-seconds. + */ + @JsonProperty(value = "TimeToLiveMs", required = true) + private long timeToLiveMs; + + /** + * Sequence number of report. + */ + @JsonProperty(value = "SequenceNumber", required = true) + private long sequenceNumber; + + /** + * Description of report. + */ + @JsonProperty(value = "Description", required = true) + private String description; + + /** + * Indicates the removal when it expires. + */ + @JsonProperty(value = "RemoveWhenExpired", required = true) + private boolean removeWhenExpired; + + /** + * Source time. + */ + @JsonProperty(value = "SourceUtcTimestamp", required = true) + private DateTime sourceUtcTimestamp; + + /** + * Get id of report source. + * + * @return the sourceId value + */ + public String sourceId() { + return this.sourceId; + } + + /** + * Set id of report source. + * + * @param sourceId the sourceId value to set + * @return the PartitionHealthReportExpiredEvent object itself. + */ + public PartitionHealthReportExpiredEvent withSourceId(String sourceId) { + this.sourceId = sourceId; + return this; + } + + /** + * Get describes the property. + * + * @return the property value + */ + public String property() { + return this.property; + } + + /** + * Set describes the property. + * + * @param property the property value to set + * @return the PartitionHealthReportExpiredEvent object itself. + */ + public PartitionHealthReportExpiredEvent withProperty(String property) { + this.property = property; + return this; + } + + /** + * Get describes the property health state. + * + * @return the healthState value + */ + public String healthState() { + return this.healthState; + } + + /** + * Set describes the property health state. + * + * @param healthState the healthState value to set + * @return the PartitionHealthReportExpiredEvent object itself. + */ + public PartitionHealthReportExpiredEvent withHealthState(String healthState) { + this.healthState = healthState; + return this; + } + + /** + * Get time to live in milli-seconds. + * + * @return the timeToLiveMs value + */ + public long timeToLiveMs() { + return this.timeToLiveMs; + } + + /** + * Set time to live in milli-seconds. + * + * @param timeToLiveMs the timeToLiveMs value to set + * @return the PartitionHealthReportExpiredEvent object itself. + */ + public PartitionHealthReportExpiredEvent withTimeToLiveMs(long timeToLiveMs) { + this.timeToLiveMs = timeToLiveMs; + return this; + } + + /** + * Get sequence number of report. + * + * @return the sequenceNumber value + */ + public long sequenceNumber() { + return this.sequenceNumber; + } + + /** + * Set sequence number of report. + * + * @param sequenceNumber the sequenceNumber value to set + * @return the PartitionHealthReportExpiredEvent object itself. + */ + public PartitionHealthReportExpiredEvent withSequenceNumber(long sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get description of report. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of report. + * + * @param description the description value to set + * @return the PartitionHealthReportExpiredEvent object itself. + */ + public PartitionHealthReportExpiredEvent withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get indicates the removal when it expires. + * + * @return the removeWhenExpired value + */ + public boolean removeWhenExpired() { + return this.removeWhenExpired; + } + + /** + * Set indicates the removal when it expires. + * + * @param removeWhenExpired the removeWhenExpired value to set + * @return the PartitionHealthReportExpiredEvent object itself. + */ + public PartitionHealthReportExpiredEvent withRemoveWhenExpired(boolean removeWhenExpired) { + this.removeWhenExpired = removeWhenExpired; + return this; + } + + /** + * Get source time. + * + * @return the sourceUtcTimestamp value + */ + public DateTime sourceUtcTimestamp() { + return this.sourceUtcTimestamp; + } + + /** + * Set source time. + * + * @param sourceUtcTimestamp the sourceUtcTimestamp value to set + * @return the PartitionHealthReportExpiredEvent object itself. + */ + public PartitionHealthReportExpiredEvent withSourceUtcTimestamp(DateTime sourceUtcTimestamp) { + this.sourceUtcTimestamp = sourceUtcTimestamp; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionHealthState.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionHealthState.java new file mode 100644 index 0000000000000..016e8da9b93b0 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionHealthState.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents the health state of a partition, which contains the partition + * identifier and its aggregated health state. + */ +public class PartitionHealthState extends EntityHealthState { + /** + * Id of the partition whose health state is described by this object. + */ + @JsonProperty(value = "PartitionId") + private UUID partitionId; + + /** + * Get id of the partition whose health state is described by this object. + * + * @return the partitionId value + */ + public UUID partitionId() { + return this.partitionId; + } + + /** + * Set id of the partition whose health state is described by this object. + * + * @param partitionId the partitionId value to set + * @return the PartitionHealthState object itself. + */ + public PartitionHealthState withPartitionId(UUID partitionId) { + this.partitionId = partitionId; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionHealthStateChunk.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionHealthStateChunk.java new file mode 100644 index 0000000000000..255c92811e9e6 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionHealthStateChunk.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents the health state chunk of a partition, which contains the + * partition ID, its aggregated health state and any replicas that respect the + * filters in the cluster health chunk query description. + */ +public class PartitionHealthStateChunk extends EntityHealthStateChunk { + /** + * The Id of the partition. + */ + @JsonProperty(value = "PartitionId") + private UUID partitionId; + + /** + * The list of replica health state chunks belonging to the partition that + * respect the filters in the cluster health chunk query description. + */ + @JsonProperty(value = "ReplicaHealthStateChunks") + private ReplicaHealthStateChunkList replicaHealthStateChunks; + + /** + * Get the Id of the partition. + * + * @return the partitionId value + */ + public UUID partitionId() { + return this.partitionId; + } + + /** + * Set the Id of the partition. + * + * @param partitionId the partitionId value to set + * @return the PartitionHealthStateChunk object itself. + */ + public PartitionHealthStateChunk withPartitionId(UUID partitionId) { + this.partitionId = partitionId; + return this; + } + + /** + * Get the list of replica health state chunks belonging to the partition that respect the filters in the cluster health chunk query description. + * + * @return the replicaHealthStateChunks value + */ + public ReplicaHealthStateChunkList replicaHealthStateChunks() { + return this.replicaHealthStateChunks; + } + + /** + * Set the list of replica health state chunks belonging to the partition that respect the filters in the cluster health chunk query description. + * + * @param replicaHealthStateChunks the replicaHealthStateChunks value to set + * @return the PartitionHealthStateChunk object itself. + */ + public PartitionHealthStateChunk withReplicaHealthStateChunks(ReplicaHealthStateChunkList replicaHealthStateChunks) { + this.replicaHealthStateChunks = replicaHealthStateChunks; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionHealthStateChunkList.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionHealthStateChunkList.java new file mode 100644 index 0000000000000..ceea485a28c15 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionHealthStateChunkList.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list of partition health state chunks that respect the input filters in + * the chunk query description. + * Returned by get cluster health state chunks query as part of the parent + * application hierarchy. + */ +public class PartitionHealthStateChunkList { + /** + * The list of partition health state chunks that respect the input filters + * in the chunk query. + */ + @JsonProperty(value = "Items") + private List items; + + /** + * Get the list of partition health state chunks that respect the input filters in the chunk query. + * + * @return the items value + */ + public List items() { + return this.items; + } + + /** + * Set the list of partition health state chunks that respect the input filters in the chunk query. + * + * @param items the items value to set + * @return the PartitionHealthStateChunkList object itself. + */ + public PartitionHealthStateChunkList withItems(List items) { + this.items = items; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionHealthStateFilter.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionHealthStateFilter.java new file mode 100644 index 0000000000000..a724931452bfe --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionHealthStateFilter.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.UUID; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines matching criteria to determine whether a partition should be + * included as a child of a service in the cluster health chunk. + * The partitions are only returned if the parent entities match a filter + * specified in the cluster health chunk query description. The parent service + * and application must be included in the cluster health chunk. + * One filter can match zero, one or multiple partitions, depending on its + * properties. + */ +public class PartitionHealthStateFilter { + /** + * ID of the partition that matches the filter. The filter is applied only + * to the specified partition, if it exists. + * If the partition doesn't exist, no partition is returned in the cluster + * health chunk based on this filter. + * If the partition exists, it is included in the cluster health chunk if + * it respects the other filter properties. + * If not specified, all partitions that match the parent filters (if any) + * are taken into consideration and matched against the other filter + * members, like health state filter. + */ + @JsonProperty(value = "PartitionIdFilter") + private UUID partitionIdFilter; + + /** + * The filter for the health state of the partitions. It allows selecting + * partitions if they match the desired health states. + * The possible values are integer value of one of the following health + * states. Only partitions that match the filter are returned. All + * partitions are used to evaluate the cluster aggregated health state. + * If not specified, default value is None, unless the partition ID is + * specified. If the filter has default value and partition ID is + * specified, the matching partition is returned. + * The state values are flag-based enumeration, so the value could be a + * combination of these values obtained using bitwise 'OR' operator. + * For example, if the provided value is 6, it matches partitions with + * HealthState value of OK (2) and Warning (4). + * + * - 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. + */ + @JsonProperty(value = "HealthStateFilter") + private Integer healthStateFilter; + + /** + * Defines a list of filters that specify which replicas to be included in + * the returned cluster health chunk as children of the parent partition. + * The replicas are returned only if the parent partition matches a filter. + * If the list is empty, no replicas are returned. All the replicas are + * used to evaluate the parent partition aggregated health state, + * regardless of the input filters. + * The partition filter may specify multiple replica filters. + * For example, it can specify a filter to return all replicas with health + * state Error and another filter to always include a replica identified by + * its replica id. + */ + @JsonProperty(value = "ReplicaFilters") + private List replicaFilters; + + /** + * Get iD of the partition that matches the filter. The filter is applied only to the specified partition, if it exists. + If the partition doesn't exist, no partition is returned in the cluster health chunk based on this filter. + If the partition exists, it is included in the cluster health chunk if it respects the other filter properties. + If not specified, all partitions that match the parent filters (if any) are taken into consideration and matched against the other filter members, like health state filter. + * + * @return the partitionIdFilter value + */ + public UUID partitionIdFilter() { + return this.partitionIdFilter; + } + + /** + * Set iD of the partition that matches the filter. The filter is applied only to the specified partition, if it exists. + If the partition doesn't exist, no partition is returned in the cluster health chunk based on this filter. + If the partition exists, it is included in the cluster health chunk if it respects the other filter properties. + If not specified, all partitions that match the parent filters (if any) are taken into consideration and matched against the other filter members, like health state filter. + * + * @param partitionIdFilter the partitionIdFilter value to set + * @return the PartitionHealthStateFilter object itself. + */ + public PartitionHealthStateFilter withPartitionIdFilter(UUID partitionIdFilter) { + this.partitionIdFilter = partitionIdFilter; + return this; + } + + /** + * Get the filter for the health state of the partitions. It allows selecting partitions if they match the desired health states. + The possible values are integer value of one of the following health states. Only partitions that match the filter are returned. All partitions are used to evaluate the cluster aggregated health state. + If not specified, default value is None, unless the partition ID is specified. If the filter has default value and partition ID is specified, the matching partition is returned. + The state values are flag-based enumeration, so the value could be a combination of these values obtained using bitwise 'OR' operator. + For example, if the provided value is 6, it matches partitions with HealthState value of OK (2) and Warning (4). + - Default - Default value. Matches any HealthState. The value is zero. + - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given collection of states. The value is 1. + - Ok - Filter that matches input with HealthState value Ok. The value is 2. + - Warning - Filter that matches input with HealthState value Warning. The value is 4. + - Error - Filter that matches input with HealthState value Error. The value is 8. + - All - Filter that matches input with any HealthState value. The value is 65535. + * + * @return the healthStateFilter value + */ + public Integer healthStateFilter() { + return this.healthStateFilter; + } + + /** + * Set the filter for the health state of the partitions. It allows selecting partitions if they match the desired health states. + The possible values are integer value of one of the following health states. Only partitions that match the filter are returned. All partitions are used to evaluate the cluster aggregated health state. + If not specified, default value is None, unless the partition ID is specified. If the filter has default value and partition ID is specified, the matching partition is returned. + The state values are flag-based enumeration, so the value could be a combination of these values obtained using bitwise 'OR' operator. + For example, if the provided value is 6, it matches partitions with HealthState value of OK (2) and Warning (4). + - 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 healthStateFilter the healthStateFilter value to set + * @return the PartitionHealthStateFilter object itself. + */ + public PartitionHealthStateFilter withHealthStateFilter(Integer healthStateFilter) { + this.healthStateFilter = healthStateFilter; + return this; + } + + /** + * Get defines a list of filters that specify which replicas to be included in the returned cluster health chunk as children of the parent partition. The replicas are returned only if the parent partition matches a filter. + If the list is empty, no replicas are returned. All the replicas are used to evaluate the parent partition aggregated health state, regardless of the input filters. + The partition filter may specify multiple replica filters. + For example, it can specify a filter to return all replicas with health state Error and another filter to always include a replica identified by its replica id. + * + * @return the replicaFilters value + */ + public List replicaFilters() { + return this.replicaFilters; + } + + /** + * Set defines a list of filters that specify which replicas to be included in the returned cluster health chunk as children of the parent partition. The replicas are returned only if the parent partition matches a filter. + If the list is empty, no replicas are returned. All the replicas are used to evaluate the parent partition aggregated health state, regardless of the input filters. + The partition filter may specify multiple replica filters. + For example, it can specify a filter to return all replicas with health state Error and another filter to always include a replica identified by its replica id. + * + * @param replicaFilters the replicaFilters value to set + * @return the PartitionHealthStateFilter object itself. + */ + public PartitionHealthStateFilter withReplicaFilters(List replicaFilters) { + this.replicaFilters = replicaFilters; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionInformation.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionInformation.java new file mode 100644 index 0000000000000..6328198912f8c --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionInformation.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Information about the partition identity, partitioning scheme and keys + * supported by it. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ServicePartitionKind") +@JsonTypeName("PartitionInformation") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Int64Range", value = Int64RangePartitionInformation.class), + @JsonSubTypes.Type(name = "Named", value = NamedPartitionInformation.class), + @JsonSubTypes.Type(name = "Singleton", value = SingletonPartitionInformation.class) +}) +public class PartitionInformation { + /** + * 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. + */ + @JsonProperty(value = "Id") + private UUID id; + + /** + * Get 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. + * + * @return the id value + */ + public UUID id() { + return this.id; + } + + /** + * Set 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. + * + * @param id the id value to set + * @return the PartitionInformation object itself. + */ + public PartitionInformation withId(UUID id) { + this.id = id; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionInstanceCountScaleMechanism.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionInstanceCountScaleMechanism.java new file mode 100644 index 0000000000000..8d676ae08964f --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionInstanceCountScaleMechanism.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents a scaling mechanism for adding or removing instances of stateless + * service partition. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("PartitionInstanceCount") +public class PartitionInstanceCountScaleMechanism extends ScalingMechanismDescription { + /** + * Minimum number of instances of the partition. + */ + @JsonProperty(value = "MinInstanceCount", required = true) + private int minInstanceCount; + + /** + * Maximum number of instances of the partition. + */ + @JsonProperty(value = "MaxInstanceCount", required = true) + private int maxInstanceCount; + + /** + * The number of instances to add or remove during a scaling operation. + */ + @JsonProperty(value = "ScaleIncrement", required = true) + private int scaleIncrement; + + /** + * Get minimum number of instances of the partition. + * + * @return the minInstanceCount value + */ + public int minInstanceCount() { + return this.minInstanceCount; + } + + /** + * Set minimum number of instances of the partition. + * + * @param minInstanceCount the minInstanceCount value to set + * @return the PartitionInstanceCountScaleMechanism object itself. + */ + public PartitionInstanceCountScaleMechanism withMinInstanceCount(int minInstanceCount) { + this.minInstanceCount = minInstanceCount; + return this; + } + + /** + * Get maximum number of instances of the partition. + * + * @return the maxInstanceCount value + */ + public int maxInstanceCount() { + return this.maxInstanceCount; + } + + /** + * Set maximum number of instances of the partition. + * + * @param maxInstanceCount the maxInstanceCount value to set + * @return the PartitionInstanceCountScaleMechanism object itself. + */ + public PartitionInstanceCountScaleMechanism withMaxInstanceCount(int maxInstanceCount) { + this.maxInstanceCount = maxInstanceCount; + return this; + } + + /** + * Get the number of instances to add or remove during a scaling operation. + * + * @return the scaleIncrement value + */ + public int scaleIncrement() { + return this.scaleIncrement; + } + + /** + * Set the number of instances to add or remove during a scaling operation. + * + * @param scaleIncrement the scaleIncrement value to set + * @return the PartitionInstanceCountScaleMechanism object itself. + */ + public PartitionInstanceCountScaleMechanism withScaleIncrement(int scaleIncrement) { + this.scaleIncrement = scaleIncrement; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionPrimaryMoveAnalysisEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionPrimaryMoveAnalysisEvent.java new file mode 100644 index 0000000000000..441b29b8a792c --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionPrimaryMoveAnalysisEvent.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Partition Primary Move Analysis event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("PartitionPrimaryMoveAnalysis") +public class PartitionPrimaryMoveAnalysisEvent extends PartitionAnalysisEvent { + /** + * Time when the move was completed. + */ + @JsonProperty(value = "WhenMoveCompleted", required = true) + private DateTime whenMoveCompleted; + + /** + * The name of a Service Fabric node. + */ + @JsonProperty(value = "PreviousNode", required = true) + private String previousNode; + + /** + * The name of a Service Fabric node. + */ + @JsonProperty(value = "CurrentNode", required = true) + private String currentNode; + + /** + * Move reason. + */ + @JsonProperty(value = "MoveReason", required = true) + private String moveReason; + + /** + * Relevant traces. + */ + @JsonProperty(value = "RelevantTraces", required = true) + private String relevantTraces; + + /** + * Get time when the move was completed. + * + * @return the whenMoveCompleted value + */ + public DateTime whenMoveCompleted() { + return this.whenMoveCompleted; + } + + /** + * Set time when the move was completed. + * + * @param whenMoveCompleted the whenMoveCompleted value to set + * @return the PartitionPrimaryMoveAnalysisEvent object itself. + */ + public PartitionPrimaryMoveAnalysisEvent withWhenMoveCompleted(DateTime whenMoveCompleted) { + this.whenMoveCompleted = whenMoveCompleted; + return this; + } + + /** + * Get the name of a Service Fabric node. + * + * @return the previousNode value + */ + public String previousNode() { + return this.previousNode; + } + + /** + * Set the name of a Service Fabric node. + * + * @param previousNode the previousNode value to set + * @return the PartitionPrimaryMoveAnalysisEvent object itself. + */ + public PartitionPrimaryMoveAnalysisEvent withPreviousNode(String previousNode) { + this.previousNode = previousNode; + return this; + } + + /** + * Get the name of a Service Fabric node. + * + * @return the currentNode value + */ + public String currentNode() { + return this.currentNode; + } + + /** + * Set the name of a Service Fabric node. + * + * @param currentNode the currentNode value to set + * @return the PartitionPrimaryMoveAnalysisEvent object itself. + */ + public PartitionPrimaryMoveAnalysisEvent withCurrentNode(String currentNode) { + this.currentNode = currentNode; + return this; + } + + /** + * Get move reason. + * + * @return the moveReason value + */ + public String moveReason() { + return this.moveReason; + } + + /** + * Set move reason. + * + * @param moveReason the moveReason value to set + * @return the PartitionPrimaryMoveAnalysisEvent object itself. + */ + public PartitionPrimaryMoveAnalysisEvent withMoveReason(String moveReason) { + this.moveReason = moveReason; + return this; + } + + /** + * Get relevant traces. + * + * @return the relevantTraces value + */ + public String relevantTraces() { + return this.relevantTraces; + } + + /** + * Set relevant traces. + * + * @param relevantTraces the relevantTraces value to set + * @return the PartitionPrimaryMoveAnalysisEvent object itself. + */ + public PartitionPrimaryMoveAnalysisEvent withRelevantTraces(String relevantTraces) { + this.relevantTraces = relevantTraces; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionReconfigurationCompletedEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionReconfigurationCompletedEvent.java new file mode 100644 index 0000000000000..bfeecb93b9e7d --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionReconfigurationCompletedEvent.java @@ -0,0 +1,360 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.PartitionEventInner; + +/** + * Partition Reconfiguration Completed event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("PartitionReconfigurationCompleted") +public class PartitionReconfigurationCompletedEvent extends PartitionEventInner { + /** + * The name of a Service Fabric node. + */ + @JsonProperty(value = "NodeName", required = true) + private String nodeName; + + /** + * Id of Node instance. + */ + @JsonProperty(value = "NodeInstanceId", required = true) + private String nodeInstanceId; + + /** + * Type of Service. + */ + @JsonProperty(value = "ServiceType", required = true) + private String serviceType; + + /** + * CcEpochDataLoss version. + */ + @JsonProperty(value = "CcEpochDataLossVersion", required = true) + private long ccEpochDataLossVersion; + + /** + * CcEpochConfig version. + */ + @JsonProperty(value = "CcEpochConfigVersion", required = true) + private long ccEpochConfigVersion; + + /** + * Type of reconfiguration. + */ + @JsonProperty(value = "ReconfigType", required = true) + private String reconfigType; + + /** + * Describes reconfiguration result. + */ + @JsonProperty(value = "Result", required = true) + private String result; + + /** + * Duration of Phase0 in milli-seconds. + */ + @JsonProperty(value = "Phase0DurationMs", required = true) + private double phase0DurationMs; + + /** + * Duration of Phase1 in milli-seconds. + */ + @JsonProperty(value = "Phase1DurationMs", required = true) + private double phase1DurationMs; + + /** + * Duration of Phase2 in milli-seconds. + */ + @JsonProperty(value = "Phase2DurationMs", required = true) + private double phase2DurationMs; + + /** + * Duration of Phase3 in milli-seconds. + */ + @JsonProperty(value = "Phase3DurationMs", required = true) + private double phase3DurationMs; + + /** + * Duration of Phase4 in milli-seconds. + */ + @JsonProperty(value = "Phase4DurationMs", required = true) + private double phase4DurationMs; + + /** + * Total duration in milli-seconds. + */ + @JsonProperty(value = "TotalDurationMs", required = true) + private double totalDurationMs; + + /** + * Get the name of a Service Fabric node. + * + * @return the nodeName value + */ + public String nodeName() { + return this.nodeName; + } + + /** + * Set the name of a Service Fabric node. + * + * @param nodeName the nodeName value to set + * @return the PartitionReconfigurationCompletedEvent object itself. + */ + public PartitionReconfigurationCompletedEvent withNodeName(String nodeName) { + this.nodeName = nodeName; + return this; + } + + /** + * Get id of Node instance. + * + * @return the nodeInstanceId value + */ + public String nodeInstanceId() { + return this.nodeInstanceId; + } + + /** + * Set id of Node instance. + * + * @param nodeInstanceId the nodeInstanceId value to set + * @return the PartitionReconfigurationCompletedEvent object itself. + */ + public PartitionReconfigurationCompletedEvent withNodeInstanceId(String nodeInstanceId) { + this.nodeInstanceId = nodeInstanceId; + return this; + } + + /** + * Get type of Service. + * + * @return the serviceType value + */ + public String serviceType() { + return this.serviceType; + } + + /** + * Set type of Service. + * + * @param serviceType the serviceType value to set + * @return the PartitionReconfigurationCompletedEvent object itself. + */ + public PartitionReconfigurationCompletedEvent withServiceType(String serviceType) { + this.serviceType = serviceType; + return this; + } + + /** + * Get ccEpochDataLoss version. + * + * @return the ccEpochDataLossVersion value + */ + public long ccEpochDataLossVersion() { + return this.ccEpochDataLossVersion; + } + + /** + * Set ccEpochDataLoss version. + * + * @param ccEpochDataLossVersion the ccEpochDataLossVersion value to set + * @return the PartitionReconfigurationCompletedEvent object itself. + */ + public PartitionReconfigurationCompletedEvent withCcEpochDataLossVersion(long ccEpochDataLossVersion) { + this.ccEpochDataLossVersion = ccEpochDataLossVersion; + return this; + } + + /** + * Get ccEpochConfig version. + * + * @return the ccEpochConfigVersion value + */ + public long ccEpochConfigVersion() { + return this.ccEpochConfigVersion; + } + + /** + * Set ccEpochConfig version. + * + * @param ccEpochConfigVersion the ccEpochConfigVersion value to set + * @return the PartitionReconfigurationCompletedEvent object itself. + */ + public PartitionReconfigurationCompletedEvent withCcEpochConfigVersion(long ccEpochConfigVersion) { + this.ccEpochConfigVersion = ccEpochConfigVersion; + return this; + } + + /** + * Get type of reconfiguration. + * + * @return the reconfigType value + */ + public String reconfigType() { + return this.reconfigType; + } + + /** + * Set type of reconfiguration. + * + * @param reconfigType the reconfigType value to set + * @return the PartitionReconfigurationCompletedEvent object itself. + */ + public PartitionReconfigurationCompletedEvent withReconfigType(String reconfigType) { + this.reconfigType = reconfigType; + return this; + } + + /** + * Get describes reconfiguration result. + * + * @return the result value + */ + public String result() { + return this.result; + } + + /** + * Set describes reconfiguration result. + * + * @param result the result value to set + * @return the PartitionReconfigurationCompletedEvent object itself. + */ + public PartitionReconfigurationCompletedEvent withResult(String result) { + this.result = result; + return this; + } + + /** + * Get duration of Phase0 in milli-seconds. + * + * @return the phase0DurationMs value + */ + public double phase0DurationMs() { + return this.phase0DurationMs; + } + + /** + * Set duration of Phase0 in milli-seconds. + * + * @param phase0DurationMs the phase0DurationMs value to set + * @return the PartitionReconfigurationCompletedEvent object itself. + */ + public PartitionReconfigurationCompletedEvent withPhase0DurationMs(double phase0DurationMs) { + this.phase0DurationMs = phase0DurationMs; + return this; + } + + /** + * Get duration of Phase1 in milli-seconds. + * + * @return the phase1DurationMs value + */ + public double phase1DurationMs() { + return this.phase1DurationMs; + } + + /** + * Set duration of Phase1 in milli-seconds. + * + * @param phase1DurationMs the phase1DurationMs value to set + * @return the PartitionReconfigurationCompletedEvent object itself. + */ + public PartitionReconfigurationCompletedEvent withPhase1DurationMs(double phase1DurationMs) { + this.phase1DurationMs = phase1DurationMs; + return this; + } + + /** + * Get duration of Phase2 in milli-seconds. + * + * @return the phase2DurationMs value + */ + public double phase2DurationMs() { + return this.phase2DurationMs; + } + + /** + * Set duration of Phase2 in milli-seconds. + * + * @param phase2DurationMs the phase2DurationMs value to set + * @return the PartitionReconfigurationCompletedEvent object itself. + */ + public PartitionReconfigurationCompletedEvent withPhase2DurationMs(double phase2DurationMs) { + this.phase2DurationMs = phase2DurationMs; + return this; + } + + /** + * Get duration of Phase3 in milli-seconds. + * + * @return the phase3DurationMs value + */ + public double phase3DurationMs() { + return this.phase3DurationMs; + } + + /** + * Set duration of Phase3 in milli-seconds. + * + * @param phase3DurationMs the phase3DurationMs value to set + * @return the PartitionReconfigurationCompletedEvent object itself. + */ + public PartitionReconfigurationCompletedEvent withPhase3DurationMs(double phase3DurationMs) { + this.phase3DurationMs = phase3DurationMs; + return this; + } + + /** + * Get duration of Phase4 in milli-seconds. + * + * @return the phase4DurationMs value + */ + public double phase4DurationMs() { + return this.phase4DurationMs; + } + + /** + * Set duration of Phase4 in milli-seconds. + * + * @param phase4DurationMs the phase4DurationMs value to set + * @return the PartitionReconfigurationCompletedEvent object itself. + */ + public PartitionReconfigurationCompletedEvent withPhase4DurationMs(double phase4DurationMs) { + this.phase4DurationMs = phase4DurationMs; + return this; + } + + /** + * Get total duration in milli-seconds. + * + * @return the totalDurationMs value + */ + public double totalDurationMs() { + return this.totalDurationMs; + } + + /** + * Set total duration in milli-seconds. + * + * @param totalDurationMs the totalDurationMs value to set + * @return the PartitionReconfigurationCompletedEvent object itself. + */ + public PartitionReconfigurationCompletedEvent withTotalDurationMs(double totalDurationMs) { + this.totalDurationMs = totalDurationMs; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionSafetyCheck.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionSafetyCheck.java new file mode 100644 index 0000000000000..3b974edc0c4d5 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionSafetyCheck.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Represents a safety check for the service partition being performed by + * service fabric before continuing with operations. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("PartitionSafetyCheck") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "EnsureAvailability", value = EnsureAvailabilitySafetyCheck.class), + @JsonSubTypes.Type(name = "EnsurePartitionQuorum", value = EnsurePartitionQurumSafetyCheck.class), + @JsonSubTypes.Type(name = "WaitForInbuildReplica", value = WaitForInbuildReplicaSafetyCheck.class), + @JsonSubTypes.Type(name = "WaitForPrimaryPlacement", value = WaitForPrimaryPlacementSafetyCheck.class), + @JsonSubTypes.Type(name = "WaitForPrimarySwap", value = WaitForPrimarySwapSafetyCheck.class), + @JsonSubTypes.Type(name = "WaitForReconfiguration", value = WaitForReconfigurationSafetyCheck.class) +}) +public class PartitionSafetyCheck extends SafetyCheck { + /** + * Id of the partition which is undergoing the safety check. + */ + @JsonProperty(value = "PartitionId") + private UUID partitionId; + + /** + * Get id of the partition which is undergoing the safety check. + * + * @return the partitionId value + */ + public UUID partitionId() { + return this.partitionId; + } + + /** + * Set id of the partition which is undergoing the safety check. + * + * @param partitionId the partitionId value to set + * @return the PartitionSafetyCheck object itself. + */ + public PartitionSafetyCheck withPartitionId(UUID partitionId) { + this.partitionId = partitionId; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionScheme.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionScheme.java new file mode 100644 index 0000000000000..473fb331b364b --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionScheme.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PartitionScheme. + */ +public final class PartitionScheme extends ExpandableStringEnum { + /** Static value Invalid for PartitionScheme. */ + public static final PartitionScheme INVALID = fromString("Invalid"); + + /** Static value Singleton for PartitionScheme. */ + public static final PartitionScheme SINGLETON = fromString("Singleton"); + + /** Static value UniformInt64Range for PartitionScheme. */ + public static final PartitionScheme UNIFORM_INT64RANGE = fromString("UniformInt64Range"); + + /** Static value Named for PartitionScheme. */ + public static final PartitionScheme NAMED = fromString("Named"); + + /** + * Creates or finds a PartitionScheme from its string representation. + * @param name a name to look for + * @return the corresponding PartitionScheme + */ + @JsonCreator + public static PartitionScheme fromString(String name) { + return fromString(name, PartitionScheme.class); + } + + /** + * @return known PartitionScheme values + */ + public static Collection values() { + return values(PartitionScheme.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionSchemeDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionSchemeDescription.java new file mode 100644 index 0000000000000..09287946c13b1 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionSchemeDescription.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Describes how the service is partitioned. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "PartitionScheme") +@JsonTypeName("PartitionSchemeDescription") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Named", value = NamedPartitionSchemeDescription.class), + @JsonSubTypes.Type(name = "Singleton", value = SingletonPartitionSchemeDescription.class), + @JsonSubTypes.Type(name = "UniformInt64Range", value = UniformInt64RangePartitionSchemeDescription.class) +}) +public class PartitionSchemeDescription { +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionsHealthEvaluation.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionsHealthEvaluation.java new file mode 100644 index 0000000000000..7a802502ca7cb --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionsHealthEvaluation.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents health evaluation for the partitions of a service, containing + * health evaluations for each unhealthy partition that impacts current + * aggregated health state. Can be returned when evaluating service health and + * the aggregated health state is either Error or Warning. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("Partitions") +public class PartitionsHealthEvaluation extends HealthEvaluation { + /** + * Maximum allowed percentage of unhealthy partitions per service from the + * ServiceTypeHealthPolicy. + */ + @JsonProperty(value = "MaxPercentUnhealthyPartitionsPerService") + private Integer maxPercentUnhealthyPartitionsPerService; + + /** + * Total number of partitions of the service from the health store. + */ + @JsonProperty(value = "TotalCount") + private Long totalCount; + + /** + * List of unhealthy evaluations that led to the aggregated health state. + * Includes all the unhealthy PartitionHealthEvaluation that impacted the + * aggregated health. + */ + @JsonProperty(value = "UnhealthyEvaluations") + private List unhealthyEvaluations; + + /** + * Get maximum allowed percentage of unhealthy partitions per service from the ServiceTypeHealthPolicy. + * + * @return the maxPercentUnhealthyPartitionsPerService value + */ + public Integer maxPercentUnhealthyPartitionsPerService() { + return this.maxPercentUnhealthyPartitionsPerService; + } + + /** + * Set maximum allowed percentage of unhealthy partitions per service from the ServiceTypeHealthPolicy. + * + * @param maxPercentUnhealthyPartitionsPerService the maxPercentUnhealthyPartitionsPerService value to set + * @return the PartitionsHealthEvaluation object itself. + */ + public PartitionsHealthEvaluation withMaxPercentUnhealthyPartitionsPerService(Integer maxPercentUnhealthyPartitionsPerService) { + this.maxPercentUnhealthyPartitionsPerService = maxPercentUnhealthyPartitionsPerService; + return this; + } + + /** + * Get total number of partitions of the service from the health store. + * + * @return the totalCount value + */ + public Long totalCount() { + return this.totalCount; + } + + /** + * Set total number of partitions of the service from the health store. + * + * @param totalCount the totalCount value to set + * @return the PartitionsHealthEvaluation object itself. + */ + public PartitionsHealthEvaluation withTotalCount(Long totalCount) { + this.totalCount = totalCount; + return this; + } + + /** + * Get list of unhealthy evaluations that led to the aggregated health state. Includes all the unhealthy PartitionHealthEvaluation that impacted the aggregated health. + * + * @return the unhealthyEvaluations value + */ + public List unhealthyEvaluations() { + return this.unhealthyEvaluations; + } + + /** + * Set list of unhealthy evaluations that led to the aggregated health state. Includes all the unhealthy PartitionHealthEvaluation that impacted the aggregated health. + * + * @param unhealthyEvaluations the unhealthyEvaluations value to set + * @return the PartitionsHealthEvaluation object itself. + */ + public PartitionsHealthEvaluation withUnhealthyEvaluations(List unhealthyEvaluations) { + this.unhealthyEvaluations = unhealthyEvaluations; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PrimaryReplicatorStatus.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PrimaryReplicatorStatus.java new file mode 100644 index 0000000000000..68a5f3112ab9e --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PrimaryReplicatorStatus.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Provides statistics about the Service Fabric Replicator, when it is + * functioning in a Primary role. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("Primary") +public class PrimaryReplicatorStatus extends ReplicatorStatus { + /** + * Details about the replication queue on the primary replicator. + */ + @JsonProperty(value = "ReplicationQueueStatus") + private ReplicatorQueueStatus replicationQueueStatus; + + /** + * The status of all the active and idle secondary replicators that the + * primary is aware of. + */ + @JsonProperty(value = "RemoteReplicators") + private List remoteReplicators; + + /** + * Get details about the replication queue on the primary replicator. + * + * @return the replicationQueueStatus value + */ + public ReplicatorQueueStatus replicationQueueStatus() { + return this.replicationQueueStatus; + } + + /** + * Set details about the replication queue on the primary replicator. + * + * @param replicationQueueStatus the replicationQueueStatus value to set + * @return the PrimaryReplicatorStatus object itself. + */ + public PrimaryReplicatorStatus withReplicationQueueStatus(ReplicatorQueueStatus replicationQueueStatus) { + this.replicationQueueStatus = replicationQueueStatus; + return this; + } + + /** + * Get the status of all the active and idle secondary replicators that the primary is aware of. + * + * @return the remoteReplicators value + */ + public List remoteReplicators() { + return this.remoteReplicators; + } + + /** + * Set the status of all the active and idle secondary replicators that the primary is aware of. + * + * @param remoteReplicators the remoteReplicators value to set + * @return the PrimaryReplicatorStatus object itself. + */ + public PrimaryReplicatorStatus withRemoteReplicators(List remoteReplicators) { + this.remoteReplicators = remoteReplicators; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ProcessDeactivatedEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ProcessDeactivatedEvent.java new file mode 100644 index 0000000000000..ae821f4c8ccd4 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ProcessDeactivatedEvent.java @@ -0,0 +1,335 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ApplicationEventInner; + +/** + * Process Deactivated event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ProcessDeactivated") +public class ProcessDeactivatedEvent extends ApplicationEventInner { + /** + * Name of Service. + */ + @JsonProperty(value = "ServiceName", required = true) + private String serviceName; + + /** + * Name of Service package. + */ + @JsonProperty(value = "ServicePackageName", required = true) + private String servicePackageName; + + /** + * Activation Id of Service package. + */ + @JsonProperty(value = "ServicePackageActivationId", required = true) + private String servicePackageActivationId; + + /** + * Indicates IsExclusive flag. + */ + @JsonProperty(value = "IsExclusive", required = true) + private boolean isExclusive; + + /** + * Name of Code package. + */ + @JsonProperty(value = "CodePackageName", required = true) + private String codePackageName; + + /** + * Type of EntryPoint. + */ + @JsonProperty(value = "EntryPointType", required = true) + private String entryPointType; + + /** + * Name of executable. + */ + @JsonProperty(value = "ExeName", required = true) + private String exeName; + + /** + * Process Id. + */ + @JsonProperty(value = "ProcessId", required = true) + private long processId; + + /** + * Host Id. + */ + @JsonProperty(value = "HostId", required = true) + private String hostId; + + /** + * Exit code of process. + */ + @JsonProperty(value = "ExitCode", required = true) + private long exitCode; + + /** + * Indicates if termination is unexpected. + */ + @JsonProperty(value = "UnexpectedTermination", required = true) + private boolean unexpectedTermination; + + /** + * Start time of process. + */ + @JsonProperty(value = "StartTime", required = true) + private DateTime startTime; + + /** + * Get name of Service. + * + * @return the serviceName value + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set name of Service. + * + * @param serviceName the serviceName value to set + * @return the ProcessDeactivatedEvent object itself. + */ + public ProcessDeactivatedEvent withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Get name of Service package. + * + * @return the servicePackageName value + */ + public String servicePackageName() { + return this.servicePackageName; + } + + /** + * Set name of Service package. + * + * @param servicePackageName the servicePackageName value to set + * @return the ProcessDeactivatedEvent object itself. + */ + public ProcessDeactivatedEvent withServicePackageName(String servicePackageName) { + this.servicePackageName = servicePackageName; + return this; + } + + /** + * Get activation Id of Service package. + * + * @return the servicePackageActivationId value + */ + public String servicePackageActivationId() { + return this.servicePackageActivationId; + } + + /** + * Set activation Id of Service package. + * + * @param servicePackageActivationId the servicePackageActivationId value to set + * @return the ProcessDeactivatedEvent object itself. + */ + public ProcessDeactivatedEvent withServicePackageActivationId(String servicePackageActivationId) { + this.servicePackageActivationId = servicePackageActivationId; + return this; + } + + /** + * Get indicates IsExclusive flag. + * + * @return the isExclusive value + */ + public boolean isExclusive() { + return this.isExclusive; + } + + /** + * Set indicates IsExclusive flag. + * + * @param isExclusive the isExclusive value to set + * @return the ProcessDeactivatedEvent object itself. + */ + public ProcessDeactivatedEvent withIsExclusive(boolean isExclusive) { + this.isExclusive = isExclusive; + return this; + } + + /** + * Get name of Code package. + * + * @return the codePackageName value + */ + public String codePackageName() { + return this.codePackageName; + } + + /** + * Set name of Code package. + * + * @param codePackageName the codePackageName value to set + * @return the ProcessDeactivatedEvent object itself. + */ + public ProcessDeactivatedEvent withCodePackageName(String codePackageName) { + this.codePackageName = codePackageName; + return this; + } + + /** + * Get type of EntryPoint. + * + * @return the entryPointType value + */ + public String entryPointType() { + return this.entryPointType; + } + + /** + * Set type of EntryPoint. + * + * @param entryPointType the entryPointType value to set + * @return the ProcessDeactivatedEvent object itself. + */ + public ProcessDeactivatedEvent withEntryPointType(String entryPointType) { + this.entryPointType = entryPointType; + return this; + } + + /** + * Get name of executable. + * + * @return the exeName value + */ + public String exeName() { + return this.exeName; + } + + /** + * Set name of executable. + * + * @param exeName the exeName value to set + * @return the ProcessDeactivatedEvent object itself. + */ + public ProcessDeactivatedEvent withExeName(String exeName) { + this.exeName = exeName; + return this; + } + + /** + * Get process Id. + * + * @return the processId value + */ + public long processId() { + return this.processId; + } + + /** + * Set process Id. + * + * @param processId the processId value to set + * @return the ProcessDeactivatedEvent object itself. + */ + public ProcessDeactivatedEvent withProcessId(long processId) { + this.processId = processId; + return this; + } + + /** + * Get host Id. + * + * @return the hostId value + */ + public String hostId() { + return this.hostId; + } + + /** + * Set host Id. + * + * @param hostId the hostId value to set + * @return the ProcessDeactivatedEvent object itself. + */ + public ProcessDeactivatedEvent withHostId(String hostId) { + this.hostId = hostId; + return this; + } + + /** + * Get exit code of process. + * + * @return the exitCode value + */ + public long exitCode() { + return this.exitCode; + } + + /** + * Set exit code of process. + * + * @param exitCode the exitCode value to set + * @return the ProcessDeactivatedEvent object itself. + */ + public ProcessDeactivatedEvent withExitCode(long exitCode) { + this.exitCode = exitCode; + return this; + } + + /** + * Get indicates if termination is unexpected. + * + * @return the unexpectedTermination value + */ + public boolean unexpectedTermination() { + return this.unexpectedTermination; + } + + /** + * Set indicates if termination is unexpected. + * + * @param unexpectedTermination the unexpectedTermination value to set + * @return the ProcessDeactivatedEvent object itself. + */ + public ProcessDeactivatedEvent withUnexpectedTermination(boolean unexpectedTermination) { + this.unexpectedTermination = unexpectedTermination; + return this; + } + + /** + * Get start time of process. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set start time of process. + * + * @param startTime the startTime value to set + * @return the ProcessDeactivatedEvent object itself. + */ + public ProcessDeactivatedEvent withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PropertyBatchDescriptionList.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PropertyBatchDescriptionList.java new file mode 100644 index 0000000000000..d63996f381a7c --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PropertyBatchDescriptionList.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a list of property batch operations to be executed. Either all or + * none of the operations will be committed. + */ +public class PropertyBatchDescriptionList { + /** + * A list of the property batch operations to be executed. + */ + @JsonProperty(value = "Operations") + private List operations; + + /** + * Get a list of the property batch operations to be executed. + * + * @return the operations value + */ + public List operations() { + return this.operations; + } + + /** + * Set a list of the property batch operations to be executed. + * + * @param operations the operations value to set + * @return the PropertyBatchDescriptionList object itself. + */ + public PropertyBatchDescriptionList withOperations(List operations) { + this.operations = operations; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PropertyBatchInfo.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PropertyBatchInfo.java new file mode 100644 index 0000000000000..f96ad3d44464c --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PropertyBatchInfo.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Information about the results of a property batch. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("PropertyBatchInfo") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Successful", value = SuccessfulPropertyBatchInfoInner.class), + @JsonSubTypes.Type(name = "Failed", value = FailedPropertyBatchInfoInner.class) +}) +public class PropertyBatchInfo { +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PropertyBatchInfoKind.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PropertyBatchInfoKind.java new file mode 100644 index 0000000000000..67b214780114e --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PropertyBatchInfoKind.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PropertyBatchInfoKind. + */ +public final class PropertyBatchInfoKind extends ExpandableStringEnum { + /** Static value Invalid for PropertyBatchInfoKind. */ + public static final PropertyBatchInfoKind INVALID = fromString("Invalid"); + + /** Static value Successful for PropertyBatchInfoKind. */ + public static final PropertyBatchInfoKind SUCCESSFUL = fromString("Successful"); + + /** Static value Failed for PropertyBatchInfoKind. */ + public static final PropertyBatchInfoKind FAILED = fromString("Failed"); + + /** + * Creates or finds a PropertyBatchInfoKind from its string representation. + * @param name a name to look for + * @return the corresponding PropertyBatchInfoKind + */ + @JsonCreator + public static PropertyBatchInfoKind fromString(String name) { + return fromString(name, PropertyBatchInfoKind.class); + } + + /** + * @return known PropertyBatchInfoKind values + */ + public static Collection values() { + return values(PropertyBatchInfoKind.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PropertyBatchOperation.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PropertyBatchOperation.java new file mode 100644 index 0000000000000..94260f6d0b3fe --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PropertyBatchOperation.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Represents the base type for property operations that can be put into a + * batch and submitted. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("PropertyBatchOperation") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "CheckExists", value = CheckExistsPropertyBatchOperation.class), + @JsonSubTypes.Type(name = "CheckSequence", value = CheckSequencePropertyBatchOperation.class), + @JsonSubTypes.Type(name = "CheckValue", value = CheckValuePropertyBatchOperation.class), + @JsonSubTypes.Type(name = "Delete", value = DeletePropertyBatchOperation.class), + @JsonSubTypes.Type(name = "Get", value = GetPropertyBatchOperation.class), + @JsonSubTypes.Type(name = "Put", value = PutPropertyBatchOperation.class) +}) +public class PropertyBatchOperation { + /** + * The name of the Service Fabric property. + */ + @JsonProperty(value = "PropertyName", required = true) + private String propertyName; + + /** + * Get the name of the Service Fabric property. + * + * @return the propertyName value + */ + public String propertyName() { + return this.propertyName; + } + + /** + * Set the name of the Service Fabric property. + * + * @param propertyName the propertyName value to set + * @return the PropertyBatchOperation object itself. + */ + public PropertyBatchOperation withPropertyName(String propertyName) { + this.propertyName = propertyName; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PropertyBatchOperationKind.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PropertyBatchOperationKind.java new file mode 100644 index 0000000000000..138c39d612d42 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PropertyBatchOperationKind.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PropertyBatchOperationKind. + */ +public final class PropertyBatchOperationKind extends ExpandableStringEnum { + /** Static value Invalid for PropertyBatchOperationKind. */ + public static final PropertyBatchOperationKind INVALID = fromString("Invalid"); + + /** Static value Put for PropertyBatchOperationKind. */ + public static final PropertyBatchOperationKind PUT = fromString("Put"); + + /** Static value Get for PropertyBatchOperationKind. */ + public static final PropertyBatchOperationKind GET = fromString("Get"); + + /** Static value CheckExists for PropertyBatchOperationKind. */ + public static final PropertyBatchOperationKind CHECK_EXISTS = fromString("CheckExists"); + + /** Static value CheckSequence for PropertyBatchOperationKind. */ + public static final PropertyBatchOperationKind CHECK_SEQUENCE = fromString("CheckSequence"); + + /** Static value Delete for PropertyBatchOperationKind. */ + public static final PropertyBatchOperationKind DELETE = fromString("Delete"); + + /** Static value CheckValue for PropertyBatchOperationKind. */ + public static final PropertyBatchOperationKind CHECK_VALUE = fromString("CheckValue"); + + /** + * Creates or finds a PropertyBatchOperationKind from its string representation. + * @param name a name to look for + * @return the corresponding PropertyBatchOperationKind + */ + @JsonCreator + public static PropertyBatchOperationKind fromString(String name) { + return fromString(name, PropertyBatchOperationKind.class); + } + + /** + * @return known PropertyBatchOperationKind values + */ + public static Collection values() { + return values(PropertyBatchOperationKind.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PropertyDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PropertyDescription.java new file mode 100644 index 0000000000000..87fe2dd827f8e --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PropertyDescription.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Description of a Service Fabric property. + */ +public class PropertyDescription { + /** + * The name of the Service Fabric property. + */ + @JsonProperty(value = "PropertyName", required = true) + private String propertyName; + + /** + * The property's custom type ID. Using this property, the user is able to + * tag the type of the value of the property. + */ + @JsonProperty(value = "CustomTypeId") + private String customTypeId; + + /** + * Describes a Service Fabric property value. + */ + @JsonProperty(value = "Value", required = true) + private PropertyValue value; + + /** + * Get the name of the Service Fabric property. + * + * @return the propertyName value + */ + public String propertyName() { + return this.propertyName; + } + + /** + * Set the name of the Service Fabric property. + * + * @param propertyName the propertyName value to set + * @return the PropertyDescription object itself. + */ + public PropertyDescription withPropertyName(String propertyName) { + this.propertyName = propertyName; + return this; + } + + /** + * Get the property's custom type ID. Using this property, the user is able to tag the type of the value of the property. + * + * @return the customTypeId value + */ + public String customTypeId() { + return this.customTypeId; + } + + /** + * Set the property's custom type ID. Using this property, the user is able to tag the type of the value of the property. + * + * @param customTypeId the customTypeId value to set + * @return the PropertyDescription object itself. + */ + public PropertyDescription withCustomTypeId(String customTypeId) { + this.customTypeId = customTypeId; + return this; + } + + /** + * Get describes a Service Fabric property value. + * + * @return the value value + */ + public PropertyValue value() { + return this.value; + } + + /** + * Set describes a Service Fabric property value. + * + * @param value the value value to set + * @return the PropertyDescription object itself. + */ + public PropertyDescription withValue(PropertyValue value) { + this.value = value; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PropertyMetadata.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PropertyMetadata.java new file mode 100644 index 0000000000000..f1523ca72e172 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PropertyMetadata.java @@ -0,0 +1,179 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The metadata associated with a property, including the property's name. + */ +public class PropertyMetadata { + /** + * The kind of property, determined by the type of data. Following are the + * possible values. Possible values include: 'Invalid', 'Binary', 'Int64', + * 'Double', 'String', 'Guid'. + */ + @JsonProperty(value = "TypeId") + private PropertyValueKind typeId; + + /** + * The property's custom type ID. + */ + @JsonProperty(value = "CustomTypeId") + private String customTypeId; + + /** + * 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. + */ + @JsonProperty(value = "Parent") + private String parent; + + /** + * The length of the serialized property value. + */ + @JsonProperty(value = "SizeInBytes") + private Integer sizeInBytes; + + /** + * Represents when the Property was last modified. Only write operations + * will cause this field to be updated. + */ + @JsonProperty(value = "LastModifiedUtcTimestamp") + private DateTime lastModifiedUtcTimestamp; + + /** + * The version of the property. Every time a property is modified, its + * sequence number is increased. + */ + @JsonProperty(value = "SequenceNumber") + private String sequenceNumber; + + /** + * Get the kind of property, determined by the type of data. Following are the possible values. Possible values include: 'Invalid', 'Binary', 'Int64', 'Double', 'String', 'Guid'. + * + * @return the typeId value + */ + public PropertyValueKind typeId() { + return this.typeId; + } + + /** + * Set the kind of property, determined by the type of data. Following are the possible values. Possible values include: 'Invalid', 'Binary', 'Int64', 'Double', 'String', 'Guid'. + * + * @param typeId the typeId value to set + * @return the PropertyMetadata object itself. + */ + public PropertyMetadata withTypeId(PropertyValueKind typeId) { + this.typeId = typeId; + return this; + } + + /** + * Get the property's custom type ID. + * + * @return the customTypeId value + */ + public String customTypeId() { + return this.customTypeId; + } + + /** + * Set the property's custom type ID. + * + * @param customTypeId the customTypeId value to set + * @return the PropertyMetadata object itself. + */ + public PropertyMetadata withCustomTypeId(String customTypeId) { + this.customTypeId = customTypeId; + return this; + } + + /** + * Get 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. + * + * @return the parent value + */ + public String parent() { + return this.parent; + } + + /** + * Set 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. + * + * @param parent the parent value to set + * @return the PropertyMetadata object itself. + */ + public PropertyMetadata withParent(String parent) { + this.parent = parent; + return this; + } + + /** + * Get the length of the serialized property value. + * + * @return the sizeInBytes value + */ + public Integer sizeInBytes() { + return this.sizeInBytes; + } + + /** + * Set the length of the serialized property value. + * + * @param sizeInBytes the sizeInBytes value to set + * @return the PropertyMetadata object itself. + */ + public PropertyMetadata withSizeInBytes(Integer sizeInBytes) { + this.sizeInBytes = sizeInBytes; + return this; + } + + /** + * Get represents when the Property was last modified. Only write operations will cause this field to be updated. + * + * @return the lastModifiedUtcTimestamp value + */ + public DateTime lastModifiedUtcTimestamp() { + return this.lastModifiedUtcTimestamp; + } + + /** + * Set represents when the Property was last modified. Only write operations will cause this field to be updated. + * + * @param lastModifiedUtcTimestamp the lastModifiedUtcTimestamp value to set + * @return the PropertyMetadata object itself. + */ + public PropertyMetadata withLastModifiedUtcTimestamp(DateTime lastModifiedUtcTimestamp) { + this.lastModifiedUtcTimestamp = lastModifiedUtcTimestamp; + return this; + } + + /** + * Get the version of the property. Every time a property is modified, its sequence number is increased. + * + * @return the sequenceNumber value + */ + public String sequenceNumber() { + return this.sequenceNumber; + } + + /** + * Set the version of the property. Every time a property is modified, its sequence number is increased. + * + * @param sequenceNumber the sequenceNumber value to set + * @return the PropertyMetadata object itself. + */ + public PropertyMetadata withSequenceNumber(String sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PropertyValue.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PropertyValue.java new file mode 100644 index 0000000000000..ed77633064b3b --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PropertyValue.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Describes a Service Fabric property value. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("PropertyValue") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Binary", value = BinaryPropertyValue.class), + @JsonSubTypes.Type(name = "Int64", value = Int64PropertyValue.class), + @JsonSubTypes.Type(name = "Double", value = DoublePropertyValue.class), + @JsonSubTypes.Type(name = "String", value = StringPropertyValue.class), + @JsonSubTypes.Type(name = "Guid", value = GuidPropertyValue.class) +}) +public class PropertyValue { +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PropertyValueKind.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PropertyValueKind.java new file mode 100644 index 0000000000000..4fc9c462b47bc --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PropertyValueKind.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PropertyValueKind. + */ +public final class PropertyValueKind extends ExpandableStringEnum { + /** Static value Invalid for PropertyValueKind. */ + public static final PropertyValueKind INVALID = fromString("Invalid"); + + /** Static value Binary for PropertyValueKind. */ + public static final PropertyValueKind BINARY = fromString("Binary"); + + /** Static value Int64 for PropertyValueKind. */ + public static final PropertyValueKind INT64 = fromString("Int64"); + + /** Static value Double for PropertyValueKind. */ + public static final PropertyValueKind DOUBLE = fromString("Double"); + + /** Static value String for PropertyValueKind. */ + public static final PropertyValueKind STRING = fromString("String"); + + /** Static value Guid for PropertyValueKind. */ + public static final PropertyValueKind GUID = fromString("Guid"); + + /** + * Creates or finds a PropertyValueKind from its string representation. + * @param name a name to look for + * @return the corresponding PropertyValueKind + */ + @JsonCreator + public static PropertyValueKind fromString(String name) { + return fromString(name, PropertyValueKind.class); + } + + /** + * @return known PropertyValueKind values + */ + public static Collection values() { + return values(PropertyValueKind.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ProvisionApplicationTypeDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ProvisionApplicationTypeDescription.java new file mode 100644 index 0000000000000..9600d1014066e --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ProvisionApplicationTypeDescription.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the operation to register or provision an application type using + * an application package uploaded to the Service Fabric image store. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ImageStorePath") +public class ProvisionApplicationTypeDescription extends ProvisionApplicationTypeDescriptionBase { + /** + * The relative path for the application package in the image store + * specified during the prior upload operation. + */ + @JsonProperty(value = "ApplicationTypeBuildPath", required = true) + private String applicationTypeBuildPath; + + /** + * The kind of action that needs to be taken for cleaning up the + * application package after successful provision. Possible values include: + * 'Invalid', 'Default', 'Automatic', 'Manual'. + */ + @JsonProperty(value = "ApplicationPackageCleanupPolicy") + private ApplicationPackageCleanupPolicy applicationPackageCleanupPolicy; + + /** + * Get the relative path for the application package in the image store specified during the prior upload operation. + * + * @return the applicationTypeBuildPath value + */ + public String applicationTypeBuildPath() { + return this.applicationTypeBuildPath; + } + + /** + * Set the relative path for the application package in the image store specified during the prior upload operation. + * + * @param applicationTypeBuildPath the applicationTypeBuildPath value to set + * @return the ProvisionApplicationTypeDescription object itself. + */ + public ProvisionApplicationTypeDescription withApplicationTypeBuildPath(String applicationTypeBuildPath) { + this.applicationTypeBuildPath = applicationTypeBuildPath; + return this; + } + + /** + * Get the kind of action that needs to be taken for cleaning up the application package after successful provision. Possible values include: 'Invalid', 'Default', 'Automatic', 'Manual'. + * + * @return the applicationPackageCleanupPolicy value + */ + public ApplicationPackageCleanupPolicy applicationPackageCleanupPolicy() { + return this.applicationPackageCleanupPolicy; + } + + /** + * Set the kind of action that needs to be taken for cleaning up the application package after successful provision. Possible values include: 'Invalid', 'Default', 'Automatic', 'Manual'. + * + * @param applicationPackageCleanupPolicy the applicationPackageCleanupPolicy value to set + * @return the ProvisionApplicationTypeDescription object itself. + */ + public ProvisionApplicationTypeDescription withApplicationPackageCleanupPolicy(ApplicationPackageCleanupPolicy applicationPackageCleanupPolicy) { + this.applicationPackageCleanupPolicy = applicationPackageCleanupPolicy; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ProvisionApplicationTypeDescriptionBase.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ProvisionApplicationTypeDescriptionBase.java new file mode 100644 index 0000000000000..a576ec8d8bedc --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ProvisionApplicationTypeDescriptionBase.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Represents the type of registration or provision requested, and if the + * operation needs to be asynchronous or not. Supported types of provision + * operations are from either image store or external store. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ProvisionApplicationTypeDescriptionBase") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "ImageStorePath", value = ProvisionApplicationTypeDescription.class), + @JsonSubTypes.Type(name = "ExternalStore", value = ExternalStoreProvisionApplicationTypeDescription.class) +}) +public class ProvisionApplicationTypeDescriptionBase { + /** + * 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. + */ + @JsonProperty(value = "Async", required = true) + private boolean async; + + /** + * Get 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. + * + * @return the async value + */ + public boolean async() { + return this.async; + } + + /** + * Set 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 async the async value to set + * @return the ProvisionApplicationTypeDescriptionBase object itself. + */ + public ProvisionApplicationTypeDescriptionBase withAsync(boolean async) { + this.async = async; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ProvisionApplicationTypeKind.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ProvisionApplicationTypeKind.java new file mode 100644 index 0000000000000..dfcee53ae8eaa --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ProvisionApplicationTypeKind.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ProvisionApplicationTypeKind. + */ +public final class ProvisionApplicationTypeKind extends ExpandableStringEnum { + /** Static value Invalid for ProvisionApplicationTypeKind. */ + public static final ProvisionApplicationTypeKind INVALID = fromString("Invalid"); + + /** Static value ImageStorePath for ProvisionApplicationTypeKind. */ + public static final ProvisionApplicationTypeKind IMAGE_STORE_PATH = fromString("ImageStorePath"); + + /** Static value ExternalStore for ProvisionApplicationTypeKind. */ + public static final ProvisionApplicationTypeKind EXTERNAL_STORE = fromString("ExternalStore"); + + /** + * Creates or finds a ProvisionApplicationTypeKind from its string representation. + * @param name a name to look for + * @return the corresponding ProvisionApplicationTypeKind + */ + @JsonCreator + public static ProvisionApplicationTypeKind fromString(String name) { + return fromString(name, ProvisionApplicationTypeKind.class); + } + + /** + * @return known ProvisionApplicationTypeKind values + */ + public static Collection values() { + return values(ProvisionApplicationTypeKind.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ProvisionFabricDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ProvisionFabricDescription.java new file mode 100644 index 0000000000000..5bf31fca71d57 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ProvisionFabricDescription.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the parameters for provisioning a cluster. + */ +public class ProvisionFabricDescription { + /** + * The cluster code package file path. + */ + @JsonProperty(value = "CodeFilePath") + private String codeFilePath; + + /** + * The cluster manifest file path. + */ + @JsonProperty(value = "ClusterManifestFilePath") + private String clusterManifestFilePath; + + /** + * Get the cluster code package file path. + * + * @return the codeFilePath value + */ + public String codeFilePath() { + return this.codeFilePath; + } + + /** + * Set the cluster code package file path. + * + * @param codeFilePath the codeFilePath value to set + * @return the ProvisionFabricDescription object itself. + */ + public ProvisionFabricDescription withCodeFilePath(String codeFilePath) { + this.codeFilePath = codeFilePath; + return this; + } + + /** + * Get the cluster manifest file path. + * + * @return the clusterManifestFilePath value + */ + public String clusterManifestFilePath() { + return this.clusterManifestFilePath; + } + + /** + * Set the cluster manifest file path. + * + * @param clusterManifestFilePath the clusterManifestFilePath value to set + * @return the ProvisionFabricDescription object itself. + */ + public ProvisionFabricDescription withClusterManifestFilePath(String clusterManifestFilePath) { + this.clusterManifestFilePath = clusterManifestFilePath; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PutPropertyBatchOperation.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PutPropertyBatchOperation.java new file mode 100644 index 0000000000000..064ae92dcbd39 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PutPropertyBatchOperation.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * 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. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("Put") +public class PutPropertyBatchOperation extends PropertyBatchOperation { + /** + * Describes a Service Fabric property value. + */ + @JsonProperty(value = "Value", required = true) + private PropertyValue value; + + /** + * The property's custom type ID. Using this property, the user is able to + * tag the type of the value of the property. + */ + @JsonProperty(value = "CustomTypeId") + private String customTypeId; + + /** + * Get describes a Service Fabric property value. + * + * @return the value value + */ + public PropertyValue value() { + return this.value; + } + + /** + * Set describes a Service Fabric property value. + * + * @param value the value value to set + * @return the PutPropertyBatchOperation object itself. + */ + public PutPropertyBatchOperation withValue(PropertyValue value) { + this.value = value; + return this; + } + + /** + * Get the property's custom type ID. Using this property, the user is able to tag the type of the value of the property. + * + * @return the customTypeId value + */ + public String customTypeId() { + return this.customTypeId; + } + + /** + * Set the property's custom type ID. Using this property, the user is able to tag the type of the value of the property. + * + * @param customTypeId the customTypeId value to set + * @return the PutPropertyBatchOperation object itself. + */ + public PutPropertyBatchOperation withCustomTypeId(String customTypeId) { + this.customTypeId = customTypeId; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/QuorumLossMode.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/QuorumLossMode.java new file mode 100644 index 0000000000000..97a63de7252fc --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/QuorumLossMode.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for QuorumLossMode. + */ +public final class QuorumLossMode extends ExpandableStringEnum { + /** Static value Invalid for QuorumLossMode. */ + public static final QuorumLossMode INVALID = fromString("Invalid"); + + /** Static value QuorumReplicas for QuorumLossMode. */ + public static final QuorumLossMode QUORUM_REPLICAS = fromString("QuorumReplicas"); + + /** Static value AllReplicas for QuorumLossMode. */ + public static final QuorumLossMode ALL_REPLICAS = fromString("AllReplicas"); + + /** + * Creates or finds a QuorumLossMode from its string representation. + * @param name a name to look for + * @return the corresponding QuorumLossMode + */ + @JsonCreator + public static QuorumLossMode fromString(String name) { + return fromString(name, QuorumLossMode.class); + } + + /** + * @return known QuorumLossMode values + */ + public static Collection values() { + return values(QuorumLossMode.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReconfigurationInformation.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReconfigurationInformation.java new file mode 100644 index 0000000000000..076bc0a34d29c --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReconfigurationInformation.java @@ -0,0 +1,130 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about current reconfiguration like phase, type, previous + * configuration role of replica and reconfiguration start date time. + */ +public class ReconfigurationInformation { + /** + * Replica role before reconfiguration started. Possible values include: + * 'Unknown', 'None', 'Primary', 'IdleSecondary', 'ActiveSecondary'. + */ + @JsonProperty(value = "PreviousConfigurationRole") + private ReplicaRole previousConfigurationRole; + + /** + * 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'. + */ + @JsonProperty(value = "ReconfigurationPhase") + private ReconfigurationPhase reconfigurationPhase; + + /** + * Type of current ongoing reconfiguration. If no reconfiguration is taking + * place then this value will be "None". Possible values include: + * 'Unknown', 'SwapPrimary', 'Failover', 'Other'. + */ + @JsonProperty(value = "ReconfigurationType") + private ReconfigurationType reconfigurationType; + + /** + * Start time (in UTC) of the ongoing reconfiguration. If no + * reconfiguration is taking place then this value will be zero date-time. + */ + @JsonProperty(value = "ReconfigurationStartTimeUtc") + private DateTime reconfigurationStartTimeUtc; + + /** + * Get replica role before reconfiguration started. Possible values include: 'Unknown', 'None', 'Primary', 'IdleSecondary', 'ActiveSecondary'. + * + * @return the previousConfigurationRole value + */ + public ReplicaRole previousConfigurationRole() { + return this.previousConfigurationRole; + } + + /** + * Set replica role before reconfiguration started. Possible values include: 'Unknown', 'None', 'Primary', 'IdleSecondary', 'ActiveSecondary'. + * + * @param previousConfigurationRole the previousConfigurationRole value to set + * @return the ReconfigurationInformation object itself. + */ + public ReconfigurationInformation withPreviousConfigurationRole(ReplicaRole previousConfigurationRole) { + this.previousConfigurationRole = previousConfigurationRole; + return this; + } + + /** + * Get 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'. + * + * @return the reconfigurationPhase value + */ + public ReconfigurationPhase reconfigurationPhase() { + return this.reconfigurationPhase; + } + + /** + * Set 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'. + * + * @param reconfigurationPhase the reconfigurationPhase value to set + * @return the ReconfigurationInformation object itself. + */ + public ReconfigurationInformation withReconfigurationPhase(ReconfigurationPhase reconfigurationPhase) { + this.reconfigurationPhase = reconfigurationPhase; + return this; + } + + /** + * Get type of current ongoing reconfiguration. If no reconfiguration is taking place then this value will be "None". Possible values include: 'Unknown', 'SwapPrimary', 'Failover', 'Other'. + * + * @return the reconfigurationType value + */ + public ReconfigurationType reconfigurationType() { + return this.reconfigurationType; + } + + /** + * Set type of current ongoing reconfiguration. If no reconfiguration is taking place then this value will be "None". Possible values include: 'Unknown', 'SwapPrimary', 'Failover', 'Other'. + * + * @param reconfigurationType the reconfigurationType value to set + * @return the ReconfigurationInformation object itself. + */ + public ReconfigurationInformation withReconfigurationType(ReconfigurationType reconfigurationType) { + this.reconfigurationType = reconfigurationType; + return this; + } + + /** + * Get start time (in UTC) of the ongoing reconfiguration. If no reconfiguration is taking place then this value will be zero date-time. + * + * @return the reconfigurationStartTimeUtc value + */ + public DateTime reconfigurationStartTimeUtc() { + return this.reconfigurationStartTimeUtc; + } + + /** + * Set start time (in UTC) of the ongoing reconfiguration. If no reconfiguration is taking place then this value will be zero date-time. + * + * @param reconfigurationStartTimeUtc the reconfigurationStartTimeUtc value to set + * @return the ReconfigurationInformation object itself. + */ + public ReconfigurationInformation withReconfigurationStartTimeUtc(DateTime reconfigurationStartTimeUtc) { + this.reconfigurationStartTimeUtc = reconfigurationStartTimeUtc; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReconfigurationPhase.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReconfigurationPhase.java new file mode 100644 index 0000000000000..20fe6165a1198 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReconfigurationPhase.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ReconfigurationPhase. + */ +public final class ReconfigurationPhase extends ExpandableStringEnum { + /** Static value Unknown for ReconfigurationPhase. */ + public static final ReconfigurationPhase UNKNOWN = fromString("Unknown"); + + /** Static value None for ReconfigurationPhase. */ + public static final ReconfigurationPhase NONE = fromString("None"); + + /** Static value Phase0 for ReconfigurationPhase. */ + public static final ReconfigurationPhase PHASE0 = fromString("Phase0"); + + /** Static value Phase1 for ReconfigurationPhase. */ + public static final ReconfigurationPhase PHASE1 = fromString("Phase1"); + + /** Static value Phase2 for ReconfigurationPhase. */ + public static final ReconfigurationPhase PHASE2 = fromString("Phase2"); + + /** Static value Phase3 for ReconfigurationPhase. */ + public static final ReconfigurationPhase PHASE3 = fromString("Phase3"); + + /** Static value Phase4 for ReconfigurationPhase. */ + public static final ReconfigurationPhase PHASE4 = fromString("Phase4"); + + /** Static value AbortPhaseZero for ReconfigurationPhase. */ + public static final ReconfigurationPhase ABORT_PHASE_ZERO = fromString("AbortPhaseZero"); + + /** + * Creates or finds a ReconfigurationPhase from its string representation. + * @param name a name to look for + * @return the corresponding ReconfigurationPhase + */ + @JsonCreator + public static ReconfigurationPhase fromString(String name) { + return fromString(name, ReconfigurationPhase.class); + } + + /** + * @return known ReconfigurationPhase values + */ + public static Collection values() { + return values(ReconfigurationPhase.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReconfigurationType.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReconfigurationType.java new file mode 100644 index 0000000000000..2e1319173a799 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReconfigurationType.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ReconfigurationType. + */ +public final class ReconfigurationType extends ExpandableStringEnum { + /** Static value Unknown for ReconfigurationType. */ + public static final ReconfigurationType UNKNOWN = fromString("Unknown"); + + /** Static value SwapPrimary for ReconfigurationType. */ + public static final ReconfigurationType SWAP_PRIMARY = fromString("SwapPrimary"); + + /** Static value Failover for ReconfigurationType. */ + public static final ReconfigurationType FAILOVER = fromString("Failover"); + + /** Static value Other for ReconfigurationType. */ + public static final ReconfigurationType OTHER = fromString("Other"); + + /** + * Creates or finds a ReconfigurationType from its string representation. + * @param name a name to look for + * @return the corresponding ReconfigurationType + */ + @JsonCreator + public static ReconfigurationType fromString(String name) { + return fromString(name, ReconfigurationType.class); + } + + /** + * @return known ReconfigurationType values + */ + public static Collection values() { + return values(ReconfigurationType.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RegistryCredential.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RegistryCredential.java new file mode 100644 index 0000000000000..83c57af3a55c3 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RegistryCredential.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Credential information to connect to container registry. + */ +public class RegistryCredential { + /** + * The user name to connect to container registry. + */ + @JsonProperty(value = "RegistryUserName") + private String registryUserName; + + /** + * The password for supplied username to connect to container registry. + */ + @JsonProperty(value = "RegistryPassword") + private String registryPassword; + + /** + * Indicates that supplied container registry password is encrypted. + */ + @JsonProperty(value = "PasswordEncrypted") + private Boolean passwordEncrypted; + + /** + * Get the user name to connect to container registry. + * + * @return the registryUserName value + */ + public String registryUserName() { + return this.registryUserName; + } + + /** + * Set the user name to connect to container registry. + * + * @param registryUserName the registryUserName value to set + * @return the RegistryCredential object itself. + */ + public RegistryCredential withRegistryUserName(String registryUserName) { + this.registryUserName = registryUserName; + return this; + } + + /** + * Get the password for supplied username to connect to container registry. + * + * @return the registryPassword value + */ + public String registryPassword() { + return this.registryPassword; + } + + /** + * Set the password for supplied username to connect to container registry. + * + * @param registryPassword the registryPassword value to set + * @return the RegistryCredential object itself. + */ + public RegistryCredential withRegistryPassword(String registryPassword) { + this.registryPassword = registryPassword; + return this; + } + + /** + * Get indicates that supplied container registry password is encrypted. + * + * @return the passwordEncrypted value + */ + public Boolean passwordEncrypted() { + return this.passwordEncrypted; + } + + /** + * Set indicates that supplied container registry password is encrypted. + * + * @param passwordEncrypted the passwordEncrypted value to set + * @return the RegistryCredential object itself. + */ + public RegistryCredential withPasswordEncrypted(Boolean passwordEncrypted) { + this.passwordEncrypted = passwordEncrypted; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RemoteReplicatorAcknowledgementDetail.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RemoteReplicatorAcknowledgementDetail.java new file mode 100644 index 0000000000000..6f08df63e003f --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RemoteReplicatorAcknowledgementDetail.java @@ -0,0 +1,126 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Provides various statistics of the acknowledgements that are being received + * from the remote replicator. + */ +public class RemoteReplicatorAcknowledgementDetail { + /** + * Represents the average duration it takes for the remote replicator to + * receive an operation. + */ + @JsonProperty(value = "AverageReceiveDuration") + private String averageReceiveDuration; + + /** + * Represents the average duration it takes for the remote replicator to + * apply an operation. This usually entails writing the operation to disk. + */ + @JsonProperty(value = "AverageApplyDuration") + private String averageApplyDuration; + + /** + * Represents the number of operations not yet received by a remote + * replicator. + */ + @JsonProperty(value = "NotReceivedCount") + private String notReceivedCount; + + /** + * Represents the number of operations received and not yet applied by a + * remote replicator. + */ + @JsonProperty(value = "ReceivedAndNotAppliedCount") + private String receivedAndNotAppliedCount; + + /** + * Get represents the average duration it takes for the remote replicator to receive an operation. + * + * @return the averageReceiveDuration value + */ + public String averageReceiveDuration() { + return this.averageReceiveDuration; + } + + /** + * Set represents the average duration it takes for the remote replicator to receive an operation. + * + * @param averageReceiveDuration the averageReceiveDuration value to set + * @return the RemoteReplicatorAcknowledgementDetail object itself. + */ + public RemoteReplicatorAcknowledgementDetail withAverageReceiveDuration(String averageReceiveDuration) { + this.averageReceiveDuration = averageReceiveDuration; + return this; + } + + /** + * Get represents the average duration it takes for the remote replicator to apply an operation. This usually entails writing the operation to disk. + * + * @return the averageApplyDuration value + */ + public String averageApplyDuration() { + return this.averageApplyDuration; + } + + /** + * Set represents the average duration it takes for the remote replicator to apply an operation. This usually entails writing the operation to disk. + * + * @param averageApplyDuration the averageApplyDuration value to set + * @return the RemoteReplicatorAcknowledgementDetail object itself. + */ + public RemoteReplicatorAcknowledgementDetail withAverageApplyDuration(String averageApplyDuration) { + this.averageApplyDuration = averageApplyDuration; + return this; + } + + /** + * Get represents the number of operations not yet received by a remote replicator. + * + * @return the notReceivedCount value + */ + public String notReceivedCount() { + return this.notReceivedCount; + } + + /** + * Set represents the number of operations not yet received by a remote replicator. + * + * @param notReceivedCount the notReceivedCount value to set + * @return the RemoteReplicatorAcknowledgementDetail object itself. + */ + public RemoteReplicatorAcknowledgementDetail withNotReceivedCount(String notReceivedCount) { + this.notReceivedCount = notReceivedCount; + return this; + } + + /** + * Get represents the number of operations received and not yet applied by a remote replicator. + * + * @return the receivedAndNotAppliedCount value + */ + public String receivedAndNotAppliedCount() { + return this.receivedAndNotAppliedCount; + } + + /** + * Set represents the number of operations received and not yet applied by a remote replicator. + * + * @param receivedAndNotAppliedCount the receivedAndNotAppliedCount value to set + * @return the RemoteReplicatorAcknowledgementDetail object itself. + */ + public RemoteReplicatorAcknowledgementDetail withReceivedAndNotAppliedCount(String receivedAndNotAppliedCount) { + this.receivedAndNotAppliedCount = receivedAndNotAppliedCount; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RemoteReplicatorAcknowledgementStatus.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RemoteReplicatorAcknowledgementStatus.java new file mode 100644 index 0000000000000..25de618ca1c5c --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RemoteReplicatorAcknowledgementStatus.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Provides details about the remote replicators from the primary replicator's + * point of view. + */ +public class RemoteReplicatorAcknowledgementStatus { + /** + * Details about the acknowledgements for operations that are part of the + * replication stream data. + */ + @JsonProperty(value = "ReplicationStreamAcknowledgementDetail") + private RemoteReplicatorAcknowledgementDetail replicationStreamAcknowledgementDetail; + + /** + * Details about the acknowledgements for operations that are part of the + * copy stream data. + */ + @JsonProperty(value = "CopyStreamAcknowledgementDetail") + private RemoteReplicatorAcknowledgementDetail copyStreamAcknowledgementDetail; + + /** + * Get details about the acknowledgements for operations that are part of the replication stream data. + * + * @return the replicationStreamAcknowledgementDetail value + */ + public RemoteReplicatorAcknowledgementDetail replicationStreamAcknowledgementDetail() { + return this.replicationStreamAcknowledgementDetail; + } + + /** + * Set details about the acknowledgements for operations that are part of the replication stream data. + * + * @param replicationStreamAcknowledgementDetail the replicationStreamAcknowledgementDetail value to set + * @return the RemoteReplicatorAcknowledgementStatus object itself. + */ + public RemoteReplicatorAcknowledgementStatus withReplicationStreamAcknowledgementDetail(RemoteReplicatorAcknowledgementDetail replicationStreamAcknowledgementDetail) { + this.replicationStreamAcknowledgementDetail = replicationStreamAcknowledgementDetail; + return this; + } + + /** + * Get details about the acknowledgements for operations that are part of the copy stream data. + * + * @return the copyStreamAcknowledgementDetail value + */ + public RemoteReplicatorAcknowledgementDetail copyStreamAcknowledgementDetail() { + return this.copyStreamAcknowledgementDetail; + } + + /** + * Set details about the acknowledgements for operations that are part of the copy stream data. + * + * @param copyStreamAcknowledgementDetail the copyStreamAcknowledgementDetail value to set + * @return the RemoteReplicatorAcknowledgementStatus object itself. + */ + public RemoteReplicatorAcknowledgementStatus withCopyStreamAcknowledgementDetail(RemoteReplicatorAcknowledgementDetail copyStreamAcknowledgementDetail) { + this.copyStreamAcknowledgementDetail = copyStreamAcknowledgementDetail; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RemoteReplicatorStatus.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RemoteReplicatorStatus.java new file mode 100644 index 0000000000000..ba83aa9fa46dc --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RemoteReplicatorStatus.java @@ -0,0 +1,246 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents the state of the secondary replicator from the primary + * replicator’s point of view. + */ +public class RemoteReplicatorStatus { + /** + * Represents the replica ID of the remote secondary replicator. + */ + @JsonProperty(value = "ReplicaId") + private String replicaId; + + /** + * 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. + */ + @JsonProperty(value = "LastAcknowledgementProcessedTimeUtc") + private DateTime lastAcknowledgementProcessedTimeUtc; + + /** + * The highest replication operation sequence number that the secondary has + * received from the primary. + */ + @JsonProperty(value = "LastReceivedReplicationSequenceNumber") + private String lastReceivedReplicationSequenceNumber; + + /** + * The highest replication operation sequence number that the secondary has + * applied to its state. + */ + @JsonProperty(value = "LastAppliedReplicationSequenceNumber") + private String lastAppliedReplicationSequenceNumber; + + /** + * A value that indicates whether the secondary replica is in the process + * of being built. + */ + @JsonProperty(value = "IsInBuild") + private Boolean isInBuild; + + /** + * 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. + */ + @JsonProperty(value = "LastReceivedCopySequenceNumber") + private String lastReceivedCopySequenceNumber; + + /** + * 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. + */ + @JsonProperty(value = "LastAppliedCopySequenceNumber") + private String lastAppliedCopySequenceNumber; + + /** + * Represents the acknowledgment status for the remote secondary + * replicator. + */ + @JsonProperty(value = "RemoteReplicatorAcknowledgementStatus") + private RemoteReplicatorAcknowledgementStatus remoteReplicatorAcknowledgementStatus; + + /** + * Get represents the replica ID of the remote secondary replicator. + * + * @return the replicaId value + */ + public String replicaId() { + return this.replicaId; + } + + /** + * Set represents the replica ID of the remote secondary replicator. + * + * @param replicaId the replicaId value to set + * @return the RemoteReplicatorStatus object itself. + */ + public RemoteReplicatorStatus withReplicaId(String replicaId) { + this.replicaId = replicaId; + return this; + } + + /** + * Get 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. + * + * @return the lastAcknowledgementProcessedTimeUtc value + */ + public DateTime lastAcknowledgementProcessedTimeUtc() { + return this.lastAcknowledgementProcessedTimeUtc; + } + + /** + * Set 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. + * + * @param lastAcknowledgementProcessedTimeUtc the lastAcknowledgementProcessedTimeUtc value to set + * @return the RemoteReplicatorStatus object itself. + */ + public RemoteReplicatorStatus withLastAcknowledgementProcessedTimeUtc(DateTime lastAcknowledgementProcessedTimeUtc) { + this.lastAcknowledgementProcessedTimeUtc = lastAcknowledgementProcessedTimeUtc; + return this; + } + + /** + * Get the highest replication operation sequence number that the secondary has received from the primary. + * + * @return the lastReceivedReplicationSequenceNumber value + */ + public String lastReceivedReplicationSequenceNumber() { + return this.lastReceivedReplicationSequenceNumber; + } + + /** + * Set the highest replication operation sequence number that the secondary has received from the primary. + * + * @param lastReceivedReplicationSequenceNumber the lastReceivedReplicationSequenceNumber value to set + * @return the RemoteReplicatorStatus object itself. + */ + public RemoteReplicatorStatus withLastReceivedReplicationSequenceNumber(String lastReceivedReplicationSequenceNumber) { + this.lastReceivedReplicationSequenceNumber = lastReceivedReplicationSequenceNumber; + return this; + } + + /** + * Get the highest replication operation sequence number that the secondary has applied to its state. + * + * @return the lastAppliedReplicationSequenceNumber value + */ + public String lastAppliedReplicationSequenceNumber() { + return this.lastAppliedReplicationSequenceNumber; + } + + /** + * Set the highest replication operation sequence number that the secondary has applied to its state. + * + * @param lastAppliedReplicationSequenceNumber the lastAppliedReplicationSequenceNumber value to set + * @return the RemoteReplicatorStatus object itself. + */ + public RemoteReplicatorStatus withLastAppliedReplicationSequenceNumber(String lastAppliedReplicationSequenceNumber) { + this.lastAppliedReplicationSequenceNumber = lastAppliedReplicationSequenceNumber; + return this; + } + + /** + * Get a value that indicates whether the secondary replica is in the process of being built. + * + * @return the isInBuild value + */ + public Boolean isInBuild() { + return this.isInBuild; + } + + /** + * Set a value that indicates whether the secondary replica is in the process of being built. + * + * @param isInBuild the isInBuild value to set + * @return the RemoteReplicatorStatus object itself. + */ + public RemoteReplicatorStatus withIsInBuild(Boolean isInBuild) { + this.isInBuild = isInBuild; + return this; + } + + /** + * Get 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. + * + * @return the lastReceivedCopySequenceNumber value + */ + public String lastReceivedCopySequenceNumber() { + return this.lastReceivedCopySequenceNumber; + } + + /** + * Set 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. + * + * @param lastReceivedCopySequenceNumber the lastReceivedCopySequenceNumber value to set + * @return the RemoteReplicatorStatus object itself. + */ + public RemoteReplicatorStatus withLastReceivedCopySequenceNumber(String lastReceivedCopySequenceNumber) { + this.lastReceivedCopySequenceNumber = lastReceivedCopySequenceNumber; + return this; + } + + /** + * Get 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. + * + * @return the lastAppliedCopySequenceNumber value + */ + public String lastAppliedCopySequenceNumber() { + return this.lastAppliedCopySequenceNumber; + } + + /** + * Set 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. + * + * @param lastAppliedCopySequenceNumber the lastAppliedCopySequenceNumber value to set + * @return the RemoteReplicatorStatus object itself. + */ + public RemoteReplicatorStatus withLastAppliedCopySequenceNumber(String lastAppliedCopySequenceNumber) { + this.lastAppliedCopySequenceNumber = lastAppliedCopySequenceNumber; + return this; + } + + /** + * Get represents the acknowledgment status for the remote secondary replicator. + * + * @return the remoteReplicatorAcknowledgementStatus value + */ + public RemoteReplicatorAcknowledgementStatus remoteReplicatorAcknowledgementStatus() { + return this.remoteReplicatorAcknowledgementStatus; + } + + /** + * Set represents the acknowledgment status for the remote secondary replicator. + * + * @param remoteReplicatorAcknowledgementStatus the remoteReplicatorAcknowledgementStatus value to set + * @return the RemoteReplicatorStatus object itself. + */ + public RemoteReplicatorStatus withRemoteReplicatorAcknowledgementStatus(RemoteReplicatorAcknowledgementStatus remoteReplicatorAcknowledgementStatus) { + this.remoteReplicatorAcknowledgementStatus = remoteReplicatorAcknowledgementStatus; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RepairImpactDescriptionBase.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RepairImpactDescriptionBase.java new file mode 100644 index 0000000000000..0d1b0dafb56bf --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RepairImpactDescriptionBase.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * 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. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("RepairImpactDescriptionBase") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Node", value = NodeRepairImpactDescription.class) +}) +public class RepairImpactDescriptionBase { +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RepairImpactKind.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RepairImpactKind.java new file mode 100644 index 0000000000000..33819313b8623 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RepairImpactKind.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for RepairImpactKind. + */ +public final class RepairImpactKind extends ExpandableStringEnum { + /** Static value Invalid for RepairImpactKind. */ + public static final RepairImpactKind INVALID = fromString("Invalid"); + + /** Static value Node for RepairImpactKind. */ + public static final RepairImpactKind NODE = fromString("Node"); + + /** + * Creates or finds a RepairImpactKind from its string representation. + * @param name a name to look for + * @return the corresponding RepairImpactKind + */ + @JsonCreator + public static RepairImpactKind fromString(String name) { + return fromString(name, RepairImpactKind.class); + } + + /** + * @return known RepairImpactKind values + */ + public static Collection values() { + return values(RepairImpactKind.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RepairTargetDescriptionBase.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RepairTargetDescriptionBase.java new file mode 100644 index 0000000000000..2f4a353743f19 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RepairTargetDescriptionBase.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * 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. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("RepairTargetDescriptionBase") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Node", value = NodeRepairTargetDescription.class) +}) +public class RepairTargetDescriptionBase { +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RepairTargetKind.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RepairTargetKind.java new file mode 100644 index 0000000000000..a78b517954db5 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RepairTargetKind.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for RepairTargetKind. + */ +public final class RepairTargetKind extends ExpandableStringEnum { + /** Static value Invalid for RepairTargetKind. */ + public static final RepairTargetKind INVALID = fromString("Invalid"); + + /** Static value Node for RepairTargetKind. */ + public static final RepairTargetKind NODE = fromString("Node"); + + /** + * Creates or finds a RepairTargetKind from its string representation. + * @param name a name to look for + * @return the corresponding RepairTargetKind + */ + @JsonCreator + public static RepairTargetKind fromString(String name) { + return fromString(name, RepairTargetKind.class); + } + + /** + * @return known RepairTargetKind values + */ + public static Collection values() { + return values(RepairTargetKind.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RepairTaskApproveDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RepairTaskApproveDescription.java new file mode 100644 index 0000000000000..fae1be05d1c62 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RepairTaskApproveDescription.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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. + */ +public class RepairTaskApproveDescription { + /** + * The ID of the repair task. + */ + @JsonProperty(value = "TaskId", required = true) + private String taskId; + + /** + * 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. + */ + @JsonProperty(value = "Version") + private String version; + + /** + * Get the ID of the repair task. + * + * @return the taskId value + */ + public String taskId() { + return this.taskId; + } + + /** + * Set the ID of the repair task. + * + * @param taskId the taskId value to set + * @return the RepairTaskApproveDescription object itself. + */ + public RepairTaskApproveDescription withTaskId(String taskId) { + this.taskId = taskId; + return this; + } + + /** + * Get 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. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Set 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 version the version value to set + * @return the RepairTaskApproveDescription object itself. + */ + public RepairTaskApproveDescription withVersion(String version) { + this.version = version; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RepairTaskCancelDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RepairTaskCancelDescription.java new file mode 100644 index 0000000000000..db8f49f8dbccd --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RepairTaskCancelDescription.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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. + */ +public class RepairTaskCancelDescription { + /** + * The ID of the repair task. + */ + @JsonProperty(value = "TaskId", required = true) + private String taskId; + + /** + * 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. + */ + @JsonProperty(value = "Version") + private String version; + + /** + * _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. + */ + @JsonProperty(value = "RequestAbort") + private Boolean requestAbort; + + /** + * Get the ID of the repair task. + * + * @return the taskId value + */ + public String taskId() { + return this.taskId; + } + + /** + * Set the ID of the repair task. + * + * @param taskId the taskId value to set + * @return the RepairTaskCancelDescription object itself. + */ + public RepairTaskCancelDescription withTaskId(String taskId) { + this.taskId = taskId; + return this; + } + + /** + * Get 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. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Set 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 version the version value to set + * @return the RepairTaskCancelDescription object itself. + */ + public RepairTaskCancelDescription withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get _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. + * + * @return the requestAbort value + */ + public Boolean requestAbort() { + return this.requestAbort; + } + + /** + * Set _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 requestAbort the requestAbort value to set + * @return the RepairTaskCancelDescription object itself. + */ + public RepairTaskCancelDescription withRequestAbort(Boolean requestAbort) { + this.requestAbort = requestAbort; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RepairTaskDeleteDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RepairTaskDeleteDescription.java new file mode 100644 index 0000000000000..fbc85cd2db73d --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RepairTaskDeleteDescription.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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. + */ +public class RepairTaskDeleteDescription { + /** + * The ID of the completed repair task to be deleted. + */ + @JsonProperty(value = "TaskId", required = true) + private String taskId; + + /** + * 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. + */ + @JsonProperty(value = "Version") + private String version; + + /** + * Get the ID of the completed repair task to be deleted. + * + * @return the taskId value + */ + public String taskId() { + return this.taskId; + } + + /** + * Set the ID of the completed repair task to be deleted. + * + * @param taskId the taskId value to set + * @return the RepairTaskDeleteDescription object itself. + */ + public RepairTaskDeleteDescription withTaskId(String taskId) { + this.taskId = taskId; + return this; + } + + /** + * Get 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. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Set 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 version the version value to set + * @return the RepairTaskDeleteDescription object itself. + */ + public RepairTaskDeleteDescription withVersion(String version) { + this.version = version; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RepairTaskHealthCheckState.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RepairTaskHealthCheckState.java new file mode 100644 index 0000000000000..313ecd61c3f20 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RepairTaskHealthCheckState.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for RepairTaskHealthCheckState. + */ +public final class RepairTaskHealthCheckState extends ExpandableStringEnum { + /** Static value NotStarted for RepairTaskHealthCheckState. */ + public static final RepairTaskHealthCheckState NOT_STARTED = fromString("NotStarted"); + + /** Static value InProgress for RepairTaskHealthCheckState. */ + public static final RepairTaskHealthCheckState IN_PROGRESS = fromString("InProgress"); + + /** Static value Succeeded for RepairTaskHealthCheckState. */ + public static final RepairTaskHealthCheckState SUCCEEDED = fromString("Succeeded"); + + /** Static value Skipped for RepairTaskHealthCheckState. */ + public static final RepairTaskHealthCheckState SKIPPED = fromString("Skipped"); + + /** Static value TimedOut for RepairTaskHealthCheckState. */ + public static final RepairTaskHealthCheckState TIMED_OUT = fromString("TimedOut"); + + /** + * Creates or finds a RepairTaskHealthCheckState from its string representation. + * @param name a name to look for + * @return the corresponding RepairTaskHealthCheckState + */ + @JsonCreator + public static RepairTaskHealthCheckState fromString(String name) { + return fromString(name, RepairTaskHealthCheckState.class); + } + + /** + * @return known RepairTaskHealthCheckState values + */ + public static Collection values() { + return values(RepairTaskHealthCheckState.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RepairTaskHistory.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RepairTaskHistory.java new file mode 100644 index 0000000000000..bbd8188ae661f --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RepairTaskHistory.java @@ -0,0 +1,311 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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. + */ +public class RepairTaskHistory { + /** + * The time when the repair task entered the Created state. + */ + @JsonProperty(value = "CreatedUtcTimestamp") + private DateTime createdUtcTimestamp; + + /** + * The time when the repair task entered the Claimed state. + */ + @JsonProperty(value = "ClaimedUtcTimestamp") + private DateTime claimedUtcTimestamp; + + /** + * The time when the repair task entered the Preparing state. + */ + @JsonProperty(value = "PreparingUtcTimestamp") + private DateTime preparingUtcTimestamp; + + /** + * The time when the repair task entered the Approved state. + */ + @JsonProperty(value = "ApprovedUtcTimestamp") + private DateTime approvedUtcTimestamp; + + /** + * The time when the repair task entered the Executing state. + */ + @JsonProperty(value = "ExecutingUtcTimestamp") + private DateTime executingUtcTimestamp; + + /** + * The time when the repair task entered the Restoring state. + */ + @JsonProperty(value = "RestoringUtcTimestamp") + private DateTime restoringUtcTimestamp; + + /** + * The time when the repair task entered the Completed state. + */ + @JsonProperty(value = "CompletedUtcTimestamp") + private DateTime completedUtcTimestamp; + + /** + * The time when the repair task started the health check in the Preparing + * state. + */ + @JsonProperty(value = "PreparingHealthCheckStartUtcTimestamp") + private DateTime preparingHealthCheckStartUtcTimestamp; + + /** + * The time when the repair task completed the health check in the + * Preparing state. + */ + @JsonProperty(value = "PreparingHealthCheckEndUtcTimestamp") + private DateTime preparingHealthCheckEndUtcTimestamp; + + /** + * The time when the repair task started the health check in the Restoring + * state. + */ + @JsonProperty(value = "RestoringHealthCheckStartUtcTimestamp") + private DateTime restoringHealthCheckStartUtcTimestamp; + + /** + * The time when the repair task completed the health check in the + * Restoring state. + */ + @JsonProperty(value = "RestoringHealthCheckEndUtcTimestamp") + private DateTime restoringHealthCheckEndUtcTimestamp; + + /** + * Get the time when the repair task entered the Created state. + * + * @return the createdUtcTimestamp value + */ + public DateTime createdUtcTimestamp() { + return this.createdUtcTimestamp; + } + + /** + * Set the time when the repair task entered the Created state. + * + * @param createdUtcTimestamp the createdUtcTimestamp value to set + * @return the RepairTaskHistory object itself. + */ + public RepairTaskHistory withCreatedUtcTimestamp(DateTime createdUtcTimestamp) { + this.createdUtcTimestamp = createdUtcTimestamp; + return this; + } + + /** + * Get the time when the repair task entered the Claimed state. + * + * @return the claimedUtcTimestamp value + */ + public DateTime claimedUtcTimestamp() { + return this.claimedUtcTimestamp; + } + + /** + * Set the time when the repair task entered the Claimed state. + * + * @param claimedUtcTimestamp the claimedUtcTimestamp value to set + * @return the RepairTaskHistory object itself. + */ + public RepairTaskHistory withClaimedUtcTimestamp(DateTime claimedUtcTimestamp) { + this.claimedUtcTimestamp = claimedUtcTimestamp; + return this; + } + + /** + * Get the time when the repair task entered the Preparing state. + * + * @return the preparingUtcTimestamp value + */ + public DateTime preparingUtcTimestamp() { + return this.preparingUtcTimestamp; + } + + /** + * Set the time when the repair task entered the Preparing state. + * + * @param preparingUtcTimestamp the preparingUtcTimestamp value to set + * @return the RepairTaskHistory object itself. + */ + public RepairTaskHistory withPreparingUtcTimestamp(DateTime preparingUtcTimestamp) { + this.preparingUtcTimestamp = preparingUtcTimestamp; + return this; + } + + /** + * Get the time when the repair task entered the Approved state. + * + * @return the approvedUtcTimestamp value + */ + public DateTime approvedUtcTimestamp() { + return this.approvedUtcTimestamp; + } + + /** + * Set the time when the repair task entered the Approved state. + * + * @param approvedUtcTimestamp the approvedUtcTimestamp value to set + * @return the RepairTaskHistory object itself. + */ + public RepairTaskHistory withApprovedUtcTimestamp(DateTime approvedUtcTimestamp) { + this.approvedUtcTimestamp = approvedUtcTimestamp; + return this; + } + + /** + * Get the time when the repair task entered the Executing state. + * + * @return the executingUtcTimestamp value + */ + public DateTime executingUtcTimestamp() { + return this.executingUtcTimestamp; + } + + /** + * Set the time when the repair task entered the Executing state. + * + * @param executingUtcTimestamp the executingUtcTimestamp value to set + * @return the RepairTaskHistory object itself. + */ + public RepairTaskHistory withExecutingUtcTimestamp(DateTime executingUtcTimestamp) { + this.executingUtcTimestamp = executingUtcTimestamp; + return this; + } + + /** + * Get the time when the repair task entered the Restoring state. + * + * @return the restoringUtcTimestamp value + */ + public DateTime restoringUtcTimestamp() { + return this.restoringUtcTimestamp; + } + + /** + * Set the time when the repair task entered the Restoring state. + * + * @param restoringUtcTimestamp the restoringUtcTimestamp value to set + * @return the RepairTaskHistory object itself. + */ + public RepairTaskHistory withRestoringUtcTimestamp(DateTime restoringUtcTimestamp) { + this.restoringUtcTimestamp = restoringUtcTimestamp; + return this; + } + + /** + * Get the time when the repair task entered the Completed state. + * + * @return the completedUtcTimestamp value + */ + public DateTime completedUtcTimestamp() { + return this.completedUtcTimestamp; + } + + /** + * Set the time when the repair task entered the Completed state. + * + * @param completedUtcTimestamp the completedUtcTimestamp value to set + * @return the RepairTaskHistory object itself. + */ + public RepairTaskHistory withCompletedUtcTimestamp(DateTime completedUtcTimestamp) { + this.completedUtcTimestamp = completedUtcTimestamp; + return this; + } + + /** + * Get the time when the repair task started the health check in the Preparing state. + * + * @return the preparingHealthCheckStartUtcTimestamp value + */ + public DateTime preparingHealthCheckStartUtcTimestamp() { + return this.preparingHealthCheckStartUtcTimestamp; + } + + /** + * Set the time when the repair task started the health check in the Preparing state. + * + * @param preparingHealthCheckStartUtcTimestamp the preparingHealthCheckStartUtcTimestamp value to set + * @return the RepairTaskHistory object itself. + */ + public RepairTaskHistory withPreparingHealthCheckStartUtcTimestamp(DateTime preparingHealthCheckStartUtcTimestamp) { + this.preparingHealthCheckStartUtcTimestamp = preparingHealthCheckStartUtcTimestamp; + return this; + } + + /** + * Get the time when the repair task completed the health check in the Preparing state. + * + * @return the preparingHealthCheckEndUtcTimestamp value + */ + public DateTime preparingHealthCheckEndUtcTimestamp() { + return this.preparingHealthCheckEndUtcTimestamp; + } + + /** + * Set the time when the repair task completed the health check in the Preparing state. + * + * @param preparingHealthCheckEndUtcTimestamp the preparingHealthCheckEndUtcTimestamp value to set + * @return the RepairTaskHistory object itself. + */ + public RepairTaskHistory withPreparingHealthCheckEndUtcTimestamp(DateTime preparingHealthCheckEndUtcTimestamp) { + this.preparingHealthCheckEndUtcTimestamp = preparingHealthCheckEndUtcTimestamp; + return this; + } + + /** + * Get the time when the repair task started the health check in the Restoring state. + * + * @return the restoringHealthCheckStartUtcTimestamp value + */ + public DateTime restoringHealthCheckStartUtcTimestamp() { + return this.restoringHealthCheckStartUtcTimestamp; + } + + /** + * Set the time when the repair task started the health check in the Restoring state. + * + * @param restoringHealthCheckStartUtcTimestamp the restoringHealthCheckStartUtcTimestamp value to set + * @return the RepairTaskHistory object itself. + */ + public RepairTaskHistory withRestoringHealthCheckStartUtcTimestamp(DateTime restoringHealthCheckStartUtcTimestamp) { + this.restoringHealthCheckStartUtcTimestamp = restoringHealthCheckStartUtcTimestamp; + return this; + } + + /** + * Get the time when the repair task completed the health check in the Restoring state. + * + * @return the restoringHealthCheckEndUtcTimestamp value + */ + public DateTime restoringHealthCheckEndUtcTimestamp() { + return this.restoringHealthCheckEndUtcTimestamp; + } + + /** + * Set the time when the repair task completed the health check in the Restoring state. + * + * @param restoringHealthCheckEndUtcTimestamp the restoringHealthCheckEndUtcTimestamp value to set + * @return the RepairTaskHistory object itself. + */ + public RepairTaskHistory withRestoringHealthCheckEndUtcTimestamp(DateTime restoringHealthCheckEndUtcTimestamp) { + this.restoringHealthCheckEndUtcTimestamp = restoringHealthCheckEndUtcTimestamp; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RepairTaskUpdateHealthPolicyDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RepairTaskUpdateHealthPolicyDescription.java new file mode 100644 index 0000000000000..bc9cbdcb28b66 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RepairTaskUpdateHealthPolicyDescription.java @@ -0,0 +1,130 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a request to update the health policy of a repair task. + * + * This type supports the Service Fabric platform; it is not meant to be used + * directly from your code. + */ +public class RepairTaskUpdateHealthPolicyDescription { + /** + * The ID of the repair task to be updated. + */ + @JsonProperty(value = "TaskId", required = true) + private String taskId; + + /** + * 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. + */ + @JsonProperty(value = "Version") + private String version; + + /** + * 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. + */ + @JsonProperty(value = "PerformPreparingHealthCheck") + private Boolean performPreparingHealthCheck; + + /** + * 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. + */ + @JsonProperty(value = "PerformRestoringHealthCheck") + private Boolean performRestoringHealthCheck; + + /** + * Get the ID of the repair task to be updated. + * + * @return the taskId value + */ + public String taskId() { + return this.taskId; + } + + /** + * Set the ID of the repair task to be updated. + * + * @param taskId the taskId value to set + * @return the RepairTaskUpdateHealthPolicyDescription object itself. + */ + public RepairTaskUpdateHealthPolicyDescription withTaskId(String taskId) { + this.taskId = taskId; + return this; + } + + /** + * Get 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. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Set 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 version the version value to set + * @return the RepairTaskUpdateHealthPolicyDescription object itself. + */ + public RepairTaskUpdateHealthPolicyDescription withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get 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. + * + * @return the performPreparingHealthCheck value + */ + public Boolean performPreparingHealthCheck() { + return this.performPreparingHealthCheck; + } + + /** + * Set 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 performPreparingHealthCheck the performPreparingHealthCheck value to set + * @return the RepairTaskUpdateHealthPolicyDescription object itself. + */ + public RepairTaskUpdateHealthPolicyDescription withPerformPreparingHealthCheck(Boolean performPreparingHealthCheck) { + this.performPreparingHealthCheck = performPreparingHealthCheck; + return this; + } + + /** + * Get 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. + * + * @return the performRestoringHealthCheck value + */ + public Boolean performRestoringHealthCheck() { + return this.performRestoringHealthCheck; + } + + /** + * Set 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 performRestoringHealthCheck the performRestoringHealthCheck value to set + * @return the RepairTaskUpdateHealthPolicyDescription object itself. + */ + public RepairTaskUpdateHealthPolicyDescription withPerformRestoringHealthCheck(Boolean performRestoringHealthCheck) { + this.performRestoringHealthCheck = performRestoringHealthCheck; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicaHealthEvaluation.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicaHealthEvaluation.java new file mode 100644 index 0000000000000..a79ef35ca8e7e --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicaHealthEvaluation.java @@ -0,0 +1,115 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.UUID; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents health evaluation for a replica, 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. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("Replica") +public class ReplicaHealthEvaluation extends HealthEvaluation { + /** + * Id of the partition to which the replica belongs. + */ + @JsonProperty(value = "PartitionId") + private UUID partitionId; + + /** + * Id of a stateful service replica or a stateless service instance. This + * ID is used in the queries that apply to both stateful and stateless + * services. It is used by Service Fabric to uniquely identify a replica of + * a partition of a stateful service or an instance of a stateless service + * partition. It is unique within a partition and does not change for the + * lifetime of the replica or the instance. If a stateful replica gets + * dropped and another replica gets created on the same node for the same + * partition, it will get a different value for the ID. If a stateless + * instance is failed over on the same or different node it will get a + * different value for the ID. + */ + @JsonProperty(value = "ReplicaOrInstanceId") + private String replicaOrInstanceId; + + /** + * List of unhealthy evaluations that led to the current aggregated health + * state of the replica. The types of the unhealthy evaluations can be + * EventHealthEvaluation. + */ + @JsonProperty(value = "UnhealthyEvaluations") + private List unhealthyEvaluations; + + /** + * Get id of the partition to which the replica belongs. + * + * @return the partitionId value + */ + public UUID partitionId() { + return this.partitionId; + } + + /** + * Set id of the partition to which the replica belongs. + * + * @param partitionId the partitionId value to set + * @return the ReplicaHealthEvaluation object itself. + */ + public ReplicaHealthEvaluation withPartitionId(UUID partitionId) { + this.partitionId = partitionId; + return this; + } + + /** + * Get id of a stateful service replica or a stateless service instance. This ID is used in the queries that apply to both stateful and stateless services. It is used by Service Fabric to uniquely identify a replica of a partition of a stateful service or an instance of a stateless service partition. It is unique within a partition and does not change for the lifetime of the replica or the instance. If a stateful replica gets dropped and another replica gets created on the same node for the same partition, it will get a different value for the ID. If a stateless instance is failed over on the same or different node it will get a different value for the ID. + * + * @return the replicaOrInstanceId value + */ + public String replicaOrInstanceId() { + return this.replicaOrInstanceId; + } + + /** + * Set id of a stateful service replica or a stateless service instance. This ID is used in the queries that apply to both stateful and stateless services. It is used by Service Fabric to uniquely identify a replica of a partition of a stateful service or an instance of a stateless service partition. It is unique within a partition and does not change for the lifetime of the replica or the instance. If a stateful replica gets dropped and another replica gets created on the same node for the same partition, it will get a different value for the ID. If a stateless instance is failed over on the same or different node it will get a different value for the ID. + * + * @param replicaOrInstanceId the replicaOrInstanceId value to set + * @return the ReplicaHealthEvaluation object itself. + */ + public ReplicaHealthEvaluation withReplicaOrInstanceId(String replicaOrInstanceId) { + this.replicaOrInstanceId = replicaOrInstanceId; + return this; + } + + /** + * Get list of unhealthy evaluations that led to the current aggregated health state of the replica. The types of the unhealthy evaluations can be EventHealthEvaluation. + * + * @return the unhealthyEvaluations value + */ + public List unhealthyEvaluations() { + return this.unhealthyEvaluations; + } + + /** + * Set list of unhealthy evaluations that led to the current aggregated health state of the replica. The types of the unhealthy evaluations can be EventHealthEvaluation. + * + * @param unhealthyEvaluations the unhealthyEvaluations value to set + * @return the ReplicaHealthEvaluation object itself. + */ + public ReplicaHealthEvaluation withUnhealthyEvaluations(List unhealthyEvaluations) { + this.unhealthyEvaluations = unhealthyEvaluations; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicaHealthReportServiceKind.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicaHealthReportServiceKind.java new file mode 100644 index 0000000000000..a7ecf3fec6b2d --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicaHealthReportServiceKind.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ReplicaHealthReportServiceKind. + */ +public final class ReplicaHealthReportServiceKind extends ExpandableStringEnum { + /** Static value Stateless for ReplicaHealthReportServiceKind. */ + public static final ReplicaHealthReportServiceKind STATELESS = fromString("Stateless"); + + /** Static value Stateful for ReplicaHealthReportServiceKind. */ + public static final ReplicaHealthReportServiceKind STATEFUL = fromString("Stateful"); + + /** + * Creates or finds a ReplicaHealthReportServiceKind from its string representation. + * @param name a name to look for + * @return the corresponding ReplicaHealthReportServiceKind + */ + @JsonCreator + public static ReplicaHealthReportServiceKind fromString(String name) { + return fromString(name, ReplicaHealthReportServiceKind.class); + } + + /** + * @return known ReplicaHealthReportServiceKind values + */ + public static Collection values() { + return values(ReplicaHealthReportServiceKind.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicaHealthState.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicaHealthState.java new file mode 100644 index 0000000000000..da9b76b38f883 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicaHealthState.java @@ -0,0 +1,54 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Represents a base class for stateful service replica or stateless service + * instance health state. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ServiceKind") +@JsonTypeName("ReplicaHealthState") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Stateful", value = StatefulServiceReplicaHealthState.class), + @JsonSubTypes.Type(name = "Stateless", value = StatelessServiceInstanceHealthState.class) +}) +public class ReplicaHealthState extends EntityHealthState { + /** + * The ID of the partition to which this replica belongs. + */ + @JsonProperty(value = "PartitionId") + private UUID partitionId; + + /** + * Get the ID of the partition to which this replica belongs. + * + * @return the partitionId value + */ + public UUID partitionId() { + return this.partitionId; + } + + /** + * Set the ID of the partition to which this replica belongs. + * + * @param partitionId the partitionId value to set + * @return the ReplicaHealthState object itself. + */ + public ReplicaHealthState withPartitionId(UUID partitionId) { + this.partitionId = partitionId; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicaHealthStateChunk.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicaHealthStateChunk.java new file mode 100644 index 0000000000000..1d71fb5ee1e8d --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicaHealthStateChunk.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents the health state chunk of a stateful service replica or a + * stateless service instance. + * The replica health state contains the replica ID and its aggregated health + * state. + */ +public class ReplicaHealthStateChunk extends EntityHealthStateChunk { + /** + * Id of a stateful service replica or a stateless service instance. This + * ID is used in the queries that apply to both stateful and stateless + * services. It is used by Service Fabric to uniquely identify a replica of + * a partition of a stateful service or an instance of a stateless service + * partition. It is unique within a partition and does not change for the + * lifetime of the replica or the instance. If a stateful replica gets + * dropped and another replica gets created on the same node for the same + * partition, it will get a different value for the ID. If a stateless + * instance is failed over on the same or different node it will get a + * different value for the ID. + */ + @JsonProperty(value = "ReplicaOrInstanceId") + private String replicaOrInstanceId; + + /** + * Get id of a stateful service replica or a stateless service instance. This ID is used in the queries that apply to both stateful and stateless services. It is used by Service Fabric to uniquely identify a replica of a partition of a stateful service or an instance of a stateless service partition. It is unique within a partition and does not change for the lifetime of the replica or the instance. If a stateful replica gets dropped and another replica gets created on the same node for the same partition, it will get a different value for the ID. If a stateless instance is failed over on the same or different node it will get a different value for the ID. + * + * @return the replicaOrInstanceId value + */ + public String replicaOrInstanceId() { + return this.replicaOrInstanceId; + } + + /** + * Set id of a stateful service replica or a stateless service instance. This ID is used in the queries that apply to both stateful and stateless services. It is used by Service Fabric to uniquely identify a replica of a partition of a stateful service or an instance of a stateless service partition. It is unique within a partition and does not change for the lifetime of the replica or the instance. If a stateful replica gets dropped and another replica gets created on the same node for the same partition, it will get a different value for the ID. If a stateless instance is failed over on the same or different node it will get a different value for the ID. + * + * @param replicaOrInstanceId the replicaOrInstanceId value to set + * @return the ReplicaHealthStateChunk object itself. + */ + public ReplicaHealthStateChunk withReplicaOrInstanceId(String replicaOrInstanceId) { + this.replicaOrInstanceId = replicaOrInstanceId; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicaHealthStateChunkList.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicaHealthStateChunkList.java new file mode 100644 index 0000000000000..8e7b6e1b1f3bb --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicaHealthStateChunkList.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list of replica health state chunks that respect the input filters in + * the chunk query. Returned by get cluster health state chunks query. + */ +public class ReplicaHealthStateChunkList { + /** + * The list of replica health state chunks that respect the input filters + * in the chunk query. + */ + @JsonProperty(value = "Items") + private List items; + + /** + * Get the list of replica health state chunks that respect the input filters in the chunk query. + * + * @return the items value + */ + public List items() { + return this.items; + } + + /** + * Set the list of replica health state chunks that respect the input filters in the chunk query. + * + * @param items the items value to set + * @return the ReplicaHealthStateChunkList object itself. + */ + public ReplicaHealthStateChunkList withItems(List items) { + this.items = items; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicaHealthStateFilter.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicaHealthStateFilter.java new file mode 100644 index 0000000000000..fcb0e4a32af72 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicaHealthStateFilter.java @@ -0,0 +1,134 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines matching criteria to determine whether a replica should be included + * as a child of a partition in the cluster health chunk. + * The replicas are only returned if the parent entities match a filter + * specified in the cluster health chunk query description. The parent + * partition, service and application must be included in the cluster health + * chunk. + * One filter can match zero, one or multiple replicas, depending on its + * properties. + */ +public class ReplicaHealthStateFilter { + /** + * Id of the stateful service replica or stateless service instance that + * matches the filter. The filter is applied only to the specified replica, + * if it exists. + * If the replica doesn't exist, no replica is returned in the cluster + * health chunk based on this filter. + * If the replica exists, it is included in the cluster health chunk if it + * respects the other filter properties. + * If not specified, all replicas that match the parent filters (if any) + * are taken into consideration and matched against the other filter + * members, like health state filter. + */ + @JsonProperty(value = "ReplicaOrInstanceIdFilter") + private String replicaOrInstanceIdFilter; + + /** + * The filter for the health state of the replicas. It allows selecting + * replicas if they match the desired health states. + * The possible values are integer value of one of the following health + * states. Only replicas that match the filter are returned. All replicas + * are used to evaluate the parent partition aggregated health state. + * If not specified, default value is None, unless the replica ID is + * specified. If the filter has default value and replica ID is specified, + * the matching replica is returned. + * The state values are flag-based enumeration, so the value could be a + * combination of these values obtained using bitwise 'OR' operator. + * For example, if the provided value is 6, it matches replicas with + * HealthState value of OK (2) and Warning (4). + * + * - 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. + */ + @JsonProperty(value = "HealthStateFilter") + private Integer healthStateFilter; + + /** + * Get id of the stateful service replica or stateless service instance that matches the filter. The filter is applied only to the specified replica, if it exists. + If the replica doesn't exist, no replica is returned in the cluster health chunk based on this filter. + If the replica exists, it is included in the cluster health chunk if it respects the other filter properties. + If not specified, all replicas that match the parent filters (if any) are taken into consideration and matched against the other filter members, like health state filter. + * + * @return the replicaOrInstanceIdFilter value + */ + public String replicaOrInstanceIdFilter() { + return this.replicaOrInstanceIdFilter; + } + + /** + * Set id of the stateful service replica or stateless service instance that matches the filter. The filter is applied only to the specified replica, if it exists. + If the replica doesn't exist, no replica is returned in the cluster health chunk based on this filter. + If the replica exists, it is included in the cluster health chunk if it respects the other filter properties. + If not specified, all replicas that match the parent filters (if any) are taken into consideration and matched against the other filter members, like health state filter. + * + * @param replicaOrInstanceIdFilter the replicaOrInstanceIdFilter value to set + * @return the ReplicaHealthStateFilter object itself. + */ + public ReplicaHealthStateFilter withReplicaOrInstanceIdFilter(String replicaOrInstanceIdFilter) { + this.replicaOrInstanceIdFilter = replicaOrInstanceIdFilter; + return this; + } + + /** + * Get the filter for the health state of the replicas. It allows selecting replicas if they match the desired health states. + The possible values are integer value of one of the following health states. Only replicas that match the filter are returned. All replicas are used to evaluate the parent partition aggregated health state. + If not specified, default value is None, unless the replica ID is specified. If the filter has default value and replica ID is specified, the matching replica is returned. + The state values are flag-based enumeration, so the value could be a combination of these values obtained using bitwise 'OR' operator. + For example, if the provided value is 6, it matches replicas with HealthState value of OK (2) and Warning (4). + - Default - Default value. Matches any HealthState. The value is zero. + - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given collection of states. The value is 1. + - Ok - Filter that matches input with HealthState value Ok. The value is 2. + - Warning - Filter that matches input with HealthState value Warning. The value is 4. + - Error - Filter that matches input with HealthState value Error. The value is 8. + - All - Filter that matches input with any HealthState value. The value is 65535. + * + * @return the healthStateFilter value + */ + public Integer healthStateFilter() { + return this.healthStateFilter; + } + + /** + * Set the filter for the health state of the replicas. It allows selecting replicas if they match the desired health states. + The possible values are integer value of one of the following health states. Only replicas that match the filter are returned. All replicas are used to evaluate the parent partition aggregated health state. + If not specified, default value is None, unless the replica ID is specified. If the filter has default value and replica ID is specified, the matching replica is returned. + The state values are flag-based enumeration, so the value could be a combination of these values obtained using bitwise 'OR' operator. + For example, if the provided value is 6, it matches replicas with HealthState value of OK (2) and Warning (4). + - 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 healthStateFilter the healthStateFilter value to set + * @return the ReplicaHealthStateFilter object itself. + */ + public ReplicaHealthStateFilter withHealthStateFilter(Integer healthStateFilter) { + this.healthStateFilter = healthStateFilter; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicaKind.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicaKind.java new file mode 100644 index 0000000000000..38bef191cf268 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicaKind.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ReplicaKind. + */ +public final class ReplicaKind extends ExpandableStringEnum { + /** Static value Invalid for ReplicaKind. */ + public static final ReplicaKind INVALID = fromString("Invalid"); + + /** Static value KeyValueStore for ReplicaKind. */ + public static final ReplicaKind KEY_VALUE_STORE = fromString("KeyValueStore"); + + /** + * Creates or finds a ReplicaKind from its string representation. + * @param name a name to look for + * @return the corresponding ReplicaKind + */ + @JsonCreator + public static ReplicaKind fromString(String name) { + return fromString(name, ReplicaKind.class); + } + + /** + * @return known ReplicaKind values + */ + public static Collection values() { + return values(ReplicaKind.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicaRole.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicaRole.java new file mode 100644 index 0000000000000..ae0415e45b593 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicaRole.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ReplicaRole. + */ +public final class ReplicaRole extends ExpandableStringEnum { + /** Static value Unknown for ReplicaRole. */ + public static final ReplicaRole UNKNOWN = fromString("Unknown"); + + /** Static value None for ReplicaRole. */ + public static final ReplicaRole NONE = fromString("None"); + + /** Static value Primary for ReplicaRole. */ + public static final ReplicaRole PRIMARY = fromString("Primary"); + + /** Static value IdleSecondary for ReplicaRole. */ + public static final ReplicaRole IDLE_SECONDARY = fromString("IdleSecondary"); + + /** Static value ActiveSecondary for ReplicaRole. */ + public static final ReplicaRole ACTIVE_SECONDARY = fromString("ActiveSecondary"); + + /** + * Creates or finds a ReplicaRole from its string representation. + * @param name a name to look for + * @return the corresponding ReplicaRole + */ + @JsonCreator + public static ReplicaRole fromString(String name) { + return fromString(name, ReplicaRole.class); + } + + /** + * @return known ReplicaRole values + */ + public static Collection values() { + return values(ReplicaRole.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicaStatus.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicaStatus.java new file mode 100644 index 0000000000000..59ac8828667c5 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicaStatus.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ReplicaStatus. + */ +public final class ReplicaStatus extends ExpandableStringEnum { + /** Static value Invalid for ReplicaStatus. */ + public static final ReplicaStatus INVALID = fromString("Invalid"); + + /** Static value InBuild for ReplicaStatus. */ + public static final ReplicaStatus IN_BUILD = fromString("InBuild"); + + /** Static value Standby for ReplicaStatus. */ + public static final ReplicaStatus STANDBY = fromString("Standby"); + + /** Static value Ready for ReplicaStatus. */ + public static final ReplicaStatus READY = fromString("Ready"); + + /** Static value Down for ReplicaStatus. */ + public static final ReplicaStatus DOWN = fromString("Down"); + + /** Static value Dropped for ReplicaStatus. */ + public static final ReplicaStatus DROPPED = fromString("Dropped"); + + /** + * Creates or finds a ReplicaStatus from its string representation. + * @param name a name to look for + * @return the corresponding ReplicaStatus + */ + @JsonCreator + public static ReplicaStatus fromString(String name) { + return fromString(name, ReplicaStatus.class); + } + + /** + * @return known ReplicaStatus values + */ + public static Collection values() { + return values(ReplicaStatus.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicaStatusBase.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicaStatusBase.java new file mode 100644 index 0000000000000..6428441f6e637 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicaStatusBase.java @@ -0,0 +1,24 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Information about the replica. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ReplicaStatusBase") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "KeyValueStore", value = KeyValueStoreReplicaStatus.class) +}) +public class ReplicaStatusBase { +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicasHealthEvaluation.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicasHealthEvaluation.java new file mode 100644 index 0000000000000..d97b407626368 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicasHealthEvaluation.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents health evaluation for replicas, containing health evaluations for + * each unhealthy replica that impacted current aggregated health state. Can be + * returned when evaluating partition health and the aggregated health state is + * either Error or Warning. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("Replicas") +public class ReplicasHealthEvaluation extends HealthEvaluation { + /** + * Maximum allowed percentage of unhealthy replicas per partition from the + * ApplicationHealthPolicy. + */ + @JsonProperty(value = "MaxPercentUnhealthyReplicasPerPartition") + private Integer maxPercentUnhealthyReplicasPerPartition; + + /** + * Total number of replicas in the partition from the health store. + */ + @JsonProperty(value = "TotalCount") + private Long totalCount; + + /** + * List of unhealthy evaluations that led to the aggregated health state. + * Includes all the unhealthy ReplicaHealthEvaluation that impacted the + * aggregated health. + */ + @JsonProperty(value = "UnhealthyEvaluations") + private List unhealthyEvaluations; + + /** + * Get maximum allowed percentage of unhealthy replicas per partition from the ApplicationHealthPolicy. + * + * @return the maxPercentUnhealthyReplicasPerPartition value + */ + public Integer maxPercentUnhealthyReplicasPerPartition() { + return this.maxPercentUnhealthyReplicasPerPartition; + } + + /** + * Set maximum allowed percentage of unhealthy replicas per partition from the ApplicationHealthPolicy. + * + * @param maxPercentUnhealthyReplicasPerPartition the maxPercentUnhealthyReplicasPerPartition value to set + * @return the ReplicasHealthEvaluation object itself. + */ + public ReplicasHealthEvaluation withMaxPercentUnhealthyReplicasPerPartition(Integer maxPercentUnhealthyReplicasPerPartition) { + this.maxPercentUnhealthyReplicasPerPartition = maxPercentUnhealthyReplicasPerPartition; + return this; + } + + /** + * Get total number of replicas in the partition from the health store. + * + * @return the totalCount value + */ + public Long totalCount() { + return this.totalCount; + } + + /** + * Set total number of replicas in the partition from the health store. + * + * @param totalCount the totalCount value to set + * @return the ReplicasHealthEvaluation object itself. + */ + public ReplicasHealthEvaluation withTotalCount(Long totalCount) { + this.totalCount = totalCount; + return this; + } + + /** + * Get list of unhealthy evaluations that led to the aggregated health state. Includes all the unhealthy ReplicaHealthEvaluation that impacted the aggregated health. + * + * @return the unhealthyEvaluations value + */ + public List unhealthyEvaluations() { + return this.unhealthyEvaluations; + } + + /** + * Set list of unhealthy evaluations that led to the aggregated health state. Includes all the unhealthy ReplicaHealthEvaluation that impacted the aggregated health. + * + * @param unhealthyEvaluations the unhealthyEvaluations value to set + * @return the ReplicasHealthEvaluation object itself. + */ + public ReplicasHealthEvaluation withUnhealthyEvaluations(List unhealthyEvaluations) { + this.unhealthyEvaluations = unhealthyEvaluations; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicatorOperationName.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicatorOperationName.java new file mode 100644 index 0000000000000..39281c9ae7128 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicatorOperationName.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ReplicatorOperationName. + */ +public final class ReplicatorOperationName extends ExpandableStringEnum { + /** Static value Invalid for ReplicatorOperationName. */ + public static final ReplicatorOperationName INVALID = fromString("Invalid"); + + /** Static value None for ReplicatorOperationName. */ + public static final ReplicatorOperationName NONE = fromString("None"); + + /** Static value Open for ReplicatorOperationName. */ + public static final ReplicatorOperationName OPEN = fromString("Open"); + + /** Static value ChangeRole for ReplicatorOperationName. */ + public static final ReplicatorOperationName CHANGE_ROLE = fromString("ChangeRole"); + + /** Static value UpdateEpoch for ReplicatorOperationName. */ + public static final ReplicatorOperationName UPDATE_EPOCH = fromString("UpdateEpoch"); + + /** Static value Close for ReplicatorOperationName. */ + public static final ReplicatorOperationName CLOSE = fromString("Close"); + + /** Static value Abort for ReplicatorOperationName. */ + public static final ReplicatorOperationName ABORT = fromString("Abort"); + + /** Static value OnDataLoss for ReplicatorOperationName. */ + public static final ReplicatorOperationName ON_DATA_LOSS = fromString("OnDataLoss"); + + /** Static value WaitForCatchup for ReplicatorOperationName. */ + public static final ReplicatorOperationName WAIT_FOR_CATCHUP = fromString("WaitForCatchup"); + + /** Static value Build for ReplicatorOperationName. */ + public static final ReplicatorOperationName BUILD = fromString("Build"); + + /** + * Creates or finds a ReplicatorOperationName from its string representation. + * @param name a name to look for + * @return the corresponding ReplicatorOperationName + */ + @JsonCreator + public static ReplicatorOperationName fromString(String name) { + return fromString(name, ReplicatorOperationName.class); + } + + /** + * @return known ReplicatorOperationName values + */ + public static Collection values() { + return values(ReplicatorOperationName.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicatorQueueStatus.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicatorQueueStatus.java new file mode 100644 index 0000000000000..95802792d336e --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicatorQueueStatus.java @@ -0,0 +1,199 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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. + */ +public class ReplicatorQueueStatus { + /** + * 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. + */ + @JsonProperty(value = "QueueUtilizationPercentage") + private Integer queueUtilizationPercentage; + + /** + * Represents the virtual memory consumed by the queue in bytes. + */ + @JsonProperty(value = "QueueMemorySize") + private String queueMemorySize; + + /** + * 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. + */ + @JsonProperty(value = "FirstSequenceNumber") + private String firstSequenceNumber; + + /** + * 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. + */ + @JsonProperty(value = "CompletedSequenceNumber") + private String completedSequenceNumber; + + /** + * 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. + */ + @JsonProperty(value = "CommittedSequenceNumber") + private String committedSequenceNumber; + + /** + * Represents the latest sequence number of the operation that is available + * in the queue. + */ + @JsonProperty(value = "LastSequenceNumber") + private String lastSequenceNumber; + + /** + * Get 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. + * + * @return the queueUtilizationPercentage value + */ + public Integer queueUtilizationPercentage() { + return this.queueUtilizationPercentage; + } + + /** + * Set 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. + * + * @param queueUtilizationPercentage the queueUtilizationPercentage value to set + * @return the ReplicatorQueueStatus object itself. + */ + public ReplicatorQueueStatus withQueueUtilizationPercentage(Integer queueUtilizationPercentage) { + this.queueUtilizationPercentage = queueUtilizationPercentage; + return this; + } + + /** + * Get represents the virtual memory consumed by the queue in bytes. + * + * @return the queueMemorySize value + */ + public String queueMemorySize() { + return this.queueMemorySize; + } + + /** + * Set represents the virtual memory consumed by the queue in bytes. + * + * @param queueMemorySize the queueMemorySize value to set + * @return the ReplicatorQueueStatus object itself. + */ + public ReplicatorQueueStatus withQueueMemorySize(String queueMemorySize) { + this.queueMemorySize = queueMemorySize; + return this; + } + + /** + * Get 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. + * + * @return the firstSequenceNumber value + */ + public String firstSequenceNumber() { + return this.firstSequenceNumber; + } + + /** + * Set 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. + * + * @param firstSequenceNumber the firstSequenceNumber value to set + * @return the ReplicatorQueueStatus object itself. + */ + public ReplicatorQueueStatus withFirstSequenceNumber(String firstSequenceNumber) { + this.firstSequenceNumber = firstSequenceNumber; + return this; + } + + /** + * Get 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. + * + * @return the completedSequenceNumber value + */ + public String completedSequenceNumber() { + return this.completedSequenceNumber; + } + + /** + * Set 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. + * + * @param completedSequenceNumber the completedSequenceNumber value to set + * @return the ReplicatorQueueStatus object itself. + */ + public ReplicatorQueueStatus withCompletedSequenceNumber(String completedSequenceNumber) { + this.completedSequenceNumber = completedSequenceNumber; + return this; + } + + /** + * Get 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. + * + * @return the committedSequenceNumber value + */ + public String committedSequenceNumber() { + return this.committedSequenceNumber; + } + + /** + * Set 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. + * + * @param committedSequenceNumber the committedSequenceNumber value to set + * @return the ReplicatorQueueStatus object itself. + */ + public ReplicatorQueueStatus withCommittedSequenceNumber(String committedSequenceNumber) { + this.committedSequenceNumber = committedSequenceNumber; + return this; + } + + /** + * Get represents the latest sequence number of the operation that is available in the queue. + * + * @return the lastSequenceNumber value + */ + public String lastSequenceNumber() { + return this.lastSequenceNumber; + } + + /** + * Set represents the latest sequence number of the operation that is available in the queue. + * + * @param lastSequenceNumber the lastSequenceNumber value to set + * @return the ReplicatorQueueStatus object itself. + */ + public ReplicatorQueueStatus withLastSequenceNumber(String lastSequenceNumber) { + this.lastSequenceNumber = lastSequenceNumber; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicatorStatus.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicatorStatus.java new file mode 100644 index 0000000000000..9e925db8332da --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReplicatorStatus.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * 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. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ReplicatorStatus") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Primary", value = PrimaryReplicatorStatus.class), + @JsonSubTypes.Type(name = "SecondaryReplicatorStatus", value = SecondaryReplicatorStatus.class) +}) +public class ReplicatorStatus { +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ResolvedServiceEndpoint.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ResolvedServiceEndpoint.java new file mode 100644 index 0000000000000..7dfb99fcddb35 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ResolvedServiceEndpoint.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Endpoint of a resolved service partition. + */ +public class ResolvedServiceEndpoint { + /** + * The role of the replica where the endpoint is reported. Possible values + * include: 'Invalid', 'Stateless', 'StatefulPrimary', 'StatefulSecondary'. + */ + @JsonProperty(value = "Kind") + private ServiceEndpointRole kind; + + /** + * 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. + */ + @JsonProperty(value = "Address") + private String address; + + /** + * Get the role of the replica where the endpoint is reported. Possible values include: 'Invalid', 'Stateless', 'StatefulPrimary', 'StatefulSecondary'. + * + * @return the kind value + */ + public ServiceEndpointRole kind() { + return this.kind; + } + + /** + * Set the role of the replica where the endpoint is reported. Possible values include: 'Invalid', 'Stateless', 'StatefulPrimary', 'StatefulSecondary'. + * + * @param kind the kind value to set + * @return the ResolvedServiceEndpoint object itself. + */ + public ResolvedServiceEndpoint withKind(ServiceEndpointRole kind) { + this.kind = kind; + return this; + } + + /** + * Get 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. + * + * @return the address value + */ + public String address() { + return this.address; + } + + /** + * Set 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. + * + * @param address the address value to set + * @return the ResolvedServiceEndpoint object itself. + */ + public ResolvedServiceEndpoint withAddress(String address) { + this.address = address; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ResourceLimits.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ResourceLimits.java new file mode 100644 index 0000000000000..85fb57c843cef --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ResourceLimits.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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. + */ +public class ResourceLimits { + /** + * The memory limit in GB. + */ + @JsonProperty(value = "memoryInGB") + private Double memoryInGB; + + /** + * CPU limits in cores. At present, only full cores are supported. + */ + @JsonProperty(value = "cpu") + private Double cpu; + + /** + * Get the memory limit in GB. + * + * @return the memoryInGB value + */ + public Double memoryInGB() { + return this.memoryInGB; + } + + /** + * Set the memory limit in GB. + * + * @param memoryInGB the memoryInGB value to set + * @return the ResourceLimits object itself. + */ + public ResourceLimits withMemoryInGB(Double memoryInGB) { + this.memoryInGB = memoryInGB; + return this; + } + + /** + * Get cPU limits in cores. At present, only full cores are supported. + * + * @return the cpu value + */ + public Double cpu() { + return this.cpu; + } + + /** + * Set cPU limits in cores. At present, only full cores are supported. + * + * @param cpu the cpu value to set + * @return the ResourceLimits object itself. + */ + public ResourceLimits withCpu(Double cpu) { + this.cpu = cpu; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ResourceRequests.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ResourceRequests.java new file mode 100644 index 0000000000000..7911d8f3fa148 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ResourceRequests.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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. + */ +public class ResourceRequests { + /** + * The memory request in GB for this container. + */ + @JsonProperty(value = "memoryInGB", required = true) + private double memoryInGB; + + /** + * Requested number of CPU cores. At present, only full cores are + * supported. + */ + @JsonProperty(value = "cpu", required = true) + private double cpu; + + /** + * Get the memory request in GB for this container. + * + * @return the memoryInGB value + */ + public double memoryInGB() { + return this.memoryInGB; + } + + /** + * Set the memory request in GB for this container. + * + * @param memoryInGB the memoryInGB value to set + * @return the ResourceRequests object itself. + */ + public ResourceRequests withMemoryInGB(double memoryInGB) { + this.memoryInGB = memoryInGB; + return this; + } + + /** + * Get requested number of CPU cores. At present, only full cores are supported. + * + * @return the cpu value + */ + public double cpu() { + return this.cpu; + } + + /** + * Set requested number of CPU cores. At present, only full cores are supported. + * + * @param cpu the cpu value to set + * @return the ResourceRequests object itself. + */ + public ResourceRequests withCpu(double cpu) { + this.cpu = cpu; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ResourceRequirements.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ResourceRequirements.java new file mode 100644 index 0000000000000..2c46a34834db0 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ResourceRequirements.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * This type describes the resource requirements for a container or a service. + */ +public class ResourceRequirements { + /** + * Describes the requested resources for a given container. + */ + @JsonProperty(value = "requests", required = true) + private ResourceRequests requests; + + /** + * Describes the maximum limits on the resources for a given container. + */ + @JsonProperty(value = "limits") + private ResourceLimits limits; + + /** + * Get describes the requested resources for a given container. + * + * @return the requests value + */ + public ResourceRequests requests() { + return this.requests; + } + + /** + * Set describes the requested resources for a given container. + * + * @param requests the requests value to set + * @return the ResourceRequirements object itself. + */ + public ResourceRequirements withRequests(ResourceRequests requests) { + this.requests = requests; + return this; + } + + /** + * Get describes the maximum limits on the resources for a given container. + * + * @return the limits value + */ + public ResourceLimits limits() { + return this.limits; + } + + /** + * Set describes the maximum limits on the resources for a given container. + * + * @param limits the limits value to set + * @return the ResourceRequirements object itself. + */ + public ResourceRequirements withLimits(ResourceLimits limits) { + this.limits = limits; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RestartDeployedCodePackageDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RestartDeployedCodePackageDescription.java new file mode 100644 index 0000000000000..ffa9cf350d652 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RestartDeployedCodePackageDescription.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines description for restarting a deployed code package on Service Fabric + * node. + */ +public class RestartDeployedCodePackageDescription { + /** + * The name of service manifest that specified this code package. + */ + @JsonProperty(value = "ServiceManifestName", required = true) + private String serviceManifestName; + + /** + * 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. + */ + @JsonProperty(value = "ServicePackageActivationId") + private String servicePackageActivationId; + + /** + * The name of the code package defined in the service manifest. + */ + @JsonProperty(value = "CodePackageName", required = true) + private String codePackageName; + + /** + * 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. + */ + @JsonProperty(value = "CodePackageInstanceId", required = true) + private String codePackageInstanceId; + + /** + * Get the name of service manifest that specified this code package. + * + * @return the serviceManifestName value + */ + public String serviceManifestName() { + return this.serviceManifestName; + } + + /** + * Set the name of service manifest that specified this code package. + * + * @param serviceManifestName the serviceManifestName value to set + * @return the RestartDeployedCodePackageDescription object itself. + */ + public RestartDeployedCodePackageDescription withServiceManifestName(String serviceManifestName) { + this.serviceManifestName = serviceManifestName; + return this; + } + + /** + * Get 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. + * + * @return the servicePackageActivationId value + */ + public String servicePackageActivationId() { + return this.servicePackageActivationId; + } + + /** + * Set 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 servicePackageActivationId the servicePackageActivationId value to set + * @return the RestartDeployedCodePackageDescription object itself. + */ + public RestartDeployedCodePackageDescription withServicePackageActivationId(String servicePackageActivationId) { + this.servicePackageActivationId = servicePackageActivationId; + return this; + } + + /** + * Get the name of the code package defined in the service manifest. + * + * @return the codePackageName value + */ + public String codePackageName() { + return this.codePackageName; + } + + /** + * Set the name of the code package defined in the service manifest. + * + * @param codePackageName the codePackageName value to set + * @return the RestartDeployedCodePackageDescription object itself. + */ + public RestartDeployedCodePackageDescription withCodePackageName(String codePackageName) { + this.codePackageName = codePackageName; + return this; + } + + /** + * Get 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. + * + * @return the codePackageInstanceId value + */ + public String codePackageInstanceId() { + return this.codePackageInstanceId; + } + + /** + * Set 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 codePackageInstanceId the codePackageInstanceId value to set + * @return the RestartDeployedCodePackageDescription object itself. + */ + public RestartDeployedCodePackageDescription withCodePackageInstanceId(String codePackageInstanceId) { + this.codePackageInstanceId = codePackageInstanceId; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RestartNodeDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RestartNodeDescription.java new file mode 100644 index 0000000000000..6089c536501f3 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RestartNodeDescription.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the parameters to restart a Service Fabric node. + */ +public class RestartNodeDescription { + /** + * 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. + */ + @JsonProperty(value = "NodeInstanceId", required = true) + private String nodeInstanceId; + + /** + * Specify True to create a dump of the fabric node process. This is + * case-sensitive. Possible values include: 'False', 'True'. + */ + @JsonProperty(value = "CreateFabricDump") + private CreateFabricDump createFabricDump; + + /** + * Get 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. + * + * @return the nodeInstanceId value + */ + public String nodeInstanceId() { + return this.nodeInstanceId; + } + + /** + * Set 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 nodeInstanceId the nodeInstanceId value to set + * @return the RestartNodeDescription object itself. + */ + public RestartNodeDescription withNodeInstanceId(String nodeInstanceId) { + this.nodeInstanceId = nodeInstanceId; + return this; + } + + /** + * Get specify True to create a dump of the fabric node process. This is case-sensitive. Possible values include: 'False', 'True'. + * + * @return the createFabricDump value + */ + public CreateFabricDump createFabricDump() { + return this.createFabricDump; + } + + /** + * Set specify True to create a dump of the fabric node process. This is case-sensitive. Possible values include: 'False', 'True'. + * + * @param createFabricDump the createFabricDump value to set + * @return the RestartNodeDescription object itself. + */ + public RestartNodeDescription withCreateFabricDump(CreateFabricDump createFabricDump) { + this.createFabricDump = createFabricDump; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RestartPartitionMode.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RestartPartitionMode.java new file mode 100644 index 0000000000000..4256b69195ba3 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RestartPartitionMode.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for RestartPartitionMode. + */ +public final class RestartPartitionMode extends ExpandableStringEnum { + /** Static value Invalid for RestartPartitionMode. */ + public static final RestartPartitionMode INVALID = fromString("Invalid"); + + /** Static value AllReplicasOrInstances for RestartPartitionMode. */ + public static final RestartPartitionMode ALL_REPLICAS_OR_INSTANCES = fromString("AllReplicasOrInstances"); + + /** Static value OnlyActiveSecondaries for RestartPartitionMode. */ + public static final RestartPartitionMode ONLY_ACTIVE_SECONDARIES = fromString("OnlyActiveSecondaries"); + + /** + * Creates or finds a RestartPartitionMode from its string representation. + * @param name a name to look for + * @return the corresponding RestartPartitionMode + */ + @JsonCreator + public static RestartPartitionMode fromString(String name) { + return fromString(name, RestartPartitionMode.class); + } + + /** + * @return known RestartPartitionMode values + */ + public static Collection values() { + return values(RestartPartitionMode.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RestartPartitionResult.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RestartPartitionResult.java new file mode 100644 index 0000000000000..546d5e9cd3201 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RestartPartitionResult.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents information about an operation in a terminal state (Completed or + * Faulted). + */ +public class RestartPartitionResult { + /** + * If OperationState is Completed, this is 0. If OperationState is + * Faulted, this is an error code indicating the reason. + */ + @JsonProperty(value = "ErrorCode") + private Integer errorCode; + + /** + * This class returns information about the partition that the user-induced + * operation acted upon. + */ + @JsonProperty(value = "SelectedPartition") + private SelectedPartition selectedPartition; + + /** + * Get if OperationState is Completed, this is 0. If OperationState is Faulted, this is an error code indicating the reason. + * + * @return the errorCode value + */ + public Integer errorCode() { + return this.errorCode; + } + + /** + * Set if OperationState is Completed, this is 0. If OperationState is Faulted, this is an error code indicating the reason. + * + * @param errorCode the errorCode value to set + * @return the RestartPartitionResult object itself. + */ + public RestartPartitionResult withErrorCode(Integer errorCode) { + this.errorCode = errorCode; + return this; + } + + /** + * Get this class returns information about the partition that the user-induced operation acted upon. + * + * @return the selectedPartition value + */ + public SelectedPartition selectedPartition() { + return this.selectedPartition; + } + + /** + * Set this class returns information about the partition that the user-induced operation acted upon. + * + * @param selectedPartition the selectedPartition value to set + * @return the RestartPartitionResult object itself. + */ + public RestartPartitionResult withSelectedPartition(SelectedPartition selectedPartition) { + this.selectedPartition = selectedPartition; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RestorePartitionDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RestorePartitionDescription.java new file mode 100644 index 0000000000000..e5e2359194213 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RestorePartitionDescription.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies the parameters needed to trigger a restore of a specific + * partition. + */ +public class RestorePartitionDescription { + /** + * Unique backup ID. + */ + @JsonProperty(value = "BackupId", required = true) + private UUID backupId; + + /** + * Location of the backup relative to the backup storage specified/ + * configured. + */ + @JsonProperty(value = "BackupLocation", required = true) + private String backupLocation; + + /** + * Location of the backup from where the partition will be restored. + */ + @JsonProperty(value = "BackupStorage") + private BackupStorageDescription backupStorage; + + /** + * Get unique backup ID. + * + * @return the backupId value + */ + public UUID backupId() { + return this.backupId; + } + + /** + * Set unique backup ID. + * + * @param backupId the backupId value to set + * @return the RestorePartitionDescription object itself. + */ + public RestorePartitionDescription withBackupId(UUID backupId) { + this.backupId = backupId; + return this; + } + + /** + * Get location of the backup relative to the backup storage specified/ configured. + * + * @return the backupLocation value + */ + public String backupLocation() { + return this.backupLocation; + } + + /** + * Set location of the backup relative to the backup storage specified/ configured. + * + * @param backupLocation the backupLocation value to set + * @return the RestorePartitionDescription object itself. + */ + public RestorePartitionDescription withBackupLocation(String backupLocation) { + this.backupLocation = backupLocation; + return this; + } + + /** + * Get location of the backup from where the partition will be restored. + * + * @return the backupStorage value + */ + public BackupStorageDescription backupStorage() { + return this.backupStorage; + } + + /** + * Set location of the backup from where the partition will be restored. + * + * @param backupStorage the backupStorage value to set + * @return the RestorePartitionDescription object itself. + */ + public RestorePartitionDescription withBackupStorage(BackupStorageDescription backupStorage) { + this.backupStorage = backupStorage; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RestoreState.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RestoreState.java new file mode 100644 index 0000000000000..b95fb036ee8e0 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RestoreState.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for RestoreState. + */ +public final class RestoreState extends ExpandableStringEnum { + /** Static value Invalid for RestoreState. */ + public static final RestoreState INVALID = fromString("Invalid"); + + /** Static value Accepted for RestoreState. */ + public static final RestoreState ACCEPTED = fromString("Accepted"); + + /** Static value RestoreInProgress for RestoreState. */ + public static final RestoreState RESTORE_IN_PROGRESS = fromString("RestoreInProgress"); + + /** Static value Success for RestoreState. */ + public static final RestoreState SUCCESS = fromString("Success"); + + /** Static value Failure for RestoreState. */ + public static final RestoreState FAILURE = fromString("Failure"); + + /** Static value Timeout for RestoreState. */ + public static final RestoreState TIMEOUT = fromString("Timeout"); + + /** + * Creates or finds a RestoreState from its string representation. + * @param name a name to look for + * @return the corresponding RestoreState + */ + @JsonCreator + public static RestoreState fromString(String name) { + return fromString(name, RestoreState.class); + } + + /** + * @return known RestoreState values + */ + public static Collection values() { + return values(RestoreState.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ResultStatus.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ResultStatus.java new file mode 100644 index 0000000000000..5d1f07dbff670 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ResultStatus.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ResultStatus. + */ +public final class ResultStatus extends ExpandableStringEnum { + /** Static value Invalid for ResultStatus. */ + public static final ResultStatus INVALID = fromString("Invalid"); + + /** Static value Succeeded for ResultStatus. */ + public static final ResultStatus SUCCEEDED = fromString("Succeeded"); + + /** Static value Cancelled for ResultStatus. */ + public static final ResultStatus CANCELLED = fromString("Cancelled"); + + /** Static value Interrupted for ResultStatus. */ + public static final ResultStatus INTERRUPTED = fromString("Interrupted"); + + /** Static value Failed for ResultStatus. */ + public static final ResultStatus FAILED = fromString("Failed"); + + /** Static value Pending for ResultStatus. */ + public static final ResultStatus PENDING = fromString("Pending"); + + /** + * Creates or finds a ResultStatus from its string representation. + * @param name a name to look for + * @return the corresponding ResultStatus + */ + @JsonCreator + public static ResultStatus fromString(String name) { + return fromString(name, ResultStatus.class); + } + + /** + * @return known ResultStatus values + */ + public static Collection values() { + return values(ResultStatus.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ResumeApplicationUpgradeDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ResumeApplicationUpgradeDescription.java new file mode 100644 index 0000000000000..ca3a4b8b00e05 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ResumeApplicationUpgradeDescription.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the parameters for resuming an unmonitored manual Service Fabric + * application upgrade. + */ +public class ResumeApplicationUpgradeDescription { + /** + * The name of the upgrade domain in which to resume the upgrade. + */ + @JsonProperty(value = "UpgradeDomainName", required = true) + private String upgradeDomainName; + + /** + * Get the name of the upgrade domain in which to resume the upgrade. + * + * @return the upgradeDomainName value + */ + public String upgradeDomainName() { + return this.upgradeDomainName; + } + + /** + * Set the name of the upgrade domain in which to resume the upgrade. + * + * @param upgradeDomainName the upgradeDomainName value to set + * @return the ResumeApplicationUpgradeDescription object itself. + */ + public ResumeApplicationUpgradeDescription withUpgradeDomainName(String upgradeDomainName) { + this.upgradeDomainName = upgradeDomainName; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ResumeClusterUpgradeDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ResumeClusterUpgradeDescription.java new file mode 100644 index 0000000000000..c912367a5799e --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ResumeClusterUpgradeDescription.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the parameters for resuming a cluster upgrade. + */ +public class ResumeClusterUpgradeDescription { + /** + * The next upgrade domain for this cluster upgrade. + */ + @JsonProperty(value = "UpgradeDomain", required = true) + private String upgradeDomain; + + /** + * Get the next upgrade domain for this cluster upgrade. + * + * @return the upgradeDomain value + */ + public String upgradeDomain() { + return this.upgradeDomain; + } + + /** + * Set the next upgrade domain for this cluster upgrade. + * + * @param upgradeDomain the upgradeDomain value to set + * @return the ResumeClusterUpgradeDescription object itself. + */ + public ResumeClusterUpgradeDescription withUpgradeDomain(String upgradeDomain) { + this.upgradeDomain = upgradeDomain; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RollingUpgradeUpdateDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RollingUpgradeUpdateDescription.java new file mode 100644 index 0000000000000..2c5ae3b1eb7ad --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RollingUpgradeUpdateDescription.java @@ -0,0 +1,290 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the parameters for updating a rolling upgrade of application or + * cluster. + */ +public class RollingUpgradeUpdateDescription { + /** + * The mode used to monitor health during a rolling upgrade. The values are + * UnmonitoredAuto, UnmonitoredManual, and Monitored. Possible values + * include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored'. + */ + @JsonProperty(value = "RollingUpgradeMode", required = true) + private UpgradeMode rollingUpgradeMode; + + /** + * If true, then processes are forcefully restarted during upgrade even + * when the code version has not changed (the upgrade only changes + * configuration or data). + */ + @JsonProperty(value = "ForceRestart") + private Boolean forceRestart; + + /** + * 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). + */ + @JsonProperty(value = "ReplicaSetCheckTimeoutInMilliseconds") + private Long replicaSetCheckTimeoutInMilliseconds; + + /** + * 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'. + */ + @JsonProperty(value = "FailureAction") + private FailureAction failureAction; + + /** + * 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. + */ + @JsonProperty(value = "HealthCheckWaitDurationInMilliseconds") + private String healthCheckWaitDurationInMilliseconds; + + /** + * 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. + */ + @JsonProperty(value = "HealthCheckStableDurationInMilliseconds") + private String healthCheckStableDurationInMilliseconds; + + /** + * 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. + */ + @JsonProperty(value = "HealthCheckRetryTimeoutInMilliseconds") + private String healthCheckRetryTimeoutInMilliseconds; + + /** + * 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. + */ + @JsonProperty(value = "UpgradeTimeoutInMilliseconds") + private String upgradeTimeoutInMilliseconds; + + /** + * 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. + */ + @JsonProperty(value = "UpgradeDomainTimeoutInMilliseconds") + private String upgradeDomainTimeoutInMilliseconds; + + /** + * Get the mode used to monitor health during a rolling upgrade. The values are UnmonitoredAuto, UnmonitoredManual, and Monitored. Possible values include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored'. + * + * @return the rollingUpgradeMode value + */ + public UpgradeMode rollingUpgradeMode() { + return this.rollingUpgradeMode; + } + + /** + * Set 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 rollingUpgradeMode the rollingUpgradeMode value to set + * @return the RollingUpgradeUpdateDescription object itself. + */ + public RollingUpgradeUpdateDescription withRollingUpgradeMode(UpgradeMode rollingUpgradeMode) { + this.rollingUpgradeMode = rollingUpgradeMode; + return this; + } + + /** + * Get if true, then processes are forcefully restarted during upgrade even when the code version has not changed (the upgrade only changes configuration or data). + * + * @return the forceRestart value + */ + public Boolean forceRestart() { + return this.forceRestart; + } + + /** + * Set 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 forceRestart the forceRestart value to set + * @return the RollingUpgradeUpdateDescription object itself. + */ + public RollingUpgradeUpdateDescription withForceRestart(Boolean forceRestart) { + this.forceRestart = forceRestart; + return this; + } + + /** + * Get 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). + * + * @return the replicaSetCheckTimeoutInMilliseconds value + */ + public Long replicaSetCheckTimeoutInMilliseconds() { + return this.replicaSetCheckTimeoutInMilliseconds; + } + + /** + * Set 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 replicaSetCheckTimeoutInMilliseconds the replicaSetCheckTimeoutInMilliseconds value to set + * @return the RollingUpgradeUpdateDescription object itself. + */ + public RollingUpgradeUpdateDescription withReplicaSetCheckTimeoutInMilliseconds(Long replicaSetCheckTimeoutInMilliseconds) { + this.replicaSetCheckTimeoutInMilliseconds = replicaSetCheckTimeoutInMilliseconds; + return this; + } + + /** + * Get 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'. + * + * @return the failureAction value + */ + public FailureAction failureAction() { + return this.failureAction; + } + + /** + * Set 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 failureAction the failureAction value to set + * @return the RollingUpgradeUpdateDescription object itself. + */ + public RollingUpgradeUpdateDescription withFailureAction(FailureAction failureAction) { + this.failureAction = failureAction; + return this; + } + + /** + * Get 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. + * + * @return the healthCheckWaitDurationInMilliseconds value + */ + public String healthCheckWaitDurationInMilliseconds() { + return this.healthCheckWaitDurationInMilliseconds; + } + + /** + * Set 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 healthCheckWaitDurationInMilliseconds the healthCheckWaitDurationInMilliseconds value to set + * @return the RollingUpgradeUpdateDescription object itself. + */ + public RollingUpgradeUpdateDescription withHealthCheckWaitDurationInMilliseconds(String healthCheckWaitDurationInMilliseconds) { + this.healthCheckWaitDurationInMilliseconds = healthCheckWaitDurationInMilliseconds; + return this; + } + + /** + * Get 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. + * + * @return the healthCheckStableDurationInMilliseconds value + */ + public String healthCheckStableDurationInMilliseconds() { + return this.healthCheckStableDurationInMilliseconds; + } + + /** + * Set 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 healthCheckStableDurationInMilliseconds the healthCheckStableDurationInMilliseconds value to set + * @return the RollingUpgradeUpdateDescription object itself. + */ + public RollingUpgradeUpdateDescription withHealthCheckStableDurationInMilliseconds(String healthCheckStableDurationInMilliseconds) { + this.healthCheckStableDurationInMilliseconds = healthCheckStableDurationInMilliseconds; + return this; + } + + /** + * Get 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. + * + * @return the healthCheckRetryTimeoutInMilliseconds value + */ + public String healthCheckRetryTimeoutInMilliseconds() { + return this.healthCheckRetryTimeoutInMilliseconds; + } + + /** + * Set 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 healthCheckRetryTimeoutInMilliseconds the healthCheckRetryTimeoutInMilliseconds value to set + * @return the RollingUpgradeUpdateDescription object itself. + */ + public RollingUpgradeUpdateDescription withHealthCheckRetryTimeoutInMilliseconds(String healthCheckRetryTimeoutInMilliseconds) { + this.healthCheckRetryTimeoutInMilliseconds = healthCheckRetryTimeoutInMilliseconds; + return this; + } + + /** + * Get 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. + * + * @return the upgradeTimeoutInMilliseconds value + */ + public String upgradeTimeoutInMilliseconds() { + return this.upgradeTimeoutInMilliseconds; + } + + /** + * Set 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 upgradeTimeoutInMilliseconds the upgradeTimeoutInMilliseconds value to set + * @return the RollingUpgradeUpdateDescription object itself. + */ + public RollingUpgradeUpdateDescription withUpgradeTimeoutInMilliseconds(String upgradeTimeoutInMilliseconds) { + this.upgradeTimeoutInMilliseconds = upgradeTimeoutInMilliseconds; + return this; + } + + /** + * Get 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. + * + * @return the upgradeDomainTimeoutInMilliseconds value + */ + public String upgradeDomainTimeoutInMilliseconds() { + return this.upgradeDomainTimeoutInMilliseconds; + } + + /** + * Set 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 upgradeDomainTimeoutInMilliseconds the upgradeDomainTimeoutInMilliseconds value to set + * @return the RollingUpgradeUpdateDescription object itself. + */ + public RollingUpgradeUpdateDescription withUpgradeDomainTimeoutInMilliseconds(String upgradeDomainTimeoutInMilliseconds) { + this.upgradeDomainTimeoutInMilliseconds = upgradeDomainTimeoutInMilliseconds; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SafetyCheck.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SafetyCheck.java new file mode 100644 index 0000000000000..d9f59dfece28b --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SafetyCheck.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Represents a safety check performed by service fabric before continuing with + * the operations. These checks ensure the availability of the service and the + * reliability of the state. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("SafetyCheck") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "PartitionSafetyCheck", value = PartitionSafetyCheck.class), + @JsonSubTypes.Type(name = "EnsureSeedNodeQuorum", value = SeedNodeSafetyCheck.class) +}) +public class SafetyCheck { +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SafetyCheckKind.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SafetyCheckKind.java new file mode 100644 index 0000000000000..e2ed6cccfcee8 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SafetyCheckKind.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SafetyCheckKind. + */ +public final class SafetyCheckKind extends ExpandableStringEnum { + /** Static value Invalid for SafetyCheckKind. */ + public static final SafetyCheckKind INVALID = fromString("Invalid"); + + /** Static value EnsureSeedNodeQuorum for SafetyCheckKind. */ + public static final SafetyCheckKind ENSURE_SEED_NODE_QUORUM = fromString("EnsureSeedNodeQuorum"); + + /** Static value EnsurePartitionQuorum for SafetyCheckKind. */ + public static final SafetyCheckKind ENSURE_PARTITION_QUORUM = fromString("EnsurePartitionQuorum"); + + /** Static value WaitForPrimaryPlacement for SafetyCheckKind. */ + public static final SafetyCheckKind WAIT_FOR_PRIMARY_PLACEMENT = fromString("WaitForPrimaryPlacement"); + + /** Static value WaitForPrimarySwap for SafetyCheckKind. */ + public static final SafetyCheckKind WAIT_FOR_PRIMARY_SWAP = fromString("WaitForPrimarySwap"); + + /** Static value WaitForReconfiguration for SafetyCheckKind. */ + public static final SafetyCheckKind WAIT_FOR_RECONFIGURATION = fromString("WaitForReconfiguration"); + + /** Static value WaitForInbuildReplica for SafetyCheckKind. */ + public static final SafetyCheckKind WAIT_FOR_INBUILD_REPLICA = fromString("WaitForInbuildReplica"); + + /** Static value EnsureAvailability for SafetyCheckKind. */ + public static final SafetyCheckKind ENSURE_AVAILABILITY = fromString("EnsureAvailability"); + + /** + * Creates or finds a SafetyCheckKind from its string representation. + * @param name a name to look for + * @return the corresponding SafetyCheckKind + */ + @JsonCreator + public static SafetyCheckKind fromString(String name) { + return fromString(name, SafetyCheckKind.class); + } + + /** + * @return known SafetyCheckKind values + */ + public static Collection values() { + return values(SafetyCheckKind.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SafetyCheckWrapper.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SafetyCheckWrapper.java new file mode 100644 index 0000000000000..13a45694e3e5f --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SafetyCheckWrapper.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A wrapper for the safety check object. Safety checks are performed by + * service fabric before continuing with the operations. These checks ensure + * the availability of the service and the reliability of the state. + */ +public class SafetyCheckWrapper { + /** + * Represents a safety check performed by service fabric before continuing + * with the operations. These checks ensure the availability of the service + * and the reliability of the state. + */ + @JsonProperty(value = "SafetyCheck") + private SafetyCheck safetyCheck; + + /** + * Get represents a safety check performed by service fabric before continuing with the operations. These checks ensure the availability of the service and the reliability of the state. + * + * @return the safetyCheck value + */ + public SafetyCheck safetyCheck() { + return this.safetyCheck; + } + + /** + * Set represents a safety check performed by service fabric before continuing with the operations. These checks ensure the availability of the service and the reliability of the state. + * + * @param safetyCheck the safetyCheck value to set + * @return the SafetyCheckWrapper object itself. + */ + public SafetyCheckWrapper withSafetyCheck(SafetyCheck safetyCheck) { + this.safetyCheck = safetyCheck; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ScalingMechanismDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ScalingMechanismDescription.java new file mode 100644 index 0000000000000..8ea877d8c1af4 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ScalingMechanismDescription.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Describes the mechanism for performing a scaling operation. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ScalingMechanismDescription") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "PartitionInstanceCount", value = PartitionInstanceCountScaleMechanism.class), + @JsonSubTypes.Type(name = "AddRemoveIncrementalNamedPartition", value = AddRemoveIncrementalNamedPartitionScalingMechanism.class) +}) +public class ScalingMechanismDescription { +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ScalingMechanismKind.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ScalingMechanismKind.java new file mode 100644 index 0000000000000..ef60ae208f4b2 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ScalingMechanismKind.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ScalingMechanismKind. + */ +public final class ScalingMechanismKind extends ExpandableStringEnum { + /** Static value Invalid for ScalingMechanismKind. */ + public static final ScalingMechanismKind INVALID = fromString("Invalid"); + + /** Static value PartitionInstanceCount for ScalingMechanismKind. */ + public static final ScalingMechanismKind PARTITION_INSTANCE_COUNT = fromString("PartitionInstanceCount"); + + /** Static value AddRemoveIncrementalNamedPartition for ScalingMechanismKind. */ + public static final ScalingMechanismKind ADD_REMOVE_INCREMENTAL_NAMED_PARTITION = fromString("AddRemoveIncrementalNamedPartition"); + + /** + * Creates or finds a ScalingMechanismKind from its string representation. + * @param name a name to look for + * @return the corresponding ScalingMechanismKind + */ + @JsonCreator + public static ScalingMechanismKind fromString(String name) { + return fromString(name, ScalingMechanismKind.class); + } + + /** + * @return known ScalingMechanismKind values + */ + public static Collection values() { + return values(ScalingMechanismKind.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ScalingPolicyDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ScalingPolicyDescription.java new file mode 100644 index 0000000000000..081c82e0294a7 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ScalingPolicyDescription.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes how the scaling should be performed. + */ +public class ScalingPolicyDescription { + /** + * Specifies the trigger associated with this scaling policy. + */ + @JsonProperty(value = "ScalingTrigger", required = true) + private ScalingTriggerDescription scalingTrigger; + + /** + * Specifies the mechanism associated with this scaling policy. + */ + @JsonProperty(value = "ScalingMechanism", required = true) + private ScalingMechanismDescription scalingMechanism; + + /** + * Get specifies the trigger associated with this scaling policy. + * + * @return the scalingTrigger value + */ + public ScalingTriggerDescription scalingTrigger() { + return this.scalingTrigger; + } + + /** + * Set specifies the trigger associated with this scaling policy. + * + * @param scalingTrigger the scalingTrigger value to set + * @return the ScalingPolicyDescription object itself. + */ + public ScalingPolicyDescription withScalingTrigger(ScalingTriggerDescription scalingTrigger) { + this.scalingTrigger = scalingTrigger; + return this; + } + + /** + * Get specifies the mechanism associated with this scaling policy. + * + * @return the scalingMechanism value + */ + public ScalingMechanismDescription scalingMechanism() { + return this.scalingMechanism; + } + + /** + * Set specifies the mechanism associated with this scaling policy. + * + * @param scalingMechanism the scalingMechanism value to set + * @return the ScalingPolicyDescription object itself. + */ + public ScalingPolicyDescription withScalingMechanism(ScalingMechanismDescription scalingMechanism) { + this.scalingMechanism = scalingMechanism; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ScalingTriggerDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ScalingTriggerDescription.java new file mode 100644 index 0000000000000..9bea34fc73e16 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ScalingTriggerDescription.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Describes the trigger for performing a scaling operation. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ScalingTriggerDescription") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AveragePartitionLoad", value = AveragePartitionLoadScalingTrigger.class), + @JsonSubTypes.Type(name = "AverageServiceLoad", value = AverageServiceLoadScalingTrigger.class) +}) +public class ScalingTriggerDescription { +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ScalingTriggerKind.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ScalingTriggerKind.java new file mode 100644 index 0000000000000..3a07c85a7edb7 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ScalingTriggerKind.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ScalingTriggerKind. + */ +public final class ScalingTriggerKind extends ExpandableStringEnum { + /** Static value Invalid for ScalingTriggerKind. */ + public static final ScalingTriggerKind INVALID = fromString("Invalid"); + + /** Static value AveragePartitionLoad for ScalingTriggerKind. */ + public static final ScalingTriggerKind AVERAGE_PARTITION_LOAD = fromString("AveragePartitionLoad"); + + /** Static value AverageServiceLoad for ScalingTriggerKind. */ + public static final ScalingTriggerKind AVERAGE_SERVICE_LOAD = fromString("AverageServiceLoad"); + + /** + * Creates or finds a ScalingTriggerKind from its string representation. + * @param name a name to look for + * @return the corresponding ScalingTriggerKind + */ + @JsonCreator + public static ScalingTriggerKind fromString(String name) { + return fromString(name, ScalingTriggerKind.class); + } + + /** + * @return known ScalingTriggerKind values + */ + public static Collection values() { + return values(ScalingTriggerKind.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SecondaryActiveReplicatorStatus.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SecondaryActiveReplicatorStatus.java new file mode 100644 index 0000000000000..e8a2dce3201d2 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SecondaryActiveReplicatorStatus.java @@ -0,0 +1,21 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Status of the secondary replicator when it is in active mode and is part of + * the replica set. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ActiveSecondary") +public class SecondaryActiveReplicatorStatus extends SecondaryReplicatorStatus { +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SecondaryIdleReplicatorStatus.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SecondaryIdleReplicatorStatus.java new file mode 100644 index 0000000000000..23cd70bf90e6d --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SecondaryIdleReplicatorStatus.java @@ -0,0 +1,21 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Status of the secondary replicator when it is in idle mode and is being + * built by the primary. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("IdleSecondary") +public class SecondaryIdleReplicatorStatus extends SecondaryReplicatorStatus { +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SecondaryReplicatorStatus.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SecondaryReplicatorStatus.java new file mode 100644 index 0000000000000..94f048f57504d --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SecondaryReplicatorStatus.java @@ -0,0 +1,199 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Provides statistics about the Service Fabric Replicator, when it is + * functioning in a ActiveSecondary role. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("SecondaryReplicatorStatus") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "ActiveSecondary", value = SecondaryActiveReplicatorStatus.class), + @JsonSubTypes.Type(name = "IdleSecondary", value = SecondaryIdleReplicatorStatus.class) +}) +public class SecondaryReplicatorStatus extends ReplicatorStatus { + /** + * Details about the replication queue on the secondary replicator. + */ + @JsonProperty(value = "ReplicationQueueStatus") + private ReplicatorQueueStatus replicationQueueStatus; + + /** + * 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. + */ + @JsonProperty(value = "LastReplicationOperationReceivedTimeUtc") + private DateTime lastReplicationOperationReceivedTimeUtc; + + /** + * Value that indicates whether the replica is currently being built. + */ + @JsonProperty(value = "IsInBuild") + private Boolean isInBuild; + + /** + * Details about the copy queue on the secondary replicator. + */ + @JsonProperty(value = "CopyQueueStatus") + private ReplicatorQueueStatus copyQueueStatus; + + /** + * 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. + */ + @JsonProperty(value = "LastCopyOperationReceivedTimeUtc") + private DateTime lastCopyOperationReceivedTimeUtc; + + /** + * 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. + */ + @JsonProperty(value = "LastAcknowledgementSentTimeUtc") + private DateTime lastAcknowledgementSentTimeUtc; + + /** + * Get details about the replication queue on the secondary replicator. + * + * @return the replicationQueueStatus value + */ + public ReplicatorQueueStatus replicationQueueStatus() { + return this.replicationQueueStatus; + } + + /** + * Set details about the replication queue on the secondary replicator. + * + * @param replicationQueueStatus the replicationQueueStatus value to set + * @return the SecondaryReplicatorStatus object itself. + */ + public SecondaryReplicatorStatus withReplicationQueueStatus(ReplicatorQueueStatus replicationQueueStatus) { + this.replicationQueueStatus = replicationQueueStatus; + return this; + } + + /** + * Get 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. + * + * @return the lastReplicationOperationReceivedTimeUtc value + */ + public DateTime lastReplicationOperationReceivedTimeUtc() { + return this.lastReplicationOperationReceivedTimeUtc; + } + + /** + * Set 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. + * + * @param lastReplicationOperationReceivedTimeUtc the lastReplicationOperationReceivedTimeUtc value to set + * @return the SecondaryReplicatorStatus object itself. + */ + public SecondaryReplicatorStatus withLastReplicationOperationReceivedTimeUtc(DateTime lastReplicationOperationReceivedTimeUtc) { + this.lastReplicationOperationReceivedTimeUtc = lastReplicationOperationReceivedTimeUtc; + return this; + } + + /** + * Get value that indicates whether the replica is currently being built. + * + * @return the isInBuild value + */ + public Boolean isInBuild() { + return this.isInBuild; + } + + /** + * Set value that indicates whether the replica is currently being built. + * + * @param isInBuild the isInBuild value to set + * @return the SecondaryReplicatorStatus object itself. + */ + public SecondaryReplicatorStatus withIsInBuild(Boolean isInBuild) { + this.isInBuild = isInBuild; + return this; + } + + /** + * Get details about the copy queue on the secondary replicator. + * + * @return the copyQueueStatus value + */ + public ReplicatorQueueStatus copyQueueStatus() { + return this.copyQueueStatus; + } + + /** + * Set details about the copy queue on the secondary replicator. + * + * @param copyQueueStatus the copyQueueStatus value to set + * @return the SecondaryReplicatorStatus object itself. + */ + public SecondaryReplicatorStatus withCopyQueueStatus(ReplicatorQueueStatus copyQueueStatus) { + this.copyQueueStatus = copyQueueStatus; + return this; + } + + /** + * Get 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. + * + * @return the lastCopyOperationReceivedTimeUtc value + */ + public DateTime lastCopyOperationReceivedTimeUtc() { + return this.lastCopyOperationReceivedTimeUtc; + } + + /** + * Set 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. + * + * @param lastCopyOperationReceivedTimeUtc the lastCopyOperationReceivedTimeUtc value to set + * @return the SecondaryReplicatorStatus object itself. + */ + public SecondaryReplicatorStatus withLastCopyOperationReceivedTimeUtc(DateTime lastCopyOperationReceivedTimeUtc) { + this.lastCopyOperationReceivedTimeUtc = lastCopyOperationReceivedTimeUtc; + return this; + } + + /** + * Get 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. + * + * @return the lastAcknowledgementSentTimeUtc value + */ + public DateTime lastAcknowledgementSentTimeUtc() { + return this.lastAcknowledgementSentTimeUtc; + } + + /** + * Set 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. + * + * @param lastAcknowledgementSentTimeUtc the lastAcknowledgementSentTimeUtc value to set + * @return the SecondaryReplicatorStatus object itself. + */ + public SecondaryReplicatorStatus withLastAcknowledgementSentTimeUtc(DateTime lastAcknowledgementSentTimeUtc) { + this.lastAcknowledgementSentTimeUtc = lastAcknowledgementSentTimeUtc; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SeedNodeSafetyCheck.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SeedNodeSafetyCheck.java new file mode 100644 index 0000000000000..720e13ef17ce7 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SeedNodeSafetyCheck.java @@ -0,0 +1,21 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents a safety check for the seed nodes being performed by service + * fabric before continuing with node level operations. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("EnsureSeedNodeQuorum") +public class SeedNodeSafetyCheck extends SafetyCheck { +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SelectedPartition.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SelectedPartition.java new file mode 100644 index 0000000000000..c9236f64088b2 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SelectedPartition.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * This class returns information about the partition that the user-induced + * operation acted upon. + */ +public class SelectedPartition { + /** + * The name of the service the partition belongs to. + */ + @JsonProperty(value = "ServiceName") + private String serviceName; + + /** + * 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. + */ + @JsonProperty(value = "PartitionId") + private UUID partitionId; + + /** + * Get the name of the service the partition belongs to. + * + * @return the serviceName value + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set the name of the service the partition belongs to. + * + * @param serviceName the serviceName value to set + * @return the SelectedPartition object itself. + */ + public SelectedPartition withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Get 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. + * + * @return the partitionId value + */ + public UUID partitionId() { + return this.partitionId; + } + + /** + * Set 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. + * + * @param partitionId the partitionId value to set + * @return the SelectedPartition object itself. + */ + public SelectedPartition withPartitionId(UUID partitionId) { + this.partitionId = partitionId; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceBackupConfigurationInfo.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceBackupConfigurationInfo.java new file mode 100644 index 0000000000000..4b2ed995299c2 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceBackupConfigurationInfo.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Backup configuration information for a specific Service Fabric service + * specifying what backup policy is being applied and suspend description, if + * any. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("Service") +public class ServiceBackupConfigurationInfo extends BackupConfigurationInfo { + /** + * The full name of the service with 'fabric:' URI scheme. + */ + @JsonProperty(value = "ServiceName") + private String serviceName; + + /** + * Get the full name of the service with 'fabric:' URI scheme. + * + * @return the serviceName value + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set the full name of the service with 'fabric:' URI scheme. + * + * @param serviceName the serviceName value to set + * @return the ServiceBackupConfigurationInfo object itself. + */ + public ServiceBackupConfigurationInfo withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceBackupEntity.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceBackupEntity.java new file mode 100644 index 0000000000000..03a2b99c84d93 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceBackupEntity.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Identifies the Service Fabric stateful service which is being backed up. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "EntityKind") +@JsonTypeName("Service") +public class ServiceBackupEntity extends BackupEntity { + /** + * The full name of the service with 'fabric:' URI scheme. + */ + @JsonProperty(value = "ServiceName") + private String serviceName; + + /** + * Get the full name of the service with 'fabric:' URI scheme. + * + * @return the serviceName value + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set the full name of the service with 'fabric:' URI scheme. + * + * @param serviceName the serviceName value to set + * @return the ServiceBackupEntity object itself. + */ + public ServiceBackupEntity withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceCorrelationDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceCorrelationDescription.java new file mode 100644 index 0000000000000..6ab45942debb5 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceCorrelationDescription.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Creates a particular correlation between services. + */ +public class ServiceCorrelationDescription { + /** + * The ServiceCorrelationScheme which describes the relationship between + * this service and the service specified via ServiceName. Possible values + * include: 'Invalid', 'Affinity', 'AlignedAffinity', 'NonAlignedAffinity'. + */ + @JsonProperty(value = "Scheme", required = true) + private ServiceCorrelationScheme scheme; + + /** + * The name of the service that the correlation relationship is established + * with. + */ + @JsonProperty(value = "ServiceName", required = true) + private String serviceName; + + /** + * Get the ServiceCorrelationScheme which describes the relationship between this service and the service specified via ServiceName. Possible values include: 'Invalid', 'Affinity', 'AlignedAffinity', 'NonAlignedAffinity'. + * + * @return the scheme value + */ + public ServiceCorrelationScheme scheme() { + return this.scheme; + } + + /** + * Set the ServiceCorrelationScheme which describes the relationship between this service and the service specified via ServiceName. Possible values include: 'Invalid', 'Affinity', 'AlignedAffinity', 'NonAlignedAffinity'. + * + * @param scheme the scheme value to set + * @return the ServiceCorrelationDescription object itself. + */ + public ServiceCorrelationDescription withScheme(ServiceCorrelationScheme scheme) { + this.scheme = scheme; + return this; + } + + /** + * Get the name of the service that the correlation relationship is established with. + * + * @return the serviceName value + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set the name of the service that the correlation relationship is established with. + * + * @param serviceName the serviceName value to set + * @return the ServiceCorrelationDescription object itself. + */ + public ServiceCorrelationDescription withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceCorrelationScheme.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceCorrelationScheme.java new file mode 100644 index 0000000000000..ac63514ae2c93 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceCorrelationScheme.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ServiceCorrelationScheme. + */ +public final class ServiceCorrelationScheme extends ExpandableStringEnum { + /** Static value Invalid for ServiceCorrelationScheme. */ + public static final ServiceCorrelationScheme INVALID = fromString("Invalid"); + + /** Static value Affinity for ServiceCorrelationScheme. */ + public static final ServiceCorrelationScheme AFFINITY = fromString("Affinity"); + + /** Static value AlignedAffinity for ServiceCorrelationScheme. */ + public static final ServiceCorrelationScheme ALIGNED_AFFINITY = fromString("AlignedAffinity"); + + /** Static value NonAlignedAffinity for ServiceCorrelationScheme. */ + public static final ServiceCorrelationScheme NON_ALIGNED_AFFINITY = fromString("NonAlignedAffinity"); + + /** + * Creates or finds a ServiceCorrelationScheme from its string representation. + * @param name a name to look for + * @return the corresponding ServiceCorrelationScheme + */ + @JsonCreator + public static ServiceCorrelationScheme fromString(String name) { + return fromString(name, ServiceCorrelationScheme.class); + } + + /** + * @return known ServiceCorrelationScheme values + */ + public static Collection values() { + return values(ServiceCorrelationScheme.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceCreatedEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceCreatedEvent.java new file mode 100644 index 0000000000000..56e996448b99f --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceCreatedEvent.java @@ -0,0 +1,287 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ServiceEventInner; + +/** + * Service Created event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ServiceCreated") +public class ServiceCreatedEvent extends ServiceEventInner { + /** + * Service type name. + */ + @JsonProperty(value = "ServiceTypeName", required = true) + private String serviceTypeName; + + /** + * Application name. + */ + @JsonProperty(value = "ApplicationName", required = true) + private String applicationName; + + /** + * Application type name. + */ + @JsonProperty(value = "ApplicationTypeName", required = true) + private String applicationTypeName; + + /** + * Id of Service instance. + */ + @JsonProperty(value = "ServiceInstance", required = true) + private long serviceInstance; + + /** + * Indicates if Service is stateful. + */ + @JsonProperty(value = "IsStateful", required = true) + private boolean isStateful; + + /** + * Number of partitions. + */ + @JsonProperty(value = "PartitionCount", required = true) + private int partitionCount; + + /** + * Size of target replicas set. + */ + @JsonProperty(value = "TargetReplicaSetSize", required = true) + private int targetReplicaSetSize; + + /** + * Minimum size of replicas set. + */ + @JsonProperty(value = "MinReplicaSetSize", required = true) + private int minReplicaSetSize; + + /** + * Version of Service package. + */ + @JsonProperty(value = "ServicePackageVersion", required = true) + private String servicePackageVersion; + + /** + * 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. + */ + @JsonProperty(value = "PartitionId", required = true) + private UUID partitionId; + + /** + * Get service type name. + * + * @return the serviceTypeName value + */ + public String serviceTypeName() { + return this.serviceTypeName; + } + + /** + * Set service type name. + * + * @param serviceTypeName the serviceTypeName value to set + * @return the ServiceCreatedEvent object itself. + */ + public ServiceCreatedEvent withServiceTypeName(String serviceTypeName) { + this.serviceTypeName = serviceTypeName; + return this; + } + + /** + * Get application name. + * + * @return the applicationName value + */ + public String applicationName() { + return this.applicationName; + } + + /** + * Set application name. + * + * @param applicationName the applicationName value to set + * @return the ServiceCreatedEvent object itself. + */ + public ServiceCreatedEvent withApplicationName(String applicationName) { + this.applicationName = applicationName; + return this; + } + + /** + * Get application type name. + * + * @return the applicationTypeName value + */ + public String applicationTypeName() { + return this.applicationTypeName; + } + + /** + * Set application type name. + * + * @param applicationTypeName the applicationTypeName value to set + * @return the ServiceCreatedEvent object itself. + */ + public ServiceCreatedEvent withApplicationTypeName(String applicationTypeName) { + this.applicationTypeName = applicationTypeName; + return this; + } + + /** + * Get id of Service instance. + * + * @return the serviceInstance value + */ + public long serviceInstance() { + return this.serviceInstance; + } + + /** + * Set id of Service instance. + * + * @param serviceInstance the serviceInstance value to set + * @return the ServiceCreatedEvent object itself. + */ + public ServiceCreatedEvent withServiceInstance(long serviceInstance) { + this.serviceInstance = serviceInstance; + return this; + } + + /** + * Get indicates if Service is stateful. + * + * @return the isStateful value + */ + public boolean isStateful() { + return this.isStateful; + } + + /** + * Set indicates if Service is stateful. + * + * @param isStateful the isStateful value to set + * @return the ServiceCreatedEvent object itself. + */ + public ServiceCreatedEvent withIsStateful(boolean isStateful) { + this.isStateful = isStateful; + return this; + } + + /** + * Get number of partitions. + * + * @return the partitionCount value + */ + public int partitionCount() { + return this.partitionCount; + } + + /** + * Set number of partitions. + * + * @param partitionCount the partitionCount value to set + * @return the ServiceCreatedEvent object itself. + */ + public ServiceCreatedEvent withPartitionCount(int partitionCount) { + this.partitionCount = partitionCount; + return this; + } + + /** + * Get size of target replicas set. + * + * @return the targetReplicaSetSize value + */ + public int targetReplicaSetSize() { + return this.targetReplicaSetSize; + } + + /** + * Set size of target replicas set. + * + * @param targetReplicaSetSize the targetReplicaSetSize value to set + * @return the ServiceCreatedEvent object itself. + */ + public ServiceCreatedEvent withTargetReplicaSetSize(int targetReplicaSetSize) { + this.targetReplicaSetSize = targetReplicaSetSize; + return this; + } + + /** + * Get minimum size of replicas set. + * + * @return the minReplicaSetSize value + */ + public int minReplicaSetSize() { + return this.minReplicaSetSize; + } + + /** + * Set minimum size of replicas set. + * + * @param minReplicaSetSize the minReplicaSetSize value to set + * @return the ServiceCreatedEvent object itself. + */ + public ServiceCreatedEvent withMinReplicaSetSize(int minReplicaSetSize) { + this.minReplicaSetSize = minReplicaSetSize; + return this; + } + + /** + * Get version of Service package. + * + * @return the servicePackageVersion value + */ + public String servicePackageVersion() { + return this.servicePackageVersion; + } + + /** + * Set version of Service package. + * + * @param servicePackageVersion the servicePackageVersion value to set + * @return the ServiceCreatedEvent object itself. + */ + public ServiceCreatedEvent withServicePackageVersion(String servicePackageVersion) { + this.servicePackageVersion = servicePackageVersion; + return this; + } + + /** + * Get 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. + * + * @return the partitionId value + */ + public UUID partitionId() { + return this.partitionId; + } + + /** + * Set 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. + * + * @param partitionId the partitionId value to set + * @return the ServiceCreatedEvent object itself. + */ + public ServiceCreatedEvent withPartitionId(UUID partitionId) { + this.partitionId = partitionId; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceDeletedEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceDeletedEvent.java new file mode 100644 index 0000000000000..bd70e55d84079 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceDeletedEvent.java @@ -0,0 +1,256 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ServiceEventInner; + +/** + * Service Deleted event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ServiceDeleted") +public class ServiceDeletedEvent extends ServiceEventInner { + /** + * Service type name. + */ + @JsonProperty(value = "ServiceTypeName", required = true) + private String serviceTypeName; + + /** + * Application name. + */ + @JsonProperty(value = "ApplicationName", required = true) + private String applicationName; + + /** + * Application type name. + */ + @JsonProperty(value = "ApplicationTypeName", required = true) + private String applicationTypeName; + + /** + * Id of Service instance. + */ + @JsonProperty(value = "ServiceInstance", required = true) + private long serviceInstance; + + /** + * Indicates if Service is stateful. + */ + @JsonProperty(value = "IsStateful", required = true) + private boolean isStateful; + + /** + * Number of partitions. + */ + @JsonProperty(value = "PartitionCount", required = true) + private int partitionCount; + + /** + * Size of target replicas set. + */ + @JsonProperty(value = "TargetReplicaSetSize", required = true) + private int targetReplicaSetSize; + + /** + * Minimum size of replicas set. + */ + @JsonProperty(value = "MinReplicaSetSize", required = true) + private int minReplicaSetSize; + + /** + * Version of Service package. + */ + @JsonProperty(value = "ServicePackageVersion", required = true) + private String servicePackageVersion; + + /** + * Get service type name. + * + * @return the serviceTypeName value + */ + public String serviceTypeName() { + return this.serviceTypeName; + } + + /** + * Set service type name. + * + * @param serviceTypeName the serviceTypeName value to set + * @return the ServiceDeletedEvent object itself. + */ + public ServiceDeletedEvent withServiceTypeName(String serviceTypeName) { + this.serviceTypeName = serviceTypeName; + return this; + } + + /** + * Get application name. + * + * @return the applicationName value + */ + public String applicationName() { + return this.applicationName; + } + + /** + * Set application name. + * + * @param applicationName the applicationName value to set + * @return the ServiceDeletedEvent object itself. + */ + public ServiceDeletedEvent withApplicationName(String applicationName) { + this.applicationName = applicationName; + return this; + } + + /** + * Get application type name. + * + * @return the applicationTypeName value + */ + public String applicationTypeName() { + return this.applicationTypeName; + } + + /** + * Set application type name. + * + * @param applicationTypeName the applicationTypeName value to set + * @return the ServiceDeletedEvent object itself. + */ + public ServiceDeletedEvent withApplicationTypeName(String applicationTypeName) { + this.applicationTypeName = applicationTypeName; + return this; + } + + /** + * Get id of Service instance. + * + * @return the serviceInstance value + */ + public long serviceInstance() { + return this.serviceInstance; + } + + /** + * Set id of Service instance. + * + * @param serviceInstance the serviceInstance value to set + * @return the ServiceDeletedEvent object itself. + */ + public ServiceDeletedEvent withServiceInstance(long serviceInstance) { + this.serviceInstance = serviceInstance; + return this; + } + + /** + * Get indicates if Service is stateful. + * + * @return the isStateful value + */ + public boolean isStateful() { + return this.isStateful; + } + + /** + * Set indicates if Service is stateful. + * + * @param isStateful the isStateful value to set + * @return the ServiceDeletedEvent object itself. + */ + public ServiceDeletedEvent withIsStateful(boolean isStateful) { + this.isStateful = isStateful; + return this; + } + + /** + * Get number of partitions. + * + * @return the partitionCount value + */ + public int partitionCount() { + return this.partitionCount; + } + + /** + * Set number of partitions. + * + * @param partitionCount the partitionCount value to set + * @return the ServiceDeletedEvent object itself. + */ + public ServiceDeletedEvent withPartitionCount(int partitionCount) { + this.partitionCount = partitionCount; + return this; + } + + /** + * Get size of target replicas set. + * + * @return the targetReplicaSetSize value + */ + public int targetReplicaSetSize() { + return this.targetReplicaSetSize; + } + + /** + * Set size of target replicas set. + * + * @param targetReplicaSetSize the targetReplicaSetSize value to set + * @return the ServiceDeletedEvent object itself. + */ + public ServiceDeletedEvent withTargetReplicaSetSize(int targetReplicaSetSize) { + this.targetReplicaSetSize = targetReplicaSetSize; + return this; + } + + /** + * Get minimum size of replicas set. + * + * @return the minReplicaSetSize value + */ + public int minReplicaSetSize() { + return this.minReplicaSetSize; + } + + /** + * Set minimum size of replicas set. + * + * @param minReplicaSetSize the minReplicaSetSize value to set + * @return the ServiceDeletedEvent object itself. + */ + public ServiceDeletedEvent withMinReplicaSetSize(int minReplicaSetSize) { + this.minReplicaSetSize = minReplicaSetSize; + return this; + } + + /** + * Get version of Service package. + * + * @return the servicePackageVersion value + */ + public String servicePackageVersion() { + return this.servicePackageVersion; + } + + /** + * Set version of Service package. + * + * @param servicePackageVersion the servicePackageVersion value to set + * @return the ServiceDeletedEvent object itself. + */ + public ServiceDeletedEvent withServicePackageVersion(String servicePackageVersion) { + this.servicePackageVersion = servicePackageVersion; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceEndpointRole.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceEndpointRole.java new file mode 100644 index 0000000000000..ffb28e852030f --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceEndpointRole.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ServiceEndpointRole. + */ +public final class ServiceEndpointRole extends ExpandableStringEnum { + /** Static value Invalid for ServiceEndpointRole. */ + public static final ServiceEndpointRole INVALID = fromString("Invalid"); + + /** Static value Stateless for ServiceEndpointRole. */ + public static final ServiceEndpointRole STATELESS = fromString("Stateless"); + + /** Static value StatefulPrimary for ServiceEndpointRole. */ + public static final ServiceEndpointRole STATEFUL_PRIMARY = fromString("StatefulPrimary"); + + /** Static value StatefulSecondary for ServiceEndpointRole. */ + public static final ServiceEndpointRole STATEFUL_SECONDARY = fromString("StatefulSecondary"); + + /** + * Creates or finds a ServiceEndpointRole from its string representation. + * @param name a name to look for + * @return the corresponding ServiceEndpointRole + */ + @JsonCreator + public static ServiceEndpointRole fromString(String name) { + return fromString(name, ServiceEndpointRole.class); + } + + /** + * @return known ServiceEndpointRole values + */ + public static Collection values() { + return values(ServiceEndpointRole.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceFromTemplateDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceFromTemplateDescription.java new file mode 100644 index 0000000000000..c58d8f28d636d --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceFromTemplateDescription.java @@ -0,0 +1,177 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines description for creating a Service Fabric service from a template + * defined in the application manifest. + */ +public class ServiceFromTemplateDescription { + /** + * The name of the application, including the 'fabric:' URI scheme. + */ + @JsonProperty(value = "ApplicationName", required = true) + private String applicationName; + + /** + * The full name of the service with 'fabric:' URI scheme. + */ + @JsonProperty(value = "ServiceName", required = true) + private String serviceName; + + /** + * Name of the service type as specified in the service manifest. + */ + @JsonProperty(value = "ServiceTypeName", required = true) + private String serviceTypeName; + + /** + * The initialization data for the newly created service instance. + */ + @JsonProperty(value = "InitializationData") + private List initializationData; + + /** + * The activation mode of service package to be used for a service. + * Possible values include: 'SharedProcess', 'ExclusiveProcess'. + */ + @JsonProperty(value = "ServicePackageActivationMode") + private ServicePackageActivationMode servicePackageActivationMode; + + /** + * The DNS name of the service. It requires the DNS system service to be + * enabled in Service Fabric cluster. + */ + @JsonProperty(value = "ServiceDnsName") + private String serviceDnsName; + + /** + * Get the name of the application, including the 'fabric:' URI scheme. + * + * @return the applicationName value + */ + public String applicationName() { + return this.applicationName; + } + + /** + * Set the name of the application, including the 'fabric:' URI scheme. + * + * @param applicationName the applicationName value to set + * @return the ServiceFromTemplateDescription object itself. + */ + public ServiceFromTemplateDescription withApplicationName(String applicationName) { + this.applicationName = applicationName; + return this; + } + + /** + * Get the full name of the service with 'fabric:' URI scheme. + * + * @return the serviceName value + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set the full name of the service with 'fabric:' URI scheme. + * + * @param serviceName the serviceName value to set + * @return the ServiceFromTemplateDescription object itself. + */ + public ServiceFromTemplateDescription withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Get name of the service type as specified in the service manifest. + * + * @return the serviceTypeName value + */ + public String serviceTypeName() { + return this.serviceTypeName; + } + + /** + * Set name of the service type as specified in the service manifest. + * + * @param serviceTypeName the serviceTypeName value to set + * @return the ServiceFromTemplateDescription object itself. + */ + public ServiceFromTemplateDescription withServiceTypeName(String serviceTypeName) { + this.serviceTypeName = serviceTypeName; + return this; + } + + /** + * Get the initialization data for the newly created service instance. + * + * @return the initializationData value + */ + public List initializationData() { + return this.initializationData; + } + + /** + * Set the initialization data for the newly created service instance. + * + * @param initializationData the initializationData value to set + * @return the ServiceFromTemplateDescription object itself. + */ + public ServiceFromTemplateDescription withInitializationData(List initializationData) { + this.initializationData = initializationData; + return this; + } + + /** + * Get the activation mode of service package to be used for a service. Possible values include: 'SharedProcess', 'ExclusiveProcess'. + * + * @return the servicePackageActivationMode value + */ + public ServicePackageActivationMode servicePackageActivationMode() { + return this.servicePackageActivationMode; + } + + /** + * Set the activation mode of service package to be used for a service. Possible values include: 'SharedProcess', 'ExclusiveProcess'. + * + * @param servicePackageActivationMode the servicePackageActivationMode value to set + * @return the ServiceFromTemplateDescription object itself. + */ + public ServiceFromTemplateDescription withServicePackageActivationMode(ServicePackageActivationMode servicePackageActivationMode) { + this.servicePackageActivationMode = servicePackageActivationMode; + return this; + } + + /** + * Get the DNS name of the service. It requires the DNS system service to be enabled in Service Fabric cluster. + * + * @return the serviceDnsName value + */ + public String serviceDnsName() { + return this.serviceDnsName; + } + + /** + * Set the DNS name of the service. It requires the DNS system service to be enabled in Service Fabric cluster. + * + * @param serviceDnsName the serviceDnsName value to set + * @return the ServiceFromTemplateDescription object itself. + */ + public ServiceFromTemplateDescription withServiceDnsName(String serviceDnsName) { + this.serviceDnsName = serviceDnsName; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceHealthEvaluation.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceHealthEvaluation.java new file mode 100644 index 0000000000000..f383aa43dbe7f --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceHealthEvaluation.java @@ -0,0 +1,79 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents health evaluation for a service, 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. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("Service") +public class ServiceHealthEvaluation extends HealthEvaluation { + /** + * Name of the service whose health evaluation is described by this object. + */ + @JsonProperty(value = "ServiceName") + private String serviceName; + + /** + * List of unhealthy evaluations that led to the current aggregated health + * state of the service. The types of the unhealthy evaluations can be + * PartitionsHealthEvaluation or EventHealthEvaluation. + */ + @JsonProperty(value = "UnhealthyEvaluations") + private List unhealthyEvaluations; + + /** + * Get name of the service whose health evaluation is described by this object. + * + * @return the serviceName value + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set name of the service whose health evaluation is described by this object. + * + * @param serviceName the serviceName value to set + * @return the ServiceHealthEvaluation object itself. + */ + public ServiceHealthEvaluation withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Get list of unhealthy evaluations that led to the current aggregated health state of the service. The types of the unhealthy evaluations can be PartitionsHealthEvaluation or EventHealthEvaluation. + * + * @return the unhealthyEvaluations value + */ + public List unhealthyEvaluations() { + return this.unhealthyEvaluations; + } + + /** + * Set list of unhealthy evaluations that led to the current aggregated health state of the service. The types of the unhealthy evaluations can be PartitionsHealthEvaluation or EventHealthEvaluation. + * + * @param unhealthyEvaluations the unhealthyEvaluations value to set + * @return the ServiceHealthEvaluation object itself. + */ + public ServiceHealthEvaluation withUnhealthyEvaluations(List unhealthyEvaluations) { + this.unhealthyEvaluations = unhealthyEvaluations; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceHealthReportCreatedEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceHealthReportCreatedEvent.java new file mode 100644 index 0000000000000..82f73f1835981 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceHealthReportCreatedEvent.java @@ -0,0 +1,257 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ServiceEventInner; + +/** + * Service Health Report Created event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ServiceHealthReportCreated") +public class ServiceHealthReportCreatedEvent extends ServiceEventInner { + /** + * Id of Service instance. + */ + @JsonProperty(value = "InstanceId", required = true) + private long instanceId; + + /** + * Id of report source. + */ + @JsonProperty(value = "SourceId", required = true) + private String sourceId; + + /** + * Describes the property. + */ + @JsonProperty(value = "Property", required = true) + private String property; + + /** + * Describes the property health state. + */ + @JsonProperty(value = "HealthState", required = true) + private String healthState; + + /** + * Time to live in milli-seconds. + */ + @JsonProperty(value = "TimeToLiveMs", required = true) + private long timeToLiveMs; + + /** + * Sequence number of report. + */ + @JsonProperty(value = "SequenceNumber", required = true) + private long sequenceNumber; + + /** + * Description of report. + */ + @JsonProperty(value = "Description", required = true) + private String description; + + /** + * Indicates the removal when it expires. + */ + @JsonProperty(value = "RemoveWhenExpired", required = true) + private boolean removeWhenExpired; + + /** + * Source time. + */ + @JsonProperty(value = "SourceUtcTimestamp", required = true) + private DateTime sourceUtcTimestamp; + + /** + * Get id of Service instance. + * + * @return the instanceId value + */ + public long instanceId() { + return this.instanceId; + } + + /** + * Set id of Service instance. + * + * @param instanceId the instanceId value to set + * @return the ServiceHealthReportCreatedEvent object itself. + */ + public ServiceHealthReportCreatedEvent withInstanceId(long instanceId) { + this.instanceId = instanceId; + return this; + } + + /** + * Get id of report source. + * + * @return the sourceId value + */ + public String sourceId() { + return this.sourceId; + } + + /** + * Set id of report source. + * + * @param sourceId the sourceId value to set + * @return the ServiceHealthReportCreatedEvent object itself. + */ + public ServiceHealthReportCreatedEvent withSourceId(String sourceId) { + this.sourceId = sourceId; + return this; + } + + /** + * Get describes the property. + * + * @return the property value + */ + public String property() { + return this.property; + } + + /** + * Set describes the property. + * + * @param property the property value to set + * @return the ServiceHealthReportCreatedEvent object itself. + */ + public ServiceHealthReportCreatedEvent withProperty(String property) { + this.property = property; + return this; + } + + /** + * Get describes the property health state. + * + * @return the healthState value + */ + public String healthState() { + return this.healthState; + } + + /** + * Set describes the property health state. + * + * @param healthState the healthState value to set + * @return the ServiceHealthReportCreatedEvent object itself. + */ + public ServiceHealthReportCreatedEvent withHealthState(String healthState) { + this.healthState = healthState; + return this; + } + + /** + * Get time to live in milli-seconds. + * + * @return the timeToLiveMs value + */ + public long timeToLiveMs() { + return this.timeToLiveMs; + } + + /** + * Set time to live in milli-seconds. + * + * @param timeToLiveMs the timeToLiveMs value to set + * @return the ServiceHealthReportCreatedEvent object itself. + */ + public ServiceHealthReportCreatedEvent withTimeToLiveMs(long timeToLiveMs) { + this.timeToLiveMs = timeToLiveMs; + return this; + } + + /** + * Get sequence number of report. + * + * @return the sequenceNumber value + */ + public long sequenceNumber() { + return this.sequenceNumber; + } + + /** + * Set sequence number of report. + * + * @param sequenceNumber the sequenceNumber value to set + * @return the ServiceHealthReportCreatedEvent object itself. + */ + public ServiceHealthReportCreatedEvent withSequenceNumber(long sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get description of report. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of report. + * + * @param description the description value to set + * @return the ServiceHealthReportCreatedEvent object itself. + */ + public ServiceHealthReportCreatedEvent withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get indicates the removal when it expires. + * + * @return the removeWhenExpired value + */ + public boolean removeWhenExpired() { + return this.removeWhenExpired; + } + + /** + * Set indicates the removal when it expires. + * + * @param removeWhenExpired the removeWhenExpired value to set + * @return the ServiceHealthReportCreatedEvent object itself. + */ + public ServiceHealthReportCreatedEvent withRemoveWhenExpired(boolean removeWhenExpired) { + this.removeWhenExpired = removeWhenExpired; + return this; + } + + /** + * Get source time. + * + * @return the sourceUtcTimestamp value + */ + public DateTime sourceUtcTimestamp() { + return this.sourceUtcTimestamp; + } + + /** + * Set source time. + * + * @param sourceUtcTimestamp the sourceUtcTimestamp value to set + * @return the ServiceHealthReportCreatedEvent object itself. + */ + public ServiceHealthReportCreatedEvent withSourceUtcTimestamp(DateTime sourceUtcTimestamp) { + this.sourceUtcTimestamp = sourceUtcTimestamp; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceHealthReportExpiredEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceHealthReportExpiredEvent.java new file mode 100644 index 0000000000000..9ab3f084afa19 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceHealthReportExpiredEvent.java @@ -0,0 +1,257 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ServiceEventInner; + +/** + * Service Health Report Expired event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ServiceHealthReportExpired") +public class ServiceHealthReportExpiredEvent extends ServiceEventInner { + /** + * Id of Service instance. + */ + @JsonProperty(value = "InstanceId", required = true) + private long instanceId; + + /** + * Id of report source. + */ + @JsonProperty(value = "SourceId", required = true) + private String sourceId; + + /** + * Describes the property. + */ + @JsonProperty(value = "Property", required = true) + private String property; + + /** + * Describes the property health state. + */ + @JsonProperty(value = "HealthState", required = true) + private String healthState; + + /** + * Time to live in milli-seconds. + */ + @JsonProperty(value = "TimeToLiveMs", required = true) + private long timeToLiveMs; + + /** + * Sequence number of report. + */ + @JsonProperty(value = "SequenceNumber", required = true) + private long sequenceNumber; + + /** + * Description of report. + */ + @JsonProperty(value = "Description", required = true) + private String description; + + /** + * Indicates the removal when it expires. + */ + @JsonProperty(value = "RemoveWhenExpired", required = true) + private boolean removeWhenExpired; + + /** + * Source time. + */ + @JsonProperty(value = "SourceUtcTimestamp", required = true) + private DateTime sourceUtcTimestamp; + + /** + * Get id of Service instance. + * + * @return the instanceId value + */ + public long instanceId() { + return this.instanceId; + } + + /** + * Set id of Service instance. + * + * @param instanceId the instanceId value to set + * @return the ServiceHealthReportExpiredEvent object itself. + */ + public ServiceHealthReportExpiredEvent withInstanceId(long instanceId) { + this.instanceId = instanceId; + return this; + } + + /** + * Get id of report source. + * + * @return the sourceId value + */ + public String sourceId() { + return this.sourceId; + } + + /** + * Set id of report source. + * + * @param sourceId the sourceId value to set + * @return the ServiceHealthReportExpiredEvent object itself. + */ + public ServiceHealthReportExpiredEvent withSourceId(String sourceId) { + this.sourceId = sourceId; + return this; + } + + /** + * Get describes the property. + * + * @return the property value + */ + public String property() { + return this.property; + } + + /** + * Set describes the property. + * + * @param property the property value to set + * @return the ServiceHealthReportExpiredEvent object itself. + */ + public ServiceHealthReportExpiredEvent withProperty(String property) { + this.property = property; + return this; + } + + /** + * Get describes the property health state. + * + * @return the healthState value + */ + public String healthState() { + return this.healthState; + } + + /** + * Set describes the property health state. + * + * @param healthState the healthState value to set + * @return the ServiceHealthReportExpiredEvent object itself. + */ + public ServiceHealthReportExpiredEvent withHealthState(String healthState) { + this.healthState = healthState; + return this; + } + + /** + * Get time to live in milli-seconds. + * + * @return the timeToLiveMs value + */ + public long timeToLiveMs() { + return this.timeToLiveMs; + } + + /** + * Set time to live in milli-seconds. + * + * @param timeToLiveMs the timeToLiveMs value to set + * @return the ServiceHealthReportExpiredEvent object itself. + */ + public ServiceHealthReportExpiredEvent withTimeToLiveMs(long timeToLiveMs) { + this.timeToLiveMs = timeToLiveMs; + return this; + } + + /** + * Get sequence number of report. + * + * @return the sequenceNumber value + */ + public long sequenceNumber() { + return this.sequenceNumber; + } + + /** + * Set sequence number of report. + * + * @param sequenceNumber the sequenceNumber value to set + * @return the ServiceHealthReportExpiredEvent object itself. + */ + public ServiceHealthReportExpiredEvent withSequenceNumber(long sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get description of report. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of report. + * + * @param description the description value to set + * @return the ServiceHealthReportExpiredEvent object itself. + */ + public ServiceHealthReportExpiredEvent withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get indicates the removal when it expires. + * + * @return the removeWhenExpired value + */ + public boolean removeWhenExpired() { + return this.removeWhenExpired; + } + + /** + * Set indicates the removal when it expires. + * + * @param removeWhenExpired the removeWhenExpired value to set + * @return the ServiceHealthReportExpiredEvent object itself. + */ + public ServiceHealthReportExpiredEvent withRemoveWhenExpired(boolean removeWhenExpired) { + this.removeWhenExpired = removeWhenExpired; + return this; + } + + /** + * Get source time. + * + * @return the sourceUtcTimestamp value + */ + public DateTime sourceUtcTimestamp() { + return this.sourceUtcTimestamp; + } + + /** + * Set source time. + * + * @param sourceUtcTimestamp the sourceUtcTimestamp value to set + * @return the ServiceHealthReportExpiredEvent object itself. + */ + public ServiceHealthReportExpiredEvent withSourceUtcTimestamp(DateTime sourceUtcTimestamp) { + this.sourceUtcTimestamp = sourceUtcTimestamp; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceHealthState.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceHealthState.java new file mode 100644 index 0000000000000..f5e9505308d10 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceHealthState.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents the health state of a service, which contains the service + * identifier and its aggregated health state. + */ +public class ServiceHealthState extends EntityHealthState { + /** + * Name of the service whose health state is represented by this object. + */ + @JsonProperty(value = "ServiceName") + private String serviceName; + + /** + * Get name of the service whose health state is represented by this object. + * + * @return the serviceName value + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set name of the service whose health state is represented by this object. + * + * @param serviceName the serviceName value to set + * @return the ServiceHealthState object itself. + */ + public ServiceHealthState withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceHealthStateChunk.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceHealthStateChunk.java new file mode 100644 index 0000000000000..2a6cdd1d446a0 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceHealthStateChunk.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents the health state chunk of a service, which contains the service + * name, its aggregated health state and any partitions that respect the + * filters in the cluster health chunk query description. + */ +public class ServiceHealthStateChunk extends EntityHealthStateChunk { + /** + * The name of the service whose health state chunk is provided in this + * object. + */ + @JsonProperty(value = "ServiceName") + private String serviceName; + + /** + * The list of partition health state chunks belonging to the service that + * respect the filters in the cluster health chunk query description. + */ + @JsonProperty(value = "PartitionHealthStateChunks") + private PartitionHealthStateChunkList partitionHealthStateChunks; + + /** + * Get the name of the service whose health state chunk is provided in this object. + * + * @return the serviceName value + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set the name of the service whose health state chunk is provided in this object. + * + * @param serviceName the serviceName value to set + * @return the ServiceHealthStateChunk object itself. + */ + public ServiceHealthStateChunk withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Get the list of partition health state chunks belonging to the service that respect the filters in the cluster health chunk query description. + * + * @return the partitionHealthStateChunks value + */ + public PartitionHealthStateChunkList partitionHealthStateChunks() { + return this.partitionHealthStateChunks; + } + + /** + * Set the list of partition health state chunks belonging to the service that respect the filters in the cluster health chunk query description. + * + * @param partitionHealthStateChunks the partitionHealthStateChunks value to set + * @return the ServiceHealthStateChunk object itself. + */ + public ServiceHealthStateChunk withPartitionHealthStateChunks(PartitionHealthStateChunkList partitionHealthStateChunks) { + this.partitionHealthStateChunks = partitionHealthStateChunks; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceHealthStateChunkList.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceHealthStateChunkList.java new file mode 100644 index 0000000000000..351a32eeb57e5 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceHealthStateChunkList.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list of service health state chunks that respect the input filters in + * the chunk query. Returned by get cluster health state chunks query. + */ +public class ServiceHealthStateChunkList { + /** + * The list of service health state chunks that respect the input filters + * in the chunk query. + */ + @JsonProperty(value = "Items") + private List items; + + /** + * Get the list of service health state chunks that respect the input filters in the chunk query. + * + * @return the items value + */ + public List items() { + return this.items; + } + + /** + * Set the list of service health state chunks that respect the input filters in the chunk query. + * + * @param items the items value to set + * @return the ServiceHealthStateChunkList object itself. + */ + public ServiceHealthStateChunkList withItems(List items) { + this.items = items; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceHealthStateFilter.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceHealthStateFilter.java new file mode 100644 index 0000000000000..5b896f841059a --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceHealthStateFilter.java @@ -0,0 +1,173 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines matching criteria to determine whether a service should be included + * as a child of an application in the cluster health chunk. + * The services are only returned if the parent application matches a filter + * specified in the cluster health chunk query description. + * One filter can match zero, one or multiple services, depending on its + * properties. + */ +public class ServiceHealthStateFilter { + /** + * The name of the service that matches the filter. The filter is applied + * only to the specified service, if it exists. + * If the service doesn't exist, no service is returned in the cluster + * health chunk based on this filter. + * If the service exists, it is included as the application's child if the + * health state matches the other filter properties. + * If not specified, all services that match the parent filters (if any) + * are taken into consideration and matched against the other filter + * members, like health state filter. + */ + @JsonProperty(value = "ServiceNameFilter") + private String serviceNameFilter; + + /** + * The filter for the health state of the services. It allows selecting + * services if they match the desired health states. + * The possible values are integer value of one of the following health + * states. Only services that match the filter are returned. All services + * are used to evaluate the cluster aggregated health state. + * If not specified, default value is None, unless the service name is + * specified. If the filter has default value and service name is + * specified, the matching service is returned. + * The state values are flag-based enumeration, so the value could be a + * combination of these values obtained using bitwise 'OR' operator. + * For example, if the provided value is 6, it matches services with + * HealthState value of OK (2) and Warning (4). + * + * - 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. + */ + @JsonProperty(value = "HealthStateFilter") + private Integer healthStateFilter; + + /** + * Defines a list of filters that specify which partitions to be included + * in the returned cluster health chunk as children of the service. The + * partitions are returned only if the parent service matches a filter. + * If the list is empty, no partitions are returned. All the partitions are + * used to evaluate the parent service aggregated health state, regardless + * of the input filters. + * The service filter may specify multiple partition filters. + * For example, it can specify a filter to return all partitions with + * health state Error and another filter to always include a partition + * identified by its partition ID. + */ + @JsonProperty(value = "PartitionFilters") + private List partitionFilters; + + /** + * Get the name of the service that matches the filter. The filter is applied only to the specified service, if it exists. + If the service doesn't exist, no service is returned in the cluster health chunk based on this filter. + If the service exists, it is included as the application's child if the health state matches the other filter properties. + If not specified, all services that match the parent filters (if any) are taken into consideration and matched against the other filter members, like health state filter. + * + * @return the serviceNameFilter value + */ + public String serviceNameFilter() { + return this.serviceNameFilter; + } + + /** + * Set the name of the service that matches the filter. The filter is applied only to the specified service, if it exists. + If the service doesn't exist, no service is returned in the cluster health chunk based on this filter. + If the service exists, it is included as the application's child if the health state matches the other filter properties. + If not specified, all services that match the parent filters (if any) are taken into consideration and matched against the other filter members, like health state filter. + * + * @param serviceNameFilter the serviceNameFilter value to set + * @return the ServiceHealthStateFilter object itself. + */ + public ServiceHealthStateFilter withServiceNameFilter(String serviceNameFilter) { + this.serviceNameFilter = serviceNameFilter; + return this; + } + + /** + * Get the filter for the health state of the services. It allows selecting services if they match the desired health states. + The possible values are integer value of one of the following health states. Only services that match the filter are returned. All services are used to evaluate the cluster aggregated health state. + If not specified, default value is None, unless the service name is specified. If the filter has default value and service name is specified, the matching service is returned. + The state values are flag-based enumeration, so the value could be a combination of these values obtained using bitwise 'OR' operator. + For example, if the provided value is 6, it matches services with HealthState value of OK (2) and Warning (4). + - Default - Default value. Matches any HealthState. The value is zero. + - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given collection of states. The value is 1. + - Ok - Filter that matches input with HealthState value Ok. The value is 2. + - Warning - Filter that matches input with HealthState value Warning. The value is 4. + - Error - Filter that matches input with HealthState value Error. The value is 8. + - All - Filter that matches input with any HealthState value. The value is 65535. + * + * @return the healthStateFilter value + */ + public Integer healthStateFilter() { + return this.healthStateFilter; + } + + /** + * Set the filter for the health state of the services. It allows selecting services if they match the desired health states. + The possible values are integer value of one of the following health states. Only services that match the filter are returned. All services are used to evaluate the cluster aggregated health state. + If not specified, default value is None, unless the service name is specified. If the filter has default value and service name is specified, the matching service is returned. + The state values are flag-based enumeration, so the value could be a combination of these values obtained using bitwise 'OR' operator. + For example, if the provided value is 6, it matches services with HealthState value of OK (2) and Warning (4). + - 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 healthStateFilter the healthStateFilter value to set + * @return the ServiceHealthStateFilter object itself. + */ + public ServiceHealthStateFilter withHealthStateFilter(Integer healthStateFilter) { + this.healthStateFilter = healthStateFilter; + return this; + } + + /** + * Get defines a list of filters that specify which partitions to be included in the returned cluster health chunk as children of the service. The partitions are returned only if the parent service matches a filter. + If the list is empty, no partitions are returned. All the partitions are used to evaluate the parent service aggregated health state, regardless of the input filters. + The service filter may specify multiple partition filters. + For example, it can specify a filter to return all partitions with health state Error and another filter to always include a partition identified by its partition ID. + * + * @return the partitionFilters value + */ + public List partitionFilters() { + return this.partitionFilters; + } + + /** + * Set defines a list of filters that specify which partitions to be included in the returned cluster health chunk as children of the service. The partitions are returned only if the parent service matches a filter. + If the list is empty, no partitions are returned. All the partitions are used to evaluate the parent service aggregated health state, regardless of the input filters. + The service filter may specify multiple partition filters. + For example, it can specify a filter to return all partitions with health state Error and another filter to always include a partition identified by its partition ID. + * + * @param partitionFilters the partitionFilters value to set + * @return the ServiceHealthStateFilter object itself. + */ + public ServiceHealthStateFilter withPartitionFilters(List partitionFilters) { + this.partitionFilters = partitionFilters; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceKind.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceKind.java new file mode 100644 index 0000000000000..7cff010c80600 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceKind.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ServiceKind. + */ +public final class ServiceKind extends ExpandableStringEnum { + /** Static value Invalid for ServiceKind. */ + public static final ServiceKind INVALID = fromString("Invalid"); + + /** Static value Stateless for ServiceKind. */ + public static final ServiceKind STATELESS = fromString("Stateless"); + + /** Static value Stateful for ServiceKind. */ + public static final ServiceKind STATEFUL = fromString("Stateful"); + + /** + * Creates or finds a ServiceKind from its string representation. + * @param name a name to look for + * @return the corresponding ServiceKind + */ + @JsonCreator + public static ServiceKind fromString(String name) { + return fromString(name, ServiceKind.class); + } + + /** + * @return known ServiceKind values + */ + public static Collection values() { + return values(ServiceKind.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceLoadMetricDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceLoadMetricDescription.java new file mode 100644 index 0000000000000..795ab4654e5fd --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceLoadMetricDescription.java @@ -0,0 +1,156 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies a metric to load balance a service during runtime. + */ +public class ServiceLoadMetricDescription { + /** + * The name of the metric. If the service chooses to report load during + * runtime, the load metric name should match the name that is specified in + * Name exactly. Note that metric names are case-sensitive. + */ + @JsonProperty(value = "Name", required = true) + private String name; + + /** + * The service load metric relative weight, compared to other metrics + * configured for this service, as a number. Possible values include: + * 'Zero', 'Low', 'Medium', 'High'. + */ + @JsonProperty(value = "Weight") + private ServiceLoadMetricWeight weight; + + /** + * Used only for Stateful services. The default amount of load, as a + * number, that this service creates for this metric when it is a Primary + * replica. + */ + @JsonProperty(value = "PrimaryDefaultLoad") + private Integer primaryDefaultLoad; + + /** + * Used only for Stateful services. The default amount of load, as a + * number, that this service creates for this metric when it is a Secondary + * replica. + */ + @JsonProperty(value = "SecondaryDefaultLoad") + private Integer secondaryDefaultLoad; + + /** + * Used only for Stateless services. The default amount of load, as a + * number, that this service creates for this metric. + */ + @JsonProperty(value = "DefaultLoad") + private Integer defaultLoad; + + /** + * Get the name of the metric. If the service chooses to report load during runtime, the load metric name should match the name that is specified in Name exactly. Note that metric names are case-sensitive. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the metric. If the service chooses to report load during runtime, the load metric name should match the name that is specified in Name exactly. Note that metric names are case-sensitive. + * + * @param name the name value to set + * @return the ServiceLoadMetricDescription object itself. + */ + public ServiceLoadMetricDescription withName(String name) { + this.name = name; + return this; + } + + /** + * Get the service load metric relative weight, compared to other metrics configured for this service, as a number. Possible values include: 'Zero', 'Low', 'Medium', 'High'. + * + * @return the weight value + */ + public ServiceLoadMetricWeight weight() { + return this.weight; + } + + /** + * Set the service load metric relative weight, compared to other metrics configured for this service, as a number. Possible values include: 'Zero', 'Low', 'Medium', 'High'. + * + * @param weight the weight value to set + * @return the ServiceLoadMetricDescription object itself. + */ + public ServiceLoadMetricDescription withWeight(ServiceLoadMetricWeight weight) { + this.weight = weight; + return this; + } + + /** + * Get used only for Stateful services. The default amount of load, as a number, that this service creates for this metric when it is a Primary replica. + * + * @return the primaryDefaultLoad value + */ + public Integer primaryDefaultLoad() { + return this.primaryDefaultLoad; + } + + /** + * Set used only for Stateful services. The default amount of load, as a number, that this service creates for this metric when it is a Primary replica. + * + * @param primaryDefaultLoad the primaryDefaultLoad value to set + * @return the ServiceLoadMetricDescription object itself. + */ + public ServiceLoadMetricDescription withPrimaryDefaultLoad(Integer primaryDefaultLoad) { + this.primaryDefaultLoad = primaryDefaultLoad; + return this; + } + + /** + * Get used only for Stateful services. The default amount of load, as a number, that this service creates for this metric when it is a Secondary replica. + * + * @return the secondaryDefaultLoad value + */ + public Integer secondaryDefaultLoad() { + return this.secondaryDefaultLoad; + } + + /** + * Set used only for Stateful services. The default amount of load, as a number, that this service creates for this metric when it is a Secondary replica. + * + * @param secondaryDefaultLoad the secondaryDefaultLoad value to set + * @return the ServiceLoadMetricDescription object itself. + */ + public ServiceLoadMetricDescription withSecondaryDefaultLoad(Integer secondaryDefaultLoad) { + this.secondaryDefaultLoad = secondaryDefaultLoad; + return this; + } + + /** + * Get used only for Stateless services. The default amount of load, as a number, that this service creates for this metric. + * + * @return the defaultLoad value + */ + public Integer defaultLoad() { + return this.defaultLoad; + } + + /** + * Set used only for Stateless services. The default amount of load, as a number, that this service creates for this metric. + * + * @param defaultLoad the defaultLoad value to set + * @return the ServiceLoadMetricDescription object itself. + */ + public ServiceLoadMetricDescription withDefaultLoad(Integer defaultLoad) { + this.defaultLoad = defaultLoad; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceLoadMetricWeight.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceLoadMetricWeight.java new file mode 100644 index 0000000000000..e083baa2bbfb6 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceLoadMetricWeight.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ServiceLoadMetricWeight. + */ +public final class ServiceLoadMetricWeight extends ExpandableStringEnum { + /** Static value Zero for ServiceLoadMetricWeight. */ + public static final ServiceLoadMetricWeight ZERO = fromString("Zero"); + + /** Static value Low for ServiceLoadMetricWeight. */ + public static final ServiceLoadMetricWeight LOW = fromString("Low"); + + /** Static value Medium for ServiceLoadMetricWeight. */ + public static final ServiceLoadMetricWeight MEDIUM = fromString("Medium"); + + /** Static value High for ServiceLoadMetricWeight. */ + public static final ServiceLoadMetricWeight HIGH = fromString("High"); + + /** + * Creates or finds a ServiceLoadMetricWeight from its string representation. + * @param name a name to look for + * @return the corresponding ServiceLoadMetricWeight + */ + @JsonCreator + public static ServiceLoadMetricWeight fromString(String name) { + return fromString(name, ServiceLoadMetricWeight.class); + } + + /** + * @return known ServiceLoadMetricWeight values + */ + public static Collection values() { + return values(ServiceLoadMetricWeight.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceOperationName.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceOperationName.java new file mode 100644 index 0000000000000..8647257c89fa2 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceOperationName.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ServiceOperationName. + */ +public final class ServiceOperationName extends ExpandableStringEnum { + /** Static value Unknown for ServiceOperationName. */ + public static final ServiceOperationName UNKNOWN = fromString("Unknown"); + + /** Static value None for ServiceOperationName. */ + public static final ServiceOperationName NONE = fromString("None"); + + /** Static value Open for ServiceOperationName. */ + public static final ServiceOperationName OPEN = fromString("Open"); + + /** Static value ChangeRole for ServiceOperationName. */ + public static final ServiceOperationName CHANGE_ROLE = fromString("ChangeRole"); + + /** Static value Close for ServiceOperationName. */ + public static final ServiceOperationName CLOSE = fromString("Close"); + + /** Static value Abort for ServiceOperationName. */ + public static final ServiceOperationName ABORT = fromString("Abort"); + + /** + * Creates or finds a ServiceOperationName from its string representation. + * @param name a name to look for + * @return the corresponding ServiceOperationName + */ + @JsonCreator + public static ServiceOperationName fromString(String name) { + return fromString(name, ServiceOperationName.class); + } + + /** + * @return known ServiceOperationName values + */ + public static Collection values() { + return values(ServiceOperationName.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicePackageActivationMode.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicePackageActivationMode.java new file mode 100644 index 0000000000000..03d48fede9363 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicePackageActivationMode.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ServicePackageActivationMode. + */ +public final class ServicePackageActivationMode extends ExpandableStringEnum { + /** Static value SharedProcess for ServicePackageActivationMode. */ + public static final ServicePackageActivationMode SHARED_PROCESS = fromString("SharedProcess"); + + /** Static value ExclusiveProcess for ServicePackageActivationMode. */ + public static final ServicePackageActivationMode EXCLUSIVE_PROCESS = fromString("ExclusiveProcess"); + + /** + * Creates or finds a ServicePackageActivationMode from its string representation. + * @param name a name to look for + * @return the corresponding ServicePackageActivationMode + */ + @JsonCreator + public static ServicePackageActivationMode fromString(String name) { + return fromString(name, ServicePackageActivationMode.class); + } + + /** + * @return known ServicePackageActivationMode values + */ + public static Collection values() { + return values(ServicePackageActivationMode.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicePartitionKind.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicePartitionKind.java new file mode 100644 index 0000000000000..875476cf4d4d0 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicePartitionKind.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ServicePartitionKind. + */ +public final class ServicePartitionKind extends ExpandableStringEnum { + /** Static value Invalid for ServicePartitionKind. */ + public static final ServicePartitionKind INVALID = fromString("Invalid"); + + /** Static value Singleton for ServicePartitionKind. */ + public static final ServicePartitionKind SINGLETON = fromString("Singleton"); + + /** Static value Int64Range for ServicePartitionKind. */ + public static final ServicePartitionKind INT64RANGE = fromString("Int64Range"); + + /** Static value Named for ServicePartitionKind. */ + public static final ServicePartitionKind NAMED = fromString("Named"); + + /** + * Creates or finds a ServicePartitionKind from its string representation. + * @param name a name to look for + * @return the corresponding ServicePartitionKind + */ + @JsonCreator + public static ServicePartitionKind fromString(String name) { + return fromString(name, ServicePartitionKind.class); + } + + /** + * @return known ServicePartitionKind values + */ + public static Collection values() { + return values(ServicePartitionKind.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicePartitionStatus.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicePartitionStatus.java new file mode 100644 index 0000000000000..ad9730cd18397 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicePartitionStatus.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ServicePartitionStatus. + */ +public final class ServicePartitionStatus extends ExpandableStringEnum { + /** Static value Invalid for ServicePartitionStatus. */ + public static final ServicePartitionStatus INVALID = fromString("Invalid"); + + /** Static value Ready for ServicePartitionStatus. */ + public static final ServicePartitionStatus READY = fromString("Ready"); + + /** Static value NotReady for ServicePartitionStatus. */ + public static final ServicePartitionStatus NOT_READY = fromString("NotReady"); + + /** Static value InQuorumLoss for ServicePartitionStatus. */ + public static final ServicePartitionStatus IN_QUORUM_LOSS = fromString("InQuorumLoss"); + + /** Static value Reconfiguring for ServicePartitionStatus. */ + public static final ServicePartitionStatus RECONFIGURING = fromString("Reconfiguring"); + + /** Static value Deleting for ServicePartitionStatus. */ + public static final ServicePartitionStatus DELETING = fromString("Deleting"); + + /** + * Creates or finds a ServicePartitionStatus from its string representation. + * @param name a name to look for + * @return the corresponding ServicePartitionStatus + */ + @JsonCreator + public static ServicePartitionStatus fromString(String name) { + return fromString(name, ServicePartitionStatus.class); + } + + /** + * @return known ServicePartitionStatus values + */ + public static Collection values() { + return values(ServicePartitionStatus.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicePlacementInvalidDomainPolicyDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicePlacementInvalidDomainPolicyDescription.java new file mode 100644 index 0000000000000..3cf7e6c2112c7 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicePlacementInvalidDomainPolicyDescription.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the policy to be used for placement of a Service Fabric service + * where a particular fault or upgrade domain should not be used for placement + * of the instances or replicas of that service. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Type") +@JsonTypeName("InvalidDomain") +public class ServicePlacementInvalidDomainPolicyDescription extends ServicePlacementPolicyDescription { + /** + * The name of the domain that should not be used for placement. + */ + @JsonProperty(value = "DomainName") + private String domainName; + + /** + * Get the name of the domain that should not be used for placement. + * + * @return the domainName value + */ + public String domainName() { + return this.domainName; + } + + /** + * Set the name of the domain that should not be used for placement. + * + * @param domainName the domainName value to set + * @return the ServicePlacementInvalidDomainPolicyDescription object itself. + */ + public ServicePlacementInvalidDomainPolicyDescription withDomainName(String domainName) { + this.domainName = domainName; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicePlacementNonPartiallyPlaceServicePolicyDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicePlacementNonPartiallyPlaceServicePolicyDescription.java new file mode 100644 index 0000000000000..ee44a5a7f0ab6 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicePlacementNonPartiallyPlaceServicePolicyDescription.java @@ -0,0 +1,22 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the policy to be used for placement of a Service Fabric service + * where all replicas must be able to be placed in order for any replicas to be + * created. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Type") +@JsonTypeName("NonPartiallyPlaceService") +public class ServicePlacementNonPartiallyPlaceServicePolicyDescription extends ServicePlacementPolicyDescription { +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicePlacementPolicyDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicePlacementPolicyDescription.java new file mode 100644 index 0000000000000..d499a7aa0449d --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicePlacementPolicyDescription.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Describes the policy to be used for placement of a Service Fabric service. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Type") +@JsonTypeName("ServicePlacementPolicyDescription") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "InvalidDomain", value = ServicePlacementInvalidDomainPolicyDescription.class), + @JsonSubTypes.Type(name = "NonPartiallyPlaceService", value = ServicePlacementNonPartiallyPlaceServicePolicyDescription.class), + @JsonSubTypes.Type(name = "PreferredPrimaryDomain", value = ServicePlacementPreferPrimaryDomainPolicyDescription.class), + @JsonSubTypes.Type(name = "RequiredDomain", value = ServicePlacementRequiredDomainPolicyDescription.class), + @JsonSubTypes.Type(name = "RequiredDomainDistribution", value = ServicePlacementRequireDomainDistributionPolicyDescription.class) +}) +public class ServicePlacementPolicyDescription { +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicePlacementPolicyType.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicePlacementPolicyType.java new file mode 100644 index 0000000000000..db2001b815ac7 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicePlacementPolicyType.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ServicePlacementPolicyType. + */ +public final class ServicePlacementPolicyType extends ExpandableStringEnum { + /** Static value Invalid for ServicePlacementPolicyType. */ + public static final ServicePlacementPolicyType INVALID = fromString("Invalid"); + + /** Static value InvalidDomain for ServicePlacementPolicyType. */ + public static final ServicePlacementPolicyType INVALID_DOMAIN = fromString("InvalidDomain"); + + /** Static value RequiredDomain for ServicePlacementPolicyType. */ + public static final ServicePlacementPolicyType REQUIRED_DOMAIN = fromString("RequiredDomain"); + + /** Static value PreferredPrimaryDomain for ServicePlacementPolicyType. */ + public static final ServicePlacementPolicyType PREFERRED_PRIMARY_DOMAIN = fromString("PreferredPrimaryDomain"); + + /** Static value RequiredDomainDistribution for ServicePlacementPolicyType. */ + public static final ServicePlacementPolicyType REQUIRED_DOMAIN_DISTRIBUTION = fromString("RequiredDomainDistribution"); + + /** Static value NonPartiallyPlaceService for ServicePlacementPolicyType. */ + public static final ServicePlacementPolicyType NON_PARTIALLY_PLACE_SERVICE = fromString("NonPartiallyPlaceService"); + + /** + * Creates or finds a ServicePlacementPolicyType from its string representation. + * @param name a name to look for + * @return the corresponding ServicePlacementPolicyType + */ + @JsonCreator + public static ServicePlacementPolicyType fromString(String name) { + return fromString(name, ServicePlacementPolicyType.class); + } + + /** + * @return known ServicePlacementPolicyType values + */ + public static Collection values() { + return values(ServicePlacementPolicyType.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicePlacementPreferPrimaryDomainPolicyDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicePlacementPreferPrimaryDomainPolicyDescription.java new file mode 100644 index 0000000000000..013c41b30d4c2 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicePlacementPreferPrimaryDomainPolicyDescription.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the policy to be used for placement of a Service Fabric service + * where the service's Primary replicas should optimally be placed in a + * particular domain. + * + * This placement policy is usually used with fault domains in scenarios where + * the Service Fabric cluster is geographically distributed in order to + * indicate that a service�s primary replica should be located in a particular + * fault domain, which in geo-distributed scenarios usually aligns with + * regional or datacenter boundaries. Note that since this is an optimization + * it is possible that the Primary replica may not end up located in this + * domain due to failures, capacity limits, or other constraints. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Type") +@JsonTypeName("PreferredPrimaryDomain") +public class ServicePlacementPreferPrimaryDomainPolicyDescription extends ServicePlacementPolicyDescription { + /** + * The name of the domain that should used for placement as per this + * policy. + */ + @JsonProperty(value = "DomainName") + private String domainName; + + /** + * Get the name of the domain that should used for placement as per this policy. + * + * @return the domainName value + */ + public String domainName() { + return this.domainName; + } + + /** + * Set the name of the domain that should used for placement as per this policy. + * + * @param domainName the domainName value to set + * @return the ServicePlacementPreferPrimaryDomainPolicyDescription object itself. + */ + public ServicePlacementPreferPrimaryDomainPolicyDescription withDomainName(String domainName) { + this.domainName = domainName; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicePlacementRequireDomainDistributionPolicyDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicePlacementRequireDomainDistributionPolicyDescription.java new file mode 100644 index 0000000000000..4cc9d6154aacb --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicePlacementRequireDomainDistributionPolicyDescription.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the policy to be used for placement of a Service Fabric service + * where two replicas from the same partition should never be placed in the + * same fault or upgrade domain. + * + * While this is not common it can expose the service to an increased risk of + * concurrent failures due to unplanned outages or other cases of + * subsequent/concurrent failures. As an example, consider a case where + * replicas are deployed across different data center, with one replica per + * location. In the event that one of the datacenters goes offline, normally + * the replica that was placed in that datacenter will be packed into one of + * the remaining datacenters. If this is not desirable then this policy should + * be set. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Type") +@JsonTypeName("RequiredDomainDistribution") +public class ServicePlacementRequireDomainDistributionPolicyDescription extends ServicePlacementPolicyDescription { + /** + * The name of the domain that should used for placement as per this + * policy. + */ + @JsonProperty(value = "DomainName") + private String domainName; + + /** + * Get the name of the domain that should used for placement as per this policy. + * + * @return the domainName value + */ + public String domainName() { + return this.domainName; + } + + /** + * Set the name of the domain that should used for placement as per this policy. + * + * @param domainName the domainName value to set + * @return the ServicePlacementRequireDomainDistributionPolicyDescription object itself. + */ + public ServicePlacementRequireDomainDistributionPolicyDescription withDomainName(String domainName) { + this.domainName = domainName; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicePlacementRequiredDomainPolicyDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicePlacementRequiredDomainPolicyDescription.java new file mode 100644 index 0000000000000..98ddb044542f3 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicePlacementRequiredDomainPolicyDescription.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the policy to be used for placement of a Service Fabric service + * where the instances or replicas of that service must be placed in a + * particular domain. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Type") +@JsonTypeName("RequiredDomain") +public class ServicePlacementRequiredDomainPolicyDescription extends ServicePlacementPolicyDescription { + /** + * The name of the domain that should used for placement as per this + * policy. + */ + @JsonProperty(value = "DomainName") + private String domainName; + + /** + * Get the name of the domain that should used for placement as per this policy. + * + * @return the domainName value + */ + public String domainName() { + return this.domainName; + } + + /** + * Set the name of the domain that should used for placement as per this policy. + * + * @param domainName the domainName value to set + * @return the ServicePlacementRequiredDomainPolicyDescription object itself. + */ + public ServicePlacementRequiredDomainPolicyDescription withDomainName(String domainName) { + this.domainName = domainName; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceReplicaProperties.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceReplicaProperties.java new file mode 100644 index 0000000000000..51cfdcf394199 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceReplicaProperties.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the properties of a service replica. + */ +public class ServiceReplicaProperties { + /** + * The Operating system type required by the code in service. + * . Possible values include: 'Linux', 'Windows'. + */ + @JsonProperty(value = "osType", required = true) + private OperatingSystemTypes osType; + + /** + * 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.). + */ + @JsonProperty(value = "codePackages", required = true) + private List codePackages; + + /** + * The names of the private networks that this service needs to be part of. + */ + @JsonProperty(value = "networkRefs") + private List networkRefs; + + /** + * Reference to sinks in DiagnosticsDescription. + */ + @JsonProperty(value = "diagnostics") + private DiagnosticsRef diagnostics; + + /** + * Get the Operating system type required by the code in service. + . Possible values include: 'Linux', 'Windows'. + * + * @return the osType value + */ + public OperatingSystemTypes osType() { + return this.osType; + } + + /** + * Set the Operating system type required by the code in service. + . Possible values include: 'Linux', 'Windows'. + * + * @param osType the osType value to set + * @return the ServiceReplicaProperties object itself. + */ + public ServiceReplicaProperties withOsType(OperatingSystemTypes osType) { + this.osType = osType; + return this; + } + + /** + * Get 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.). + * + * @return the codePackages value + */ + public List codePackages() { + return this.codePackages; + } + + /** + * Set 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.). + * + * @param codePackages the codePackages value to set + * @return the ServiceReplicaProperties object itself. + */ + public ServiceReplicaProperties withCodePackages(List codePackages) { + this.codePackages = codePackages; + return this; + } + + /** + * Get the names of the private networks that this service needs to be part of. + * + * @return the networkRefs value + */ + public List networkRefs() { + return this.networkRefs; + } + + /** + * Set the names of the private networks that this service needs to be part of. + * + * @param networkRefs the networkRefs value to set + * @return the ServiceReplicaProperties object itself. + */ + public ServiceReplicaProperties withNetworkRefs(List networkRefs) { + this.networkRefs = networkRefs; + return this; + } + + /** + * Get reference to sinks in DiagnosticsDescription. + * + * @return the diagnostics value + */ + public DiagnosticsRef diagnostics() { + return this.diagnostics; + } + + /** + * Set reference to sinks in DiagnosticsDescription. + * + * @param diagnostics the diagnostics value to set + * @return the ServiceReplicaProperties object itself. + */ + public ServiceReplicaProperties withDiagnostics(DiagnosticsRef diagnostics) { + this.diagnostics = diagnostics; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceResourceStatus.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceResourceStatus.java new file mode 100644 index 0000000000000..fe7aaa4b87dc2 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceResourceStatus.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ServiceResourceStatus. + */ +public final class ServiceResourceStatus extends ExpandableStringEnum { + /** Static value Unknown for ServiceResourceStatus. */ + public static final ServiceResourceStatus UNKNOWN = fromString("Unknown"); + + /** Static value Active for ServiceResourceStatus. */ + public static final ServiceResourceStatus ACTIVE = fromString("Active"); + + /** Static value Upgrading for ServiceResourceStatus. */ + public static final ServiceResourceStatus UPGRADING = fromString("Upgrading"); + + /** Static value Deleting for ServiceResourceStatus. */ + public static final ServiceResourceStatus DELETING = fromString("Deleting"); + + /** Static value Creating for ServiceResourceStatus. */ + public static final ServiceResourceStatus CREATING = fromString("Creating"); + + /** Static value Failed for ServiceResourceStatus. */ + public static final ServiceResourceStatus FAILED = fromString("Failed"); + + /** + * Creates or finds a ServiceResourceStatus from its string representation. + * @param name a name to look for + * @return the corresponding ServiceResourceStatus + */ + @JsonCreator + public static ServiceResourceStatus fromString(String name) { + return fromString(name, ServiceResourceStatus.class); + } + + /** + * @return known ServiceResourceStatus values + */ + public static Collection values() { + return values(ServiceResourceStatus.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceStatus.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceStatus.java new file mode 100644 index 0000000000000..1d590fd69f84a --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceStatus.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ServiceStatus. + */ +public final class ServiceStatus extends ExpandableStringEnum { + /** Static value Unknown for ServiceStatus. */ + public static final ServiceStatus UNKNOWN = fromString("Unknown"); + + /** Static value Active for ServiceStatus. */ + public static final ServiceStatus ACTIVE = fromString("Active"); + + /** Static value Upgrading for ServiceStatus. */ + public static final ServiceStatus UPGRADING = fromString("Upgrading"); + + /** Static value Deleting for ServiceStatus. */ + public static final ServiceStatus DELETING = fromString("Deleting"); + + /** Static value Creating for ServiceStatus. */ + public static final ServiceStatus CREATING = fromString("Creating"); + + /** Static value Failed for ServiceStatus. */ + public static final ServiceStatus FAILED = fromString("Failed"); + + /** + * Creates or finds a ServiceStatus from its string representation. + * @param name a name to look for + * @return the corresponding ServiceStatus + */ + @JsonCreator + public static ServiceStatus fromString(String name) { + return fromString(name, ServiceStatus.class); + } + + /** + * @return known ServiceStatus values + */ + public static Collection values() { + return values(ServiceStatus.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceTypeDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceTypeDescription.java new file mode 100644 index 0000000000000..19d24b2f93e47 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceTypeDescription.java @@ -0,0 +1,188 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Describes a service type defined in the service manifest of a provisioned + * application type. The properties the ones defined in the service manifest. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ServiceTypeDescription") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Stateful", value = StatefulServiceTypeDescription.class), + @JsonSubTypes.Type(name = "Stateless", value = StatelessServiceTypeDescription.class) +}) +public class ServiceTypeDescription { + /** + * Indicates whether the service type is a stateful service type or a + * stateless service type. This property is true if the service type is a + * stateful service type, false otherwise. + */ + @JsonProperty(value = "IsStateful") + private Boolean isStateful; + + /** + * Name of the service type as specified in the service manifest. + */ + @JsonProperty(value = "ServiceTypeName") + private String serviceTypeName; + + /** + * The placement constraint to be used when instantiating this service in a + * Service Fabric cluster. + */ + @JsonProperty(value = "PlacementConstraints") + private String placementConstraints; + + /** + * The service load metrics is given as an array of + * ServiceLoadMetricDescription objects. + */ + @JsonProperty(value = "LoadMetrics") + private List loadMetrics; + + /** + * List of service placement policy descriptions. + */ + @JsonProperty(value = "ServicePlacementPolicies") + private List servicePlacementPolicies; + + /** + * List of service type extensions. + */ + @JsonProperty(value = "Extensions") + private List extensions; + + /** + * Get indicates whether the service type is a stateful service type or a stateless service type. This property is true if the service type is a stateful service type, false otherwise. + * + * @return the isStateful value + */ + public Boolean isStateful() { + return this.isStateful; + } + + /** + * Set indicates whether the service type is a stateful service type or a stateless service type. This property is true if the service type is a stateful service type, false otherwise. + * + * @param isStateful the isStateful value to set + * @return the ServiceTypeDescription object itself. + */ + public ServiceTypeDescription withIsStateful(Boolean isStateful) { + this.isStateful = isStateful; + return this; + } + + /** + * Get name of the service type as specified in the service manifest. + * + * @return the serviceTypeName value + */ + public String serviceTypeName() { + return this.serviceTypeName; + } + + /** + * Set name of the service type as specified in the service manifest. + * + * @param serviceTypeName the serviceTypeName value to set + * @return the ServiceTypeDescription object itself. + */ + public ServiceTypeDescription withServiceTypeName(String serviceTypeName) { + this.serviceTypeName = serviceTypeName; + return this; + } + + /** + * Get the placement constraint to be used when instantiating this service in a Service Fabric cluster. + * + * @return the placementConstraints value + */ + public String placementConstraints() { + return this.placementConstraints; + } + + /** + * Set the placement constraint to be used when instantiating this service in a Service Fabric cluster. + * + * @param placementConstraints the placementConstraints value to set + * @return the ServiceTypeDescription object itself. + */ + public ServiceTypeDescription withPlacementConstraints(String placementConstraints) { + this.placementConstraints = placementConstraints; + return this; + } + + /** + * Get the service load metrics is given as an array of ServiceLoadMetricDescription objects. + * + * @return the loadMetrics value + */ + public List loadMetrics() { + return this.loadMetrics; + } + + /** + * Set the service load metrics is given as an array of ServiceLoadMetricDescription objects. + * + * @param loadMetrics the loadMetrics value to set + * @return the ServiceTypeDescription object itself. + */ + public ServiceTypeDescription withLoadMetrics(List loadMetrics) { + this.loadMetrics = loadMetrics; + return this; + } + + /** + * Get list of service placement policy descriptions. + * + * @return the servicePlacementPolicies value + */ + public List servicePlacementPolicies() { + return this.servicePlacementPolicies; + } + + /** + * Set list of service placement policy descriptions. + * + * @param servicePlacementPolicies the servicePlacementPolicies value to set + * @return the ServiceTypeDescription object itself. + */ + public ServiceTypeDescription withServicePlacementPolicies(List servicePlacementPolicies) { + this.servicePlacementPolicies = servicePlacementPolicies; + return this; + } + + /** + * Get list of service type extensions. + * + * @return the extensions value + */ + public List extensions() { + return this.extensions; + } + + /** + * Set list of service type extensions. + * + * @param extensions the extensions value to set + * @return the ServiceTypeDescription object itself. + */ + public ServiceTypeDescription withExtensions(List extensions) { + this.extensions = extensions; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceTypeExtensionDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceTypeExtensionDescription.java new file mode 100644 index 0000000000000..f6e9117e91a26 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceTypeExtensionDescription.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes extension of a service type defined in the service manifest. + */ +public class ServiceTypeExtensionDescription { + /** + * The name of the extension. + */ + @JsonProperty(value = "Key") + private String key; + + /** + * The extension value. + */ + @JsonProperty(value = "Value") + private String value; + + /** + * Get the name of the extension. + * + * @return the key value + */ + public String key() { + return this.key; + } + + /** + * Set the name of the extension. + * + * @param key the key value to set + * @return the ServiceTypeExtensionDescription object itself. + */ + public ServiceTypeExtensionDescription withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the extension value. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the extension value. + * + * @param value the value value to set + * @return the ServiceTypeExtensionDescription object itself. + */ + public ServiceTypeExtensionDescription withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceTypeHealthPolicy.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceTypeHealthPolicy.java new file mode 100644 index 0000000000000..c8c0f1978d254 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceTypeHealthPolicy.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents the health policy used to evaluate the health of services + * belonging to a service type. + */ +public class ServiceTypeHealthPolicy { + /** + * 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. + */ + @JsonProperty(value = "MaxPercentUnhealthyPartitionsPerService") + private Integer maxPercentUnhealthyPartitionsPerService; + + /** + * 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. + */ + @JsonProperty(value = "MaxPercentUnhealthyReplicasPerPartition") + private Integer maxPercentUnhealthyReplicasPerPartition; + + /** + * The maximum maximum allowed percentage of unhealthy services. Allowed + * values are Byte values from zero to 100. + * + * The percentage represents the maximum tolerated percentage of services + * that can be unhealthy before the application is considered in error. + * If the percentage is respected but there is at least one unhealthy + * service, the health is evaluated as Warning. + * This is calculated by dividing the number of unhealthy services of the + * specific service type over the total number of services of the specific + * service type. + * The computation rounds up to tolerate one failure on small numbers of + * services. Default percentage is zero. + */ + @JsonProperty(value = "MaxPercentUnhealthyServices") + private Integer maxPercentUnhealthyServices; + + /** + * Get 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. + * + * @return the maxPercentUnhealthyPartitionsPerService value + */ + public Integer maxPercentUnhealthyPartitionsPerService() { + return this.maxPercentUnhealthyPartitionsPerService; + } + + /** + * Set 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 maxPercentUnhealthyPartitionsPerService the maxPercentUnhealthyPartitionsPerService value to set + * @return the ServiceTypeHealthPolicy object itself. + */ + public ServiceTypeHealthPolicy withMaxPercentUnhealthyPartitionsPerService(Integer maxPercentUnhealthyPartitionsPerService) { + this.maxPercentUnhealthyPartitionsPerService = maxPercentUnhealthyPartitionsPerService; + return this; + } + + /** + * Get 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. + * + * @return the maxPercentUnhealthyReplicasPerPartition value + */ + public Integer maxPercentUnhealthyReplicasPerPartition() { + return this.maxPercentUnhealthyReplicasPerPartition; + } + + /** + * Set 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 maxPercentUnhealthyReplicasPerPartition the maxPercentUnhealthyReplicasPerPartition value to set + * @return the ServiceTypeHealthPolicy object itself. + */ + public ServiceTypeHealthPolicy withMaxPercentUnhealthyReplicasPerPartition(Integer maxPercentUnhealthyReplicasPerPartition) { + this.maxPercentUnhealthyReplicasPerPartition = maxPercentUnhealthyReplicasPerPartition; + return this; + } + + /** + * Get the maximum maximum allowed percentage of unhealthy services. Allowed values are Byte values from zero to 100. + The percentage represents the maximum tolerated percentage of services that can be unhealthy before the application is considered in error. + If the percentage is respected but there is at least one unhealthy service, the health is evaluated as Warning. + This is calculated by dividing the number of unhealthy services of the specific service type over the total number of services of the specific service type. + The computation rounds up to tolerate one failure on small numbers of services. Default percentage is zero. + * + * @return the maxPercentUnhealthyServices value + */ + public Integer maxPercentUnhealthyServices() { + return this.maxPercentUnhealthyServices; + } + + /** + * Set the maximum maximum allowed percentage of unhealthy services. Allowed values are Byte values from zero to 100. + The percentage represents the maximum tolerated percentage of services that can be unhealthy before the application is considered in error. + If the percentage is respected but there is at least one unhealthy service, the health is evaluated as Warning. + This is calculated by dividing the number of unhealthy services of the specific service type over the total number of services of the specific service type. + The computation rounds up to tolerate one failure on small numbers of services. Default percentage is zero. + * + * @param maxPercentUnhealthyServices the maxPercentUnhealthyServices value to set + * @return the ServiceTypeHealthPolicy object itself. + */ + public ServiceTypeHealthPolicy withMaxPercentUnhealthyServices(Integer maxPercentUnhealthyServices) { + this.maxPercentUnhealthyServices = maxPercentUnhealthyServices; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceTypeHealthPolicyMapItem.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceTypeHealthPolicyMapItem.java new file mode 100644 index 0000000000000..563974f5e9426 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceTypeHealthPolicyMapItem.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines an item in ServiceTypeHealthPolicyMap. + */ +public class ServiceTypeHealthPolicyMapItem { + /** + * The key of the service type health policy map item. This is the name of + * the service type. + */ + @JsonProperty(value = "Key", required = true) + private String key; + + /** + * The value of the service type health policy map item. This is the + * ServiceTypeHealthPolicy for this service type. + */ + @JsonProperty(value = "Value", required = true) + private ServiceTypeHealthPolicy value; + + /** + * Get the key of the service type health policy map item. This is the name of the service type. + * + * @return the key value + */ + public String key() { + return this.key; + } + + /** + * Set the key of the service type health policy map item. This is the name of the service type. + * + * @param key the key value to set + * @return the ServiceTypeHealthPolicyMapItem object itself. + */ + public ServiceTypeHealthPolicyMapItem withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value of the service type health policy map item. This is the ServiceTypeHealthPolicy for this service type. + * + * @return the value value + */ + public ServiceTypeHealthPolicy value() { + return this.value; + } + + /** + * Set the value of the service type health policy map item. This is the ServiceTypeHealthPolicy for this service type. + * + * @param value the value value to set + * @return the ServiceTypeHealthPolicyMapItem object itself. + */ + public ServiceTypeHealthPolicyMapItem withValue(ServiceTypeHealthPolicy value) { + this.value = value; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceTypeRegistrationStatus.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceTypeRegistrationStatus.java new file mode 100644 index 0000000000000..b700a35158ed4 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceTypeRegistrationStatus.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ServiceTypeRegistrationStatus. + */ +public final class ServiceTypeRegistrationStatus extends ExpandableStringEnum { + /** Static value Invalid for ServiceTypeRegistrationStatus. */ + public static final ServiceTypeRegistrationStatus INVALID = fromString("Invalid"); + + /** Static value Disabled for ServiceTypeRegistrationStatus. */ + public static final ServiceTypeRegistrationStatus DISABLED = fromString("Disabled"); + + /** Static value Enabled for ServiceTypeRegistrationStatus. */ + public static final ServiceTypeRegistrationStatus ENABLED = fromString("Enabled"); + + /** Static value Registered for ServiceTypeRegistrationStatus. */ + public static final ServiceTypeRegistrationStatus REGISTERED = fromString("Registered"); + + /** + * Creates or finds a ServiceTypeRegistrationStatus from its string representation. + * @param name a name to look for + * @return the corresponding ServiceTypeRegistrationStatus + */ + @JsonCreator + public static ServiceTypeRegistrationStatus fromString(String name) { + return fromString(name, ServiceTypeRegistrationStatus.class); + } + + /** + * @return known ServiceTypeRegistrationStatus values + */ + public static Collection values() { + return values(ServiceTypeRegistrationStatus.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceUpdateDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceUpdateDescription.java new file mode 100644 index 0000000000000..39e4c5a8accc7 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceUpdateDescription.java @@ -0,0 +1,275 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * A ServiceUpdateDescription contains all of the information necessary to + * update a service. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ServiceKind") +@JsonTypeName("ServiceUpdateDescription") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Stateful", value = StatefulServiceUpdateDescription.class), + @JsonSubTypes.Type(name = "Stateless", value = StatelessServiceUpdateDescription.class) +}) +public class ServiceUpdateDescription { + /** + * 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. + */ + @JsonProperty(value = "Flags") + private String flags; + + /** + * 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)". + */ + @JsonProperty(value = "PlacementConstraints") + private String placementConstraints; + + /** + * The correlation scheme. + */ + @JsonProperty(value = "CorrelationScheme") + private List correlationScheme; + + /** + * The service load metrics. + */ + @JsonProperty(value = "LoadMetrics") + private List loadMetrics; + + /** + * The service placement policies. + */ + @JsonProperty(value = "ServicePlacementPolicies") + private List servicePlacementPolicies; + + /** + * The move cost for the service. Possible values include: 'Zero', 'Low', + * 'Medium', 'High'. + */ + @JsonProperty(value = "DefaultMoveCost") + private MoveCost defaultMoveCost; + + /** + * Scaling policies for this service. + */ + @JsonProperty(value = "ScalingPolicies") + private List scalingPolicies; + + /** + * Get 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. + * + * @return the flags value + */ + public String flags() { + return this.flags; + } + + /** + * Set 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 flags the flags value to set + * @return the ServiceUpdateDescription object itself. + */ + public ServiceUpdateDescription withFlags(String flags) { + this.flags = flags; + return this; + } + + /** + * Get 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)". + * + * @return the placementConstraints value + */ + public String placementConstraints() { + return this.placementConstraints; + } + + /** + * Set 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 placementConstraints the placementConstraints value to set + * @return the ServiceUpdateDescription object itself. + */ + public ServiceUpdateDescription withPlacementConstraints(String placementConstraints) { + this.placementConstraints = placementConstraints; + return this; + } + + /** + * Get the correlation scheme. + * + * @return the correlationScheme value + */ + public List correlationScheme() { + return this.correlationScheme; + } + + /** + * Set the correlation scheme. + * + * @param correlationScheme the correlationScheme value to set + * @return the ServiceUpdateDescription object itself. + */ + public ServiceUpdateDescription withCorrelationScheme(List correlationScheme) { + this.correlationScheme = correlationScheme; + return this; + } + + /** + * Get the service load metrics. + * + * @return the loadMetrics value + */ + public List loadMetrics() { + return this.loadMetrics; + } + + /** + * Set the service load metrics. + * + * @param loadMetrics the loadMetrics value to set + * @return the ServiceUpdateDescription object itself. + */ + public ServiceUpdateDescription withLoadMetrics(List loadMetrics) { + this.loadMetrics = loadMetrics; + return this; + } + + /** + * Get the service placement policies. + * + * @return the servicePlacementPolicies value + */ + public List servicePlacementPolicies() { + return this.servicePlacementPolicies; + } + + /** + * Set the service placement policies. + * + * @param servicePlacementPolicies the servicePlacementPolicies value to set + * @return the ServiceUpdateDescription object itself. + */ + public ServiceUpdateDescription withServicePlacementPolicies(List servicePlacementPolicies) { + this.servicePlacementPolicies = servicePlacementPolicies; + return this; + } + + /** + * Get the move cost for the service. Possible values include: 'Zero', 'Low', 'Medium', 'High'. + * + * @return the defaultMoveCost value + */ + public MoveCost defaultMoveCost() { + return this.defaultMoveCost; + } + + /** + * Set the move cost for the service. Possible values include: 'Zero', 'Low', 'Medium', 'High'. + * + * @param defaultMoveCost the defaultMoveCost value to set + * @return the ServiceUpdateDescription object itself. + */ + public ServiceUpdateDescription withDefaultMoveCost(MoveCost defaultMoveCost) { + this.defaultMoveCost = defaultMoveCost; + return this; + } + + /** + * Get scaling policies for this service. + * + * @return the scalingPolicies value + */ + public List scalingPolicies() { + return this.scalingPolicies; + } + + /** + * Set scaling policies for this service. + * + * @param scalingPolicies the scalingPolicies value to set + * @return the ServiceUpdateDescription object itself. + */ + public ServiceUpdateDescription withScalingPolicies(List scalingPolicies) { + this.scalingPolicies = scalingPolicies; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicesHealthEvaluation.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicesHealthEvaluation.java new file mode 100644 index 0000000000000..16c4d297a7d8a --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicesHealthEvaluation.java @@ -0,0 +1,134 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents health evaluation for services of a certain service type + * belonging to an application, containing health evaluations for each + * unhealthy service that impacted current aggregated health state. Can be + * returned when evaluating application health and the aggregated health state + * is either Error or Warning. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("Services") +public class ServicesHealthEvaluation extends HealthEvaluation { + /** + * Name of the service type of the services. + */ + @JsonProperty(value = "ServiceTypeName") + private String serviceTypeName; + + /** + * Maximum allowed percentage of unhealthy services from the + * ServiceTypeHealthPolicy. + */ + @JsonProperty(value = "MaxPercentUnhealthyServices") + private Integer maxPercentUnhealthyServices; + + /** + * Total number of services of the current service type in the application + * from the health store. + */ + @JsonProperty(value = "TotalCount") + private Long totalCount; + + /** + * List of unhealthy evaluations that led to the aggregated health state. + * Includes all the unhealthy ServiceHealthEvaluation that impacted the + * aggregated health. + */ + @JsonProperty(value = "UnhealthyEvaluations") + private List unhealthyEvaluations; + + /** + * Get name of the service type of the services. + * + * @return the serviceTypeName value + */ + public String serviceTypeName() { + return this.serviceTypeName; + } + + /** + * Set name of the service type of the services. + * + * @param serviceTypeName the serviceTypeName value to set + * @return the ServicesHealthEvaluation object itself. + */ + public ServicesHealthEvaluation withServiceTypeName(String serviceTypeName) { + this.serviceTypeName = serviceTypeName; + return this; + } + + /** + * Get maximum allowed percentage of unhealthy services from the ServiceTypeHealthPolicy. + * + * @return the maxPercentUnhealthyServices value + */ + public Integer maxPercentUnhealthyServices() { + return this.maxPercentUnhealthyServices; + } + + /** + * Set maximum allowed percentage of unhealthy services from the ServiceTypeHealthPolicy. + * + * @param maxPercentUnhealthyServices the maxPercentUnhealthyServices value to set + * @return the ServicesHealthEvaluation object itself. + */ + public ServicesHealthEvaluation withMaxPercentUnhealthyServices(Integer maxPercentUnhealthyServices) { + this.maxPercentUnhealthyServices = maxPercentUnhealthyServices; + return this; + } + + /** + * Get total number of services of the current service type in the application from the health store. + * + * @return the totalCount value + */ + public Long totalCount() { + return this.totalCount; + } + + /** + * Set total number of services of the current service type in the application from the health store. + * + * @param totalCount the totalCount value to set + * @return the ServicesHealthEvaluation object itself. + */ + public ServicesHealthEvaluation withTotalCount(Long totalCount) { + this.totalCount = totalCount; + return this; + } + + /** + * Get list of unhealthy evaluations that led to the aggregated health state. Includes all the unhealthy ServiceHealthEvaluation that impacted the aggregated health. + * + * @return the unhealthyEvaluations value + */ + public List unhealthyEvaluations() { + return this.unhealthyEvaluations; + } + + /** + * Set list of unhealthy evaluations that led to the aggregated health state. Includes all the unhealthy ServiceHealthEvaluation that impacted the aggregated health. + * + * @param unhealthyEvaluations the unhealthyEvaluations value to set + * @return the ServicesHealthEvaluation object itself. + */ + public ServicesHealthEvaluation withUnhealthyEvaluations(List unhealthyEvaluations) { + this.unhealthyEvaluations = unhealthyEvaluations; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/Setting.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/Setting.java new file mode 100644 index 0000000000000..d97b8ae4336f8 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/Setting.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a setting for the container. + */ +public class Setting { + /** + * The name of the setting. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The value of the setting. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the name of the setting. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the setting. + * + * @param name the name value to set + * @return the Setting object itself. + */ + public Setting withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value of the setting. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the value of the setting. + * + * @param value the value value to set + * @return the Setting object itself. + */ + public Setting withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SingletonPartitionInformation.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SingletonPartitionInformation.java new file mode 100644 index 0000000000000..e81d2fd3711e7 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SingletonPartitionInformation.java @@ -0,0 +1,22 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Information about a partition that is singleton. The services with singleton + * partitioning scheme are effectively non-partitioned. They only have one + * partition. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ServicePartitionKind") +@JsonTypeName("Singleton") +public class SingletonPartitionInformation extends PartitionInformation { +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SingletonPartitionSchemeDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SingletonPartitionSchemeDescription.java new file mode 100644 index 0000000000000..8695bd9113047 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SingletonPartitionSchemeDescription.java @@ -0,0 +1,21 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the partition scheme of a singleton-partitioned, or + * non-partitioned service. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "PartitionScheme") +@JsonTypeName("Singleton") +public class SingletonPartitionSchemeDescription extends PartitionSchemeDescription { +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StartClusterUpgradeDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StartClusterUpgradeDescription.java new file mode 100644 index 0000000000000..82c31e2b49f34 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StartClusterUpgradeDescription.java @@ -0,0 +1,317 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the parameters for starting a cluster upgrade. + */ +public class StartClusterUpgradeDescription { + /** + * The cluster code version. + */ + @JsonProperty(value = "CodeVersion") + private String codeVersion; + + /** + * The cluster configuration version. + */ + @JsonProperty(value = "ConfigVersion") + private String configVersion; + + /** + * The kind of upgrade out of the following possible values. Possible + * values include: 'Invalid', 'Rolling'. + */ + @JsonProperty(value = "UpgradeKind") + private UpgradeKind upgradeKind; + + /** + * The mode used to monitor health during a rolling upgrade. The values are + * UnmonitoredAuto, UnmonitoredManual, and Monitored. Possible values + * include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored'. + */ + @JsonProperty(value = "RollingUpgradeMode") + private UpgradeMode rollingUpgradeMode; + + /** + * 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). + */ + @JsonProperty(value = "UpgradeReplicaSetCheckTimeoutInSeconds") + private Long upgradeReplicaSetCheckTimeoutInSeconds; + + /** + * If true, then processes are forcefully restarted during upgrade even + * when the code version has not changed (the upgrade only changes + * configuration or data). + */ + @JsonProperty(value = "ForceRestart") + private Boolean forceRestart; + + /** + * Describes the parameters for monitoring an upgrade in Monitored mode. + */ + @JsonProperty(value = "MonitoringPolicy") + private MonitoringPolicyDescription monitoringPolicy; + + /** + * Defines a health policy used to evaluate the health of the cluster or of + * a cluster node. + */ + @JsonProperty(value = "ClusterHealthPolicy") + private ClusterHealthPolicy clusterHealthPolicy; + + /** + * When true, enables delta health evaluation rather than absolute health + * evaluation after completion of each upgrade domain. + */ + @JsonProperty(value = "EnableDeltaHealthEvaluation") + private Boolean enableDeltaHealthEvaluation; + + /** + * Defines a health policy used to evaluate the health of the cluster + * during a cluster upgrade. + */ + @JsonProperty(value = "ClusterUpgradeHealthPolicy") + private ClusterUpgradeHealthPolicyObject clusterUpgradeHealthPolicy; + + /** + * Defines the application health policy map used to evaluate the health of + * an application or one of its children entities. + */ + @JsonProperty(value = "ApplicationHealthPolicyMap") + private ApplicationHealthPolicies applicationHealthPolicyMap; + + /** + * Get the cluster code version. + * + * @return the codeVersion value + */ + public String codeVersion() { + return this.codeVersion; + } + + /** + * Set the cluster code version. + * + * @param codeVersion the codeVersion value to set + * @return the StartClusterUpgradeDescription object itself. + */ + public StartClusterUpgradeDescription withCodeVersion(String codeVersion) { + this.codeVersion = codeVersion; + return this; + } + + /** + * Get the cluster configuration version. + * + * @return the configVersion value + */ + public String configVersion() { + return this.configVersion; + } + + /** + * Set the cluster configuration version. + * + * @param configVersion the configVersion value to set + * @return the StartClusterUpgradeDescription object itself. + */ + public StartClusterUpgradeDescription withConfigVersion(String configVersion) { + this.configVersion = configVersion; + return this; + } + + /** + * Get the kind of upgrade out of the following possible values. Possible values include: 'Invalid', 'Rolling'. + * + * @return the upgradeKind value + */ + public UpgradeKind upgradeKind() { + return this.upgradeKind; + } + + /** + * Set the kind of upgrade out of the following possible values. Possible values include: 'Invalid', 'Rolling'. + * + * @param upgradeKind the upgradeKind value to set + * @return the StartClusterUpgradeDescription object itself. + */ + public StartClusterUpgradeDescription withUpgradeKind(UpgradeKind upgradeKind) { + this.upgradeKind = upgradeKind; + return this; + } + + /** + * Get the mode used to monitor health during a rolling upgrade. The values are UnmonitoredAuto, UnmonitoredManual, and Monitored. Possible values include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored'. + * + * @return the rollingUpgradeMode value + */ + public UpgradeMode rollingUpgradeMode() { + return this.rollingUpgradeMode; + } + + /** + * Set 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 rollingUpgradeMode the rollingUpgradeMode value to set + * @return the StartClusterUpgradeDescription object itself. + */ + public StartClusterUpgradeDescription withRollingUpgradeMode(UpgradeMode rollingUpgradeMode) { + this.rollingUpgradeMode = rollingUpgradeMode; + return this; + } + + /** + * Get 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). + * + * @return the upgradeReplicaSetCheckTimeoutInSeconds value + */ + public Long upgradeReplicaSetCheckTimeoutInSeconds() { + return this.upgradeReplicaSetCheckTimeoutInSeconds; + } + + /** + * Set 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 upgradeReplicaSetCheckTimeoutInSeconds the upgradeReplicaSetCheckTimeoutInSeconds value to set + * @return the StartClusterUpgradeDescription object itself. + */ + public StartClusterUpgradeDescription withUpgradeReplicaSetCheckTimeoutInSeconds(Long upgradeReplicaSetCheckTimeoutInSeconds) { + this.upgradeReplicaSetCheckTimeoutInSeconds = upgradeReplicaSetCheckTimeoutInSeconds; + return this; + } + + /** + * Get if true, then processes are forcefully restarted during upgrade even when the code version has not changed (the upgrade only changes configuration or data). + * + * @return the forceRestart value + */ + public Boolean forceRestart() { + return this.forceRestart; + } + + /** + * Set 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 forceRestart the forceRestart value to set + * @return the StartClusterUpgradeDescription object itself. + */ + public StartClusterUpgradeDescription withForceRestart(Boolean forceRestart) { + this.forceRestart = forceRestart; + return this; + } + + /** + * Get describes the parameters for monitoring an upgrade in Monitored mode. + * + * @return the monitoringPolicy value + */ + public MonitoringPolicyDescription monitoringPolicy() { + return this.monitoringPolicy; + } + + /** + * Set describes the parameters for monitoring an upgrade in Monitored mode. + * + * @param monitoringPolicy the monitoringPolicy value to set + * @return the StartClusterUpgradeDescription object itself. + */ + public StartClusterUpgradeDescription withMonitoringPolicy(MonitoringPolicyDescription monitoringPolicy) { + this.monitoringPolicy = monitoringPolicy; + return this; + } + + /** + * Get defines a health policy used to evaluate the health of the cluster or of a cluster node. + * + * @return the clusterHealthPolicy value + */ + public ClusterHealthPolicy clusterHealthPolicy() { + return this.clusterHealthPolicy; + } + + /** + * Set defines a health policy used to evaluate the health of the cluster or of a cluster node. + * + * @param clusterHealthPolicy the clusterHealthPolicy value to set + * @return the StartClusterUpgradeDescription object itself. + */ + public StartClusterUpgradeDescription withClusterHealthPolicy(ClusterHealthPolicy clusterHealthPolicy) { + this.clusterHealthPolicy = clusterHealthPolicy; + return this; + } + + /** + * Get when true, enables delta health evaluation rather than absolute health evaluation after completion of each upgrade domain. + * + * @return the enableDeltaHealthEvaluation value + */ + public Boolean enableDeltaHealthEvaluation() { + return this.enableDeltaHealthEvaluation; + } + + /** + * Set when true, enables delta health evaluation rather than absolute health evaluation after completion of each upgrade domain. + * + * @param enableDeltaHealthEvaluation the enableDeltaHealthEvaluation value to set + * @return the StartClusterUpgradeDescription object itself. + */ + public StartClusterUpgradeDescription withEnableDeltaHealthEvaluation(Boolean enableDeltaHealthEvaluation) { + this.enableDeltaHealthEvaluation = enableDeltaHealthEvaluation; + return this; + } + + /** + * Get defines a health policy used to evaluate the health of the cluster during a cluster upgrade. + * + * @return the clusterUpgradeHealthPolicy value + */ + public ClusterUpgradeHealthPolicyObject clusterUpgradeHealthPolicy() { + return this.clusterUpgradeHealthPolicy; + } + + /** + * Set defines a health policy used to evaluate the health of the cluster during a cluster upgrade. + * + * @param clusterUpgradeHealthPolicy the clusterUpgradeHealthPolicy value to set + * @return the StartClusterUpgradeDescription object itself. + */ + public StartClusterUpgradeDescription withClusterUpgradeHealthPolicy(ClusterUpgradeHealthPolicyObject clusterUpgradeHealthPolicy) { + this.clusterUpgradeHealthPolicy = clusterUpgradeHealthPolicy; + return this; + } + + /** + * Get defines the application health policy map used to evaluate the health of an application or one of its children entities. + * + * @return the applicationHealthPolicyMap value + */ + public ApplicationHealthPolicies applicationHealthPolicyMap() { + return this.applicationHealthPolicyMap; + } + + /** + * Set defines the application health policy map used to evaluate the health of an application or one of its children entities. + * + * @param applicationHealthPolicyMap the applicationHealthPolicyMap value to set + * @return the StartClusterUpgradeDescription object itself. + */ + public StartClusterUpgradeDescription withApplicationHealthPolicyMap(ApplicationHealthPolicies applicationHealthPolicyMap) { + this.applicationHealthPolicyMap = applicationHealthPolicyMap; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StartedChaosEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StartedChaosEvent.java new file mode 100644 index 0000000000000..a7f33b4bd1372 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StartedChaosEvent.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes a Chaos event that gets generated when Chaos is started. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("Started") +public class StartedChaosEvent extends ChaosEvent { + /** + * Defines all the parameters to configure a Chaos run. + */ + @JsonProperty(value = "ChaosParameters") + private ChaosParameters chaosParameters; + + /** + * Get defines all the parameters to configure a Chaos run. + * + * @return the chaosParameters value + */ + public ChaosParameters chaosParameters() { + return this.chaosParameters; + } + + /** + * Set defines all the parameters to configure a Chaos run. + * + * @param chaosParameters the chaosParameters value to set + * @return the StartedChaosEvent object itself. + */ + public StartedChaosEvent withChaosParameters(ChaosParameters chaosParameters) { + this.chaosParameters = chaosParameters; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/State.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/State.java new file mode 100644 index 0000000000000..4d679ef4a3e91 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/State.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for State. + */ +public final class State extends ExpandableStringEnum { + /** Static value Invalid for State. */ + public static final State INVALID = fromString("Invalid"); + + /** Static value Created for State. */ + public static final State CREATED = fromString("Created"); + + /** Static value Claimed for State. */ + public static final State CLAIMED = fromString("Claimed"); + + /** Static value Preparing for State. */ + public static final State PREPARING = fromString("Preparing"); + + /** Static value Approved for State. */ + public static final State APPROVED = fromString("Approved"); + + /** Static value Executing for State. */ + public static final State EXECUTING = fromString("Executing"); + + /** Static value Restoring for State. */ + public static final State RESTORING = fromString("Restoring"); + + /** Static value Completed for State. */ + public static final State COMPLETED = fromString("Completed"); + + /** + * Creates or finds a State from its string representation. + * @param name a name to look for + * @return the corresponding State + */ + @JsonCreator + public static State fromString(String name) { + return fromString(name, State.class); + } + + /** + * @return known State values + */ + public static Collection values() { + return values(State.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulReplicaHealthReportCreatedEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulReplicaHealthReportCreatedEvent.java new file mode 100644 index 0000000000000..faa2b87a47034 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulReplicaHealthReportCreatedEvent.java @@ -0,0 +1,257 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ReplicaEventInner; + +/** + * Stateful Replica Health Report Created event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("StatefulReplicaHealthReportCreated") +public class StatefulReplicaHealthReportCreatedEvent extends ReplicaEventInner { + /** + * Id of Replica instance. + */ + @JsonProperty(value = "ReplicaInstanceId", required = true) + private long replicaInstanceId; + + /** + * Id of report source. + */ + @JsonProperty(value = "SourceId", required = true) + private String sourceId; + + /** + * Describes the property. + */ + @JsonProperty(value = "Property", required = true) + private String property; + + /** + * Describes the property health state. + */ + @JsonProperty(value = "HealthState", required = true) + private String healthState; + + /** + * Time to live in milli-seconds. + */ + @JsonProperty(value = "TimeToLiveMs", required = true) + private long timeToLiveMs; + + /** + * Sequence number of report. + */ + @JsonProperty(value = "SequenceNumber", required = true) + private long sequenceNumber; + + /** + * Description of report. + */ + @JsonProperty(value = "Description", required = true) + private String description; + + /** + * Indicates the removal when it expires. + */ + @JsonProperty(value = "RemoveWhenExpired", required = true) + private boolean removeWhenExpired; + + /** + * Source time. + */ + @JsonProperty(value = "SourceUtcTimestamp", required = true) + private DateTime sourceUtcTimestamp; + + /** + * Get id of Replica instance. + * + * @return the replicaInstanceId value + */ + public long replicaInstanceId() { + return this.replicaInstanceId; + } + + /** + * Set id of Replica instance. + * + * @param replicaInstanceId the replicaInstanceId value to set + * @return the StatefulReplicaHealthReportCreatedEvent object itself. + */ + public StatefulReplicaHealthReportCreatedEvent withReplicaInstanceId(long replicaInstanceId) { + this.replicaInstanceId = replicaInstanceId; + return this; + } + + /** + * Get id of report source. + * + * @return the sourceId value + */ + public String sourceId() { + return this.sourceId; + } + + /** + * Set id of report source. + * + * @param sourceId the sourceId value to set + * @return the StatefulReplicaHealthReportCreatedEvent object itself. + */ + public StatefulReplicaHealthReportCreatedEvent withSourceId(String sourceId) { + this.sourceId = sourceId; + return this; + } + + /** + * Get describes the property. + * + * @return the property value + */ + public String property() { + return this.property; + } + + /** + * Set describes the property. + * + * @param property the property value to set + * @return the StatefulReplicaHealthReportCreatedEvent object itself. + */ + public StatefulReplicaHealthReportCreatedEvent withProperty(String property) { + this.property = property; + return this; + } + + /** + * Get describes the property health state. + * + * @return the healthState value + */ + public String healthState() { + return this.healthState; + } + + /** + * Set describes the property health state. + * + * @param healthState the healthState value to set + * @return the StatefulReplicaHealthReportCreatedEvent object itself. + */ + public StatefulReplicaHealthReportCreatedEvent withHealthState(String healthState) { + this.healthState = healthState; + return this; + } + + /** + * Get time to live in milli-seconds. + * + * @return the timeToLiveMs value + */ + public long timeToLiveMs() { + return this.timeToLiveMs; + } + + /** + * Set time to live in milli-seconds. + * + * @param timeToLiveMs the timeToLiveMs value to set + * @return the StatefulReplicaHealthReportCreatedEvent object itself. + */ + public StatefulReplicaHealthReportCreatedEvent withTimeToLiveMs(long timeToLiveMs) { + this.timeToLiveMs = timeToLiveMs; + return this; + } + + /** + * Get sequence number of report. + * + * @return the sequenceNumber value + */ + public long sequenceNumber() { + return this.sequenceNumber; + } + + /** + * Set sequence number of report. + * + * @param sequenceNumber the sequenceNumber value to set + * @return the StatefulReplicaHealthReportCreatedEvent object itself. + */ + public StatefulReplicaHealthReportCreatedEvent withSequenceNumber(long sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get description of report. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of report. + * + * @param description the description value to set + * @return the StatefulReplicaHealthReportCreatedEvent object itself. + */ + public StatefulReplicaHealthReportCreatedEvent withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get indicates the removal when it expires. + * + * @return the removeWhenExpired value + */ + public boolean removeWhenExpired() { + return this.removeWhenExpired; + } + + /** + * Set indicates the removal when it expires. + * + * @param removeWhenExpired the removeWhenExpired value to set + * @return the StatefulReplicaHealthReportCreatedEvent object itself. + */ + public StatefulReplicaHealthReportCreatedEvent withRemoveWhenExpired(boolean removeWhenExpired) { + this.removeWhenExpired = removeWhenExpired; + return this; + } + + /** + * Get source time. + * + * @return the sourceUtcTimestamp value + */ + public DateTime sourceUtcTimestamp() { + return this.sourceUtcTimestamp; + } + + /** + * Set source time. + * + * @param sourceUtcTimestamp the sourceUtcTimestamp value to set + * @return the StatefulReplicaHealthReportCreatedEvent object itself. + */ + public StatefulReplicaHealthReportCreatedEvent withSourceUtcTimestamp(DateTime sourceUtcTimestamp) { + this.sourceUtcTimestamp = sourceUtcTimestamp; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulReplicaHealthReportExpiredEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulReplicaHealthReportExpiredEvent.java new file mode 100644 index 0000000000000..2fe19ee36155e --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulReplicaHealthReportExpiredEvent.java @@ -0,0 +1,257 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ReplicaEventInner; + +/** + * Stateful Replica Health Report Expired event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("StatefulReplicaHealthReportExpired") +public class StatefulReplicaHealthReportExpiredEvent extends ReplicaEventInner { + /** + * Id of Replica instance. + */ + @JsonProperty(value = "ReplicaInstanceId", required = true) + private long replicaInstanceId; + + /** + * Id of report source. + */ + @JsonProperty(value = "SourceId", required = true) + private String sourceId; + + /** + * Describes the property. + */ + @JsonProperty(value = "Property", required = true) + private String property; + + /** + * Describes the property health state. + */ + @JsonProperty(value = "HealthState", required = true) + private String healthState; + + /** + * Time to live in milli-seconds. + */ + @JsonProperty(value = "TimeToLiveMs", required = true) + private long timeToLiveMs; + + /** + * Sequence number of report. + */ + @JsonProperty(value = "SequenceNumber", required = true) + private long sequenceNumber; + + /** + * Description of report. + */ + @JsonProperty(value = "Description", required = true) + private String description; + + /** + * Indicates the removal when it expires. + */ + @JsonProperty(value = "RemoveWhenExpired", required = true) + private boolean removeWhenExpired; + + /** + * Source time. + */ + @JsonProperty(value = "SourceUtcTimestamp", required = true) + private DateTime sourceUtcTimestamp; + + /** + * Get id of Replica instance. + * + * @return the replicaInstanceId value + */ + public long replicaInstanceId() { + return this.replicaInstanceId; + } + + /** + * Set id of Replica instance. + * + * @param replicaInstanceId the replicaInstanceId value to set + * @return the StatefulReplicaHealthReportExpiredEvent object itself. + */ + public StatefulReplicaHealthReportExpiredEvent withReplicaInstanceId(long replicaInstanceId) { + this.replicaInstanceId = replicaInstanceId; + return this; + } + + /** + * Get id of report source. + * + * @return the sourceId value + */ + public String sourceId() { + return this.sourceId; + } + + /** + * Set id of report source. + * + * @param sourceId the sourceId value to set + * @return the StatefulReplicaHealthReportExpiredEvent object itself. + */ + public StatefulReplicaHealthReportExpiredEvent withSourceId(String sourceId) { + this.sourceId = sourceId; + return this; + } + + /** + * Get describes the property. + * + * @return the property value + */ + public String property() { + return this.property; + } + + /** + * Set describes the property. + * + * @param property the property value to set + * @return the StatefulReplicaHealthReportExpiredEvent object itself. + */ + public StatefulReplicaHealthReportExpiredEvent withProperty(String property) { + this.property = property; + return this; + } + + /** + * Get describes the property health state. + * + * @return the healthState value + */ + public String healthState() { + return this.healthState; + } + + /** + * Set describes the property health state. + * + * @param healthState the healthState value to set + * @return the StatefulReplicaHealthReportExpiredEvent object itself. + */ + public StatefulReplicaHealthReportExpiredEvent withHealthState(String healthState) { + this.healthState = healthState; + return this; + } + + /** + * Get time to live in milli-seconds. + * + * @return the timeToLiveMs value + */ + public long timeToLiveMs() { + return this.timeToLiveMs; + } + + /** + * Set time to live in milli-seconds. + * + * @param timeToLiveMs the timeToLiveMs value to set + * @return the StatefulReplicaHealthReportExpiredEvent object itself. + */ + public StatefulReplicaHealthReportExpiredEvent withTimeToLiveMs(long timeToLiveMs) { + this.timeToLiveMs = timeToLiveMs; + return this; + } + + /** + * Get sequence number of report. + * + * @return the sequenceNumber value + */ + public long sequenceNumber() { + return this.sequenceNumber; + } + + /** + * Set sequence number of report. + * + * @param sequenceNumber the sequenceNumber value to set + * @return the StatefulReplicaHealthReportExpiredEvent object itself. + */ + public StatefulReplicaHealthReportExpiredEvent withSequenceNumber(long sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get description of report. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of report. + * + * @param description the description value to set + * @return the StatefulReplicaHealthReportExpiredEvent object itself. + */ + public StatefulReplicaHealthReportExpiredEvent withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get indicates the removal when it expires. + * + * @return the removeWhenExpired value + */ + public boolean removeWhenExpired() { + return this.removeWhenExpired; + } + + /** + * Set indicates the removal when it expires. + * + * @param removeWhenExpired the removeWhenExpired value to set + * @return the StatefulReplicaHealthReportExpiredEvent object itself. + */ + public StatefulReplicaHealthReportExpiredEvent withRemoveWhenExpired(boolean removeWhenExpired) { + this.removeWhenExpired = removeWhenExpired; + return this; + } + + /** + * Get source time. + * + * @return the sourceUtcTimestamp value + */ + public DateTime sourceUtcTimestamp() { + return this.sourceUtcTimestamp; + } + + /** + * Set source time. + * + * @param sourceUtcTimestamp the sourceUtcTimestamp value to set + * @return the StatefulReplicaHealthReportExpiredEvent object itself. + */ + public StatefulReplicaHealthReportExpiredEvent withSourceUtcTimestamp(DateTime sourceUtcTimestamp) { + this.sourceUtcTimestamp = sourceUtcTimestamp; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulServiceDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulServiceDescription.java new file mode 100644 index 0000000000000..0950461f43d81 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulServiceDescription.java @@ -0,0 +1,236 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ServiceDescriptionInner; + +/** + * Describes a stateful service. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ServiceKind") +@JsonTypeName("Stateful") +public class StatefulServiceDescription extends ServiceDescriptionInner { + /** + * The target replica set size as a number. + */ + @JsonProperty(value = "TargetReplicaSetSize", required = true) + private int targetReplicaSetSize; + + /** + * The minimum replica set size as a number. + */ + @JsonProperty(value = "MinReplicaSetSize", required = true) + private int minReplicaSetSize; + + /** + * 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. + */ + @JsonProperty(value = "HasPersistedState", required = true) + private boolean hasPersistedState; + + /** + * 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. + */ + @JsonProperty(value = "Flags") + private Integer flags; + + /** + * The duration, in seconds, between when a replica goes down and when a + * new replica is created. + */ + @JsonProperty(value = "ReplicaRestartWaitDurationSeconds") + private Long replicaRestartWaitDurationSeconds; + + /** + * The maximum duration, in seconds, for which a partition is allowed to be + * in a state of quorum loss. + */ + @JsonProperty(value = "QuorumLossWaitDurationSeconds") + private Long quorumLossWaitDurationSeconds; + + /** + * The definition on how long StandBy replicas should be maintained before + * being removed. + */ + @JsonProperty(value = "StandByReplicaKeepDurationSeconds") + private Long standByReplicaKeepDurationSeconds; + + /** + * Get the target replica set size as a number. + * + * @return the targetReplicaSetSize value + */ + public int targetReplicaSetSize() { + return this.targetReplicaSetSize; + } + + /** + * Set the target replica set size as a number. + * + * @param targetReplicaSetSize the targetReplicaSetSize value to set + * @return the StatefulServiceDescription object itself. + */ + public StatefulServiceDescription withTargetReplicaSetSize(int targetReplicaSetSize) { + this.targetReplicaSetSize = targetReplicaSetSize; + return this; + } + + /** + * Get the minimum replica set size as a number. + * + * @return the minReplicaSetSize value + */ + public int minReplicaSetSize() { + return this.minReplicaSetSize; + } + + /** + * Set the minimum replica set size as a number. + * + * @param minReplicaSetSize the minReplicaSetSize value to set + * @return the StatefulServiceDescription object itself. + */ + public StatefulServiceDescription withMinReplicaSetSize(int minReplicaSetSize) { + this.minReplicaSetSize = minReplicaSetSize; + return this; + } + + /** + * Get 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. + * + * @return the hasPersistedState value + */ + public boolean hasPersistedState() { + return this.hasPersistedState; + } + + /** + * Set 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. + * + * @param hasPersistedState the hasPersistedState value to set + * @return the StatefulServiceDescription object itself. + */ + public StatefulServiceDescription withHasPersistedState(boolean hasPersistedState) { + this.hasPersistedState = hasPersistedState; + return this; + } + + /** + * Get 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. + * + * @return the flags value + */ + public Integer flags() { + return this.flags; + } + + /** + * Set 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. + * + * @param flags the flags value to set + * @return the StatefulServiceDescription object itself. + */ + public StatefulServiceDescription withFlags(Integer flags) { + this.flags = flags; + return this; + } + + /** + * Get the duration, in seconds, between when a replica goes down and when a new replica is created. + * + * @return the replicaRestartWaitDurationSeconds value + */ + public Long replicaRestartWaitDurationSeconds() { + return this.replicaRestartWaitDurationSeconds; + } + + /** + * Set the duration, in seconds, between when a replica goes down and when a new replica is created. + * + * @param replicaRestartWaitDurationSeconds the replicaRestartWaitDurationSeconds value to set + * @return the StatefulServiceDescription object itself. + */ + public StatefulServiceDescription withReplicaRestartWaitDurationSeconds(Long replicaRestartWaitDurationSeconds) { + this.replicaRestartWaitDurationSeconds = replicaRestartWaitDurationSeconds; + return this; + } + + /** + * Get the maximum duration, in seconds, for which a partition is allowed to be in a state of quorum loss. + * + * @return the quorumLossWaitDurationSeconds value + */ + public Long quorumLossWaitDurationSeconds() { + return this.quorumLossWaitDurationSeconds; + } + + /** + * Set the maximum duration, in seconds, for which a partition is allowed to be in a state of quorum loss. + * + * @param quorumLossWaitDurationSeconds the quorumLossWaitDurationSeconds value to set + * @return the StatefulServiceDescription object itself. + */ + public StatefulServiceDescription withQuorumLossWaitDurationSeconds(Long quorumLossWaitDurationSeconds) { + this.quorumLossWaitDurationSeconds = quorumLossWaitDurationSeconds; + return this; + } + + /** + * Get the definition on how long StandBy replicas should be maintained before being removed. + * + * @return the standByReplicaKeepDurationSeconds value + */ + public Long standByReplicaKeepDurationSeconds() { + return this.standByReplicaKeepDurationSeconds; + } + + /** + * Set the definition on how long StandBy replicas should be maintained before being removed. + * + * @param standByReplicaKeepDurationSeconds the standByReplicaKeepDurationSeconds value to set + * @return the StatefulServiceDescription object itself. + */ + public StatefulServiceDescription withStandByReplicaKeepDurationSeconds(Long standByReplicaKeepDurationSeconds) { + this.standByReplicaKeepDurationSeconds = standByReplicaKeepDurationSeconds; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulServiceInfo.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulServiceInfo.java new file mode 100644 index 0000000000000..8be08af67e4e6 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulServiceInfo.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ServiceInfoInner; + +/** + * Information about a stateful Service Fabric service. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ServiceKind") +@JsonTypeName("Stateful") +public class StatefulServiceInfo extends ServiceInfoInner { + /** + * Whether the service has persisted state. + */ + @JsonProperty(value = "HasPersistedState") + private Boolean hasPersistedState; + + /** + * Get whether the service has persisted state. + * + * @return the hasPersistedState value + */ + public Boolean hasPersistedState() { + return this.hasPersistedState; + } + + /** + * Set whether the service has persisted state. + * + * @param hasPersistedState the hasPersistedState value to set + * @return the StatefulServiceInfo object itself. + */ + public StatefulServiceInfo withHasPersistedState(Boolean hasPersistedState) { + this.hasPersistedState = hasPersistedState; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulServicePartitionInfo.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulServicePartitionInfo.java new file mode 100644 index 0000000000000..07821770f3efc --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulServicePartitionInfo.java @@ -0,0 +1,134 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.Period; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ServicePartitionInfoInner; + +/** + * Information about a partition of a stateful Service Fabric service.. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ServiceKind") +@JsonTypeName("Stateful") +public class StatefulServicePartitionInfo extends ServicePartitionInfoInner { + /** + * The target replica set size as a number. + */ + @JsonProperty(value = "TargetReplicaSetSize") + private Long targetReplicaSetSize; + + /** + * The minimum replica set size as a number. + */ + @JsonProperty(value = "MinReplicaSetSize") + private Long minReplicaSetSize; + + /** + * The duration for which 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. + */ + @JsonProperty(value = "LastQuorumLossDuration") + private Period lastQuorumLossDuration; + + /** + * 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. + */ + @JsonProperty(value = "CurrentConfigurationEpoch") + private Epoch currentConfigurationEpoch; + + /** + * Get the target replica set size as a number. + * + * @return the targetReplicaSetSize value + */ + public Long targetReplicaSetSize() { + return this.targetReplicaSetSize; + } + + /** + * Set the target replica set size as a number. + * + * @param targetReplicaSetSize the targetReplicaSetSize value to set + * @return the StatefulServicePartitionInfo object itself. + */ + public StatefulServicePartitionInfo withTargetReplicaSetSize(Long targetReplicaSetSize) { + this.targetReplicaSetSize = targetReplicaSetSize; + return this; + } + + /** + * Get the minimum replica set size as a number. + * + * @return the minReplicaSetSize value + */ + public Long minReplicaSetSize() { + return this.minReplicaSetSize; + } + + /** + * Set the minimum replica set size as a number. + * + * @param minReplicaSetSize the minReplicaSetSize value to set + * @return the StatefulServicePartitionInfo object itself. + */ + public StatefulServicePartitionInfo withMinReplicaSetSize(Long minReplicaSetSize) { + this.minReplicaSetSize = minReplicaSetSize; + return this; + } + + /** + * Get the duration for which 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. + * + * @return the lastQuorumLossDuration value + */ + public Period lastQuorumLossDuration() { + return this.lastQuorumLossDuration; + } + + /** + * Set the duration for which 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. + * + * @param lastQuorumLossDuration the lastQuorumLossDuration value to set + * @return the StatefulServicePartitionInfo object itself. + */ + public StatefulServicePartitionInfo withLastQuorumLossDuration(Period lastQuorumLossDuration) { + this.lastQuorumLossDuration = lastQuorumLossDuration; + return this; + } + + /** + * Get 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. + * + * @return the currentConfigurationEpoch value + */ + public Epoch currentConfigurationEpoch() { + return this.currentConfigurationEpoch; + } + + /** + * Set 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. + * + * @param currentConfigurationEpoch the currentConfigurationEpoch value to set + * @return the StatefulServicePartitionInfo object itself. + */ + public StatefulServicePartitionInfo withCurrentConfigurationEpoch(Epoch currentConfigurationEpoch) { + this.currentConfigurationEpoch = currentConfigurationEpoch; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulServiceReplicaHealth.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulServiceReplicaHealth.java new file mode 100644 index 0000000000000..ae36d3e8e375c --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulServiceReplicaHealth.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ReplicaHealthInner; + +/** + * Represents the health of the stateful service replica. + * Contains the replica aggregated health state, the health events and the + * unhealthy evaluations. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ServiceKind") +@JsonTypeName("Stateful") +public class StatefulServiceReplicaHealth extends ReplicaHealthInner { + /** + * 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. + */ + @JsonProperty(value = "ReplicaId") + private String replicaId; + + /** + * Get 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. + * + * @return the replicaId value + */ + public String replicaId() { + return this.replicaId; + } + + /** + * Set 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. + * + * @param replicaId the replicaId value to set + * @return the StatefulServiceReplicaHealth object itself. + */ + public StatefulServiceReplicaHealth withReplicaId(String replicaId) { + this.replicaId = replicaId; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulServiceReplicaHealthState.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulServiceReplicaHealthState.java new file mode 100644 index 0000000000000..cd2438d46f5dd --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulServiceReplicaHealthState.java @@ -0,0 +1,54 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents the health state of the stateful service replica, which contains + * the replica ID and the aggregated health state. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ServiceKind") +@JsonTypeName("Stateful") +public class StatefulServiceReplicaHealthState extends ReplicaHealthState { + /** + * 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. + */ + @JsonProperty(value = "ReplicaId") + private String replicaId; + + /** + * Get 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. + * + * @return the replicaId value + */ + public String replicaId() { + return this.replicaId; + } + + /** + * Set 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. + * + * @param replicaId the replicaId value to set + * @return the StatefulServiceReplicaHealthState object itself. + */ + public StatefulServiceReplicaHealthState withReplicaId(String replicaId) { + this.replicaId = replicaId; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulServiceReplicaInfo.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulServiceReplicaInfo.java new file mode 100644 index 0000000000000..77465caacd31d --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulServiceReplicaInfo.java @@ -0,0 +1,83 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ReplicaInfoInner; + +/** + * Represents a stateful service replica. This includes information about the + * identity, role, status, health, node name, uptime, and other details about + * the replica. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ServiceKind") +@JsonTypeName("Stateful") +public class StatefulServiceReplicaInfo extends ReplicaInfoInner { + /** + * The role of a replica of a stateful service. Possible values include: + * 'Unknown', 'None', 'Primary', 'IdleSecondary', 'ActiveSecondary'. + */ + @JsonProperty(value = "ReplicaRole") + private ReplicaRole replicaRole; + + /** + * 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. + */ + @JsonProperty(value = "ReplicaId") + private String replicaId; + + /** + * Get the role of a replica of a stateful service. Possible values include: 'Unknown', 'None', 'Primary', 'IdleSecondary', 'ActiveSecondary'. + * + * @return the replicaRole value + */ + public ReplicaRole replicaRole() { + return this.replicaRole; + } + + /** + * Set the role of a replica of a stateful service. Possible values include: 'Unknown', 'None', 'Primary', 'IdleSecondary', 'ActiveSecondary'. + * + * @param replicaRole the replicaRole value to set + * @return the StatefulServiceReplicaInfo object itself. + */ + public StatefulServiceReplicaInfo withReplicaRole(ReplicaRole replicaRole) { + this.replicaRole = replicaRole; + return this; + } + + /** + * Get 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. + * + * @return the replicaId value + */ + public String replicaId() { + return this.replicaId; + } + + /** + * Set 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. + * + * @param replicaId the replicaId value to set + * @return the StatefulServiceReplicaInfo object itself. + */ + public StatefulServiceReplicaInfo withReplicaId(String replicaId) { + this.replicaId = replicaId; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulServiceTypeDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulServiceTypeDescription.java new file mode 100644 index 0000000000000..b5a998e3774c9 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulServiceTypeDescription.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes a stateful service type defined in the service manifest of a + * provisioned application type. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("Stateful") +public class StatefulServiceTypeDescription extends ServiceTypeDescription { + /** + * 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. + */ + @JsonProperty(value = "HasPersistedState") + private Boolean hasPersistedState; + + /** + * Get 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. + * + * @return the hasPersistedState value + */ + public Boolean hasPersistedState() { + return this.hasPersistedState; + } + + /** + * Set 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. + * + * @param hasPersistedState the hasPersistedState value to set + * @return the StatefulServiceTypeDescription object itself. + */ + public StatefulServiceTypeDescription withHasPersistedState(Boolean hasPersistedState) { + this.hasPersistedState = hasPersistedState; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulServiceUpdateDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulServiceUpdateDescription.java new file mode 100644 index 0000000000000..ff43c4d3167ad --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulServiceUpdateDescription.java @@ -0,0 +1,154 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes an update for a stateful service. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ServiceKind") +@JsonTypeName("Stateful") +public class StatefulServiceUpdateDescription extends ServiceUpdateDescription { + /** + * The target replica set size as a number. + */ + @JsonProperty(value = "TargetReplicaSetSize") + private Integer targetReplicaSetSize; + + /** + * The minimum replica set size as a number. + */ + @JsonProperty(value = "MinReplicaSetSize") + private Integer minReplicaSetSize; + + /** + * The duration, in seconds, between when a replica goes down and when a + * new replica is created. + */ + @JsonProperty(value = "ReplicaRestartWaitDurationSeconds") + private String replicaRestartWaitDurationSeconds; + + /** + * The maximum duration, in seconds, for which a partition is allowed to be + * in a state of quorum loss. + */ + @JsonProperty(value = "QuorumLossWaitDurationSeconds") + private String quorumLossWaitDurationSeconds; + + /** + * The definition on how long StandBy replicas should be maintained before + * being removed. + */ + @JsonProperty(value = "StandByReplicaKeepDurationSeconds") + private String standByReplicaKeepDurationSeconds; + + /** + * Get the target replica set size as a number. + * + * @return the targetReplicaSetSize value + */ + public Integer targetReplicaSetSize() { + return this.targetReplicaSetSize; + } + + /** + * Set the target replica set size as a number. + * + * @param targetReplicaSetSize the targetReplicaSetSize value to set + * @return the StatefulServiceUpdateDescription object itself. + */ + public StatefulServiceUpdateDescription withTargetReplicaSetSize(Integer targetReplicaSetSize) { + this.targetReplicaSetSize = targetReplicaSetSize; + return this; + } + + /** + * Get the minimum replica set size as a number. + * + * @return the minReplicaSetSize value + */ + public Integer minReplicaSetSize() { + return this.minReplicaSetSize; + } + + /** + * Set the minimum replica set size as a number. + * + * @param minReplicaSetSize the minReplicaSetSize value to set + * @return the StatefulServiceUpdateDescription object itself. + */ + public StatefulServiceUpdateDescription withMinReplicaSetSize(Integer minReplicaSetSize) { + this.minReplicaSetSize = minReplicaSetSize; + return this; + } + + /** + * Get the duration, in seconds, between when a replica goes down and when a new replica is created. + * + * @return the replicaRestartWaitDurationSeconds value + */ + public String replicaRestartWaitDurationSeconds() { + return this.replicaRestartWaitDurationSeconds; + } + + /** + * Set the duration, in seconds, between when a replica goes down and when a new replica is created. + * + * @param replicaRestartWaitDurationSeconds the replicaRestartWaitDurationSeconds value to set + * @return the StatefulServiceUpdateDescription object itself. + */ + public StatefulServiceUpdateDescription withReplicaRestartWaitDurationSeconds(String replicaRestartWaitDurationSeconds) { + this.replicaRestartWaitDurationSeconds = replicaRestartWaitDurationSeconds; + return this; + } + + /** + * Get the maximum duration, in seconds, for which a partition is allowed to be in a state of quorum loss. + * + * @return the quorumLossWaitDurationSeconds value + */ + public String quorumLossWaitDurationSeconds() { + return this.quorumLossWaitDurationSeconds; + } + + /** + * Set the maximum duration, in seconds, for which a partition is allowed to be in a state of quorum loss. + * + * @param quorumLossWaitDurationSeconds the quorumLossWaitDurationSeconds value to set + * @return the StatefulServiceUpdateDescription object itself. + */ + public StatefulServiceUpdateDescription withQuorumLossWaitDurationSeconds(String quorumLossWaitDurationSeconds) { + this.quorumLossWaitDurationSeconds = quorumLossWaitDurationSeconds; + return this; + } + + /** + * Get the definition on how long StandBy replicas should be maintained before being removed. + * + * @return the standByReplicaKeepDurationSeconds value + */ + public String standByReplicaKeepDurationSeconds() { + return this.standByReplicaKeepDurationSeconds; + } + + /** + * Set the definition on how long StandBy replicas should be maintained before being removed. + * + * @param standByReplicaKeepDurationSeconds the standByReplicaKeepDurationSeconds value to set + * @return the StatefulServiceUpdateDescription object itself. + */ + public StatefulServiceUpdateDescription withStandByReplicaKeepDurationSeconds(String standByReplicaKeepDurationSeconds) { + this.standByReplicaKeepDurationSeconds = standByReplicaKeepDurationSeconds; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatelessReplicaHealthReportCreatedEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatelessReplicaHealthReportCreatedEvent.java new file mode 100644 index 0000000000000..a35b8095f2ecf --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatelessReplicaHealthReportCreatedEvent.java @@ -0,0 +1,231 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ReplicaEventInner; + +/** + * Stateless Replica Health Report Created event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("StatelessReplicaHealthReportCreated") +public class StatelessReplicaHealthReportCreatedEvent extends ReplicaEventInner { + /** + * Id of report source. + */ + @JsonProperty(value = "SourceId", required = true) + private String sourceId; + + /** + * Describes the property. + */ + @JsonProperty(value = "Property", required = true) + private String property; + + /** + * Describes the property health state. + */ + @JsonProperty(value = "HealthState", required = true) + private String healthState; + + /** + * Time to live in milli-seconds. + */ + @JsonProperty(value = "TimeToLiveMs", required = true) + private long timeToLiveMs; + + /** + * Sequence number of report. + */ + @JsonProperty(value = "SequenceNumber", required = true) + private long sequenceNumber; + + /** + * Description of report. + */ + @JsonProperty(value = "Description", required = true) + private String description; + + /** + * Indicates the removal when it expires. + */ + @JsonProperty(value = "RemoveWhenExpired", required = true) + private boolean removeWhenExpired; + + /** + * Source time. + */ + @JsonProperty(value = "SourceUtcTimestamp", required = true) + private DateTime sourceUtcTimestamp; + + /** + * Get id of report source. + * + * @return the sourceId value + */ + public String sourceId() { + return this.sourceId; + } + + /** + * Set id of report source. + * + * @param sourceId the sourceId value to set + * @return the StatelessReplicaHealthReportCreatedEvent object itself. + */ + public StatelessReplicaHealthReportCreatedEvent withSourceId(String sourceId) { + this.sourceId = sourceId; + return this; + } + + /** + * Get describes the property. + * + * @return the property value + */ + public String property() { + return this.property; + } + + /** + * Set describes the property. + * + * @param property the property value to set + * @return the StatelessReplicaHealthReportCreatedEvent object itself. + */ + public StatelessReplicaHealthReportCreatedEvent withProperty(String property) { + this.property = property; + return this; + } + + /** + * Get describes the property health state. + * + * @return the healthState value + */ + public String healthState() { + return this.healthState; + } + + /** + * Set describes the property health state. + * + * @param healthState the healthState value to set + * @return the StatelessReplicaHealthReportCreatedEvent object itself. + */ + public StatelessReplicaHealthReportCreatedEvent withHealthState(String healthState) { + this.healthState = healthState; + return this; + } + + /** + * Get time to live in milli-seconds. + * + * @return the timeToLiveMs value + */ + public long timeToLiveMs() { + return this.timeToLiveMs; + } + + /** + * Set time to live in milli-seconds. + * + * @param timeToLiveMs the timeToLiveMs value to set + * @return the StatelessReplicaHealthReportCreatedEvent object itself. + */ + public StatelessReplicaHealthReportCreatedEvent withTimeToLiveMs(long timeToLiveMs) { + this.timeToLiveMs = timeToLiveMs; + return this; + } + + /** + * Get sequence number of report. + * + * @return the sequenceNumber value + */ + public long sequenceNumber() { + return this.sequenceNumber; + } + + /** + * Set sequence number of report. + * + * @param sequenceNumber the sequenceNumber value to set + * @return the StatelessReplicaHealthReportCreatedEvent object itself. + */ + public StatelessReplicaHealthReportCreatedEvent withSequenceNumber(long sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get description of report. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of report. + * + * @param description the description value to set + * @return the StatelessReplicaHealthReportCreatedEvent object itself. + */ + public StatelessReplicaHealthReportCreatedEvent withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get indicates the removal when it expires. + * + * @return the removeWhenExpired value + */ + public boolean removeWhenExpired() { + return this.removeWhenExpired; + } + + /** + * Set indicates the removal when it expires. + * + * @param removeWhenExpired the removeWhenExpired value to set + * @return the StatelessReplicaHealthReportCreatedEvent object itself. + */ + public StatelessReplicaHealthReportCreatedEvent withRemoveWhenExpired(boolean removeWhenExpired) { + this.removeWhenExpired = removeWhenExpired; + return this; + } + + /** + * Get source time. + * + * @return the sourceUtcTimestamp value + */ + public DateTime sourceUtcTimestamp() { + return this.sourceUtcTimestamp; + } + + /** + * Set source time. + * + * @param sourceUtcTimestamp the sourceUtcTimestamp value to set + * @return the StatelessReplicaHealthReportCreatedEvent object itself. + */ + public StatelessReplicaHealthReportCreatedEvent withSourceUtcTimestamp(DateTime sourceUtcTimestamp) { + this.sourceUtcTimestamp = sourceUtcTimestamp; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatelessReplicaHealthReportExpiredEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatelessReplicaHealthReportExpiredEvent.java new file mode 100644 index 0000000000000..eae1f1b68cc91 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatelessReplicaHealthReportExpiredEvent.java @@ -0,0 +1,231 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ReplicaEventInner; + +/** + * Stateless Replica Health Report Expired event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("StatelessReplicaHealthReportExpired") +public class StatelessReplicaHealthReportExpiredEvent extends ReplicaEventInner { + /** + * Id of report source. + */ + @JsonProperty(value = "SourceId", required = true) + private String sourceId; + + /** + * Describes the property. + */ + @JsonProperty(value = "Property", required = true) + private String property; + + /** + * Describes the property health state. + */ + @JsonProperty(value = "HealthState", required = true) + private String healthState; + + /** + * Time to live in milli-seconds. + */ + @JsonProperty(value = "TimeToLiveMs", required = true) + private long timeToLiveMs; + + /** + * Sequence number of report. + */ + @JsonProperty(value = "SequenceNumber", required = true) + private long sequenceNumber; + + /** + * Description of report. + */ + @JsonProperty(value = "Description", required = true) + private String description; + + /** + * Indicates the removal when it expires. + */ + @JsonProperty(value = "RemoveWhenExpired", required = true) + private boolean removeWhenExpired; + + /** + * Source time. + */ + @JsonProperty(value = "SourceUtcTimestamp", required = true) + private DateTime sourceUtcTimestamp; + + /** + * Get id of report source. + * + * @return the sourceId value + */ + public String sourceId() { + return this.sourceId; + } + + /** + * Set id of report source. + * + * @param sourceId the sourceId value to set + * @return the StatelessReplicaHealthReportExpiredEvent object itself. + */ + public StatelessReplicaHealthReportExpiredEvent withSourceId(String sourceId) { + this.sourceId = sourceId; + return this; + } + + /** + * Get describes the property. + * + * @return the property value + */ + public String property() { + return this.property; + } + + /** + * Set describes the property. + * + * @param property the property value to set + * @return the StatelessReplicaHealthReportExpiredEvent object itself. + */ + public StatelessReplicaHealthReportExpiredEvent withProperty(String property) { + this.property = property; + return this; + } + + /** + * Get describes the property health state. + * + * @return the healthState value + */ + public String healthState() { + return this.healthState; + } + + /** + * Set describes the property health state. + * + * @param healthState the healthState value to set + * @return the StatelessReplicaHealthReportExpiredEvent object itself. + */ + public StatelessReplicaHealthReportExpiredEvent withHealthState(String healthState) { + this.healthState = healthState; + return this; + } + + /** + * Get time to live in milli-seconds. + * + * @return the timeToLiveMs value + */ + public long timeToLiveMs() { + return this.timeToLiveMs; + } + + /** + * Set time to live in milli-seconds. + * + * @param timeToLiveMs the timeToLiveMs value to set + * @return the StatelessReplicaHealthReportExpiredEvent object itself. + */ + public StatelessReplicaHealthReportExpiredEvent withTimeToLiveMs(long timeToLiveMs) { + this.timeToLiveMs = timeToLiveMs; + return this; + } + + /** + * Get sequence number of report. + * + * @return the sequenceNumber value + */ + public long sequenceNumber() { + return this.sequenceNumber; + } + + /** + * Set sequence number of report. + * + * @param sequenceNumber the sequenceNumber value to set + * @return the StatelessReplicaHealthReportExpiredEvent object itself. + */ + public StatelessReplicaHealthReportExpiredEvent withSequenceNumber(long sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get description of report. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of report. + * + * @param description the description value to set + * @return the StatelessReplicaHealthReportExpiredEvent object itself. + */ + public StatelessReplicaHealthReportExpiredEvent withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get indicates the removal when it expires. + * + * @return the removeWhenExpired value + */ + public boolean removeWhenExpired() { + return this.removeWhenExpired; + } + + /** + * Set indicates the removal when it expires. + * + * @param removeWhenExpired the removeWhenExpired value to set + * @return the StatelessReplicaHealthReportExpiredEvent object itself. + */ + public StatelessReplicaHealthReportExpiredEvent withRemoveWhenExpired(boolean removeWhenExpired) { + this.removeWhenExpired = removeWhenExpired; + return this; + } + + /** + * Get source time. + * + * @return the sourceUtcTimestamp value + */ + public DateTime sourceUtcTimestamp() { + return this.sourceUtcTimestamp; + } + + /** + * Set source time. + * + * @param sourceUtcTimestamp the sourceUtcTimestamp value to set + * @return the StatelessReplicaHealthReportExpiredEvent object itself. + */ + public StatelessReplicaHealthReportExpiredEvent withSourceUtcTimestamp(DateTime sourceUtcTimestamp) { + this.sourceUtcTimestamp = sourceUtcTimestamp; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatelessServiceDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatelessServiceDescription.java new file mode 100644 index 0000000000000..b64c1770157c9 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatelessServiceDescription.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ServiceDescriptionInner; + +/** + * Describes a stateless service. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ServiceKind") +@JsonTypeName("Stateless") +public class StatelessServiceDescription extends ServiceDescriptionInner { + /** + * The instance count. + */ + @JsonProperty(value = "InstanceCount", required = true) + private int instanceCount; + + /** + * Get the instance count. + * + * @return the instanceCount value + */ + public int instanceCount() { + return this.instanceCount; + } + + /** + * Set the instance count. + * + * @param instanceCount the instanceCount value to set + * @return the StatelessServiceDescription object itself. + */ + public StatelessServiceDescription withInstanceCount(int instanceCount) { + this.instanceCount = instanceCount; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatelessServiceInfo.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatelessServiceInfo.java new file mode 100644 index 0000000000000..757a89f64b891 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatelessServiceInfo.java @@ -0,0 +1,21 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ServiceInfoInner; + +/** + * Information about a stateless Service Fabric service. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ServiceKind") +@JsonTypeName("Stateless") +public class StatelessServiceInfo extends ServiceInfoInner { +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatelessServiceInstanceHealth.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatelessServiceInstanceHealth.java new file mode 100644 index 0000000000000..e6b962aa80f7f --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatelessServiceInstanceHealth.java @@ -0,0 +1,54 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ReplicaHealthInner; + +/** + * Represents the health of the stateless service instance. + * Contains the instance aggregated health state, the health events and the + * unhealthy evaluations. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ServiceKind") +@JsonTypeName("Stateless") +public class StatelessServiceInstanceHealth extends ReplicaHealthInner { + /** + * 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. + */ + @JsonProperty(value = "InstanceId") + private String instanceId; + + /** + * Get 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. + * + * @return the instanceId value + */ + public String instanceId() { + return this.instanceId; + } + + /** + * Set 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. + * + * @param instanceId the instanceId value to set + * @return the StatelessServiceInstanceHealth object itself. + */ + public StatelessServiceInstanceHealth withInstanceId(String instanceId) { + this.instanceId = instanceId; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatelessServiceInstanceHealthState.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatelessServiceInstanceHealthState.java new file mode 100644 index 0000000000000..58ec93c54af43 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatelessServiceInstanceHealthState.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents the health state of the stateless service instance, which + * contains the instance ID and the aggregated health state. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ServiceKind") +@JsonTypeName("Stateless") +public class StatelessServiceInstanceHealthState extends ReplicaHealthState { + /** + * Id of the stateless service instance on the wire this field is called + * ReplicaId. + */ + @JsonProperty(value = "ReplicaId") + private String replicaId; + + /** + * Get id of the stateless service instance on the wire this field is called ReplicaId. + * + * @return the replicaId value + */ + public String replicaId() { + return this.replicaId; + } + + /** + * Set id of the stateless service instance on the wire this field is called ReplicaId. + * + * @param replicaId the replicaId value to set + * @return the StatelessServiceInstanceHealthState object itself. + */ + public StatelessServiceInstanceHealthState withReplicaId(String replicaId) { + this.replicaId = replicaId; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatelessServiceInstanceInfo.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatelessServiceInstanceInfo.java new file mode 100644 index 0000000000000..589f9bd319236 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatelessServiceInstanceInfo.java @@ -0,0 +1,54 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ReplicaInfoInner; + +/** + * Represents a stateless service instance. This includes information about the + * identity, status, health, node name, uptime, and other details about the + * instance. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ServiceKind") +@JsonTypeName("Stateless") +public class StatelessServiceInstanceInfo extends ReplicaInfoInner { + /** + * 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. + */ + @JsonProperty(value = "InstanceId") + private String instanceId; + + /** + * Get 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. + * + * @return the instanceId value + */ + public String instanceId() { + return this.instanceId; + } + + /** + * Set 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. + * + * @param instanceId the instanceId value to set + * @return the StatelessServiceInstanceInfo object itself. + */ + public StatelessServiceInstanceInfo withInstanceId(String instanceId) { + this.instanceId = instanceId; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatelessServicePartitionInfo.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatelessServicePartitionInfo.java new file mode 100644 index 0000000000000..e649aee57ea0a --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatelessServicePartitionInfo.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ServicePartitionInfoInner; + +/** + * Information about a partition of a stateless Service Fabric service. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ServiceKind") +@JsonTypeName("Stateless") +public class StatelessServicePartitionInfo extends ServicePartitionInfoInner { + /** + * Number of instances of this partition. + */ + @JsonProperty(value = "InstanceCount") + private Long instanceCount; + + /** + * Get number of instances of this partition. + * + * @return the instanceCount value + */ + public Long instanceCount() { + return this.instanceCount; + } + + /** + * Set number of instances of this partition. + * + * @param instanceCount the instanceCount value to set + * @return the StatelessServicePartitionInfo object itself. + */ + public StatelessServicePartitionInfo withInstanceCount(Long instanceCount) { + this.instanceCount = instanceCount; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatelessServiceTypeDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatelessServiceTypeDescription.java new file mode 100644 index 0000000000000..572f907da18e7 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatelessServiceTypeDescription.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes a stateless service type defined in the service manifest of a + * provisioned application type. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("Stateless") +public class StatelessServiceTypeDescription extends ServiceTypeDescription { + /** + * A flag indicating if this type is not implemented and hosted by a user + * service process, but is implicitly hosted by a system created process. + * This value is true for services using the guest executable services, + * false otherwise. + */ + @JsonProperty(value = "UseImplicitHost") + private Boolean useImplicitHost; + + /** + * Get a flag indicating if this type is not implemented and hosted by a user service process, but is implicitly hosted by a system created process. This value is true for services using the guest executable services, false otherwise. + * + * @return the useImplicitHost value + */ + public Boolean useImplicitHost() { + return this.useImplicitHost; + } + + /** + * Set a flag indicating if this type is not implemented and hosted by a user service process, but is implicitly hosted by a system created process. This value is true for services using the guest executable services, false otherwise. + * + * @param useImplicitHost the useImplicitHost value to set + * @return the StatelessServiceTypeDescription object itself. + */ + public StatelessServiceTypeDescription withUseImplicitHost(Boolean useImplicitHost) { + this.useImplicitHost = useImplicitHost; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatelessServiceUpdateDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatelessServiceUpdateDescription.java new file mode 100644 index 0000000000000..a99e837ae75fb --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatelessServiceUpdateDescription.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes an update for a stateless service. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ServiceKind") +@JsonTypeName("Stateless") +public class StatelessServiceUpdateDescription extends ServiceUpdateDescription { + /** + * The instance count. + */ + @JsonProperty(value = "InstanceCount") + private Integer instanceCount; + + /** + * Get the instance count. + * + * @return the instanceCount value + */ + public Integer instanceCount() { + return this.instanceCount; + } + + /** + * Set the instance count. + * + * @param instanceCount the instanceCount value to set + * @return the StatelessServiceUpdateDescription object itself. + */ + public StatelessServiceUpdateDescription withInstanceCount(Integer instanceCount) { + this.instanceCount = instanceCount; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StoppedChaosEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StoppedChaosEvent.java new file mode 100644 index 0000000000000..51d6cc24ba7b5 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StoppedChaosEvent.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes a Chaos event that gets generated when Chaos stops because either + * the user issued a stop or the time to run was up. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("Stopped") +public class StoppedChaosEvent extends ChaosEvent { + /** + * Describes why Chaos stopped. Chaos can stop because of StopChaos API + * call or the timeToRun provided in ChaosParameters is over. + */ + @JsonProperty(value = "Reason") + private String reason; + + /** + * Get describes why Chaos stopped. Chaos can stop because of StopChaos API call or the timeToRun provided in ChaosParameters is over. + * + * @return the reason value + */ + public String reason() { + return this.reason; + } + + /** + * Set describes why Chaos stopped. Chaos can stop because of StopChaos API call or the timeToRun provided in ChaosParameters is over. + * + * @param reason the reason value to set + * @return the StoppedChaosEvent object itself. + */ + public StoppedChaosEvent withReason(String reason) { + this.reason = reason; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StringPropertyValue.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StringPropertyValue.java new file mode 100644 index 0000000000000..216dfef0aa435 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StringPropertyValue.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes a Service Fabric property value of type String. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("String") +public class StringPropertyValue extends PropertyValue { + /** + * The data of the property value. + */ + @JsonProperty(value = "Data", required = true) + private String data; + + /** + * Get the data of the property value. + * + * @return the data value + */ + public String data() { + return this.data; + } + + /** + * Set the data of the property value. + * + * @param data the data value to set + * @return the StringPropertyValue object itself. + */ + public StringPropertyValue withData(String data) { + this.data = data; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SystemApplicationHealthEvaluation.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SystemApplicationHealthEvaluation.java new file mode 100644 index 0000000000000..50ccb36a11348 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SystemApplicationHealthEvaluation.java @@ -0,0 +1,54 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents health evaluation for the fabric:/System application, 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 of the cluster is either Error or Warning. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("SystemApplication") +public class SystemApplicationHealthEvaluation extends HealthEvaluation { + /** + * List of unhealthy evaluations that led to the current aggregated health + * state of the system application. The types of the unhealthy evaluations + * can be DeployedApplicationsHealthEvaluation, ServicesHealthEvaluation or + * EventHealthEvaluation. + */ + @JsonProperty(value = "UnhealthyEvaluations") + private List unhealthyEvaluations; + + /** + * Get list of unhealthy evaluations that led to the current aggregated health state of the system application. The types of the unhealthy evaluations can be DeployedApplicationsHealthEvaluation, ServicesHealthEvaluation or EventHealthEvaluation. + * + * @return the unhealthyEvaluations value + */ + public List unhealthyEvaluations() { + return this.unhealthyEvaluations; + } + + /** + * Set list of unhealthy evaluations that led to the current aggregated health state of the system application. The types of the unhealthy evaluations can be DeployedApplicationsHealthEvaluation, ServicesHealthEvaluation or EventHealthEvaluation. + * + * @param unhealthyEvaluations the unhealthyEvaluations value to set + * @return the SystemApplicationHealthEvaluation object itself. + */ + public SystemApplicationHealthEvaluation withUnhealthyEvaluations(List unhealthyEvaluations) { + this.unhealthyEvaluations = unhealthyEvaluations; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/TestErrorChaosEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/TestErrorChaosEvent.java new file mode 100644 index 0000000000000..87066b271fa39 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/TestErrorChaosEvent.java @@ -0,0 +1,54 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes a Chaos event that gets generated when an unexpected event occurs + * in the Chaos engine. + * For example, due to the cluster snapshot being inconsistent, while faulting + * an entity, Chaos found that the entity was already faulted -- which would be + * an unexpected event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("TestError") +public class TestErrorChaosEvent extends ChaosEvent { + /** + * Describes why TestErrorChaosEvent was generated. For example, Chaos + * tries to fault a partition but finds that the partition is no longer + * fault tolerant, then a TestErrorEvent gets generated with the reason + * stating that the partition is not fault tolerant. + */ + @JsonProperty(value = "Reason") + private String reason; + + /** + * Get describes why TestErrorChaosEvent was generated. For example, Chaos tries to fault a partition but finds that the partition is no longer fault tolerant, then a TestErrorEvent gets generated with the reason stating that the partition is not fault tolerant. + * + * @return the reason value + */ + public String reason() { + return this.reason; + } + + /** + * Set describes why TestErrorChaosEvent was generated. For example, Chaos tries to fault a partition but finds that the partition is no longer fault tolerant, then a TestErrorEvent gets generated with the reason stating that the partition is not fault tolerant. + * + * @param reason the reason value to set + * @return the TestErrorChaosEvent object itself. + */ + public TestErrorChaosEvent withReason(String reason) { + this.reason = reason; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/TimeBasedBackupScheduleDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/TimeBasedBackupScheduleDescription.java new file mode 100644 index 0000000000000..1c878bf15ea40 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/TimeBasedBackupScheduleDescription.java @@ -0,0 +1,108 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the time based backup schedule. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ScheduleKind") +@JsonTypeName("TimeBased") +public class TimeBasedBackupScheduleDescription extends BackupScheduleDescription { + /** + * Describes the frequency with which to run the time based backup + * schedule. + * . Possible values include: 'Invalid', 'Daily', 'Weekly'. + */ + @JsonProperty(value = "ScheduleFrequencyType", required = true) + private BackupScheduleFrequencyType scheduleFrequencyType; + + /** + * List of days of a week when to trigger the periodic backup. This is + * valid only when the backup schedule frequency type is weekly. + */ + @JsonProperty(value = "RunDays") + private List runDays; + + /** + * 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. + */ + @JsonProperty(value = "RunTimes", required = true) + private List runTimes; + + /** + * Get describes the frequency with which to run the time based backup schedule. + . Possible values include: 'Invalid', 'Daily', 'Weekly'. + * + * @return the scheduleFrequencyType value + */ + public BackupScheduleFrequencyType scheduleFrequencyType() { + return this.scheduleFrequencyType; + } + + /** + * Set describes the frequency with which to run the time based backup schedule. + . Possible values include: 'Invalid', 'Daily', 'Weekly'. + * + * @param scheduleFrequencyType the scheduleFrequencyType value to set + * @return the TimeBasedBackupScheduleDescription object itself. + */ + public TimeBasedBackupScheduleDescription withScheduleFrequencyType(BackupScheduleFrequencyType scheduleFrequencyType) { + this.scheduleFrequencyType = scheduleFrequencyType; + return this; + } + + /** + * Get list of days of a week when to trigger the periodic backup. This is valid only when the backup schedule frequency type is weekly. + * + * @return the runDays value + */ + public List runDays() { + return this.runDays; + } + + /** + * Set list of days of a week when to trigger the periodic backup. This is valid only when the backup schedule frequency type is weekly. + * + * @param runDays the runDays value to set + * @return the TimeBasedBackupScheduleDescription object itself. + */ + public TimeBasedBackupScheduleDescription withRunDays(List runDays) { + this.runDays = runDays; + return this; + } + + /** + * Get 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. + * + * @return the runTimes value + */ + public List runTimes() { + return this.runTimes; + } + + /** + * Set 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. + * + * @param runTimes the runTimes value to set + * @return the TimeBasedBackupScheduleDescription object itself. + */ + public TimeBasedBackupScheduleDescription withRunTimes(List runTimes) { + this.runTimes = runTimes; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/TimeOfDay.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/TimeOfDay.java new file mode 100644 index 0000000000000..c551e48757c66 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/TimeOfDay.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines an hour and minute of the day specified in 24 hour time. + */ +public class TimeOfDay { + /** + * Represents the hour of the day. Value must be between 0 and 23 + * inclusive. + */ + @JsonProperty(value = "Hour") + private Integer hour; + + /** + * Represents the minute of the hour. Value must be between 0 to 59 + * inclusive. + */ + @JsonProperty(value = "Minute") + private Integer minute; + + /** + * Get represents the hour of the day. Value must be between 0 and 23 inclusive. + * + * @return the hour value + */ + public Integer hour() { + return this.hour; + } + + /** + * Set represents the hour of the day. Value must be between 0 and 23 inclusive. + * + * @param hour the hour value to set + * @return the TimeOfDay object itself. + */ + public TimeOfDay withHour(Integer hour) { + this.hour = hour; + return this; + } + + /** + * Get represents the minute of the hour. Value must be between 0 to 59 inclusive. + * + * @return the minute value + */ + public Integer minute() { + return this.minute; + } + + /** + * Set represents the minute of the hour. Value must be between 0 to 59 inclusive. + * + * @param minute the minute value to set + * @return the TimeOfDay object itself. + */ + public TimeOfDay withMinute(Integer minute) { + this.minute = minute; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/TimeRange.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/TimeRange.java new file mode 100644 index 0000000000000..920686d961176 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/TimeRange.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines a time range in a 24 hour day specified by a start and end time. + */ +public class TimeRange { + /** + * Defines an hour and minute of the day specified in 24 hour time. + */ + @JsonProperty(value = "StartTime") + private TimeOfDay startTime; + + /** + * Defines an hour and minute of the day specified in 24 hour time. + */ + @JsonProperty(value = "EndTime") + private TimeOfDay endTime; + + /** + * Get defines an hour and minute of the day specified in 24 hour time. + * + * @return the startTime value + */ + public TimeOfDay startTime() { + return this.startTime; + } + + /** + * Set defines an hour and minute of the day specified in 24 hour time. + * + * @param startTime the startTime value to set + * @return the TimeRange object itself. + */ + public TimeRange withStartTime(TimeOfDay startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get defines an hour and minute of the day specified in 24 hour time. + * + * @return the endTime value + */ + public TimeOfDay endTime() { + return this.endTime; + } + + /** + * Set defines an hour and minute of the day specified in 24 hour time. + * + * @param endTime the endTime value to set + * @return the TimeRange object itself. + */ + public TimeRange withEndTime(TimeOfDay endTime) { + this.endTime = endTime; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UniformInt64RangePartitionSchemeDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UniformInt64RangePartitionSchemeDescription.java new file mode 100644 index 0000000000000..3fa969c0dc1ef --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UniformInt64RangePartitionSchemeDescription.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes a partitioning scheme where an integer range is allocated evenly + * across a number of partitions. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "PartitionScheme") +@JsonTypeName("UniformInt64Range") +public class UniformInt64RangePartitionSchemeDescription extends PartitionSchemeDescription { + /** + * The number of partitions. + */ + @JsonProperty(value = "Count", required = true) + private int count; + + /** + * String indicating the lower bound of the partition key range that + * should be split between the partitions. + */ + @JsonProperty(value = "LowKey", required = true) + private String lowKey; + + /** + * String indicating the upper bound of the partition key range that + * should be split between the partitions. + */ + @JsonProperty(value = "HighKey", required = true) + private String highKey; + + /** + * Get the number of partitions. + * + * @return the count value + */ + public int count() { + return this.count; + } + + /** + * Set the number of partitions. + * + * @param count the count value to set + * @return the UniformInt64RangePartitionSchemeDescription object itself. + */ + public UniformInt64RangePartitionSchemeDescription withCount(int count) { + this.count = count; + return this; + } + + /** + * Get string indicating the lower bound of the partition key range that + should be split between the partitions. + * + * @return the lowKey value + */ + public String lowKey() { + return this.lowKey; + } + + /** + * Set string indicating the lower bound of the partition key range that + should be split between the partitions. + * + * @param lowKey the lowKey value to set + * @return the UniformInt64RangePartitionSchemeDescription object itself. + */ + public UniformInt64RangePartitionSchemeDescription withLowKey(String lowKey) { + this.lowKey = lowKey; + return this; + } + + /** + * Get string indicating the upper bound of the partition key range that + should be split between the partitions. + * + * @return the highKey value + */ + public String highKey() { + return this.highKey; + } + + /** + * Set string indicating the upper bound of the partition key range that + should be split between the partitions. + * + * @param highKey the highKey value to set + * @return the UniformInt64RangePartitionSchemeDescription object itself. + */ + public UniformInt64RangePartitionSchemeDescription withHighKey(String highKey) { + this.highKey = highKey; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UnprovisionApplicationTypeDescriptionInfo.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UnprovisionApplicationTypeDescriptionInfo.java new file mode 100644 index 0000000000000..b33b743a85136 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UnprovisionApplicationTypeDescriptionInfo.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the operation to unregister or unprovision an application type and + * its version that was registered with the Service Fabric. + */ +public class UnprovisionApplicationTypeDescriptionInfo { + /** + * The version of the application type as defined in the application + * manifest. + */ + @JsonProperty(value = "ApplicationTypeVersion", required = true) + private String applicationTypeVersion; + + /** + * 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. + */ + @JsonProperty(value = "Async") + private Boolean async; + + /** + * Get the version of the application type as defined in the application manifest. + * + * @return the applicationTypeVersion value + */ + public String applicationTypeVersion() { + return this.applicationTypeVersion; + } + + /** + * Set the version of the application type as defined in the application manifest. + * + * @param applicationTypeVersion the applicationTypeVersion value to set + * @return the UnprovisionApplicationTypeDescriptionInfo object itself. + */ + public UnprovisionApplicationTypeDescriptionInfo withApplicationTypeVersion(String applicationTypeVersion) { + this.applicationTypeVersion = applicationTypeVersion; + return this; + } + + /** + * Get 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. + * + * @return the async value + */ + public Boolean async() { + return this.async; + } + + /** + * Set 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 async the async value to set + * @return the UnprovisionApplicationTypeDescriptionInfo object itself. + */ + public UnprovisionApplicationTypeDescriptionInfo withAsync(Boolean async) { + this.async = async; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UnprovisionFabricDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UnprovisionFabricDescription.java new file mode 100644 index 0000000000000..6c6eb6b5abbed --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UnprovisionFabricDescription.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the parameters for unprovisioning a cluster. + */ +public class UnprovisionFabricDescription { + /** + * The cluster code package version. + */ + @JsonProperty(value = "CodeVersion") + private String codeVersion; + + /** + * The cluster manifest version. + */ + @JsonProperty(value = "ConfigVersion") + private String configVersion; + + /** + * Get the cluster code package version. + * + * @return the codeVersion value + */ + public String codeVersion() { + return this.codeVersion; + } + + /** + * Set the cluster code package version. + * + * @param codeVersion the codeVersion value to set + * @return the UnprovisionFabricDescription object itself. + */ + public UnprovisionFabricDescription withCodeVersion(String codeVersion) { + this.codeVersion = codeVersion; + return this; + } + + /** + * Get the cluster manifest version. + * + * @return the configVersion value + */ + public String configVersion() { + return this.configVersion; + } + + /** + * Set the cluster manifest version. + * + * @param configVersion the configVersion value to set + * @return the UnprovisionFabricDescription object itself. + */ + public UnprovisionFabricDescription withConfigVersion(String configVersion) { + this.configVersion = configVersion; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UpdateClusterUpgradeDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UpdateClusterUpgradeDescription.java new file mode 100644 index 0000000000000..0489f2d729d76 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UpdateClusterUpgradeDescription.java @@ -0,0 +1,179 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters for updating a cluster upgrade. + */ +public class UpdateClusterUpgradeDescription { + /** + * The type of upgrade out of the following possible values. Possible + * values include: 'Invalid', 'Rolling', 'Rolling_ForceRestart'. + */ + @JsonProperty(value = "UpgradeKind") + private UpgradeType upgradeKind; + + /** + * Describes the parameters for updating a rolling upgrade of application + * or cluster. + */ + @JsonProperty(value = "UpdateDescription") + private RollingUpgradeUpdateDescription updateDescription; + + /** + * Defines a health policy used to evaluate the health of the cluster or of + * a cluster node. + */ + @JsonProperty(value = "ClusterHealthPolicy") + private ClusterHealthPolicy clusterHealthPolicy; + + /** + * When true, enables delta health evaluation rather than absolute health + * evaluation after completion of each upgrade domain. + */ + @JsonProperty(value = "EnableDeltaHealthEvaluation") + private Boolean enableDeltaHealthEvaluation; + + /** + * Defines a health policy used to evaluate the health of the cluster + * during a cluster upgrade. + */ + @JsonProperty(value = "ClusterUpgradeHealthPolicy") + private ClusterUpgradeHealthPolicyObject clusterUpgradeHealthPolicy; + + /** + * Defines the application health policy map used to evaluate the health of + * an application or one of its children entities. + */ + @JsonProperty(value = "ApplicationHealthPolicyMap") + private ApplicationHealthPolicies applicationHealthPolicyMap; + + /** + * Get the type of upgrade out of the following possible values. Possible values include: 'Invalid', 'Rolling', 'Rolling_ForceRestart'. + * + * @return the upgradeKind value + */ + public UpgradeType upgradeKind() { + return this.upgradeKind; + } + + /** + * Set the type of upgrade out of the following possible values. Possible values include: 'Invalid', 'Rolling', 'Rolling_ForceRestart'. + * + * @param upgradeKind the upgradeKind value to set + * @return the UpdateClusterUpgradeDescription object itself. + */ + public UpdateClusterUpgradeDescription withUpgradeKind(UpgradeType upgradeKind) { + this.upgradeKind = upgradeKind; + return this; + } + + /** + * Get describes the parameters for updating a rolling upgrade of application or cluster. + * + * @return the updateDescription value + */ + public RollingUpgradeUpdateDescription updateDescription() { + return this.updateDescription; + } + + /** + * Set describes the parameters for updating a rolling upgrade of application or cluster. + * + * @param updateDescription the updateDescription value to set + * @return the UpdateClusterUpgradeDescription object itself. + */ + public UpdateClusterUpgradeDescription withUpdateDescription(RollingUpgradeUpdateDescription updateDescription) { + this.updateDescription = updateDescription; + return this; + } + + /** + * Get defines a health policy used to evaluate the health of the cluster or of a cluster node. + * + * @return the clusterHealthPolicy value + */ + public ClusterHealthPolicy clusterHealthPolicy() { + return this.clusterHealthPolicy; + } + + /** + * Set defines a health policy used to evaluate the health of the cluster or of a cluster node. + * + * @param clusterHealthPolicy the clusterHealthPolicy value to set + * @return the UpdateClusterUpgradeDescription object itself. + */ + public UpdateClusterUpgradeDescription withClusterHealthPolicy(ClusterHealthPolicy clusterHealthPolicy) { + this.clusterHealthPolicy = clusterHealthPolicy; + return this; + } + + /** + * Get when true, enables delta health evaluation rather than absolute health evaluation after completion of each upgrade domain. + * + * @return the enableDeltaHealthEvaluation value + */ + public Boolean enableDeltaHealthEvaluation() { + return this.enableDeltaHealthEvaluation; + } + + /** + * Set when true, enables delta health evaluation rather than absolute health evaluation after completion of each upgrade domain. + * + * @param enableDeltaHealthEvaluation the enableDeltaHealthEvaluation value to set + * @return the UpdateClusterUpgradeDescription object itself. + */ + public UpdateClusterUpgradeDescription withEnableDeltaHealthEvaluation(Boolean enableDeltaHealthEvaluation) { + this.enableDeltaHealthEvaluation = enableDeltaHealthEvaluation; + return this; + } + + /** + * Get defines a health policy used to evaluate the health of the cluster during a cluster upgrade. + * + * @return the clusterUpgradeHealthPolicy value + */ + public ClusterUpgradeHealthPolicyObject clusterUpgradeHealthPolicy() { + return this.clusterUpgradeHealthPolicy; + } + + /** + * Set defines a health policy used to evaluate the health of the cluster during a cluster upgrade. + * + * @param clusterUpgradeHealthPolicy the clusterUpgradeHealthPolicy value to set + * @return the UpdateClusterUpgradeDescription object itself. + */ + public UpdateClusterUpgradeDescription withClusterUpgradeHealthPolicy(ClusterUpgradeHealthPolicyObject clusterUpgradeHealthPolicy) { + this.clusterUpgradeHealthPolicy = clusterUpgradeHealthPolicy; + return this; + } + + /** + * Get defines the application health policy map used to evaluate the health of an application or one of its children entities. + * + * @return the applicationHealthPolicyMap value + */ + public ApplicationHealthPolicies applicationHealthPolicyMap() { + return this.applicationHealthPolicyMap; + } + + /** + * Set defines the application health policy map used to evaluate the health of an application or one of its children entities. + * + * @param applicationHealthPolicyMap the applicationHealthPolicyMap value to set + * @return the UpdateClusterUpgradeDescription object itself. + */ + public UpdateClusterUpgradeDescription withApplicationHealthPolicyMap(ApplicationHealthPolicies applicationHealthPolicyMap) { + this.applicationHealthPolicyMap = applicationHealthPolicyMap; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UpgradeDomainDeltaNodesCheckHealthEvaluation.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UpgradeDomainDeltaNodesCheckHealthEvaluation.java new file mode 100644 index 0000000000000..2939f71869216 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UpgradeDomainDeltaNodesCheckHealthEvaluation.java @@ -0,0 +1,187 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents health evaluation for delta unhealthy cluster nodes in an upgrade + * domain, containing health evaluations for each unhealthy node that impacted + * current aggregated health state. + * Can be returned during cluster upgrade when cluster aggregated health state + * is Warning or Error. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("UpgradeDomainDeltaNodesCheck") +public class UpgradeDomainDeltaNodesCheckHealthEvaluation extends HealthEvaluation { + /** + * Name of the upgrade domain where nodes health is currently evaluated. + */ + @JsonProperty(value = "UpgradeDomainName") + private String upgradeDomainName; + + /** + * Number of upgrade domain nodes with aggregated heath state Error in the + * health store at the beginning of the cluster upgrade. + */ + @JsonProperty(value = "BaselineErrorCount") + private Long baselineErrorCount; + + /** + * Total number of upgrade domain nodes in the health store at the + * beginning of the cluster upgrade. + */ + @JsonProperty(value = "BaselineTotalCount") + private Long baselineTotalCount; + + /** + * Maximum allowed percentage of upgrade domain delta unhealthy nodes from + * the ClusterUpgradeHealthPolicy. + */ + @JsonProperty(value = "MaxPercentDeltaUnhealthyNodes") + private Integer maxPercentDeltaUnhealthyNodes; + + /** + * Total number of upgrade domain nodes in the health store. + */ + @JsonProperty(value = "TotalCount") + private Long totalCount; + + /** + * List of unhealthy evaluations that led to the aggregated health state. + * Includes all the unhealthy NodeHealthEvaluation that impacted the + * aggregated health. + */ + @JsonProperty(value = "UnhealthyEvaluations") + private List unhealthyEvaluations; + + /** + * Get name of the upgrade domain where nodes health is currently evaluated. + * + * @return the upgradeDomainName value + */ + public String upgradeDomainName() { + return this.upgradeDomainName; + } + + /** + * Set name of the upgrade domain where nodes health is currently evaluated. + * + * @param upgradeDomainName the upgradeDomainName value to set + * @return the UpgradeDomainDeltaNodesCheckHealthEvaluation object itself. + */ + public UpgradeDomainDeltaNodesCheckHealthEvaluation withUpgradeDomainName(String upgradeDomainName) { + this.upgradeDomainName = upgradeDomainName; + return this; + } + + /** + * Get number of upgrade domain nodes with aggregated heath state Error in the health store at the beginning of the cluster upgrade. + * + * @return the baselineErrorCount value + */ + public Long baselineErrorCount() { + return this.baselineErrorCount; + } + + /** + * Set number of upgrade domain nodes with aggregated heath state Error in the health store at the beginning of the cluster upgrade. + * + * @param baselineErrorCount the baselineErrorCount value to set + * @return the UpgradeDomainDeltaNodesCheckHealthEvaluation object itself. + */ + public UpgradeDomainDeltaNodesCheckHealthEvaluation withBaselineErrorCount(Long baselineErrorCount) { + this.baselineErrorCount = baselineErrorCount; + return this; + } + + /** + * Get total number of upgrade domain nodes in the health store at the beginning of the cluster upgrade. + * + * @return the baselineTotalCount value + */ + public Long baselineTotalCount() { + return this.baselineTotalCount; + } + + /** + * Set total number of upgrade domain nodes in the health store at the beginning of the cluster upgrade. + * + * @param baselineTotalCount the baselineTotalCount value to set + * @return the UpgradeDomainDeltaNodesCheckHealthEvaluation object itself. + */ + public UpgradeDomainDeltaNodesCheckHealthEvaluation withBaselineTotalCount(Long baselineTotalCount) { + this.baselineTotalCount = baselineTotalCount; + return this; + } + + /** + * Get maximum allowed percentage of upgrade domain delta unhealthy nodes from the ClusterUpgradeHealthPolicy. + * + * @return the maxPercentDeltaUnhealthyNodes value + */ + public Integer maxPercentDeltaUnhealthyNodes() { + return this.maxPercentDeltaUnhealthyNodes; + } + + /** + * Set maximum allowed percentage of upgrade domain delta unhealthy nodes from the ClusterUpgradeHealthPolicy. + * + * @param maxPercentDeltaUnhealthyNodes the maxPercentDeltaUnhealthyNodes value to set + * @return the UpgradeDomainDeltaNodesCheckHealthEvaluation object itself. + */ + public UpgradeDomainDeltaNodesCheckHealthEvaluation withMaxPercentDeltaUnhealthyNodes(Integer maxPercentDeltaUnhealthyNodes) { + this.maxPercentDeltaUnhealthyNodes = maxPercentDeltaUnhealthyNodes; + return this; + } + + /** + * Get total number of upgrade domain nodes in the health store. + * + * @return the totalCount value + */ + public Long totalCount() { + return this.totalCount; + } + + /** + * Set total number of upgrade domain nodes in the health store. + * + * @param totalCount the totalCount value to set + * @return the UpgradeDomainDeltaNodesCheckHealthEvaluation object itself. + */ + public UpgradeDomainDeltaNodesCheckHealthEvaluation withTotalCount(Long totalCount) { + this.totalCount = totalCount; + return this; + } + + /** + * Get list of unhealthy evaluations that led to the aggregated health state. Includes all the unhealthy NodeHealthEvaluation that impacted the aggregated health. + * + * @return the unhealthyEvaluations value + */ + public List unhealthyEvaluations() { + return this.unhealthyEvaluations; + } + + /** + * Set list of unhealthy evaluations that led to the aggregated health state. Includes all the unhealthy NodeHealthEvaluation that impacted the aggregated health. + * + * @param unhealthyEvaluations the unhealthyEvaluations value to set + * @return the UpgradeDomainDeltaNodesCheckHealthEvaluation object itself. + */ + public UpgradeDomainDeltaNodesCheckHealthEvaluation withUnhealthyEvaluations(List unhealthyEvaluations) { + this.unhealthyEvaluations = unhealthyEvaluations; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UpgradeDomainInfo.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UpgradeDomainInfo.java new file mode 100644 index 0000000000000..f5d0413070b6b --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UpgradeDomainInfo.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about an upgrade domain. + */ +public class UpgradeDomainInfo { + /** + * The name of the upgrade domain. + */ + @JsonProperty(value = "Name") + private String name; + + /** + * The state of the upgrade domain. Possible values include: 'Invalid', + * 'Pending', 'InProgress', 'Completed'. + */ + @JsonProperty(value = "State") + private UpgradeDomainState state; + + /** + * Get the name of the upgrade domain. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the upgrade domain. + * + * @param name the name value to set + * @return the UpgradeDomainInfo object itself. + */ + public UpgradeDomainInfo withName(String name) { + this.name = name; + return this; + } + + /** + * Get the state of the upgrade domain. Possible values include: 'Invalid', 'Pending', 'InProgress', 'Completed'. + * + * @return the state value + */ + public UpgradeDomainState state() { + return this.state; + } + + /** + * Set the state of the upgrade domain. Possible values include: 'Invalid', 'Pending', 'InProgress', 'Completed'. + * + * @param state the state value to set + * @return the UpgradeDomainInfo object itself. + */ + public UpgradeDomainInfo withState(UpgradeDomainState state) { + this.state = state; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UpgradeDomainNodesHealthEvaluation.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UpgradeDomainNodesHealthEvaluation.java new file mode 100644 index 0000000000000..1a76062db0910 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UpgradeDomainNodesHealthEvaluation.java @@ -0,0 +1,133 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents health evaluation for cluster nodes in an upgrade domain, + * containing health evaluations for each unhealthy node that impacted current + * aggregated health state. Can be returned when evaluating cluster health + * during cluster upgrade and the aggregated health state is either Error or + * Warning. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("UpgradeDomainNodes") +public class UpgradeDomainNodesHealthEvaluation extends HealthEvaluation { + /** + * Name of the upgrade domain where nodes health is currently evaluated. + */ + @JsonProperty(value = "UpgradeDomainName") + private String upgradeDomainName; + + /** + * Maximum allowed percentage of unhealthy nodes from the + * ClusterHealthPolicy. + */ + @JsonProperty(value = "MaxPercentUnhealthyNodes") + private Integer maxPercentUnhealthyNodes; + + /** + * Total number of nodes in the current upgrade domain. + */ + @JsonProperty(value = "TotalCount") + private Long totalCount; + + /** + * List of unhealthy evaluations that led to the aggregated health state. + * Includes all the unhealthy NodeHealthEvaluation that impacted the + * aggregated health. + */ + @JsonProperty(value = "UnhealthyEvaluations") + private List unhealthyEvaluations; + + /** + * Get name of the upgrade domain where nodes health is currently evaluated. + * + * @return the upgradeDomainName value + */ + public String upgradeDomainName() { + return this.upgradeDomainName; + } + + /** + * Set name of the upgrade domain where nodes health is currently evaluated. + * + * @param upgradeDomainName the upgradeDomainName value to set + * @return the UpgradeDomainNodesHealthEvaluation object itself. + */ + public UpgradeDomainNodesHealthEvaluation withUpgradeDomainName(String upgradeDomainName) { + this.upgradeDomainName = upgradeDomainName; + return this; + } + + /** + * Get maximum allowed percentage of unhealthy nodes from the ClusterHealthPolicy. + * + * @return the maxPercentUnhealthyNodes value + */ + public Integer maxPercentUnhealthyNodes() { + return this.maxPercentUnhealthyNodes; + } + + /** + * Set maximum allowed percentage of unhealthy nodes from the ClusterHealthPolicy. + * + * @param maxPercentUnhealthyNodes the maxPercentUnhealthyNodes value to set + * @return the UpgradeDomainNodesHealthEvaluation object itself. + */ + public UpgradeDomainNodesHealthEvaluation withMaxPercentUnhealthyNodes(Integer maxPercentUnhealthyNodes) { + this.maxPercentUnhealthyNodes = maxPercentUnhealthyNodes; + return this; + } + + /** + * Get total number of nodes in the current upgrade domain. + * + * @return the totalCount value + */ + public Long totalCount() { + return this.totalCount; + } + + /** + * Set total number of nodes in the current upgrade domain. + * + * @param totalCount the totalCount value to set + * @return the UpgradeDomainNodesHealthEvaluation object itself. + */ + public UpgradeDomainNodesHealthEvaluation withTotalCount(Long totalCount) { + this.totalCount = totalCount; + return this; + } + + /** + * Get list of unhealthy evaluations that led to the aggregated health state. Includes all the unhealthy NodeHealthEvaluation that impacted the aggregated health. + * + * @return the unhealthyEvaluations value + */ + public List unhealthyEvaluations() { + return this.unhealthyEvaluations; + } + + /** + * Set list of unhealthy evaluations that led to the aggregated health state. Includes all the unhealthy NodeHealthEvaluation that impacted the aggregated health. + * + * @param unhealthyEvaluations the unhealthyEvaluations value to set + * @return the UpgradeDomainNodesHealthEvaluation object itself. + */ + public UpgradeDomainNodesHealthEvaluation withUnhealthyEvaluations(List unhealthyEvaluations) { + this.unhealthyEvaluations = unhealthyEvaluations; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UpgradeDomainState.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UpgradeDomainState.java new file mode 100644 index 0000000000000..9acb0ea529acb --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UpgradeDomainState.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for UpgradeDomainState. + */ +public final class UpgradeDomainState extends ExpandableStringEnum { + /** Static value Invalid for UpgradeDomainState. */ + public static final UpgradeDomainState INVALID = fromString("Invalid"); + + /** Static value Pending for UpgradeDomainState. */ + public static final UpgradeDomainState PENDING = fromString("Pending"); + + /** Static value InProgress for UpgradeDomainState. */ + public static final UpgradeDomainState IN_PROGRESS = fromString("InProgress"); + + /** Static value Completed for UpgradeDomainState. */ + public static final UpgradeDomainState COMPLETED = fromString("Completed"); + + /** + * Creates or finds a UpgradeDomainState from its string representation. + * @param name a name to look for + * @return the corresponding UpgradeDomainState + */ + @JsonCreator + public static UpgradeDomainState fromString(String name) { + return fromString(name, UpgradeDomainState.class); + } + + /** + * @return known UpgradeDomainState values + */ + public static Collection values() { + return values(UpgradeDomainState.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UpgradeKind.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UpgradeKind.java new file mode 100644 index 0000000000000..cb70577530891 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UpgradeKind.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for UpgradeKind. + */ +public final class UpgradeKind extends ExpandableStringEnum { + /** Static value Invalid for UpgradeKind. */ + public static final UpgradeKind INVALID = fromString("Invalid"); + + /** Static value Rolling for UpgradeKind. */ + public static final UpgradeKind ROLLING = fromString("Rolling"); + + /** + * Creates or finds a UpgradeKind from its string representation. + * @param name a name to look for + * @return the corresponding UpgradeKind + */ + @JsonCreator + public static UpgradeKind fromString(String name) { + return fromString(name, UpgradeKind.class); + } + + /** + * @return known UpgradeKind values + */ + public static Collection values() { + return values(UpgradeKind.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UpgradeMode.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UpgradeMode.java new file mode 100644 index 0000000000000..81a2105815e3f --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UpgradeMode.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for UpgradeMode. + */ +public final class UpgradeMode extends ExpandableStringEnum { + /** Static value Invalid for UpgradeMode. */ + public static final UpgradeMode INVALID = fromString("Invalid"); + + /** Static value UnmonitoredAuto for UpgradeMode. */ + public static final UpgradeMode UNMONITORED_AUTO = fromString("UnmonitoredAuto"); + + /** Static value UnmonitoredManual for UpgradeMode. */ + public static final UpgradeMode UNMONITORED_MANUAL = fromString("UnmonitoredManual"); + + /** Static value Monitored for UpgradeMode. */ + public static final UpgradeMode MONITORED = fromString("Monitored"); + + /** + * Creates or finds a UpgradeMode from its string representation. + * @param name a name to look for + * @return the corresponding UpgradeMode + */ + @JsonCreator + public static UpgradeMode fromString(String name) { + return fromString(name, UpgradeMode.class); + } + + /** + * @return known UpgradeMode values + */ + public static Collection values() { + return values(UpgradeMode.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UpgradeState.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UpgradeState.java new file mode 100644 index 0000000000000..cdd3315d62aea --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UpgradeState.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for UpgradeState. + */ +public final class UpgradeState extends ExpandableStringEnum { + /** Static value Invalid for UpgradeState. */ + public static final UpgradeState INVALID = fromString("Invalid"); + + /** Static value RollingBackInProgress for UpgradeState. */ + public static final UpgradeState ROLLING_BACK_IN_PROGRESS = fromString("RollingBackInProgress"); + + /** Static value RollingBackCompleted for UpgradeState. */ + public static final UpgradeState ROLLING_BACK_COMPLETED = fromString("RollingBackCompleted"); + + /** Static value RollingForwardPending for UpgradeState. */ + public static final UpgradeState ROLLING_FORWARD_PENDING = fromString("RollingForwardPending"); + + /** Static value RollingForwardInProgress for UpgradeState. */ + public static final UpgradeState ROLLING_FORWARD_IN_PROGRESS = fromString("RollingForwardInProgress"); + + /** Static value RollingForwardCompleted for UpgradeState. */ + public static final UpgradeState ROLLING_FORWARD_COMPLETED = fromString("RollingForwardCompleted"); + + /** Static value Failed for UpgradeState. */ + public static final UpgradeState FAILED = fromString("Failed"); + + /** + * Creates or finds a UpgradeState from its string representation. + * @param name a name to look for + * @return the corresponding UpgradeState + */ + @JsonCreator + public static UpgradeState fromString(String name) { + return fromString(name, UpgradeState.class); + } + + /** + * @return known UpgradeState values + */ + public static Collection values() { + return values(UpgradeState.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UpgradeType.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UpgradeType.java new file mode 100644 index 0000000000000..6b2214e59e766 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UpgradeType.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for UpgradeType. + */ +public final class UpgradeType extends ExpandableStringEnum { + /** Static value Invalid for UpgradeType. */ + public static final UpgradeType INVALID = fromString("Invalid"); + + /** Static value Rolling for UpgradeType. */ + public static final UpgradeType ROLLING = fromString("Rolling"); + + /** Static value Rolling_ForceRestart for UpgradeType. */ + public static final UpgradeType ROLLING_FORCE_RESTART = fromString("Rolling_ForceRestart"); + + /** + * Creates or finds a UpgradeType from its string representation. + * @param name a name to look for + * @return the corresponding UpgradeType + */ + @JsonCreator + public static UpgradeType fromString(String name) { + return fromString(name, UpgradeType.class); + } + + /** + * @return known UpgradeType values + */ + public static Collection values() { + return values(UpgradeType.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UploadChunkRange.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UploadChunkRange.java new file mode 100644 index 0000000000000..8fae6f1760fae --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UploadChunkRange.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about which portion of the file to upload. + */ +public class UploadChunkRange { + /** + * The start position of the portion of the file. It's represented by the + * number of bytes. + */ + @JsonProperty(value = "StartPosition") + private String startPosition; + + /** + * The end position of the portion of the file. It's represented by the + * number of bytes. + */ + @JsonProperty(value = "EndPosition") + private String endPosition; + + /** + * Get the start position of the portion of the file. It's represented by the number of bytes. + * + * @return the startPosition value + */ + public String startPosition() { + return this.startPosition; + } + + /** + * Set the start position of the portion of the file. It's represented by the number of bytes. + * + * @param startPosition the startPosition value to set + * @return the UploadChunkRange object itself. + */ + public UploadChunkRange withStartPosition(String startPosition) { + this.startPosition = startPosition; + return this; + } + + /** + * Get the end position of the portion of the file. It's represented by the number of bytes. + * + * @return the endPosition value + */ + public String endPosition() { + return this.endPosition; + } + + /** + * Set the end position of the portion of the file. It's represented by the number of bytes. + * + * @param endPosition the endPosition value to set + * @return the UploadChunkRange object itself. + */ + public UploadChunkRange withEndPosition(String endPosition) { + this.endPosition = endPosition; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UploadSessionInfo.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UploadSessionInfo.java new file mode 100644 index 0000000000000..a63d0c73b5503 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/UploadSessionInfo.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.UUID; +import org.joda.time.DateTime; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about an image store upload session. A session is associated + * with a relative path in the image store. + */ +public class UploadSessionInfo { + /** + * The remote location within image store. This path is relative to the + * image store root. + */ + @JsonProperty(value = "StoreRelativePath") + private String storeRelativePath; + + /** + * A unique ID of the upload session. A session ID can be reused only if + * the session was committed or removed. + */ + @JsonProperty(value = "SessionId") + private UUID sessionId; + + /** + * The date and time when the upload session was last modified. + */ + @JsonProperty(value = "ModifiedDate") + private DateTime modifiedDate; + + /** + * The size in bytes of the uploading file. + */ + @JsonProperty(value = "FileSize") + private String fileSize; + + /** + * List of chunk ranges that image store has not received yet. + */ + @JsonProperty(value = "ExpectedRanges") + private List expectedRanges; + + /** + * Get the remote location within image store. This path is relative to the image store root. + * + * @return the storeRelativePath value + */ + public String storeRelativePath() { + return this.storeRelativePath; + } + + /** + * Set the remote location within image store. This path is relative to the image store root. + * + * @param storeRelativePath the storeRelativePath value to set + * @return the UploadSessionInfo object itself. + */ + public UploadSessionInfo withStoreRelativePath(String storeRelativePath) { + this.storeRelativePath = storeRelativePath; + return this; + } + + /** + * Get a unique ID of the upload session. A session ID can be reused only if the session was committed or removed. + * + * @return the sessionId value + */ + public UUID sessionId() { + return this.sessionId; + } + + /** + * Set a unique ID of the upload session. A session ID can be reused only if the session was committed or removed. + * + * @param sessionId the sessionId value to set + * @return the UploadSessionInfo object itself. + */ + public UploadSessionInfo withSessionId(UUID sessionId) { + this.sessionId = sessionId; + return this; + } + + /** + * Get the date and time when the upload session was last modified. + * + * @return the modifiedDate value + */ + public DateTime modifiedDate() { + return this.modifiedDate; + } + + /** + * Set the date and time when the upload session was last modified. + * + * @param modifiedDate the modifiedDate value to set + * @return the UploadSessionInfo object itself. + */ + public UploadSessionInfo withModifiedDate(DateTime modifiedDate) { + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Get the size in bytes of the uploading file. + * + * @return the fileSize value + */ + public String fileSize() { + return this.fileSize; + } + + /** + * Set the size in bytes of the uploading file. + * + * @param fileSize the fileSize value to set + * @return the UploadSessionInfo object itself. + */ + public UploadSessionInfo withFileSize(String fileSize) { + this.fileSize = fileSize; + return this; + } + + /** + * Get list of chunk ranges that image store has not received yet. + * + * @return the expectedRanges value + */ + public List expectedRanges() { + return this.expectedRanges; + } + + /** + * Set list of chunk ranges that image store has not received yet. + * + * @param expectedRanges the expectedRanges value to set + * @return the UploadSessionInfo object itself. + */ + public UploadSessionInfo withExpectedRanges(List expectedRanges) { + this.expectedRanges = expectedRanges; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ValidationFailedChaosEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ValidationFailedChaosEvent.java new file mode 100644 index 0000000000000..d5df9dc0f2a69 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ValidationFailedChaosEvent.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Chaos event corresponding to a failure during validation. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ValidationFailed") +public class ValidationFailedChaosEvent extends ChaosEvent { + /** + * Describes why the ValidationFailedChaosEvent was generated. This may + * happen because more than MaxPercentUnhealthyNodes are unhealthy for more + * than MaxClusterStabilizationTimeout. This reason will be in the Reason + * property of the ValidationFailedChaosEvent as a string. + */ + @JsonProperty(value = "Reason") + private String reason; + + /** + * Get describes why the ValidationFailedChaosEvent was generated. This may happen because more than MaxPercentUnhealthyNodes are unhealthy for more than MaxClusterStabilizationTimeout. This reason will be in the Reason property of the ValidationFailedChaosEvent as a string. + * + * @return the reason value + */ + public String reason() { + return this.reason; + } + + /** + * Set describes why the ValidationFailedChaosEvent was generated. This may happen because more than MaxPercentUnhealthyNodes are unhealthy for more than MaxClusterStabilizationTimeout. This reason will be in the Reason property of the ValidationFailedChaosEvent as a string. + * + * @param reason the reason value to set + * @return the ValidationFailedChaosEvent object itself. + */ + public ValidationFailedChaosEvent withReason(String reason) { + this.reason = reason; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/VolumeProviderParametersAzureFile.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/VolumeProviderParametersAzureFile.java new file mode 100644 index 0000000000000..48b27637cbcf1 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/VolumeProviderParametersAzureFile.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * This type describes a volume provided by an Azure Files file share. + */ +public class VolumeProviderParametersAzureFile { + /** + * Name of the Azure storage account for the File Share. + */ + @JsonProperty(value = "accountName", required = true) + private String accountName; + + /** + * Access key of the Azure storage account for the File Share. + */ + @JsonProperty(value = "accountKey") + private String accountKey; + + /** + * Name of the Azure Files file share that provides storage for the volume. + */ + @JsonProperty(value = "shareName", required = true) + private String shareName; + + /** + * Get name of the Azure storage account for the File Share. + * + * @return the accountName value + */ + public String accountName() { + return this.accountName; + } + + /** + * Set name of the Azure storage account for the File Share. + * + * @param accountName the accountName value to set + * @return the VolumeProviderParametersAzureFile object itself. + */ + public VolumeProviderParametersAzureFile withAccountName(String accountName) { + this.accountName = accountName; + return this; + } + + /** + * Get access key of the Azure storage account for the File Share. + * + * @return the accountKey value + */ + public String accountKey() { + return this.accountKey; + } + + /** + * Set access key of the Azure storage account for the File Share. + * + * @param accountKey the accountKey value to set + * @return the VolumeProviderParametersAzureFile object itself. + */ + public VolumeProviderParametersAzureFile withAccountKey(String accountKey) { + this.accountKey = accountKey; + return this; + } + + /** + * Get name of the Azure Files file share that provides storage for the volume. + * + * @return the shareName value + */ + public String shareName() { + return this.shareName; + } + + /** + * Set name of the Azure Files file share that provides storage for the volume. + * + * @param shareName the shareName value to set + * @return the VolumeProviderParametersAzureFile object itself. + */ + public VolumeProviderParametersAzureFile withShareName(String shareName) { + this.shareName = shareName; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/WaitForInbuildReplicaSafetyCheck.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/WaitForInbuildReplicaSafetyCheck.java new file mode 100644 index 0000000000000..64d9c19d8a5ca --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/WaitForInbuildReplicaSafetyCheck.java @@ -0,0 +1,23 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Safety check that waits for the replica build operation to finish. This + * indicates that there is a replica that is going through the copy or is + * providing data for building another replica. Bring the node down will abort + * this copy operation which are typically expensive involving data movements. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("WaitForInbuildReplica") +public class WaitForInbuildReplicaSafetyCheck extends PartitionSafetyCheck { +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/WaitForPrimaryPlacementSafetyCheck.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/WaitForPrimaryPlacementSafetyCheck.java new file mode 100644 index 0000000000000..3eeac17e13cd8 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/WaitForPrimaryPlacementSafetyCheck.java @@ -0,0 +1,21 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Safety check that waits for the primary replica that was moved out of the + * node due to upgrade to be placed back again on that node. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("WaitForPrimaryPlacement") +public class WaitForPrimaryPlacementSafetyCheck extends PartitionSafetyCheck { +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/WaitForPrimarySwapSafetyCheck.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/WaitForPrimarySwapSafetyCheck.java new file mode 100644 index 0000000000000..a52ab76a731ff --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/WaitForPrimarySwapSafetyCheck.java @@ -0,0 +1,22 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Safety check that waits for the primary replica to be moved out of the node + * before starting an upgrade to ensure the availability of the primary replica + * for the partition. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("WaitForPrimarySwap") +public class WaitForPrimarySwapSafetyCheck extends PartitionSafetyCheck { +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/WaitForReconfigurationSafetyCheck.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/WaitForReconfigurationSafetyCheck.java new file mode 100644 index 0000000000000..8c629e5104881 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/WaitForReconfigurationSafetyCheck.java @@ -0,0 +1,21 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Safety check that waits for the current reconfiguration of the partition to + * be completed before starting an upgrade. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("WaitForReconfiguration") +public class WaitForReconfigurationSafetyCheck extends PartitionSafetyCheck { +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/WaitingChaosEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/WaitingChaosEvent.java new file mode 100644 index 0000000000000..a9295cec1105c --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/WaitingChaosEvent.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes a Chaos event that gets generated when Chaos is waiting for the + * cluster to become ready for faulting, for example, Chaos may be waiting for + * the on-going upgrade to finish. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("Waiting") +public class WaitingChaosEvent extends ChaosEvent { + /** + * Describes why the WaitingChaosEvent was generated, for example, due to a + * cluster upgrade. + */ + @JsonProperty(value = "Reason") + private String reason; + + /** + * Get describes why the WaitingChaosEvent was generated, for example, due to a cluster upgrade. + * + * @return the reason value + */ + public String reason() { + return this.reason; + } + + /** + * Set describes why the WaitingChaosEvent was generated, for example, due to a cluster upgrade. + * + * @param reason the reason value to set + * @return the WaitingChaosEvent object itself. + */ + public WaitingChaosEvent withReason(String reason) { + this.reason = reason; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/AadMetadataObjectInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/AadMetadataObjectInner.java new file mode 100644 index 0000000000000..7a40ba904a8b1 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/AadMetadataObjectInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.microsoft.azure.servicefabric.AadMetadata; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Azure Active Directory metadata object used for secured connection to + * cluster. + */ +public class AadMetadataObjectInner { + /** + * The client authentication method. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Azure Active Directory metadata used for secured connection to cluster. + */ + @JsonProperty(value = "metadata") + private AadMetadata metadata; + + /** + * Get the client authentication method. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the client authentication method. + * + * @param type the type value to set + * @return the AadMetadataObjectInner object itself. + */ + public AadMetadataObjectInner withType(String type) { + this.type = type; + return this; + } + + /** + * Get azure Active Directory metadata used for secured connection to cluster. + * + * @return the metadata value + */ + public AadMetadata metadata() { + return this.metadata; + } + + /** + * Set azure Active Directory metadata used for secured connection to cluster. + * + * @param metadata the metadata value to set + * @return the AadMetadataObjectInner object itself. + */ + public AadMetadataObjectInner withMetadata(AadMetadata metadata) { + this.metadata = metadata; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ApplicationEventInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ApplicationEventInner.java new file mode 100644 index 0000000000000..58aa9f10fd743 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ApplicationEventInner.java @@ -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. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Represents the base for all Application Events. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ApplicationEvent") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "ApplicationCreated", value = ApplicationCreatedEvent.class), + @JsonSubTypes.Type(name = "ApplicationDeleted", value = ApplicationDeletedEvent.class), + @JsonSubTypes.Type(name = "ApplicationHealthReportCreated", value = ApplicationHealthReportCreatedEvent.class), + @JsonSubTypes.Type(name = "ApplicationHealthReportExpired", value = ApplicationHealthReportExpiredEvent.class), + @JsonSubTypes.Type(name = "ApplicationUpgradeComplete", value = ApplicationUpgradeCompleteEvent.class), + @JsonSubTypes.Type(name = "ApplicationUpgradeDomainComplete", value = ApplicationUpgradeDomainCompleteEvent.class), + @JsonSubTypes.Type(name = "ApplicationUpgradeRollbackComplete", value = ApplicationUpgradeRollbackCompleteEvent.class), + @JsonSubTypes.Type(name = "ApplicationUpgradeRollbackStart", value = ApplicationUpgradeRollbackStartEvent.class), + @JsonSubTypes.Type(name = "ApplicationUpgradeStart", value = ApplicationUpgradeStartEvent.class), + @JsonSubTypes.Type(name = "DeployedApplicationHealthReportCreated", value = DeployedApplicationHealthReportCreatedEvent.class), + @JsonSubTypes.Type(name = "DeployedApplicationHealthReportExpired", value = DeployedApplicationHealthReportExpiredEvent.class), + @JsonSubTypes.Type(name = "ProcessDeactivated", value = ProcessDeactivatedEvent.class), + @JsonSubTypes.Type(name = "ContainerDeactivated", value = ContainerDeactivatedEvent.class), + @JsonSubTypes.Type(name = "DeployedServiceHealthReportCreated", value = DeployedServiceHealthReportCreatedEvent.class), + @JsonSubTypes.Type(name = "DeployedServiceHealthReportExpired", value = DeployedServiceHealthReportExpiredEvent.class), + @JsonSubTypes.Type(name = "ChaosRestartCodePackageFaultScheduled", value = ChaosRestartCodePackageFaultScheduledEvent.class), + @JsonSubTypes.Type(name = "ChaosRestartCodePackageFaultCompleted", value = ChaosRestartCodePackageFaultCompletedEvent.class) +}) +public class ApplicationEventInner extends FabricEventInner { + /** + * 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. + */ + @JsonProperty(value = "ApplicationId", required = true) + private String applicationId; + + /** + * Get 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. + * + * @return the applicationId value + */ + public String applicationId() { + return this.applicationId; + } + + /** + * Set 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. + * + * @param applicationId the applicationId value to set + * @return the ApplicationEventInner object itself. + */ + public ApplicationEventInner withApplicationId(String applicationId) { + this.applicationId = applicationId; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ApplicationHealthInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ApplicationHealthInner.java new file mode 100644 index 0000000000000..388d976e43671 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ApplicationHealthInner.java @@ -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. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import java.util.List; +import com.microsoft.azure.servicefabric.ServiceHealthState; +import com.microsoft.azure.servicefabric.DeployedApplicationHealthState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.servicefabric.EntityHealth; + +/** + * Represents the health of the application. Contains the application + * aggregated health state and the service and deployed application health + * states. + */ +public class ApplicationHealthInner extends EntityHealth { + /** + * The name of the application, including the 'fabric:' URI scheme. + */ + @JsonProperty(value = "Name") + private String name; + + /** + * Service health states as found in the health store. + */ + @JsonProperty(value = "ServiceHealthStates") + private List serviceHealthStates; + + /** + * Deployed application health states as found in the health store. + */ + @JsonProperty(value = "DeployedApplicationHealthStates") + private List deployedApplicationHealthStates; + + /** + * Get the name of the application, including the 'fabric:' URI scheme. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the application, including the 'fabric:' URI scheme. + * + * @param name the name value to set + * @return the ApplicationHealthInner object itself. + */ + public ApplicationHealthInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get service health states as found in the health store. + * + * @return the serviceHealthStates value + */ + public List serviceHealthStates() { + return this.serviceHealthStates; + } + + /** + * Set service health states as found in the health store. + * + * @param serviceHealthStates the serviceHealthStates value to set + * @return the ApplicationHealthInner object itself. + */ + public ApplicationHealthInner withServiceHealthStates(List serviceHealthStates) { + this.serviceHealthStates = serviceHealthStates; + return this; + } + + /** + * Get deployed application health states as found in the health store. + * + * @return the deployedApplicationHealthStates value + */ + public List deployedApplicationHealthStates() { + return this.deployedApplicationHealthStates; + } + + /** + * Set deployed application health states as found in the health store. + * + * @param deployedApplicationHealthStates the deployedApplicationHealthStates value to set + * @return the ApplicationHealthInner object itself. + */ + public ApplicationHealthInner withDeployedApplicationHealthStates(List deployedApplicationHealthStates) { + this.deployedApplicationHealthStates = deployedApplicationHealthStates; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ApplicationInfoInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ApplicationInfoInner.java new file mode 100644 index 0000000000000..224c773a3630c --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ApplicationInfoInner.java @@ -0,0 +1,252 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.microsoft.azure.servicefabric.ApplicationStatus; +import java.util.List; +import com.microsoft.azure.servicefabric.ApplicationParameter; +import com.microsoft.azure.servicefabric.HealthState; +import com.microsoft.azure.servicefabric.ApplicationDefinitionKind; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about a Service Fabric application. + */ +public class ApplicationInfoInner { + /** + * 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. + */ + @JsonProperty(value = "Id") + private String id; + + /** + * The name of the application, including the 'fabric:' URI scheme. + */ + @JsonProperty(value = "Name") + private String name; + + /** + * The application type name as defined in the application manifest. + */ + @JsonProperty(value = "TypeName") + private String typeName; + + /** + * The version of the application type as defined in the application + * manifest. + */ + @JsonProperty(value = "TypeVersion") + private String typeVersion; + + /** + * The status of the application. + * . Possible values include: 'Invalid', 'Ready', 'Upgrading', 'Creating', + * 'Deleting', 'Failed'. + */ + @JsonProperty(value = "Status") + private ApplicationStatus status; + + /** + * List of application parameters with overridden values from their default + * values specified in the application manifest. + */ + @JsonProperty(value = "Parameters") + private List parameters; + + /** + * 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'. + */ + @JsonProperty(value = "HealthState") + private HealthState healthState; + + /** + * The mechanism used to define a Service Fabric application. + * . Possible values include: 'Invalid', + * 'ServiceFabricApplicationDescription', 'Compose'. + */ + @JsonProperty(value = "ApplicationDefinitionKind") + private ApplicationDefinitionKind applicationDefinitionKind; + + /** + * Get 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. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set 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. + * + * @param id the id value to set + * @return the ApplicationInfoInner object itself. + */ + public ApplicationInfoInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name of the application, including the 'fabric:' URI scheme. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the application, including the 'fabric:' URI scheme. + * + * @param name the name value to set + * @return the ApplicationInfoInner object itself. + */ + public ApplicationInfoInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the application type name as defined in the application manifest. + * + * @return the typeName value + */ + public String typeName() { + return this.typeName; + } + + /** + * Set the application type name as defined in the application manifest. + * + * @param typeName the typeName value to set + * @return the ApplicationInfoInner object itself. + */ + public ApplicationInfoInner withTypeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get the version of the application type as defined in the application manifest. + * + * @return the typeVersion value + */ + public String typeVersion() { + return this.typeVersion; + } + + /** + * Set the version of the application type as defined in the application manifest. + * + * @param typeVersion the typeVersion value to set + * @return the ApplicationInfoInner object itself. + */ + public ApplicationInfoInner withTypeVersion(String typeVersion) { + this.typeVersion = typeVersion; + return this; + } + + /** + * Get the status of the application. + . Possible values include: 'Invalid', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed'. + * + * @return the status value + */ + public ApplicationStatus status() { + return this.status; + } + + /** + * Set the status of the application. + . Possible values include: 'Invalid', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed'. + * + * @param status the status value to set + * @return the ApplicationInfoInner object itself. + */ + public ApplicationInfoInner withStatus(ApplicationStatus status) { + this.status = status; + return this; + } + + /** + * Get list of application parameters with overridden values from their default values specified in the application manifest. + * + * @return the parameters value + */ + public List parameters() { + return this.parameters; + } + + /** + * Set list of application parameters with overridden values from their default values specified in the application manifest. + * + * @param parameters the parameters value to set + * @return the ApplicationInfoInner object itself. + */ + public ApplicationInfoInner withParameters(List parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get 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'. + * + * @return the healthState value + */ + public HealthState healthState() { + return this.healthState; + } + + /** + * Set 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 healthState the healthState value to set + * @return the ApplicationInfoInner object itself. + */ + public ApplicationInfoInner withHealthState(HealthState healthState) { + this.healthState = healthState; + return this; + } + + /** + * Get the mechanism used to define a Service Fabric application. + . Possible values include: 'Invalid', 'ServiceFabricApplicationDescription', 'Compose'. + * + * @return the applicationDefinitionKind value + */ + public ApplicationDefinitionKind applicationDefinitionKind() { + return this.applicationDefinitionKind; + } + + /** + * Set the mechanism used to define a Service Fabric application. + . Possible values include: 'Invalid', 'ServiceFabricApplicationDescription', 'Compose'. + * + * @param applicationDefinitionKind the applicationDefinitionKind value to set + * @return the ApplicationInfoInner object itself. + */ + public ApplicationInfoInner withApplicationDefinitionKind(ApplicationDefinitionKind applicationDefinitionKind) { + this.applicationDefinitionKind = applicationDefinitionKind; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ApplicationLoadInfoInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ApplicationLoadInfoInner.java new file mode 100644 index 0000000000000..a393c51167355 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ApplicationLoadInfoInner.java @@ -0,0 +1,179 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import java.util.List; +import com.microsoft.azure.servicefabric.ApplicationMetricDescription; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Load Information about a Service Fabric application. + */ +public class ApplicationLoadInfoInner { + /** + * 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. + */ + @JsonProperty(value = "Id") + private String id; + + /** + * The minimum number of nodes for this application. + * It is the number of nodes where Service Fabric will reserve Capacity in + * the cluster which equals to ReservedLoad * MinimumNodes for this + * Application instance. + * For applications that do not have application capacity defined this + * value will be zero. + */ + @JsonProperty(value = "MinimumNodes") + private Long minimumNodes; + + /** + * The maximum number of nodes where this application can be instantiated. + * It is the number of nodes this application is allowed to span. + * For applications that do not have application capacity defined this + * value will be zero. + */ + @JsonProperty(value = "MaximumNodes") + private Long maximumNodes; + + /** + * The number of nodes on which this application is instantiated. + * For applications that do not have application capacity defined this + * value will be zero. + */ + @JsonProperty(value = "NodeCount") + private Long nodeCount; + + /** + * List of application capacity metric description. + */ + @JsonProperty(value = "ApplicationLoadMetricInformation") + private List applicationLoadMetricInformation; + + /** + * Get 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. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set 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. + * + * @param id the id value to set + * @return the ApplicationLoadInfoInner object itself. + */ + public ApplicationLoadInfoInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the minimum number of nodes for this application. + It is the number of nodes where Service Fabric will reserve Capacity in the cluster which equals to ReservedLoad * MinimumNodes for this Application instance. + For applications that do not have application capacity defined this value will be zero. + * + * @return the minimumNodes value + */ + public Long minimumNodes() { + return this.minimumNodes; + } + + /** + * Set the minimum number of nodes for this application. + It is the number of nodes where Service Fabric will reserve Capacity in the cluster which equals to ReservedLoad * MinimumNodes for this Application instance. + For applications that do not have application capacity defined this value will be zero. + * + * @param minimumNodes the minimumNodes value to set + * @return the ApplicationLoadInfoInner object itself. + */ + public ApplicationLoadInfoInner withMinimumNodes(Long minimumNodes) { + this.minimumNodes = minimumNodes; + return this; + } + + /** + * Get the maximum number of nodes where this application can be instantiated. + It is the number of nodes this application is allowed to span. + For applications that do not have application capacity defined this value will be zero. + * + * @return the maximumNodes value + */ + public Long maximumNodes() { + return this.maximumNodes; + } + + /** + * Set the maximum number of nodes where this application can be instantiated. + It is the number of nodes this application is allowed to span. + For applications that do not have application capacity defined this value will be zero. + * + * @param maximumNodes the maximumNodes value to set + * @return the ApplicationLoadInfoInner object itself. + */ + public ApplicationLoadInfoInner withMaximumNodes(Long maximumNodes) { + this.maximumNodes = maximumNodes; + return this; + } + + /** + * Get the number of nodes on which this application is instantiated. + For applications that do not have application capacity defined this value will be zero. + * + * @return the nodeCount value + */ + public Long nodeCount() { + return this.nodeCount; + } + + /** + * Set the number of nodes on which this application is instantiated. + For applications that do not have application capacity defined this value will be zero. + * + * @param nodeCount the nodeCount value to set + * @return the ApplicationLoadInfoInner object itself. + */ + public ApplicationLoadInfoInner withNodeCount(Long nodeCount) { + this.nodeCount = nodeCount; + return this; + } + + /** + * Get list of application capacity metric description. + * + * @return the applicationLoadMetricInformation value + */ + public List applicationLoadMetricInformation() { + return this.applicationLoadMetricInformation; + } + + /** + * Set list of application capacity metric description. + * + * @param applicationLoadMetricInformation the applicationLoadMetricInformation value to set + * @return the ApplicationLoadInfoInner object itself. + */ + public ApplicationLoadInfoInner withApplicationLoadMetricInformation(List applicationLoadMetricInformation) { + this.applicationLoadMetricInformation = applicationLoadMetricInformation; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ApplicationNameInfoInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ApplicationNameInfoInner.java new file mode 100644 index 0000000000000..3e8d1a2a26d8c --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ApplicationNameInfoInner.java @@ -0,0 +1,79 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about the application name. + */ +public class ApplicationNameInfoInner { + /** + * 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. + */ + @JsonProperty(value = "Id") + private String id; + + /** + * The name of the application, including the 'fabric:' URI scheme. + */ + @JsonProperty(value = "Name") + private String name; + + /** + * Get 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. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set 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. + * + * @param id the id value to set + * @return the ApplicationNameInfoInner object itself. + */ + public ApplicationNameInfoInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name of the application, including the 'fabric:' URI scheme. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the application, including the 'fabric:' URI scheme. + * + * @param name the name value to set + * @return the ApplicationNameInfoInner object itself. + */ + public ApplicationNameInfoInner withName(String name) { + this.name = name; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ApplicationResourceDescriptionInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ApplicationResourceDescriptionInner.java new file mode 100644 index 0000000000000..9877fdc5ae8c7 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ApplicationResourceDescriptionInner.java @@ -0,0 +1,234 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import java.util.List; +import com.microsoft.azure.servicefabric.HealthState; +import com.microsoft.azure.servicefabric.ApplicationResourceStatus; +import com.microsoft.azure.servicefabric.DiagnosticsDescription; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Describes a service fabric application resource. + */ +@JsonFlatten +public class ApplicationResourceDescriptionInner { + /** + * User readable description of the application. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * Internal use. + */ + @JsonProperty(value = "properties.debugParams") + private String debugParams; + + /** + * describes the services in the application. + */ + @JsonProperty(value = "properties.services") + private List services; + + /** + * Describes the health state of an application resource. Possible values + * include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown'. + */ + @JsonProperty(value = "properties.healthState", access = JsonProperty.Access.WRITE_ONLY) + private HealthState healthState; + + /** + * 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. + */ + @JsonProperty(value = "properties.unhealthyEvaluation", access = JsonProperty.Access.WRITE_ONLY) + private String unhealthyEvaluation; + + /** + * Status of the application resource. Possible values include: 'Invalid', + * 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private ApplicationResourceStatus status; + + /** + * Gives additional information about the current status of the application + * deployment. + */ + @JsonProperty(value = "properties.statusDetails", access = JsonProperty.Access.WRITE_ONLY) + private String statusDetails; + + /** + * Names of the services in the application. + */ + @JsonProperty(value = "properties.serviceNames", access = JsonProperty.Access.WRITE_ONLY) + private List serviceNames; + + /** + * Describes the diagnostics definition and usage for an application + * resource. + */ + @JsonProperty(value = "properties.diagnostics") + private DiagnosticsDescription diagnostics; + + /** + * Application resource name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get user readable description of the application. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set user readable description of the application. + * + * @param description the description value to set + * @return the ApplicationResourceDescriptionInner object itself. + */ + public ApplicationResourceDescriptionInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get internal use. + * + * @return the debugParams value + */ + public String debugParams() { + return this.debugParams; + } + + /** + * Set internal use. + * + * @param debugParams the debugParams value to set + * @return the ApplicationResourceDescriptionInner object itself. + */ + public ApplicationResourceDescriptionInner withDebugParams(String debugParams) { + this.debugParams = debugParams; + return this; + } + + /** + * Get describes the services in the application. + * + * @return the services value + */ + public List services() { + return this.services; + } + + /** + * Set describes the services in the application. + * + * @param services the services value to set + * @return the ApplicationResourceDescriptionInner object itself. + */ + public ApplicationResourceDescriptionInner withServices(List services) { + this.services = services; + return this; + } + + /** + * Get describes the health state of an application resource. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown'. + * + * @return the healthState value + */ + public HealthState healthState() { + return this.healthState; + } + + /** + * Get 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. + * + * @return the unhealthyEvaluation value + */ + public String unhealthyEvaluation() { + return this.unhealthyEvaluation; + } + + /** + * Get status of the application resource. Possible values include: 'Invalid', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed'. + * + * @return the status value + */ + public ApplicationResourceStatus status() { + return this.status; + } + + /** + * Get gives additional information about the current status of the application deployment. + * + * @return the statusDetails value + */ + public String statusDetails() { + return this.statusDetails; + } + + /** + * Get names of the services in the application. + * + * @return the serviceNames value + */ + public List serviceNames() { + return this.serviceNames; + } + + /** + * Get describes the diagnostics definition and usage for an application resource. + * + * @return the diagnostics value + */ + public DiagnosticsDescription diagnostics() { + return this.diagnostics; + } + + /** + * Set describes the diagnostics definition and usage for an application resource. + * + * @param diagnostics the diagnostics value to set + * @return the ApplicationResourceDescriptionInner object itself. + */ + public ApplicationResourceDescriptionInner withDiagnostics(DiagnosticsDescription diagnostics) { + this.diagnostics = diagnostics; + return this; + } + + /** + * Get application resource name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set application resource name. + * + * @param name the name value to set + * @return the ApplicationResourceDescriptionInner object itself. + */ + public ApplicationResourceDescriptionInner withName(String name) { + this.name = name; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ApplicationTypeManifestInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ApplicationTypeManifestInner.java new file mode 100644 index 0000000000000..851acaae57f70 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ApplicationTypeManifestInner.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains the manifest describing an application type registered in a Service + * Fabric cluster. + */ +public class ApplicationTypeManifestInner { + /** + * The XML manifest as a string. + */ + @JsonProperty(value = "Manifest") + private String manifest; + + /** + * Get the XML manifest as a string. + * + * @return the manifest value + */ + public String manifest() { + return this.manifest; + } + + /** + * Set the XML manifest as a string. + * + * @param manifest the manifest value to set + * @return the ApplicationTypeManifestInner object itself. + */ + public ApplicationTypeManifestInner withManifest(String manifest) { + this.manifest = manifest; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ApplicationUpgradeProgressInfoInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ApplicationUpgradeProgressInfoInner.java new file mode 100644 index 0000000000000..60595af3e30e5 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ApplicationUpgradeProgressInfoInner.java @@ -0,0 +1,488 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import java.util.List; +import com.microsoft.azure.servicefabric.UpgradeDomainInfo; +import com.microsoft.azure.servicefabric.UpgradeState; +import com.microsoft.azure.servicefabric.UpgradeMode; +import com.microsoft.azure.servicefabric.ApplicationUpgradeDescription; +import com.microsoft.azure.servicefabric.HealthEvaluationWrapper; +import com.microsoft.azure.servicefabric.CurrentUpgradeDomainProgressInfo; +import com.microsoft.azure.servicefabric.FailureReason; +import com.microsoft.azure.servicefabric.FailureUpgradeDomainProgressInfo; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the parameters for an application upgrade. + */ +public class ApplicationUpgradeProgressInfoInner { + /** + * The name of the target application, including the 'fabric:' URI scheme. + */ + @JsonProperty(value = "Name") + private String name; + + /** + * The application type name as defined in the application manifest. + */ + @JsonProperty(value = "TypeName") + private String typeName; + + /** + * The target application type version (found in the application manifest) + * for the application upgrade. + */ + @JsonProperty(value = "TargetApplicationTypeVersion") + private String targetApplicationTypeVersion; + + /** + * List of upgrade domains and their statuses. + */ + @JsonProperty(value = "UpgradeDomains") + private List upgradeDomains; + + /** + * The state of the upgrade domain. Possible values include: 'Invalid', + * 'RollingBackInProgress', 'RollingBackCompleted', + * 'RollingForwardPending', 'RollingForwardInProgress', + * 'RollingForwardCompleted', 'Failed'. + */ + @JsonProperty(value = "UpgradeState") + private UpgradeState upgradeState; + + /** + * The name of the next upgrade domain to be processed. + */ + @JsonProperty(value = "NextUpgradeDomain") + private String nextUpgradeDomain; + + /** + * The mode used to monitor health during a rolling upgrade. The values are + * UnmonitoredAuto, UnmonitoredManual, and Monitored. Possible values + * include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored'. + */ + @JsonProperty(value = "RollingUpgradeMode") + private UpgradeMode rollingUpgradeMode; + + /** + * Describes the parameters for an application upgrade. Note that upgrade + * description replaces the existing application description. This means + * that if the parameters are not specified, the existing parameters on the + * applications will be overwritten with the empty parameters list. This + * would result in the application using the default value of the + * parameters from the application manifest. If you do not want to change + * any existing parameter values, please get the application parameters + * first using the GetApplicationInfo query and then supply those values as + * Parameters in this ApplicationUpgradeDescription. + */ + @JsonProperty(value = "UpgradeDescription") + private ApplicationUpgradeDescription upgradeDescription; + + /** + * The estimated total amount of time spent processing the overall upgrade. + */ + @JsonProperty(value = "UpgradeDurationInMilliseconds") + private String upgradeDurationInMilliseconds; + + /** + * The estimated total amount of time spent processing the current upgrade + * domain. + */ + @JsonProperty(value = "UpgradeDomainDurationInMilliseconds") + private String upgradeDomainDurationInMilliseconds; + + /** + * List of health evaluations that resulted in the current aggregated + * health state. + */ + @JsonProperty(value = "UnhealthyEvaluations") + private List unhealthyEvaluations; + + /** + * Information about the current in-progress upgrade domain. + */ + @JsonProperty(value = "CurrentUpgradeDomainProgress") + private CurrentUpgradeDomainProgressInfo currentUpgradeDomainProgress; + + /** + * The estimated UTC datetime when the upgrade started. + */ + @JsonProperty(value = "StartTimestampUtc") + private String startTimestampUtc; + + /** + * The estimated UTC datetime when the upgrade failed and FailureAction was + * executed. + */ + @JsonProperty(value = "FailureTimestampUtc") + private String failureTimestampUtc; + + /** + * The cause of an upgrade failure that resulted in FailureAction being + * executed. Possible values include: 'None', 'Interrupted', 'HealthCheck', + * 'UpgradeDomainTimeout', 'OverallUpgradeTimeout'. + */ + @JsonProperty(value = "FailureReason") + private FailureReason failureReason; + + /** + * Information about the upgrade domain progress at the time of upgrade + * failure. + */ + @JsonProperty(value = "UpgradeDomainProgressAtFailure") + private FailureUpgradeDomainProgressInfo upgradeDomainProgressAtFailure; + + /** + * Additional detailed information about the status of the pending upgrade. + */ + @JsonProperty(value = "UpgradeStatusDetails") + private String upgradeStatusDetails; + + /** + * Get the name of the target application, including the 'fabric:' URI scheme. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the target application, including the 'fabric:' URI scheme. + * + * @param name the name value to set + * @return the ApplicationUpgradeProgressInfoInner object itself. + */ + public ApplicationUpgradeProgressInfoInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the application type name as defined in the application manifest. + * + * @return the typeName value + */ + public String typeName() { + return this.typeName; + } + + /** + * Set the application type name as defined in the application manifest. + * + * @param typeName the typeName value to set + * @return the ApplicationUpgradeProgressInfoInner object itself. + */ + public ApplicationUpgradeProgressInfoInner withTypeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get the target application type version (found in the application manifest) for the application upgrade. + * + * @return the targetApplicationTypeVersion value + */ + public String targetApplicationTypeVersion() { + return this.targetApplicationTypeVersion; + } + + /** + * Set the target application type version (found in the application manifest) for the application upgrade. + * + * @param targetApplicationTypeVersion the targetApplicationTypeVersion value to set + * @return the ApplicationUpgradeProgressInfoInner object itself. + */ + public ApplicationUpgradeProgressInfoInner withTargetApplicationTypeVersion(String targetApplicationTypeVersion) { + this.targetApplicationTypeVersion = targetApplicationTypeVersion; + return this; + } + + /** + * Get list of upgrade domains and their statuses. + * + * @return the upgradeDomains value + */ + public List upgradeDomains() { + return this.upgradeDomains; + } + + /** + * Set list of upgrade domains and their statuses. + * + * @param upgradeDomains the upgradeDomains value to set + * @return the ApplicationUpgradeProgressInfoInner object itself. + */ + public ApplicationUpgradeProgressInfoInner withUpgradeDomains(List upgradeDomains) { + this.upgradeDomains = upgradeDomains; + return this; + } + + /** + * Get the state of the upgrade domain. Possible values include: 'Invalid', 'RollingBackInProgress', 'RollingBackCompleted', 'RollingForwardPending', 'RollingForwardInProgress', 'RollingForwardCompleted', 'Failed'. + * + * @return the upgradeState value + */ + public UpgradeState upgradeState() { + return this.upgradeState; + } + + /** + * Set the state of the upgrade domain. Possible values include: 'Invalid', 'RollingBackInProgress', 'RollingBackCompleted', 'RollingForwardPending', 'RollingForwardInProgress', 'RollingForwardCompleted', 'Failed'. + * + * @param upgradeState the upgradeState value to set + * @return the ApplicationUpgradeProgressInfoInner object itself. + */ + public ApplicationUpgradeProgressInfoInner withUpgradeState(UpgradeState upgradeState) { + this.upgradeState = upgradeState; + return this; + } + + /** + * Get the name of the next upgrade domain to be processed. + * + * @return the nextUpgradeDomain value + */ + public String nextUpgradeDomain() { + return this.nextUpgradeDomain; + } + + /** + * Set the name of the next upgrade domain to be processed. + * + * @param nextUpgradeDomain the nextUpgradeDomain value to set + * @return the ApplicationUpgradeProgressInfoInner object itself. + */ + public ApplicationUpgradeProgressInfoInner withNextUpgradeDomain(String nextUpgradeDomain) { + this.nextUpgradeDomain = nextUpgradeDomain; + return this; + } + + /** + * Get the mode used to monitor health during a rolling upgrade. The values are UnmonitoredAuto, UnmonitoredManual, and Monitored. Possible values include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored'. + * + * @return the rollingUpgradeMode value + */ + public UpgradeMode rollingUpgradeMode() { + return this.rollingUpgradeMode; + } + + /** + * Set 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 rollingUpgradeMode the rollingUpgradeMode value to set + * @return the ApplicationUpgradeProgressInfoInner object itself. + */ + public ApplicationUpgradeProgressInfoInner withRollingUpgradeMode(UpgradeMode rollingUpgradeMode) { + this.rollingUpgradeMode = rollingUpgradeMode; + return this; + } + + /** + * Get describes the parameters for an application upgrade. Note that upgrade description replaces the existing application description. This means that if the parameters are not specified, the existing parameters on the applications will be overwritten with the empty parameters list. This would result in the application using the default value of the parameters from the application manifest. If you do not want to change any existing parameter values, please get the application parameters first using the GetApplicationInfo query and then supply those values as Parameters in this ApplicationUpgradeDescription. + * + * @return the upgradeDescription value + */ + public ApplicationUpgradeDescription upgradeDescription() { + return this.upgradeDescription; + } + + /** + * Set describes the parameters for an application upgrade. Note that upgrade description replaces the existing application description. This means that if the parameters are not specified, the existing parameters on the applications will be overwritten with the empty parameters list. This would result in the application using the default value of the parameters from the application manifest. If you do not want to change any existing parameter values, please get the application parameters first using the GetApplicationInfo query and then supply those values as Parameters in this ApplicationUpgradeDescription. + * + * @param upgradeDescription the upgradeDescription value to set + * @return the ApplicationUpgradeProgressInfoInner object itself. + */ + public ApplicationUpgradeProgressInfoInner withUpgradeDescription(ApplicationUpgradeDescription upgradeDescription) { + this.upgradeDescription = upgradeDescription; + return this; + } + + /** + * Get the estimated total amount of time spent processing the overall upgrade. + * + * @return the upgradeDurationInMilliseconds value + */ + public String upgradeDurationInMilliseconds() { + return this.upgradeDurationInMilliseconds; + } + + /** + * Set the estimated total amount of time spent processing the overall upgrade. + * + * @param upgradeDurationInMilliseconds the upgradeDurationInMilliseconds value to set + * @return the ApplicationUpgradeProgressInfoInner object itself. + */ + public ApplicationUpgradeProgressInfoInner withUpgradeDurationInMilliseconds(String upgradeDurationInMilliseconds) { + this.upgradeDurationInMilliseconds = upgradeDurationInMilliseconds; + return this; + } + + /** + * Get the estimated total amount of time spent processing the current upgrade domain. + * + * @return the upgradeDomainDurationInMilliseconds value + */ + public String upgradeDomainDurationInMilliseconds() { + return this.upgradeDomainDurationInMilliseconds; + } + + /** + * Set the estimated total amount of time spent processing the current upgrade domain. + * + * @param upgradeDomainDurationInMilliseconds the upgradeDomainDurationInMilliseconds value to set + * @return the ApplicationUpgradeProgressInfoInner object itself. + */ + public ApplicationUpgradeProgressInfoInner withUpgradeDomainDurationInMilliseconds(String upgradeDomainDurationInMilliseconds) { + this.upgradeDomainDurationInMilliseconds = upgradeDomainDurationInMilliseconds; + return this; + } + + /** + * Get list of health evaluations that resulted in the current aggregated health state. + * + * @return the unhealthyEvaluations value + */ + public List unhealthyEvaluations() { + return this.unhealthyEvaluations; + } + + /** + * Set list of health evaluations that resulted in the current aggregated health state. + * + * @param unhealthyEvaluations the unhealthyEvaluations value to set + * @return the ApplicationUpgradeProgressInfoInner object itself. + */ + public ApplicationUpgradeProgressInfoInner withUnhealthyEvaluations(List unhealthyEvaluations) { + this.unhealthyEvaluations = unhealthyEvaluations; + return this; + } + + /** + * Get information about the current in-progress upgrade domain. + * + * @return the currentUpgradeDomainProgress value + */ + public CurrentUpgradeDomainProgressInfo currentUpgradeDomainProgress() { + return this.currentUpgradeDomainProgress; + } + + /** + * Set information about the current in-progress upgrade domain. + * + * @param currentUpgradeDomainProgress the currentUpgradeDomainProgress value to set + * @return the ApplicationUpgradeProgressInfoInner object itself. + */ + public ApplicationUpgradeProgressInfoInner withCurrentUpgradeDomainProgress(CurrentUpgradeDomainProgressInfo currentUpgradeDomainProgress) { + this.currentUpgradeDomainProgress = currentUpgradeDomainProgress; + return this; + } + + /** + * Get the estimated UTC datetime when the upgrade started. + * + * @return the startTimestampUtc value + */ + public String startTimestampUtc() { + return this.startTimestampUtc; + } + + /** + * Set the estimated UTC datetime when the upgrade started. + * + * @param startTimestampUtc the startTimestampUtc value to set + * @return the ApplicationUpgradeProgressInfoInner object itself. + */ + public ApplicationUpgradeProgressInfoInner withStartTimestampUtc(String startTimestampUtc) { + this.startTimestampUtc = startTimestampUtc; + return this; + } + + /** + * Get the estimated UTC datetime when the upgrade failed and FailureAction was executed. + * + * @return the failureTimestampUtc value + */ + public String failureTimestampUtc() { + return this.failureTimestampUtc; + } + + /** + * Set the estimated UTC datetime when the upgrade failed and FailureAction was executed. + * + * @param failureTimestampUtc the failureTimestampUtc value to set + * @return the ApplicationUpgradeProgressInfoInner object itself. + */ + public ApplicationUpgradeProgressInfoInner withFailureTimestampUtc(String failureTimestampUtc) { + this.failureTimestampUtc = failureTimestampUtc; + return this; + } + + /** + * Get the cause of an upgrade failure that resulted in FailureAction being executed. Possible values include: 'None', 'Interrupted', 'HealthCheck', 'UpgradeDomainTimeout', 'OverallUpgradeTimeout'. + * + * @return the failureReason value + */ + public FailureReason failureReason() { + return this.failureReason; + } + + /** + * Set the cause of an upgrade failure that resulted in FailureAction being executed. Possible values include: 'None', 'Interrupted', 'HealthCheck', 'UpgradeDomainTimeout', 'OverallUpgradeTimeout'. + * + * @param failureReason the failureReason value to set + * @return the ApplicationUpgradeProgressInfoInner object itself. + */ + public ApplicationUpgradeProgressInfoInner withFailureReason(FailureReason failureReason) { + this.failureReason = failureReason; + return this; + } + + /** + * Get information about the upgrade domain progress at the time of upgrade failure. + * + * @return the upgradeDomainProgressAtFailure value + */ + public FailureUpgradeDomainProgressInfo upgradeDomainProgressAtFailure() { + return this.upgradeDomainProgressAtFailure; + } + + /** + * Set information about the upgrade domain progress at the time of upgrade failure. + * + * @param upgradeDomainProgressAtFailure the upgradeDomainProgressAtFailure value to set + * @return the ApplicationUpgradeProgressInfoInner object itself. + */ + public ApplicationUpgradeProgressInfoInner withUpgradeDomainProgressAtFailure(FailureUpgradeDomainProgressInfo upgradeDomainProgressAtFailure) { + this.upgradeDomainProgressAtFailure = upgradeDomainProgressAtFailure; + return this; + } + + /** + * Get additional detailed information about the status of the pending upgrade. + * + * @return the upgradeStatusDetails value + */ + public String upgradeStatusDetails() { + return this.upgradeStatusDetails; + } + + /** + * Set additional detailed information about the status of the pending upgrade. + * + * @param upgradeStatusDetails the upgradeStatusDetails value to set + * @return the ApplicationUpgradeProgressInfoInner object itself. + */ + public ApplicationUpgradeProgressInfoInner withUpgradeStatusDetails(String upgradeStatusDetails) { + this.upgradeStatusDetails = upgradeStatusDetails; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/BackupPolicyDescriptionInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/BackupPolicyDescriptionInner.java new file mode 100644 index 0000000000000..a438c29ff08a5 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/BackupPolicyDescriptionInner.java @@ -0,0 +1,163 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.microsoft.azure.servicefabric.BackupScheduleDescription; +import com.microsoft.azure.servicefabric.BackupStorageDescription; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a backup policy for configuring periodic backup. + */ +public class BackupPolicyDescriptionInner { + /** + * The unique name identifying this backup policy. + */ + @JsonProperty(value = "Name", required = true) + private String name; + + /** + * Specifies whether to trigger restore automatically using the latest + * available backup in case the partition experiences a data loss event. + */ + @JsonProperty(value = "AutoRestoreOnDataLoss", required = true) + private boolean autoRestoreOnDataLoss; + + /** + * 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. + */ + @JsonProperty(value = "MaxIncrementalBackups", required = true) + private int maxIncrementalBackups; + + /** + * Describes the backup schedule parameters. + */ + @JsonProperty(value = "Schedule", required = true) + private BackupScheduleDescription schedule; + + /** + * Describes the details of backup storage where to store the periodic + * backups. + */ + @JsonProperty(value = "Storage", required = true) + private BackupStorageDescription storage; + + /** + * Get the unique name identifying this backup policy. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the unique name identifying this backup policy. + * + * @param name the name value to set + * @return the BackupPolicyDescriptionInner object itself. + */ + public BackupPolicyDescriptionInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get specifies whether to trigger restore automatically using the latest available backup in case the partition experiences a data loss event. + * + * @return the autoRestoreOnDataLoss value + */ + public boolean autoRestoreOnDataLoss() { + return this.autoRestoreOnDataLoss; + } + + /** + * Set specifies whether to trigger restore automatically using the latest available backup in case the partition experiences a data loss event. + * + * @param autoRestoreOnDataLoss the autoRestoreOnDataLoss value to set + * @return the BackupPolicyDescriptionInner object itself. + */ + public BackupPolicyDescriptionInner withAutoRestoreOnDataLoss(boolean autoRestoreOnDataLoss) { + this.autoRestoreOnDataLoss = autoRestoreOnDataLoss; + return this; + } + + /** + * Get 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. + * + * @return the maxIncrementalBackups value + */ + public int maxIncrementalBackups() { + return this.maxIncrementalBackups; + } + + /** + * Set 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 maxIncrementalBackups the maxIncrementalBackups value to set + * @return the BackupPolicyDescriptionInner object itself. + */ + public BackupPolicyDescriptionInner withMaxIncrementalBackups(int maxIncrementalBackups) { + this.maxIncrementalBackups = maxIncrementalBackups; + return this; + } + + /** + * Get describes the backup schedule parameters. + * + * @return the schedule value + */ + public BackupScheduleDescription schedule() { + return this.schedule; + } + + /** + * Set describes the backup schedule parameters. + * + * @param schedule the schedule value to set + * @return the BackupPolicyDescriptionInner object itself. + */ + public BackupPolicyDescriptionInner withSchedule(BackupScheduleDescription schedule) { + this.schedule = schedule; + return this; + } + + /** + * Get describes the details of backup storage where to store the periodic backups. + * + * @return the storage value + */ + public BackupStorageDescription storage() { + return this.storage; + } + + /** + * Set describes the details of backup storage where to store the periodic backups. + * + * @param storage the storage value to set + * @return the BackupPolicyDescriptionInner object itself. + */ + public BackupPolicyDescriptionInner withStorage(BackupStorageDescription storage) { + this.storage = storage; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/BackupProgressInfoInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/BackupProgressInfoInner.java new file mode 100644 index 0000000000000..ed297f0b65f1d --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/BackupProgressInfoInner.java @@ -0,0 +1,208 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.microsoft.azure.servicefabric.BackupState; +import org.joda.time.DateTime; +import java.util.UUID; +import com.microsoft.azure.servicefabric.BackupEpoch; +import com.microsoft.azure.servicefabric.FabricErrorError; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the progress of a partition's backup. + */ +public class BackupProgressInfoInner { + /** + * Represents the current state of the partition backup operation. + * . Possible values include: 'Invalid', 'Accepted', 'BackupInProgress', + * 'Success', 'Failure', 'Timeout'. + */ + @JsonProperty(value = "BackupState") + private BackupState backupState; + + /** + * TimeStamp in UTC when operation succeeded or failed. + */ + @JsonProperty(value = "TimeStampUtc") + private DateTime timeStampUtc; + + /** + * Unique ID of the newly created backup. + */ + @JsonProperty(value = "BackupId") + private UUID backupId; + + /** + * Location, relative to the backup store, of the newly created backup. + */ + @JsonProperty(value = "BackupLocation") + private String backupLocation; + + /** + * Specifies the epoch of the last record included in backup. + */ + @JsonProperty(value = "EpochOfLastBackupRecord") + private BackupEpoch epochOfLastBackupRecord; + + /** + * The LSN of last record included in backup. + */ + @JsonProperty(value = "LsnOfLastBackupRecord") + private String lsnOfLastBackupRecord; + + /** + * Denotes the failure encountered in performing backup operation. + */ + @JsonProperty(value = "FailureError") + private FabricErrorError failureError; + + /** + * Get represents the current state of the partition backup operation. + . Possible values include: 'Invalid', 'Accepted', 'BackupInProgress', 'Success', 'Failure', 'Timeout'. + * + * @return the backupState value + */ + public BackupState backupState() { + return this.backupState; + } + + /** + * Set represents the current state of the partition backup operation. + . Possible values include: 'Invalid', 'Accepted', 'BackupInProgress', 'Success', 'Failure', 'Timeout'. + * + * @param backupState the backupState value to set + * @return the BackupProgressInfoInner object itself. + */ + public BackupProgressInfoInner withBackupState(BackupState backupState) { + this.backupState = backupState; + return this; + } + + /** + * Get timeStamp in UTC when operation succeeded or failed. + * + * @return the timeStampUtc value + */ + public DateTime timeStampUtc() { + return this.timeStampUtc; + } + + /** + * Set timeStamp in UTC when operation succeeded or failed. + * + * @param timeStampUtc the timeStampUtc value to set + * @return the BackupProgressInfoInner object itself. + */ + public BackupProgressInfoInner withTimeStampUtc(DateTime timeStampUtc) { + this.timeStampUtc = timeStampUtc; + return this; + } + + /** + * Get unique ID of the newly created backup. + * + * @return the backupId value + */ + public UUID backupId() { + return this.backupId; + } + + /** + * Set unique ID of the newly created backup. + * + * @param backupId the backupId value to set + * @return the BackupProgressInfoInner object itself. + */ + public BackupProgressInfoInner withBackupId(UUID backupId) { + this.backupId = backupId; + return this; + } + + /** + * Get location, relative to the backup store, of the newly created backup. + * + * @return the backupLocation value + */ + public String backupLocation() { + return this.backupLocation; + } + + /** + * Set location, relative to the backup store, of the newly created backup. + * + * @param backupLocation the backupLocation value to set + * @return the BackupProgressInfoInner object itself. + */ + public BackupProgressInfoInner withBackupLocation(String backupLocation) { + this.backupLocation = backupLocation; + return this; + } + + /** + * Get specifies the epoch of the last record included in backup. + * + * @return the epochOfLastBackupRecord value + */ + public BackupEpoch epochOfLastBackupRecord() { + return this.epochOfLastBackupRecord; + } + + /** + * Set specifies the epoch of the last record included in backup. + * + * @param epochOfLastBackupRecord the epochOfLastBackupRecord value to set + * @return the BackupProgressInfoInner object itself. + */ + public BackupProgressInfoInner withEpochOfLastBackupRecord(BackupEpoch epochOfLastBackupRecord) { + this.epochOfLastBackupRecord = epochOfLastBackupRecord; + return this; + } + + /** + * Get the LSN of last record included in backup. + * + * @return the lsnOfLastBackupRecord value + */ + public String lsnOfLastBackupRecord() { + return this.lsnOfLastBackupRecord; + } + + /** + * Set the LSN of last record included in backup. + * + * @param lsnOfLastBackupRecord the lsnOfLastBackupRecord value to set + * @return the BackupProgressInfoInner object itself. + */ + public BackupProgressInfoInner withLsnOfLastBackupRecord(String lsnOfLastBackupRecord) { + this.lsnOfLastBackupRecord = lsnOfLastBackupRecord; + return this; + } + + /** + * Get denotes the failure encountered in performing backup operation. + * + * @return the failureError value + */ + public FabricErrorError failureError() { + return this.failureError; + } + + /** + * Set denotes the failure encountered in performing backup operation. + * + * @param failureError the failureError value to set + * @return the BackupProgressInfoInner object itself. + */ + public BackupProgressInfoInner withFailureError(FabricErrorError failureError) { + this.failureError = failureError; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ChaosEventsSegmentInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ChaosEventsSegmentInner.java new file mode 100644 index 0000000000000..194a5c052753b --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ChaosEventsSegmentInner.java @@ -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. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import java.util.List; +import com.microsoft.azure.servicefabric.ChaosEventWrapper; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains the list of Chaos events and the continuation token to get the next + * segment. + */ +public class ChaosEventsSegmentInner { + /** + * 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. + */ + @JsonProperty(value = "ContinuationToken") + private String continuationToken; + + /** + * List of Chaos events that meet the user-supplied criteria. + */ + @JsonProperty(value = "History") + private List history; + + /** + * Get 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. + * + * @return the continuationToken value + */ + public String continuationToken() { + return this.continuationToken; + } + + /** + * Set 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. + * + * @param continuationToken the continuationToken value to set + * @return the ChaosEventsSegmentInner object itself. + */ + public ChaosEventsSegmentInner withContinuationToken(String continuationToken) { + this.continuationToken = continuationToken; + return this; + } + + /** + * Get list of Chaos events that meet the user-supplied criteria. + * + * @return the history value + */ + public List history() { + return this.history; + } + + /** + * Set list of Chaos events that meet the user-supplied criteria. + * + * @param history the history value to set + * @return the ChaosEventsSegmentInner object itself. + */ + public ChaosEventsSegmentInner withHistory(List history) { + this.history = history; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ChaosInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ChaosInner.java new file mode 100644 index 0000000000000..42f95992edd61 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ChaosInner.java @@ -0,0 +1,105 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.microsoft.azure.servicefabric.ChaosParameters; +import com.microsoft.azure.servicefabric.ChaosStatus; +import com.microsoft.azure.servicefabric.ChaosScheduleStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains a description of Chaos. + */ +public class ChaosInner { + /** + * If Chaos is running, these are the parameters Chaos is running with. + */ + @JsonProperty(value = "ChaosParameters") + private ChaosParameters chaosParameters; + + /** + * Current status of the Chaos run. + * . Possible values include: 'Invalid', 'Running', 'Stopped'. + */ + @JsonProperty(value = "Status") + private ChaosStatus status; + + /** + * Current status of the schedule. + * . Possible values include: 'Invalid', 'Stopped', 'Active', 'Expired', + * 'Pending'. + */ + @JsonProperty(value = "ScheduleStatus") + private ChaosScheduleStatus scheduleStatus; + + /** + * Get if Chaos is running, these are the parameters Chaos is running with. + * + * @return the chaosParameters value + */ + public ChaosParameters chaosParameters() { + return this.chaosParameters; + } + + /** + * Set if Chaos is running, these are the parameters Chaos is running with. + * + * @param chaosParameters the chaosParameters value to set + * @return the ChaosInner object itself. + */ + public ChaosInner withChaosParameters(ChaosParameters chaosParameters) { + this.chaosParameters = chaosParameters; + return this; + } + + /** + * Get current status of the Chaos run. + . Possible values include: 'Invalid', 'Running', 'Stopped'. + * + * @return the status value + */ + public ChaosStatus status() { + return this.status; + } + + /** + * Set current status of the Chaos run. + . Possible values include: 'Invalid', 'Running', 'Stopped'. + * + * @param status the status value to set + * @return the ChaosInner object itself. + */ + public ChaosInner withStatus(ChaosStatus status) { + this.status = status; + return this; + } + + /** + * Get current status of the schedule. + . Possible values include: 'Invalid', 'Stopped', 'Active', 'Expired', 'Pending'. + * + * @return the scheduleStatus value + */ + public ChaosScheduleStatus scheduleStatus() { + return this.scheduleStatus; + } + + /** + * Set current status of the schedule. + . Possible values include: 'Invalid', 'Stopped', 'Active', 'Expired', 'Pending'. + * + * @param scheduleStatus the scheduleStatus value to set + * @return the ChaosInner object itself. + */ + public ChaosInner withScheduleStatus(ChaosScheduleStatus scheduleStatus) { + this.scheduleStatus = scheduleStatus; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ChaosScheduleDescriptionInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ChaosScheduleDescriptionInner.java new file mode 100644 index 0000000000000..426982203727e --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ChaosScheduleDescriptionInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.microsoft.azure.servicefabric.ChaosSchedule; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines the Chaos Schedule used by Chaos and the version of the Chaos + * Schedule. The version value wraps back to 0 after surpassing 2,147,483,647. + */ +public class ChaosScheduleDescriptionInner { + /** + * The version number of the Schedule. + */ + @JsonProperty(value = "Version") + private Integer version; + + /** + * Defines the schedule used by Chaos. + */ + @JsonProperty(value = "Schedule") + private ChaosSchedule schedule; + + /** + * Get the version number of the Schedule. + * + * @return the version value + */ + public Integer version() { + return this.version; + } + + /** + * Set the version number of the Schedule. + * + * @param version the version value to set + * @return the ChaosScheduleDescriptionInner object itself. + */ + public ChaosScheduleDescriptionInner withVersion(Integer version) { + this.version = version; + return this; + } + + /** + * Get defines the schedule used by Chaos. + * + * @return the schedule value + */ + public ChaosSchedule schedule() { + return this.schedule; + } + + /** + * Set defines the schedule used by Chaos. + * + * @param schedule the schedule value to set + * @return the ChaosScheduleDescriptionInner object itself. + */ + public ChaosScheduleDescriptionInner withSchedule(ChaosSchedule schedule) { + this.schedule = schedule; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ClusterConfigurationInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ClusterConfigurationInner.java new file mode 100644 index 0000000000000..51bbf273f7a02 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ClusterConfigurationInner.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about the standalone cluster configuration. + */ +public class ClusterConfigurationInner { + /** + * The contents of the cluster configuration file. + */ + @JsonProperty(value = "ClusterConfiguration") + private String clusterConfiguration; + + /** + * Get the contents of the cluster configuration file. + * + * @return the clusterConfiguration value + */ + public String clusterConfiguration() { + return this.clusterConfiguration; + } + + /** + * Set the contents of the cluster configuration file. + * + * @param clusterConfiguration the clusterConfiguration value to set + * @return the ClusterConfigurationInner object itself. + */ + public ClusterConfigurationInner withClusterConfiguration(String clusterConfiguration) { + this.clusterConfiguration = clusterConfiguration; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ClusterConfigurationUpgradeStatusInfoInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ClusterConfigurationUpgradeStatusInfoInner.java new file mode 100644 index 0000000000000..72248fe396a0c --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ClusterConfigurationUpgradeStatusInfoInner.java @@ -0,0 +1,125 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.microsoft.azure.servicefabric.UpgradeState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about a standalone cluster configuration upgrade status. + */ +public class ClusterConfigurationUpgradeStatusInfoInner { + /** + * The state of the upgrade domain. Possible values include: 'Invalid', + * 'RollingBackInProgress', 'RollingBackCompleted', + * 'RollingForwardPending', 'RollingForwardInProgress', + * 'RollingForwardCompleted', 'Failed'. + */ + @JsonProperty(value = "UpgradeState") + private UpgradeState upgradeState; + + /** + * The cluster manifest version. + */ + @JsonProperty(value = "ProgressStatus") + private Integer progressStatus; + + /** + * The cluster configuration version. + */ + @JsonProperty(value = "ConfigVersion") + private String configVersion; + + /** + * The cluster upgrade status details. + */ + @JsonProperty(value = "Details") + private String details; + + /** + * Get the state of the upgrade domain. Possible values include: 'Invalid', 'RollingBackInProgress', 'RollingBackCompleted', 'RollingForwardPending', 'RollingForwardInProgress', 'RollingForwardCompleted', 'Failed'. + * + * @return the upgradeState value + */ + public UpgradeState upgradeState() { + return this.upgradeState; + } + + /** + * Set the state of the upgrade domain. Possible values include: 'Invalid', 'RollingBackInProgress', 'RollingBackCompleted', 'RollingForwardPending', 'RollingForwardInProgress', 'RollingForwardCompleted', 'Failed'. + * + * @param upgradeState the upgradeState value to set + * @return the ClusterConfigurationUpgradeStatusInfoInner object itself. + */ + public ClusterConfigurationUpgradeStatusInfoInner withUpgradeState(UpgradeState upgradeState) { + this.upgradeState = upgradeState; + return this; + } + + /** + * Get the cluster manifest version. + * + * @return the progressStatus value + */ + public Integer progressStatus() { + return this.progressStatus; + } + + /** + * Set the cluster manifest version. + * + * @param progressStatus the progressStatus value to set + * @return the ClusterConfigurationUpgradeStatusInfoInner object itself. + */ + public ClusterConfigurationUpgradeStatusInfoInner withProgressStatus(Integer progressStatus) { + this.progressStatus = progressStatus; + return this; + } + + /** + * Get the cluster configuration version. + * + * @return the configVersion value + */ + public String configVersion() { + return this.configVersion; + } + + /** + * Set the cluster configuration version. + * + * @param configVersion the configVersion value to set + * @return the ClusterConfigurationUpgradeStatusInfoInner object itself. + */ + public ClusterConfigurationUpgradeStatusInfoInner withConfigVersion(String configVersion) { + this.configVersion = configVersion; + return this; + } + + /** + * Get the cluster upgrade status details. + * + * @return the details value + */ + public String details() { + return this.details; + } + + /** + * Set the cluster upgrade status details. + * + * @param details the details value to set + * @return the ClusterConfigurationUpgradeStatusInfoInner object itself. + */ + public ClusterConfigurationUpgradeStatusInfoInner withDetails(String details) { + this.details = details; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ClusterEventInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ClusterEventInner.java new file mode 100644 index 0000000000000..db95730519c91 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ClusterEventInner.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Represents the base for all Cluster Events. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ClusterEvent") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "ClusterHealthReportCreated", value = ClusterHealthReportCreatedEvent.class), + @JsonSubTypes.Type(name = "ClusterHealthReportExpired", value = ClusterHealthReportExpiredEvent.class), + @JsonSubTypes.Type(name = "ClusterUpgradeComplete", value = ClusterUpgradeCompleteEvent.class), + @JsonSubTypes.Type(name = "ClusterUpgradeDomainComplete", value = ClusterUpgradeDomainCompleteEvent.class), + @JsonSubTypes.Type(name = "ClusterUpgradeRollbackComplete", value = ClusterUpgradeRollbackCompleteEvent.class), + @JsonSubTypes.Type(name = "ClusterUpgradeRollbackStart", value = ClusterUpgradeRollbackStartEvent.class), + @JsonSubTypes.Type(name = "ClusterUpgradeStart", value = ClusterUpgradeStartEvent.class), + @JsonSubTypes.Type(name = "ChaosStopped", value = ChaosStoppedEvent.class), + @JsonSubTypes.Type(name = "ChaosStarted", value = ChaosStartedEvent.class) +}) +public class ClusterEventInner extends FabricEventInner { +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ClusterHealthChunkInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ClusterHealthChunkInner.java new file mode 100644 index 0000000000000..a0386fda04349 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ClusterHealthChunkInner.java @@ -0,0 +1,115 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.microsoft.azure.servicefabric.HealthState; +import com.microsoft.azure.servicefabric.NodeHealthStateChunkList; +import com.microsoft.azure.servicefabric.ApplicationHealthStateChunkList; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents the health chunk of the cluster. + * Contains the cluster aggregated health state, and the cluster entities that + * respect the input filter. + */ +public class ClusterHealthChunkInner { + /** + * The HealthState representing the aggregated health state of the cluster + * computed by Health Manager. + * The health evaluation of the entity reflects all events reported on the + * entity and its children (if any). + * The aggregation is done by applying the desired cluster health policy + * and the application health policies. + * . Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', + * 'Unknown'. + */ + @JsonProperty(value = "HealthState") + private HealthState healthState; + + /** + * The list of node health state chunks in the cluster that respect the + * filters in the cluster health chunk query description. + */ + @JsonProperty(value = "NodeHealthStateChunks") + private NodeHealthStateChunkList nodeHealthStateChunks; + + /** + * The list of application health state chunks in the cluster that respect + * the filters in the cluster health chunk query description. + */ + @JsonProperty(value = "ApplicationHealthStateChunks") + private ApplicationHealthStateChunkList applicationHealthStateChunks; + + /** + * Get the HealthState representing the aggregated health state of the cluster computed by Health Manager. + The health evaluation of the entity reflects all events reported on the entity and its children (if any). + The aggregation is done by applying the desired cluster health policy and the application health policies. + . Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown'. + * + * @return the healthState value + */ + public HealthState healthState() { + return this.healthState; + } + + /** + * Set the HealthState representing the aggregated health state of the cluster computed by Health Manager. + The health evaluation of the entity reflects all events reported on the entity and its children (if any). + The aggregation is done by applying the desired cluster health policy and the application health policies. + . Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown'. + * + * @param healthState the healthState value to set + * @return the ClusterHealthChunkInner object itself. + */ + public ClusterHealthChunkInner withHealthState(HealthState healthState) { + this.healthState = healthState; + return this; + } + + /** + * Get the list of node health state chunks in the cluster that respect the filters in the cluster health chunk query description. + * + * @return the nodeHealthStateChunks value + */ + public NodeHealthStateChunkList nodeHealthStateChunks() { + return this.nodeHealthStateChunks; + } + + /** + * Set the list of node health state chunks in the cluster that respect the filters in the cluster health chunk query description. + * + * @param nodeHealthStateChunks the nodeHealthStateChunks value to set + * @return the ClusterHealthChunkInner object itself. + */ + public ClusterHealthChunkInner withNodeHealthStateChunks(NodeHealthStateChunkList nodeHealthStateChunks) { + this.nodeHealthStateChunks = nodeHealthStateChunks; + return this; + } + + /** + * Get the list of application health state chunks in the cluster that respect the filters in the cluster health chunk query description. + * + * @return the applicationHealthStateChunks value + */ + public ApplicationHealthStateChunkList applicationHealthStateChunks() { + return this.applicationHealthStateChunks; + } + + /** + * Set the list of application health state chunks in the cluster that respect the filters in the cluster health chunk query description. + * + * @param applicationHealthStateChunks the applicationHealthStateChunks value to set + * @return the ClusterHealthChunkInner object itself. + */ + public ClusterHealthChunkInner withApplicationHealthStateChunks(ApplicationHealthStateChunkList applicationHealthStateChunks) { + this.applicationHealthStateChunks = applicationHealthStateChunks; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ClusterHealthInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ClusterHealthInner.java new file mode 100644 index 0000000000000..24209789b1eb6 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ClusterHealthInner.java @@ -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. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import java.util.List; +import com.microsoft.azure.servicefabric.NodeHealthState; +import com.microsoft.azure.servicefabric.ApplicationHealthState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.servicefabric.EntityHealth; + +/** + * Represents the health of the cluster. + * Contains the cluster aggregated health state, the cluster application and + * node health states as well as the health events and the unhealthy + * evaluations. + */ +public class ClusterHealthInner extends EntityHealth { + /** + * Cluster node health states as found in the health store. + */ + @JsonProperty(value = "NodeHealthStates") + private List nodeHealthStates; + + /** + * Cluster application health states as found in the health store. + */ + @JsonProperty(value = "ApplicationHealthStates") + private List applicationHealthStates; + + /** + * Get cluster node health states as found in the health store. + * + * @return the nodeHealthStates value + */ + public List nodeHealthStates() { + return this.nodeHealthStates; + } + + /** + * Set cluster node health states as found in the health store. + * + * @param nodeHealthStates the nodeHealthStates value to set + * @return the ClusterHealthInner object itself. + */ + public ClusterHealthInner withNodeHealthStates(List nodeHealthStates) { + this.nodeHealthStates = nodeHealthStates; + return this; + } + + /** + * Get cluster application health states as found in the health store. + * + * @return the applicationHealthStates value + */ + public List applicationHealthStates() { + return this.applicationHealthStates; + } + + /** + * Set cluster application health states as found in the health store. + * + * @param applicationHealthStates the applicationHealthStates value to set + * @return the ClusterHealthInner object itself. + */ + public ClusterHealthInner withApplicationHealthStates(List applicationHealthStates) { + this.applicationHealthStates = applicationHealthStates; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ClusterManifestInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ClusterManifestInner.java new file mode 100644 index 0000000000000..5044538c20fc7 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ClusterManifestInner.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about the cluster manifest. + */ +public class ClusterManifestInner { + /** + * The contents of the cluster manifest file. + */ + @JsonProperty(value = "Manifest") + private String manifest; + + /** + * Get the contents of the cluster manifest file. + * + * @return the manifest value + */ + public String manifest() { + return this.manifest; + } + + /** + * Set the contents of the cluster manifest file. + * + * @param manifest the manifest value to set + * @return the ClusterManifestInner object itself. + */ + public ClusterManifestInner withManifest(String manifest) { + this.manifest = manifest; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ClusterUpgradeProgressObjectInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ClusterUpgradeProgressObjectInner.java new file mode 100644 index 0000000000000..4a79d8ed83a6b --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ClusterUpgradeProgressObjectInner.java @@ -0,0 +1,425 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import java.util.List; +import com.microsoft.azure.servicefabric.UpgradeDomainInfo; +import com.microsoft.azure.servicefabric.UpgradeState; +import com.microsoft.azure.servicefabric.UpgradeMode; +import com.microsoft.azure.servicefabric.ClusterUpgradeDescriptionObject; +import com.microsoft.azure.servicefabric.HealthEvaluationWrapper; +import com.microsoft.azure.servicefabric.CurrentUpgradeDomainProgressInfo; +import com.microsoft.azure.servicefabric.FailureReason; +import com.microsoft.azure.servicefabric.FailedUpgradeDomainProgressObject; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about a cluster upgrade. + */ +public class ClusterUpgradeProgressObjectInner { + /** + * The ServiceFabric code version of the cluster. + */ + @JsonProperty(value = "CodeVersion") + private String codeVersion; + + /** + * The cluster configuration version (specified in the cluster manifest). + */ + @JsonProperty(value = "ConfigVersion") + private String configVersion; + + /** + * List of upgrade domains and their statuses. + */ + @JsonProperty(value = "UpgradeDomains") + private List upgradeDomains; + + /** + * The state of the upgrade domain. Possible values include: 'Invalid', + * 'RollingBackInProgress', 'RollingBackCompleted', + * 'RollingForwardPending', 'RollingForwardInProgress', + * 'RollingForwardCompleted', 'Failed'. + */ + @JsonProperty(value = "UpgradeState") + private UpgradeState upgradeState; + + /** + * The name of the next upgrade domain to be processed. + */ + @JsonProperty(value = "NextUpgradeDomain") + private String nextUpgradeDomain; + + /** + * The mode used to monitor health during a rolling upgrade. The values are + * UnmonitoredAuto, UnmonitoredManual, and Monitored. Possible values + * include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored'. + */ + @JsonProperty(value = "RollingUpgradeMode") + private UpgradeMode rollingUpgradeMode; + + /** + * Represents a ServiceFabric cluster upgrade. + */ + @JsonProperty(value = "UpgradeDescription") + private ClusterUpgradeDescriptionObject upgradeDescription; + + /** + * The estimated elapsed time spent processing the current overall upgrade. + */ + @JsonProperty(value = "UpgradeDurationInMilliseconds") + private String upgradeDurationInMilliseconds; + + /** + * The estimated elapsed time spent processing the current upgrade domain. + */ + @JsonProperty(value = "UpgradeDomainDurationInMilliseconds") + private String upgradeDomainDurationInMilliseconds; + + /** + * List of health evaluations that resulted in the current aggregated + * health state. + */ + @JsonProperty(value = "UnhealthyEvaluations") + private List unhealthyEvaluations; + + /** + * Information about the current in-progress upgrade domain. + */ + @JsonProperty(value = "CurrentUpgradeDomainProgress") + private CurrentUpgradeDomainProgressInfo currentUpgradeDomainProgress; + + /** + * The start time of the upgrade in UTC. + */ + @JsonProperty(value = "StartTimestampUtc") + private String startTimestampUtc; + + /** + * The failure time of the upgrade in UTC. + */ + @JsonProperty(value = "FailureTimestampUtc") + private String failureTimestampUtc; + + /** + * The cause of an upgrade failure that resulted in FailureAction being + * executed. Possible values include: 'None', 'Interrupted', 'HealthCheck', + * 'UpgradeDomainTimeout', 'OverallUpgradeTimeout'. + */ + @JsonProperty(value = "FailureReason") + private FailureReason failureReason; + + /** + * The detailed upgrade progress for nodes in the current upgrade domain at + * the point of failure. + */ + @JsonProperty(value = "UpgradeDomainProgressAtFailure") + private FailedUpgradeDomainProgressObject upgradeDomainProgressAtFailure; + + /** + * Get the ServiceFabric code version of the cluster. + * + * @return the codeVersion value + */ + public String codeVersion() { + return this.codeVersion; + } + + /** + * Set the ServiceFabric code version of the cluster. + * + * @param codeVersion the codeVersion value to set + * @return the ClusterUpgradeProgressObjectInner object itself. + */ + public ClusterUpgradeProgressObjectInner withCodeVersion(String codeVersion) { + this.codeVersion = codeVersion; + return this; + } + + /** + * Get the cluster configuration version (specified in the cluster manifest). + * + * @return the configVersion value + */ + public String configVersion() { + return this.configVersion; + } + + /** + * Set the cluster configuration version (specified in the cluster manifest). + * + * @param configVersion the configVersion value to set + * @return the ClusterUpgradeProgressObjectInner object itself. + */ + public ClusterUpgradeProgressObjectInner withConfigVersion(String configVersion) { + this.configVersion = configVersion; + return this; + } + + /** + * Get list of upgrade domains and their statuses. + * + * @return the upgradeDomains value + */ + public List upgradeDomains() { + return this.upgradeDomains; + } + + /** + * Set list of upgrade domains and their statuses. + * + * @param upgradeDomains the upgradeDomains value to set + * @return the ClusterUpgradeProgressObjectInner object itself. + */ + public ClusterUpgradeProgressObjectInner withUpgradeDomains(List upgradeDomains) { + this.upgradeDomains = upgradeDomains; + return this; + } + + /** + * Get the state of the upgrade domain. Possible values include: 'Invalid', 'RollingBackInProgress', 'RollingBackCompleted', 'RollingForwardPending', 'RollingForwardInProgress', 'RollingForwardCompleted', 'Failed'. + * + * @return the upgradeState value + */ + public UpgradeState upgradeState() { + return this.upgradeState; + } + + /** + * Set the state of the upgrade domain. Possible values include: 'Invalid', 'RollingBackInProgress', 'RollingBackCompleted', 'RollingForwardPending', 'RollingForwardInProgress', 'RollingForwardCompleted', 'Failed'. + * + * @param upgradeState the upgradeState value to set + * @return the ClusterUpgradeProgressObjectInner object itself. + */ + public ClusterUpgradeProgressObjectInner withUpgradeState(UpgradeState upgradeState) { + this.upgradeState = upgradeState; + return this; + } + + /** + * Get the name of the next upgrade domain to be processed. + * + * @return the nextUpgradeDomain value + */ + public String nextUpgradeDomain() { + return this.nextUpgradeDomain; + } + + /** + * Set the name of the next upgrade domain to be processed. + * + * @param nextUpgradeDomain the nextUpgradeDomain value to set + * @return the ClusterUpgradeProgressObjectInner object itself. + */ + public ClusterUpgradeProgressObjectInner withNextUpgradeDomain(String nextUpgradeDomain) { + this.nextUpgradeDomain = nextUpgradeDomain; + return this; + } + + /** + * Get the mode used to monitor health during a rolling upgrade. The values are UnmonitoredAuto, UnmonitoredManual, and Monitored. Possible values include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored'. + * + * @return the rollingUpgradeMode value + */ + public UpgradeMode rollingUpgradeMode() { + return this.rollingUpgradeMode; + } + + /** + * Set 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 rollingUpgradeMode the rollingUpgradeMode value to set + * @return the ClusterUpgradeProgressObjectInner object itself. + */ + public ClusterUpgradeProgressObjectInner withRollingUpgradeMode(UpgradeMode rollingUpgradeMode) { + this.rollingUpgradeMode = rollingUpgradeMode; + return this; + } + + /** + * Get represents a ServiceFabric cluster upgrade. + * + * @return the upgradeDescription value + */ + public ClusterUpgradeDescriptionObject upgradeDescription() { + return this.upgradeDescription; + } + + /** + * Set represents a ServiceFabric cluster upgrade. + * + * @param upgradeDescription the upgradeDescription value to set + * @return the ClusterUpgradeProgressObjectInner object itself. + */ + public ClusterUpgradeProgressObjectInner withUpgradeDescription(ClusterUpgradeDescriptionObject upgradeDescription) { + this.upgradeDescription = upgradeDescription; + return this; + } + + /** + * Get the estimated elapsed time spent processing the current overall upgrade. + * + * @return the upgradeDurationInMilliseconds value + */ + public String upgradeDurationInMilliseconds() { + return this.upgradeDurationInMilliseconds; + } + + /** + * Set the estimated elapsed time spent processing the current overall upgrade. + * + * @param upgradeDurationInMilliseconds the upgradeDurationInMilliseconds value to set + * @return the ClusterUpgradeProgressObjectInner object itself. + */ + public ClusterUpgradeProgressObjectInner withUpgradeDurationInMilliseconds(String upgradeDurationInMilliseconds) { + this.upgradeDurationInMilliseconds = upgradeDurationInMilliseconds; + return this; + } + + /** + * Get the estimated elapsed time spent processing the current upgrade domain. + * + * @return the upgradeDomainDurationInMilliseconds value + */ + public String upgradeDomainDurationInMilliseconds() { + return this.upgradeDomainDurationInMilliseconds; + } + + /** + * Set the estimated elapsed time spent processing the current upgrade domain. + * + * @param upgradeDomainDurationInMilliseconds the upgradeDomainDurationInMilliseconds value to set + * @return the ClusterUpgradeProgressObjectInner object itself. + */ + public ClusterUpgradeProgressObjectInner withUpgradeDomainDurationInMilliseconds(String upgradeDomainDurationInMilliseconds) { + this.upgradeDomainDurationInMilliseconds = upgradeDomainDurationInMilliseconds; + return this; + } + + /** + * Get list of health evaluations that resulted in the current aggregated health state. + * + * @return the unhealthyEvaluations value + */ + public List unhealthyEvaluations() { + return this.unhealthyEvaluations; + } + + /** + * Set list of health evaluations that resulted in the current aggregated health state. + * + * @param unhealthyEvaluations the unhealthyEvaluations value to set + * @return the ClusterUpgradeProgressObjectInner object itself. + */ + public ClusterUpgradeProgressObjectInner withUnhealthyEvaluations(List unhealthyEvaluations) { + this.unhealthyEvaluations = unhealthyEvaluations; + return this; + } + + /** + * Get information about the current in-progress upgrade domain. + * + * @return the currentUpgradeDomainProgress value + */ + public CurrentUpgradeDomainProgressInfo currentUpgradeDomainProgress() { + return this.currentUpgradeDomainProgress; + } + + /** + * Set information about the current in-progress upgrade domain. + * + * @param currentUpgradeDomainProgress the currentUpgradeDomainProgress value to set + * @return the ClusterUpgradeProgressObjectInner object itself. + */ + public ClusterUpgradeProgressObjectInner withCurrentUpgradeDomainProgress(CurrentUpgradeDomainProgressInfo currentUpgradeDomainProgress) { + this.currentUpgradeDomainProgress = currentUpgradeDomainProgress; + return this; + } + + /** + * Get the start time of the upgrade in UTC. + * + * @return the startTimestampUtc value + */ + public String startTimestampUtc() { + return this.startTimestampUtc; + } + + /** + * Set the start time of the upgrade in UTC. + * + * @param startTimestampUtc the startTimestampUtc value to set + * @return the ClusterUpgradeProgressObjectInner object itself. + */ + public ClusterUpgradeProgressObjectInner withStartTimestampUtc(String startTimestampUtc) { + this.startTimestampUtc = startTimestampUtc; + return this; + } + + /** + * Get the failure time of the upgrade in UTC. + * + * @return the failureTimestampUtc value + */ + public String failureTimestampUtc() { + return this.failureTimestampUtc; + } + + /** + * Set the failure time of the upgrade in UTC. + * + * @param failureTimestampUtc the failureTimestampUtc value to set + * @return the ClusterUpgradeProgressObjectInner object itself. + */ + public ClusterUpgradeProgressObjectInner withFailureTimestampUtc(String failureTimestampUtc) { + this.failureTimestampUtc = failureTimestampUtc; + return this; + } + + /** + * Get the cause of an upgrade failure that resulted in FailureAction being executed. Possible values include: 'None', 'Interrupted', 'HealthCheck', 'UpgradeDomainTimeout', 'OverallUpgradeTimeout'. + * + * @return the failureReason value + */ + public FailureReason failureReason() { + return this.failureReason; + } + + /** + * Set the cause of an upgrade failure that resulted in FailureAction being executed. Possible values include: 'None', 'Interrupted', 'HealthCheck', 'UpgradeDomainTimeout', 'OverallUpgradeTimeout'. + * + * @param failureReason the failureReason value to set + * @return the ClusterUpgradeProgressObjectInner object itself. + */ + public ClusterUpgradeProgressObjectInner withFailureReason(FailureReason failureReason) { + this.failureReason = failureReason; + return this; + } + + /** + * Get the detailed upgrade progress for nodes in the current upgrade domain at the point of failure. + * + * @return the upgradeDomainProgressAtFailure value + */ + public FailedUpgradeDomainProgressObject upgradeDomainProgressAtFailure() { + return this.upgradeDomainProgressAtFailure; + } + + /** + * Set the detailed upgrade progress for nodes in the current upgrade domain at the point of failure. + * + * @param upgradeDomainProgressAtFailure the upgradeDomainProgressAtFailure value to set + * @return the ClusterUpgradeProgressObjectInner object itself. + */ + public ClusterUpgradeProgressObjectInner withUpgradeDomainProgressAtFailure(FailedUpgradeDomainProgressObject upgradeDomainProgressAtFailure) { + this.upgradeDomainProgressAtFailure = upgradeDomainProgressAtFailure; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ComposeDeploymentStatusInfoInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ComposeDeploymentStatusInfoInner.java new file mode 100644 index 0000000000000..5e4f204bc2bc5 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ComposeDeploymentStatusInfoInner.java @@ -0,0 +1,124 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.microsoft.azure.servicefabric.ComposeDeploymentStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about a Service Fabric compose deployment. + */ +public class ComposeDeploymentStatusInfoInner { + /** + * The name of the deployment. + */ + @JsonProperty(value = "Name") + private String name; + + /** + * The name of the application, including the 'fabric:' URI scheme. + */ + @JsonProperty(value = "ApplicationName") + private String applicationName; + + /** + * The status of the compose deployment. Possible values include: + * 'Invalid', 'Provisioning', 'Creating', 'Ready', 'Unprovisioning', + * 'Deleting', 'Failed', 'Upgrading'. + */ + @JsonProperty(value = "Status") + private ComposeDeploymentStatus status; + + /** + * The status details of compose deployment including failure message. + */ + @JsonProperty(value = "StatusDetails") + private String statusDetails; + + /** + * Get the name of the deployment. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the deployment. + * + * @param name the name value to set + * @return the ComposeDeploymentStatusInfoInner object itself. + */ + public ComposeDeploymentStatusInfoInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the name of the application, including the 'fabric:' URI scheme. + * + * @return the applicationName value + */ + public String applicationName() { + return this.applicationName; + } + + /** + * Set the name of the application, including the 'fabric:' URI scheme. + * + * @param applicationName the applicationName value to set + * @return the ComposeDeploymentStatusInfoInner object itself. + */ + public ComposeDeploymentStatusInfoInner withApplicationName(String applicationName) { + this.applicationName = applicationName; + return this; + } + + /** + * Get the status of the compose deployment. Possible values include: 'Invalid', 'Provisioning', 'Creating', 'Ready', 'Unprovisioning', 'Deleting', 'Failed', 'Upgrading'. + * + * @return the status value + */ + public ComposeDeploymentStatus status() { + return this.status; + } + + /** + * Set the status of the compose deployment. Possible values include: 'Invalid', 'Provisioning', 'Creating', 'Ready', 'Unprovisioning', 'Deleting', 'Failed', 'Upgrading'. + * + * @param status the status value to set + * @return the ComposeDeploymentStatusInfoInner object itself. + */ + public ComposeDeploymentStatusInfoInner withStatus(ComposeDeploymentStatus status) { + this.status = status; + return this; + } + + /** + * Get the status details of compose deployment including failure message. + * + * @return the statusDetails value + */ + public String statusDetails() { + return this.statusDetails; + } + + /** + * Set the status details of compose deployment including failure message. + * + * @param statusDetails the statusDetails value to set + * @return the ComposeDeploymentStatusInfoInner object itself. + */ + public ComposeDeploymentStatusInfoInner withStatusDetails(String statusDetails) { + this.statusDetails = statusDetails; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ComposeDeploymentUpgradeProgressInfoInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ComposeDeploymentUpgradeProgressInfoInner.java new file mode 100644 index 0000000000000..0bdcf55465447 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ComposeDeploymentUpgradeProgressInfoInner.java @@ -0,0 +1,577 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.microsoft.azure.servicefabric.ComposeDeploymentUpgradeState; +import com.microsoft.azure.servicefabric.UpgradeKind; +import com.microsoft.azure.servicefabric.UpgradeMode; +import com.microsoft.azure.servicefabric.MonitoringPolicyDescription; +import com.microsoft.azure.servicefabric.ApplicationHealthPolicy; +import java.util.List; +import com.microsoft.azure.servicefabric.HealthEvaluationWrapper; +import com.microsoft.azure.servicefabric.CurrentUpgradeDomainProgressInfo; +import com.microsoft.azure.servicefabric.FailureReason; +import com.microsoft.azure.servicefabric.FailureUpgradeDomainProgressInfo; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the parameters for a compose deployment upgrade. + */ +public class ComposeDeploymentUpgradeProgressInfoInner { + /** + * The name of the target deployment. + */ + @JsonProperty(value = "DeploymentName") + private String deploymentName; + + /** + * The name of the target application, including the 'fabric:' URI scheme. + */ + @JsonProperty(value = "ApplicationName") + private String applicationName; + + /** + * The state of the compose deployment upgrade. + * . Possible values include: 'Invalid', 'ProvisioningTarget', + * 'RollingForwardInProgress', 'RollingForwardPending', + * 'UnprovisioningCurrent', 'RollingForwardCompleted', + * 'RollingBackInProgress', 'UnprovisioningTarget', 'RollingBackCompleted', + * 'Failed'. + */ + @JsonProperty(value = "UpgradeState") + private ComposeDeploymentUpgradeState upgradeState; + + /** + * Additional detailed information about the status of the pending upgrade. + */ + @JsonProperty(value = "UpgradeStatusDetails") + private String upgradeStatusDetails; + + /** + * The kind of upgrade out of the following possible values. Possible + * values include: 'Invalid', 'Rolling'. + */ + @JsonProperty(value = "UpgradeKind") + private UpgradeKind upgradeKind; + + /** + * The mode used to monitor health during a rolling upgrade. The values are + * UnmonitoredAuto, UnmonitoredManual, and Monitored. Possible values + * include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored'. + */ + @JsonProperty(value = "RollingUpgradeMode") + private UpgradeMode rollingUpgradeMode; + + /** + * If true, then processes are forcefully restarted during upgrade even + * when the code version has not changed (the upgrade only changes + * configuration or data). + */ + @JsonProperty(value = "ForceRestart") + private Boolean forceRestart; + + /** + * 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). + */ + @JsonProperty(value = "UpgradeReplicaSetCheckTimeoutInSeconds") + private Long upgradeReplicaSetCheckTimeoutInSeconds; + + /** + * Describes the parameters for monitoring an upgrade in Monitored mode. + */ + @JsonProperty(value = "MonitoringPolicy") + private MonitoringPolicyDescription monitoringPolicy; + + /** + * Defines a health policy used to evaluate the health of an application or + * one of its children entities. + */ + @JsonProperty(value = "ApplicationHealthPolicy") + private ApplicationHealthPolicy applicationHealthPolicy; + + /** + * The target application type version (found in the application manifest) + * for the application upgrade. + */ + @JsonProperty(value = "TargetApplicationTypeVersion") + private String targetApplicationTypeVersion; + + /** + * The estimated amount of time that the overall upgrade elapsed. It is + * first interpreted as a string representing an ISO 8601 duration. If that + * fails, then it is interpreted as a number representing the total number + * of milliseconds. + */ + @JsonProperty(value = "UpgradeDuration") + private String upgradeDuration; + + /** + * The estimated amount of time spent processing current Upgrade Domain. It + * is first interpreted as a string representing an ISO 8601 duration. If + * that fails, then it is interpreted as a number representing the total + * number of milliseconds. + */ + @JsonProperty(value = "CurrentUpgradeDomainDuration") + private String currentUpgradeDomainDuration; + + /** + * List of health evaluations that resulted in the current aggregated + * health state. + */ + @JsonProperty(value = "ApplicationUnhealthyEvaluations") + private List applicationUnhealthyEvaluations; + + /** + * Information about the current in-progress upgrade domain. + */ + @JsonProperty(value = "CurrentUpgradeDomainProgress") + private CurrentUpgradeDomainProgressInfo currentUpgradeDomainProgress; + + /** + * The estimated UTC datetime when the upgrade started. + */ + @JsonProperty(value = "StartTimestampUtc") + private String startTimestampUtc; + + /** + * The estimated UTC datetime when the upgrade failed and FailureAction was + * executed. + */ + @JsonProperty(value = "FailureTimestampUtc") + private String failureTimestampUtc; + + /** + * The cause of an upgrade failure that resulted in FailureAction being + * executed. Possible values include: 'None', 'Interrupted', 'HealthCheck', + * 'UpgradeDomainTimeout', 'OverallUpgradeTimeout'. + */ + @JsonProperty(value = "FailureReason") + private FailureReason failureReason; + + /** + * Information about the upgrade domain progress at the time of upgrade + * failure. + */ + @JsonProperty(value = "UpgradeDomainProgressAtFailure") + private FailureUpgradeDomainProgressInfo upgradeDomainProgressAtFailure; + + /** + * Additional details of application upgrade including failure message. + */ + @JsonProperty(value = "ApplicationUpgradeStatusDetails") + private String applicationUpgradeStatusDetails; + + /** + * Get the name of the target deployment. + * + * @return the deploymentName value + */ + public String deploymentName() { + return this.deploymentName; + } + + /** + * Set the name of the target deployment. + * + * @param deploymentName the deploymentName value to set + * @return the ComposeDeploymentUpgradeProgressInfoInner object itself. + */ + public ComposeDeploymentUpgradeProgressInfoInner withDeploymentName(String deploymentName) { + this.deploymentName = deploymentName; + return this; + } + + /** + * Get the name of the target application, including the 'fabric:' URI scheme. + * + * @return the applicationName value + */ + public String applicationName() { + return this.applicationName; + } + + /** + * Set the name of the target application, including the 'fabric:' URI scheme. + * + * @param applicationName the applicationName value to set + * @return the ComposeDeploymentUpgradeProgressInfoInner object itself. + */ + public ComposeDeploymentUpgradeProgressInfoInner withApplicationName(String applicationName) { + this.applicationName = applicationName; + return this; + } + + /** + * Get the state of the compose deployment upgrade. + . Possible values include: 'Invalid', 'ProvisioningTarget', 'RollingForwardInProgress', 'RollingForwardPending', 'UnprovisioningCurrent', 'RollingForwardCompleted', 'RollingBackInProgress', 'UnprovisioningTarget', 'RollingBackCompleted', 'Failed'. + * + * @return the upgradeState value + */ + public ComposeDeploymentUpgradeState upgradeState() { + return this.upgradeState; + } + + /** + * Set the state of the compose deployment upgrade. + . Possible values include: 'Invalid', 'ProvisioningTarget', 'RollingForwardInProgress', 'RollingForwardPending', 'UnprovisioningCurrent', 'RollingForwardCompleted', 'RollingBackInProgress', 'UnprovisioningTarget', 'RollingBackCompleted', 'Failed'. + * + * @param upgradeState the upgradeState value to set + * @return the ComposeDeploymentUpgradeProgressInfoInner object itself. + */ + public ComposeDeploymentUpgradeProgressInfoInner withUpgradeState(ComposeDeploymentUpgradeState upgradeState) { + this.upgradeState = upgradeState; + return this; + } + + /** + * Get additional detailed information about the status of the pending upgrade. + * + * @return the upgradeStatusDetails value + */ + public String upgradeStatusDetails() { + return this.upgradeStatusDetails; + } + + /** + * Set additional detailed information about the status of the pending upgrade. + * + * @param upgradeStatusDetails the upgradeStatusDetails value to set + * @return the ComposeDeploymentUpgradeProgressInfoInner object itself. + */ + public ComposeDeploymentUpgradeProgressInfoInner withUpgradeStatusDetails(String upgradeStatusDetails) { + this.upgradeStatusDetails = upgradeStatusDetails; + return this; + } + + /** + * Get the kind of upgrade out of the following possible values. Possible values include: 'Invalid', 'Rolling'. + * + * @return the upgradeKind value + */ + public UpgradeKind upgradeKind() { + return this.upgradeKind; + } + + /** + * Set the kind of upgrade out of the following possible values. Possible values include: 'Invalid', 'Rolling'. + * + * @param upgradeKind the upgradeKind value to set + * @return the ComposeDeploymentUpgradeProgressInfoInner object itself. + */ + public ComposeDeploymentUpgradeProgressInfoInner withUpgradeKind(UpgradeKind upgradeKind) { + this.upgradeKind = upgradeKind; + return this; + } + + /** + * Get the mode used to monitor health during a rolling upgrade. The values are UnmonitoredAuto, UnmonitoredManual, and Monitored. Possible values include: 'Invalid', 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored'. + * + * @return the rollingUpgradeMode value + */ + public UpgradeMode rollingUpgradeMode() { + return this.rollingUpgradeMode; + } + + /** + * Set 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 rollingUpgradeMode the rollingUpgradeMode value to set + * @return the ComposeDeploymentUpgradeProgressInfoInner object itself. + */ + public ComposeDeploymentUpgradeProgressInfoInner withRollingUpgradeMode(UpgradeMode rollingUpgradeMode) { + this.rollingUpgradeMode = rollingUpgradeMode; + return this; + } + + /** + * Get if true, then processes are forcefully restarted during upgrade even when the code version has not changed (the upgrade only changes configuration or data). + * + * @return the forceRestart value + */ + public Boolean forceRestart() { + return this.forceRestart; + } + + /** + * Set 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 forceRestart the forceRestart value to set + * @return the ComposeDeploymentUpgradeProgressInfoInner object itself. + */ + public ComposeDeploymentUpgradeProgressInfoInner withForceRestart(Boolean forceRestart) { + this.forceRestart = forceRestart; + return this; + } + + /** + * Get 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). + * + * @return the upgradeReplicaSetCheckTimeoutInSeconds value + */ + public Long upgradeReplicaSetCheckTimeoutInSeconds() { + return this.upgradeReplicaSetCheckTimeoutInSeconds; + } + + /** + * Set 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 upgradeReplicaSetCheckTimeoutInSeconds the upgradeReplicaSetCheckTimeoutInSeconds value to set + * @return the ComposeDeploymentUpgradeProgressInfoInner object itself. + */ + public ComposeDeploymentUpgradeProgressInfoInner withUpgradeReplicaSetCheckTimeoutInSeconds(Long upgradeReplicaSetCheckTimeoutInSeconds) { + this.upgradeReplicaSetCheckTimeoutInSeconds = upgradeReplicaSetCheckTimeoutInSeconds; + return this; + } + + /** + * Get describes the parameters for monitoring an upgrade in Monitored mode. + * + * @return the monitoringPolicy value + */ + public MonitoringPolicyDescription monitoringPolicy() { + return this.monitoringPolicy; + } + + /** + * Set describes the parameters for monitoring an upgrade in Monitored mode. + * + * @param monitoringPolicy the monitoringPolicy value to set + * @return the ComposeDeploymentUpgradeProgressInfoInner object itself. + */ + public ComposeDeploymentUpgradeProgressInfoInner withMonitoringPolicy(MonitoringPolicyDescription monitoringPolicy) { + this.monitoringPolicy = monitoringPolicy; + return this; + } + + /** + * Get defines a health policy used to evaluate the health of an application or one of its children entities. + * + * @return the applicationHealthPolicy value + */ + public ApplicationHealthPolicy applicationHealthPolicy() { + return this.applicationHealthPolicy; + } + + /** + * Set defines a health policy used to evaluate the health of an application or one of its children entities. + * + * @param applicationHealthPolicy the applicationHealthPolicy value to set + * @return the ComposeDeploymentUpgradeProgressInfoInner object itself. + */ + public ComposeDeploymentUpgradeProgressInfoInner withApplicationHealthPolicy(ApplicationHealthPolicy applicationHealthPolicy) { + this.applicationHealthPolicy = applicationHealthPolicy; + return this; + } + + /** + * Get the target application type version (found in the application manifest) for the application upgrade. + * + * @return the targetApplicationTypeVersion value + */ + public String targetApplicationTypeVersion() { + return this.targetApplicationTypeVersion; + } + + /** + * Set the target application type version (found in the application manifest) for the application upgrade. + * + * @param targetApplicationTypeVersion the targetApplicationTypeVersion value to set + * @return the ComposeDeploymentUpgradeProgressInfoInner object itself. + */ + public ComposeDeploymentUpgradeProgressInfoInner withTargetApplicationTypeVersion(String targetApplicationTypeVersion) { + this.targetApplicationTypeVersion = targetApplicationTypeVersion; + return this; + } + + /** + * Get the estimated amount of time that the overall upgrade elapsed. It is first interpreted as a string representing an ISO 8601 duration. If that fails, then it is interpreted as a number representing the total number of milliseconds. + * + * @return the upgradeDuration value + */ + public String upgradeDuration() { + return this.upgradeDuration; + } + + /** + * Set the estimated amount of time that the overall upgrade elapsed. It is first interpreted as a string representing an ISO 8601 duration. If that fails, then it is interpreted as a number representing the total number of milliseconds. + * + * @param upgradeDuration the upgradeDuration value to set + * @return the ComposeDeploymentUpgradeProgressInfoInner object itself. + */ + public ComposeDeploymentUpgradeProgressInfoInner withUpgradeDuration(String upgradeDuration) { + this.upgradeDuration = upgradeDuration; + return this; + } + + /** + * Get the estimated amount of time spent processing current Upgrade Domain. It is first interpreted as a string representing an ISO 8601 duration. If that fails, then it is interpreted as a number representing the total number of milliseconds. + * + * @return the currentUpgradeDomainDuration value + */ + public String currentUpgradeDomainDuration() { + return this.currentUpgradeDomainDuration; + } + + /** + * Set the estimated amount of time spent processing current Upgrade Domain. It is first interpreted as a string representing an ISO 8601 duration. If that fails, then it is interpreted as a number representing the total number of milliseconds. + * + * @param currentUpgradeDomainDuration the currentUpgradeDomainDuration value to set + * @return the ComposeDeploymentUpgradeProgressInfoInner object itself. + */ + public ComposeDeploymentUpgradeProgressInfoInner withCurrentUpgradeDomainDuration(String currentUpgradeDomainDuration) { + this.currentUpgradeDomainDuration = currentUpgradeDomainDuration; + return this; + } + + /** + * Get list of health evaluations that resulted in the current aggregated health state. + * + * @return the applicationUnhealthyEvaluations value + */ + public List applicationUnhealthyEvaluations() { + return this.applicationUnhealthyEvaluations; + } + + /** + * Set list of health evaluations that resulted in the current aggregated health state. + * + * @param applicationUnhealthyEvaluations the applicationUnhealthyEvaluations value to set + * @return the ComposeDeploymentUpgradeProgressInfoInner object itself. + */ + public ComposeDeploymentUpgradeProgressInfoInner withApplicationUnhealthyEvaluations(List applicationUnhealthyEvaluations) { + this.applicationUnhealthyEvaluations = applicationUnhealthyEvaluations; + return this; + } + + /** + * Get information about the current in-progress upgrade domain. + * + * @return the currentUpgradeDomainProgress value + */ + public CurrentUpgradeDomainProgressInfo currentUpgradeDomainProgress() { + return this.currentUpgradeDomainProgress; + } + + /** + * Set information about the current in-progress upgrade domain. + * + * @param currentUpgradeDomainProgress the currentUpgradeDomainProgress value to set + * @return the ComposeDeploymentUpgradeProgressInfoInner object itself. + */ + public ComposeDeploymentUpgradeProgressInfoInner withCurrentUpgradeDomainProgress(CurrentUpgradeDomainProgressInfo currentUpgradeDomainProgress) { + this.currentUpgradeDomainProgress = currentUpgradeDomainProgress; + return this; + } + + /** + * Get the estimated UTC datetime when the upgrade started. + * + * @return the startTimestampUtc value + */ + public String startTimestampUtc() { + return this.startTimestampUtc; + } + + /** + * Set the estimated UTC datetime when the upgrade started. + * + * @param startTimestampUtc the startTimestampUtc value to set + * @return the ComposeDeploymentUpgradeProgressInfoInner object itself. + */ + public ComposeDeploymentUpgradeProgressInfoInner withStartTimestampUtc(String startTimestampUtc) { + this.startTimestampUtc = startTimestampUtc; + return this; + } + + /** + * Get the estimated UTC datetime when the upgrade failed and FailureAction was executed. + * + * @return the failureTimestampUtc value + */ + public String failureTimestampUtc() { + return this.failureTimestampUtc; + } + + /** + * Set the estimated UTC datetime when the upgrade failed and FailureAction was executed. + * + * @param failureTimestampUtc the failureTimestampUtc value to set + * @return the ComposeDeploymentUpgradeProgressInfoInner object itself. + */ + public ComposeDeploymentUpgradeProgressInfoInner withFailureTimestampUtc(String failureTimestampUtc) { + this.failureTimestampUtc = failureTimestampUtc; + return this; + } + + /** + * Get the cause of an upgrade failure that resulted in FailureAction being executed. Possible values include: 'None', 'Interrupted', 'HealthCheck', 'UpgradeDomainTimeout', 'OverallUpgradeTimeout'. + * + * @return the failureReason value + */ + public FailureReason failureReason() { + return this.failureReason; + } + + /** + * Set the cause of an upgrade failure that resulted in FailureAction being executed. Possible values include: 'None', 'Interrupted', 'HealthCheck', 'UpgradeDomainTimeout', 'OverallUpgradeTimeout'. + * + * @param failureReason the failureReason value to set + * @return the ComposeDeploymentUpgradeProgressInfoInner object itself. + */ + public ComposeDeploymentUpgradeProgressInfoInner withFailureReason(FailureReason failureReason) { + this.failureReason = failureReason; + return this; + } + + /** + * Get information about the upgrade domain progress at the time of upgrade failure. + * + * @return the upgradeDomainProgressAtFailure value + */ + public FailureUpgradeDomainProgressInfo upgradeDomainProgressAtFailure() { + return this.upgradeDomainProgressAtFailure; + } + + /** + * Set information about the upgrade domain progress at the time of upgrade failure. + * + * @param upgradeDomainProgressAtFailure the upgradeDomainProgressAtFailure value to set + * @return the ComposeDeploymentUpgradeProgressInfoInner object itself. + */ + public ComposeDeploymentUpgradeProgressInfoInner withUpgradeDomainProgressAtFailure(FailureUpgradeDomainProgressInfo upgradeDomainProgressAtFailure) { + this.upgradeDomainProgressAtFailure = upgradeDomainProgressAtFailure; + return this; + } + + /** + * Get additional details of application upgrade including failure message. + * + * @return the applicationUpgradeStatusDetails value + */ + public String applicationUpgradeStatusDetails() { + return this.applicationUpgradeStatusDetails; + } + + /** + * Set additional details of application upgrade including failure message. + * + * @param applicationUpgradeStatusDetails the applicationUpgradeStatusDetails value to set + * @return the ComposeDeploymentUpgradeProgressInfoInner object itself. + */ + public ComposeDeploymentUpgradeProgressInfoInner withApplicationUpgradeStatusDetails(String applicationUpgradeStatusDetails) { + this.applicationUpgradeStatusDetails = applicationUpgradeStatusDetails; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ContainerApiResponseInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ContainerApiResponseInner.java new file mode 100644 index 0000000000000..02ac7fdf3dd3f --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ContainerApiResponseInner.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.microsoft.azure.servicefabric.ContainerApiResult; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response body that wraps container API result. + */ +public class ContainerApiResponseInner { + /** + * Container API result. + */ + @JsonProperty(value = "ContainerApiResult", required = true) + private ContainerApiResult containerApiResult; + + /** + * Get container API result. + * + * @return the containerApiResult value + */ + public ContainerApiResult containerApiResult() { + return this.containerApiResult; + } + + /** + * Set container API result. + * + * @param containerApiResult the containerApiResult value to set + * @return the ContainerApiResponseInner object itself. + */ + public ContainerApiResponseInner withContainerApiResult(ContainerApiResult containerApiResult) { + this.containerApiResult = containerApiResult; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ContainerInstanceEventInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ContainerInstanceEventInner.java new file mode 100644 index 0000000000000..f7e1e9bf89982 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ContainerInstanceEventInner.java @@ -0,0 +1,20 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents the base for all Container Events. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ContainerInstanceEvent") +public class ContainerInstanceEventInner extends FabricEventInner { +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ContainerLogsInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ContainerLogsInner.java new file mode 100644 index 0000000000000..5cdc1d660af3e --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ContainerLogsInner.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Container logs. + */ +public class ContainerLogsInner { + /** + * Container logs. + */ + @JsonProperty(value = "Content") + private String content; + + /** + * Get container logs. + * + * @return the content value + */ + public String content() { + return this.content; + } + + /** + * Set container logs. + * + * @param content the content value to set + * @return the ContainerLogsInner object itself. + */ + public ContainerLogsInner withContent(String content) { + this.content = content; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/DeployedApplicationHealthInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/DeployedApplicationHealthInner.java new file mode 100644 index 0000000000000..13524d8ff1fe2 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/DeployedApplicationHealthInner.java @@ -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. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import java.util.List; +import com.microsoft.azure.servicefabric.DeployedServicePackageHealthState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.servicefabric.EntityHealth; + +/** + * Information about the health of an application deployed on a Service Fabric + * node. + */ +public class DeployedApplicationHealthInner extends EntityHealth { + /** + * Name of the application deployed on the node whose health information is + * described by this object. + */ + @JsonProperty(value = "Name") + private String name; + + /** + * Name of the node where this application is deployed. + */ + @JsonProperty(value = "NodeName") + private String nodeName; + + /** + * Deployed service package health states for the current deployed + * application as found in the health store. + */ + @JsonProperty(value = "DeployedServicePackageHealthStates") + private List deployedServicePackageHealthStates; + + /** + * Get name of the application deployed on the node whose health information is described by this object. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the application deployed on the node whose health information is described by this object. + * + * @param name the name value to set + * @return the DeployedApplicationHealthInner object itself. + */ + public DeployedApplicationHealthInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get name of the node where this application is deployed. + * + * @return the nodeName value + */ + public String nodeName() { + return this.nodeName; + } + + /** + * Set name of the node where this application is deployed. + * + * @param nodeName the nodeName value to set + * @return the DeployedApplicationHealthInner object itself. + */ + public DeployedApplicationHealthInner withNodeName(String nodeName) { + this.nodeName = nodeName; + return this; + } + + /** + * Get deployed service package health states for the current deployed application as found in the health store. + * + * @return the deployedServicePackageHealthStates value + */ + public List deployedServicePackageHealthStates() { + return this.deployedServicePackageHealthStates; + } + + /** + * Set deployed service package health states for the current deployed application as found in the health store. + * + * @param deployedServicePackageHealthStates the deployedServicePackageHealthStates value to set + * @return the DeployedApplicationHealthInner object itself. + */ + public DeployedApplicationHealthInner withDeployedServicePackageHealthStates(List deployedServicePackageHealthStates) { + this.deployedServicePackageHealthStates = deployedServicePackageHealthStates; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/DeployedApplicationInfoInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/DeployedApplicationInfoInner.java new file mode 100644 index 0000000000000..c4a1f0707b420 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/DeployedApplicationInfoInner.java @@ -0,0 +1,248 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.microsoft.azure.servicefabric.DeployedApplicationStatus; +import com.microsoft.azure.servicefabric.HealthState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about application deployed on the node. + */ +public class DeployedApplicationInfoInner { + /** + * 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. + */ + @JsonProperty(value = "Id") + private String id; + + /** + * The name of the application, including the 'fabric:' URI scheme. + */ + @JsonProperty(value = "Name") + private String name; + + /** + * The application type name as defined in the application manifest. + */ + @JsonProperty(value = "TypeName") + private String typeName; + + /** + * The status of the application deployed on the node. Following are the + * possible values. + * . Possible values include: 'Invalid', 'Downloading', 'Activating', + * 'Active', 'Upgrading', 'Deactivating'. + */ + @JsonProperty(value = "Status") + private DeployedApplicationStatus status; + + /** + * The work directory of the application on the node. The work directory + * can be used to store application data. + */ + @JsonProperty(value = "WorkDirectory") + private String workDirectory; + + /** + * The log directory of the application on the node. The log directory can + * be used to store application logs. + */ + @JsonProperty(value = "LogDirectory") + private String logDirectory; + + /** + * The temp directory of the application on the node. The code packages + * belonging to the application are forked with this directory set as their + * temporary directory. + */ + @JsonProperty(value = "TempDirectory") + private String tempDirectory; + + /** + * 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'. + */ + @JsonProperty(value = "HealthState") + private HealthState healthState; + + /** + * Get 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. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set 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. + * + * @param id the id value to set + * @return the DeployedApplicationInfoInner object itself. + */ + public DeployedApplicationInfoInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name of the application, including the 'fabric:' URI scheme. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the application, including the 'fabric:' URI scheme. + * + * @param name the name value to set + * @return the DeployedApplicationInfoInner object itself. + */ + public DeployedApplicationInfoInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the application type name as defined in the application manifest. + * + * @return the typeName value + */ + public String typeName() { + return this.typeName; + } + + /** + * Set the application type name as defined in the application manifest. + * + * @param typeName the typeName value to set + * @return the DeployedApplicationInfoInner object itself. + */ + public DeployedApplicationInfoInner withTypeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get the status of the application deployed on the node. Following are the possible values. + . Possible values include: 'Invalid', 'Downloading', 'Activating', 'Active', 'Upgrading', 'Deactivating'. + * + * @return the status value + */ + public DeployedApplicationStatus status() { + return this.status; + } + + /** + * Set the status of the application deployed on the node. Following are the possible values. + . Possible values include: 'Invalid', 'Downloading', 'Activating', 'Active', 'Upgrading', 'Deactivating'. + * + * @param status the status value to set + * @return the DeployedApplicationInfoInner object itself. + */ + public DeployedApplicationInfoInner withStatus(DeployedApplicationStatus status) { + this.status = status; + return this; + } + + /** + * Get the work directory of the application on the node. The work directory can be used to store application data. + * + * @return the workDirectory value + */ + public String workDirectory() { + return this.workDirectory; + } + + /** + * Set the work directory of the application on the node. The work directory can be used to store application data. + * + * @param workDirectory the workDirectory value to set + * @return the DeployedApplicationInfoInner object itself. + */ + public DeployedApplicationInfoInner withWorkDirectory(String workDirectory) { + this.workDirectory = workDirectory; + return this; + } + + /** + * Get the log directory of the application on the node. The log directory can be used to store application logs. + * + * @return the logDirectory value + */ + public String logDirectory() { + return this.logDirectory; + } + + /** + * Set the log directory of the application on the node. The log directory can be used to store application logs. + * + * @param logDirectory the logDirectory value to set + * @return the DeployedApplicationInfoInner object itself. + */ + public DeployedApplicationInfoInner withLogDirectory(String logDirectory) { + this.logDirectory = logDirectory; + return this; + } + + /** + * Get the temp directory of the application on the node. The code packages belonging to the application are forked with this directory set as their temporary directory. + * + * @return the tempDirectory value + */ + public String tempDirectory() { + return this.tempDirectory; + } + + /** + * Set the temp directory of the application on the node. The code packages belonging to the application are forked with this directory set as their temporary directory. + * + * @param tempDirectory the tempDirectory value to set + * @return the DeployedApplicationInfoInner object itself. + */ + public DeployedApplicationInfoInner withTempDirectory(String tempDirectory) { + this.tempDirectory = tempDirectory; + return this; + } + + /** + * Get 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'. + * + * @return the healthState value + */ + public HealthState healthState() { + return this.healthState; + } + + /** + * Set 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 healthState the healthState value to set + * @return the DeployedApplicationInfoInner object itself. + */ + public DeployedApplicationInfoInner withHealthState(HealthState healthState) { + this.healthState = healthState; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/DeployedCodePackageInfoInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/DeployedCodePackageInfoInner.java new file mode 100644 index 0000000000000..d97341e661c9d --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/DeployedCodePackageInfoInner.java @@ -0,0 +1,303 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.microsoft.azure.servicefabric.HostType; +import com.microsoft.azure.servicefabric.HostIsolationMode; +import com.microsoft.azure.servicefabric.DeploymentStatus; +import com.microsoft.azure.servicefabric.CodePackageEntryPoint; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about code package deployed on a Service Fabric node. + */ +public class DeployedCodePackageInfoInner { + /** + * The name of the code package. + */ + @JsonProperty(value = "Name") + private String name; + + /** + * The version of the code package specified in service manifest. + */ + @JsonProperty(value = "Version") + private String version; + + /** + * The name of service manifest that specified this code package. + */ + @JsonProperty(value = "ServiceManifestName") + private String serviceManifestName; + + /** + * 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. + */ + @JsonProperty(value = "ServicePackageActivationId") + private String servicePackageActivationId; + + /** + * Specifies the type of host for main entry point of a code package as + * specified in service manifest. Possible values include: 'Invalid', + * 'ExeHost', 'ContainerHost'. + */ + @JsonProperty(value = "HostType") + private HostType hostType; + + /** + * Specifies the isolation mode of main entry point of a code package when + * it's host type is ContainerHost. This is specified as part of container + * host policies in application manifest while importing service manifest. + * Possible values include: 'None', 'Process', 'HyperV'. + */ + @JsonProperty(value = "HostIsolationMode") + private HostIsolationMode hostIsolationMode; + + /** + * Specifies the status of a deployed application or service package on a + * Service Fabric node. + * . Possible values include: 'Invalid', 'Downloading', 'Activating', + * 'Active', 'Upgrading', 'Deactivating'. + */ + @JsonProperty(value = "Status") + private DeploymentStatus status; + + /** + * The interval at which code package is run. This is used for periodic + * code package. + */ + @JsonProperty(value = "RunFrequencyInterval") + private String runFrequencyInterval; + + /** + * Information about setup or main entry point of a code package deployed + * on a Service Fabric node. + */ + @JsonProperty(value = "SetupEntryPoint") + private CodePackageEntryPoint setupEntryPoint; + + /** + * Information about setup or main entry point of a code package deployed + * on a Service Fabric node. + */ + @JsonProperty(value = "MainEntryPoint") + private CodePackageEntryPoint mainEntryPoint; + + /** + * Get the name of the code package. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the code package. + * + * @param name the name value to set + * @return the DeployedCodePackageInfoInner object itself. + */ + public DeployedCodePackageInfoInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the version of the code package specified in service manifest. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Set the version of the code package specified in service manifest. + * + * @param version the version value to set + * @return the DeployedCodePackageInfoInner object itself. + */ + public DeployedCodePackageInfoInner withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the name of service manifest that specified this code package. + * + * @return the serviceManifestName value + */ + public String serviceManifestName() { + return this.serviceManifestName; + } + + /** + * Set the name of service manifest that specified this code package. + * + * @param serviceManifestName the serviceManifestName value to set + * @return the DeployedCodePackageInfoInner object itself. + */ + public DeployedCodePackageInfoInner withServiceManifestName(String serviceManifestName) { + this.serviceManifestName = serviceManifestName; + return this; + } + + /** + * Get 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. + * + * @return the servicePackageActivationId value + */ + public String servicePackageActivationId() { + return this.servicePackageActivationId; + } + + /** + * Set 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 servicePackageActivationId the servicePackageActivationId value to set + * @return the DeployedCodePackageInfoInner object itself. + */ + public DeployedCodePackageInfoInner withServicePackageActivationId(String servicePackageActivationId) { + this.servicePackageActivationId = servicePackageActivationId; + return this; + } + + /** + * Get specifies the type of host for main entry point of a code package as specified in service manifest. Possible values include: 'Invalid', 'ExeHost', 'ContainerHost'. + * + * @return the hostType value + */ + public HostType hostType() { + return this.hostType; + } + + /** + * Set specifies the type of host for main entry point of a code package as specified in service manifest. Possible values include: 'Invalid', 'ExeHost', 'ContainerHost'. + * + * @param hostType the hostType value to set + * @return the DeployedCodePackageInfoInner object itself. + */ + public DeployedCodePackageInfoInner withHostType(HostType hostType) { + this.hostType = hostType; + return this; + } + + /** + * Get specifies the isolation mode of main entry point of a code package when it's host type is ContainerHost. This is specified as part of container host policies in application manifest while importing service manifest. Possible values include: 'None', 'Process', 'HyperV'. + * + * @return the hostIsolationMode value + */ + public HostIsolationMode hostIsolationMode() { + return this.hostIsolationMode; + } + + /** + * Set specifies the isolation mode of main entry point of a code package when it's host type is ContainerHost. This is specified as part of container host policies in application manifest while importing service manifest. Possible values include: 'None', 'Process', 'HyperV'. + * + * @param hostIsolationMode the hostIsolationMode value to set + * @return the DeployedCodePackageInfoInner object itself. + */ + public DeployedCodePackageInfoInner withHostIsolationMode(HostIsolationMode hostIsolationMode) { + this.hostIsolationMode = hostIsolationMode; + return this; + } + + /** + * Get specifies the status of a deployed application or service package on a Service Fabric node. + . Possible values include: 'Invalid', 'Downloading', 'Activating', 'Active', 'Upgrading', 'Deactivating'. + * + * @return the status value + */ + public DeploymentStatus status() { + return this.status; + } + + /** + * Set specifies the status of a deployed application or service package on a Service Fabric node. + . Possible values include: 'Invalid', 'Downloading', 'Activating', 'Active', 'Upgrading', 'Deactivating'. + * + * @param status the status value to set + * @return the DeployedCodePackageInfoInner object itself. + */ + public DeployedCodePackageInfoInner withStatus(DeploymentStatus status) { + this.status = status; + return this; + } + + /** + * Get the interval at which code package is run. This is used for periodic code package. + * + * @return the runFrequencyInterval value + */ + public String runFrequencyInterval() { + return this.runFrequencyInterval; + } + + /** + * Set the interval at which code package is run. This is used for periodic code package. + * + * @param runFrequencyInterval the runFrequencyInterval value to set + * @return the DeployedCodePackageInfoInner object itself. + */ + public DeployedCodePackageInfoInner withRunFrequencyInterval(String runFrequencyInterval) { + this.runFrequencyInterval = runFrequencyInterval; + return this; + } + + /** + * Get information about setup or main entry point of a code package deployed on a Service Fabric node. + * + * @return the setupEntryPoint value + */ + public CodePackageEntryPoint setupEntryPoint() { + return this.setupEntryPoint; + } + + /** + * Set information about setup or main entry point of a code package deployed on a Service Fabric node. + * + * @param setupEntryPoint the setupEntryPoint value to set + * @return the DeployedCodePackageInfoInner object itself. + */ + public DeployedCodePackageInfoInner withSetupEntryPoint(CodePackageEntryPoint setupEntryPoint) { + this.setupEntryPoint = setupEntryPoint; + return this; + } + + /** + * Get information about setup or main entry point of a code package deployed on a Service Fabric node. + * + * @return the mainEntryPoint value + */ + public CodePackageEntryPoint mainEntryPoint() { + return this.mainEntryPoint; + } + + /** + * Set information about setup or main entry point of a code package deployed on a Service Fabric node. + * + * @param mainEntryPoint the mainEntryPoint value to set + * @return the DeployedCodePackageInfoInner object itself. + */ + public DeployedCodePackageInfoInner withMainEntryPoint(CodePackageEntryPoint mainEntryPoint) { + this.mainEntryPoint = mainEntryPoint; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/DeployedServicePackageHealthInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/DeployedServicePackageHealthInner.java new file mode 100644 index 0000000000000..c57ee762590eb --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/DeployedServicePackageHealthInner.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.servicefabric.EntityHealth; + +/** + * Information about the health of a service package for a specific application + * deployed on a Service Fabric node. + */ +public class DeployedServicePackageHealthInner extends EntityHealth { + /** + * The name of the application, including the 'fabric:' URI scheme. + */ + @JsonProperty(value = "ApplicationName") + private String applicationName; + + /** + * Name of the service manifest. + */ + @JsonProperty(value = "ServiceManifestName") + private String serviceManifestName; + + /** + * Name of the node where this service package is deployed. + */ + @JsonProperty(value = "NodeName") + private String nodeName; + + /** + * Get the name of the application, including the 'fabric:' URI scheme. + * + * @return the applicationName value + */ + public String applicationName() { + return this.applicationName; + } + + /** + * Set the name of the application, including the 'fabric:' URI scheme. + * + * @param applicationName the applicationName value to set + * @return the DeployedServicePackageHealthInner object itself. + */ + public DeployedServicePackageHealthInner withApplicationName(String applicationName) { + this.applicationName = applicationName; + return this; + } + + /** + * Get name of the service manifest. + * + * @return the serviceManifestName value + */ + public String serviceManifestName() { + return this.serviceManifestName; + } + + /** + * Set name of the service manifest. + * + * @param serviceManifestName the serviceManifestName value to set + * @return the DeployedServicePackageHealthInner object itself. + */ + public DeployedServicePackageHealthInner withServiceManifestName(String serviceManifestName) { + this.serviceManifestName = serviceManifestName; + return this; + } + + /** + * Get name of the node where this service package is deployed. + * + * @return the nodeName value + */ + public String nodeName() { + return this.nodeName; + } + + /** + * Set name of the node where this service package is deployed. + * + * @param nodeName the nodeName value to set + * @return the DeployedServicePackageHealthInner object itself. + */ + public DeployedServicePackageHealthInner withNodeName(String nodeName) { + this.nodeName = nodeName; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/DeployedServicePackageInfoInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/DeployedServicePackageInfoInner.java new file mode 100644 index 0000000000000..dc598f4d4b975 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/DeployedServicePackageInfoInner.java @@ -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. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.microsoft.azure.servicefabric.DeploymentStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about service package deployed on a Service Fabric node. + */ +public class DeployedServicePackageInfoInner { + /** + * The name of the service package as specified in the service manifest. + */ + @JsonProperty(value = "Name") + private String name; + + /** + * The version of the service package specified in service manifest. + */ + @JsonProperty(value = "Version") + private String version; + + /** + * Specifies the status of a deployed application or service package on a + * Service Fabric node. + * . Possible values include: 'Invalid', 'Downloading', 'Activating', + * 'Active', 'Upgrading', 'Deactivating'. + */ + @JsonProperty(value = "Status") + private DeploymentStatus status; + + /** + * 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. + */ + @JsonProperty(value = "ServicePackageActivationId") + private String servicePackageActivationId; + + /** + * Get the name of the service package as specified in the service manifest. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the service package as specified in the service manifest. + * + * @param name the name value to set + * @return the DeployedServicePackageInfoInner object itself. + */ + public DeployedServicePackageInfoInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the version of the service package specified in service manifest. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Set the version of the service package specified in service manifest. + * + * @param version the version value to set + * @return the DeployedServicePackageInfoInner object itself. + */ + public DeployedServicePackageInfoInner withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get specifies the status of a deployed application or service package on a Service Fabric node. + . Possible values include: 'Invalid', 'Downloading', 'Activating', 'Active', 'Upgrading', 'Deactivating'. + * + * @return the status value + */ + public DeploymentStatus status() { + return this.status; + } + + /** + * Set specifies the status of a deployed application or service package on a Service Fabric node. + . Possible values include: 'Invalid', 'Downloading', 'Activating', 'Active', 'Upgrading', 'Deactivating'. + * + * @param status the status value to set + * @return the DeployedServicePackageInfoInner object itself. + */ + public DeployedServicePackageInfoInner withStatus(DeploymentStatus status) { + this.status = status; + return this; + } + + /** + * Get 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. + * + * @return the servicePackageActivationId value + */ + public String servicePackageActivationId() { + return this.servicePackageActivationId; + } + + /** + * Set 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 servicePackageActivationId the servicePackageActivationId value to set + * @return the DeployedServicePackageInfoInner object itself. + */ + public DeployedServicePackageInfoInner withServicePackageActivationId(String servicePackageActivationId) { + this.servicePackageActivationId = servicePackageActivationId; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/DeployedServiceReplicaDetailInfoInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/DeployedServiceReplicaDetailInfoInner.java new file mode 100644 index 0000000000000..3fa0904465eb7 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/DeployedServiceReplicaDetailInfoInner.java @@ -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. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import java.util.UUID; +import com.microsoft.azure.servicefabric.ServiceOperationName; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.servicefabric.LoadMetricReportInfo; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Information about a Service Fabric service replica deployed on a node. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ServiceKind") +@JsonTypeName("DeployedServiceReplicaDetailInfo") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Stateful", value = DeployedStatefulServiceReplicaDetailInfo.class), + @JsonSubTypes.Type(name = "Stateless", value = DeployedStatelessServiceInstanceDetailInfo.class) +}) +public class DeployedServiceReplicaDetailInfoInner { + /** + * Full hierarchical name of the service in URI format starting with + * `fabric:`. + */ + @JsonProperty(value = "ServiceName") + private String serviceName; + + /** + * 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. + */ + @JsonProperty(value = "PartitionId") + private UUID partitionId; + + /** + * 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'. + */ + @JsonProperty(value = "CurrentServiceOperation") + private ServiceOperationName currentServiceOperation; + + /** + * The start time of the current service operation in UTC format. + */ + @JsonProperty(value = "CurrentServiceOperationStartTimeUtc") + private DateTime currentServiceOperationStartTimeUtc; + + /** + * List of load reported by replica. + */ + @JsonProperty(value = "ReportedLoad") + private List reportedLoad; + + /** + * Get full hierarchical name of the service in URI format starting with `fabric:`. + * + * @return the serviceName value + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set full hierarchical name of the service in URI format starting with `fabric:`. + * + * @param serviceName the serviceName value to set + * @return the DeployedServiceReplicaDetailInfoInner object itself. + */ + public DeployedServiceReplicaDetailInfoInner withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Get 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. + * + * @return the partitionId value + */ + public UUID partitionId() { + return this.partitionId; + } + + /** + * Set 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. + * + * @param partitionId the partitionId value to set + * @return the DeployedServiceReplicaDetailInfoInner object itself. + */ + public DeployedServiceReplicaDetailInfoInner withPartitionId(UUID partitionId) { + this.partitionId = partitionId; + return this; + } + + /** + * Get 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'. + * + * @return the currentServiceOperation value + */ + public ServiceOperationName currentServiceOperation() { + return this.currentServiceOperation; + } + + /** + * Set 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'. + * + * @param currentServiceOperation the currentServiceOperation value to set + * @return the DeployedServiceReplicaDetailInfoInner object itself. + */ + public DeployedServiceReplicaDetailInfoInner withCurrentServiceOperation(ServiceOperationName currentServiceOperation) { + this.currentServiceOperation = currentServiceOperation; + return this; + } + + /** + * Get the start time of the current service operation in UTC format. + * + * @return the currentServiceOperationStartTimeUtc value + */ + public DateTime currentServiceOperationStartTimeUtc() { + return this.currentServiceOperationStartTimeUtc; + } + + /** + * Set the start time of the current service operation in UTC format. + * + * @param currentServiceOperationStartTimeUtc the currentServiceOperationStartTimeUtc value to set + * @return the DeployedServiceReplicaDetailInfoInner object itself. + */ + public DeployedServiceReplicaDetailInfoInner withCurrentServiceOperationStartTimeUtc(DateTime currentServiceOperationStartTimeUtc) { + this.currentServiceOperationStartTimeUtc = currentServiceOperationStartTimeUtc; + return this; + } + + /** + * Get list of load reported by replica. + * + * @return the reportedLoad value + */ + public List reportedLoad() { + return this.reportedLoad; + } + + /** + * Set list of load reported by replica. + * + * @param reportedLoad the reportedLoad value to set + * @return the DeployedServiceReplicaDetailInfoInner object itself. + */ + public DeployedServiceReplicaDetailInfoInner withReportedLoad(List reportedLoad) { + this.reportedLoad = reportedLoad; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/DeployedServiceReplicaInfoInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/DeployedServiceReplicaInfoInner.java new file mode 100644 index 0000000000000..430853aa83168 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/DeployedServiceReplicaInfoInner.java @@ -0,0 +1,278 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import java.util.UUID; +import com.microsoft.azure.servicefabric.ReplicaStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Information about a Service Fabric service replica deployed on a node. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ServiceKind") +@JsonTypeName("DeployedServiceReplicaInfo") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Stateful", value = DeployedStatefulServiceReplicaInfo.class), + @JsonSubTypes.Type(name = "Stateless", value = DeployedStatelessServiceInstanceInfo.class) +}) +public class DeployedServiceReplicaInfoInner { + /** + * The full name of the service with 'fabric:' URI scheme. + */ + @JsonProperty(value = "ServiceName") + private String serviceName; + + /** + * Name of the service type as specified in the service manifest. + */ + @JsonProperty(value = "ServiceTypeName") + private String serviceTypeName; + + /** + * The name of the service manifest in which this service type is defined. + */ + @JsonProperty(value = "ServiceManifestName") + private String serviceManifestName; + + /** + * The name of the code package that hosts this replica. + */ + @JsonProperty(value = "CodePackageName") + private String codePackageName; + + /** + * 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. + */ + @JsonProperty(value = "PartitionId") + private UUID partitionId; + + /** + * The status of a replica of a service. Possible values include: + * 'Invalid', 'InBuild', 'Standby', 'Ready', 'Down', 'Dropped'. + */ + @JsonProperty(value = "ReplicaStatus") + private ReplicaStatus replicaStatus; + + /** + * The last address returned by the replica in Open or ChangeRole. + */ + @JsonProperty(value = "Address") + private String address; + + /** + * 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. + */ + @JsonProperty(value = "ServicePackageActivationId") + private String servicePackageActivationId; + + /** + * Host process ID of the process that is hosting the replica. This will be + * zero if the replica is down. In hyper-v containers this host process ID + * will be from different kernel. + */ + @JsonProperty(value = "HostProcessId") + private String hostProcessId; + + /** + * Get the full name of the service with 'fabric:' URI scheme. + * + * @return the serviceName value + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set the full name of the service with 'fabric:' URI scheme. + * + * @param serviceName the serviceName value to set + * @return the DeployedServiceReplicaInfoInner object itself. + */ + public DeployedServiceReplicaInfoInner withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Get name of the service type as specified in the service manifest. + * + * @return the serviceTypeName value + */ + public String serviceTypeName() { + return this.serviceTypeName; + } + + /** + * Set name of the service type as specified in the service manifest. + * + * @param serviceTypeName the serviceTypeName value to set + * @return the DeployedServiceReplicaInfoInner object itself. + */ + public DeployedServiceReplicaInfoInner withServiceTypeName(String serviceTypeName) { + this.serviceTypeName = serviceTypeName; + return this; + } + + /** + * Get the name of the service manifest in which this service type is defined. + * + * @return the serviceManifestName value + */ + public String serviceManifestName() { + return this.serviceManifestName; + } + + /** + * Set the name of the service manifest in which this service type is defined. + * + * @param serviceManifestName the serviceManifestName value to set + * @return the DeployedServiceReplicaInfoInner object itself. + */ + public DeployedServiceReplicaInfoInner withServiceManifestName(String serviceManifestName) { + this.serviceManifestName = serviceManifestName; + return this; + } + + /** + * Get the name of the code package that hosts this replica. + * + * @return the codePackageName value + */ + public String codePackageName() { + return this.codePackageName; + } + + /** + * Set the name of the code package that hosts this replica. + * + * @param codePackageName the codePackageName value to set + * @return the DeployedServiceReplicaInfoInner object itself. + */ + public DeployedServiceReplicaInfoInner withCodePackageName(String codePackageName) { + this.codePackageName = codePackageName; + return this; + } + + /** + * Get 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. + * + * @return the partitionId value + */ + public UUID partitionId() { + return this.partitionId; + } + + /** + * Set 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. + * + * @param partitionId the partitionId value to set + * @return the DeployedServiceReplicaInfoInner object itself. + */ + public DeployedServiceReplicaInfoInner withPartitionId(UUID partitionId) { + this.partitionId = partitionId; + return this; + } + + /** + * Get the status of a replica of a service. Possible values include: 'Invalid', 'InBuild', 'Standby', 'Ready', 'Down', 'Dropped'. + * + * @return the replicaStatus value + */ + public ReplicaStatus replicaStatus() { + return this.replicaStatus; + } + + /** + * Set the status of a replica of a service. Possible values include: 'Invalid', 'InBuild', 'Standby', 'Ready', 'Down', 'Dropped'. + * + * @param replicaStatus the replicaStatus value to set + * @return the DeployedServiceReplicaInfoInner object itself. + */ + public DeployedServiceReplicaInfoInner withReplicaStatus(ReplicaStatus replicaStatus) { + this.replicaStatus = replicaStatus; + return this; + } + + /** + * Get the last address returned by the replica in Open or ChangeRole. + * + * @return the address value + */ + public String address() { + return this.address; + } + + /** + * Set the last address returned by the replica in Open or ChangeRole. + * + * @param address the address value to set + * @return the DeployedServiceReplicaInfoInner object itself. + */ + public DeployedServiceReplicaInfoInner withAddress(String address) { + this.address = address; + return this; + } + + /** + * Get 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. + * + * @return the servicePackageActivationId value + */ + public String servicePackageActivationId() { + return this.servicePackageActivationId; + } + + /** + * Set 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 servicePackageActivationId the servicePackageActivationId value to set + * @return the DeployedServiceReplicaInfoInner object itself. + */ + public DeployedServiceReplicaInfoInner withServicePackageActivationId(String servicePackageActivationId) { + this.servicePackageActivationId = servicePackageActivationId; + return this; + } + + /** + * Get host process ID of the process that is hosting the replica. This will be zero if the replica is down. In hyper-v containers this host process ID will be from different kernel. + * + * @return the hostProcessId value + */ + public String hostProcessId() { + return this.hostProcessId; + } + + /** + * Set host process ID of the process that is hosting the replica. This will be zero if the replica is down. In hyper-v containers this host process ID will be from different kernel. + * + * @param hostProcessId the hostProcessId value to set + * @return the DeployedServiceReplicaInfoInner object itself. + */ + public DeployedServiceReplicaInfoInner withHostProcessId(String hostProcessId) { + this.hostProcessId = hostProcessId; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/DeployedServiceTypeInfoInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/DeployedServiceTypeInfoInner.java new file mode 100644 index 0000000000000..0dfde91a97092 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/DeployedServiceTypeInfoInner.java @@ -0,0 +1,159 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.microsoft.azure.servicefabric.ServiceTypeRegistrationStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about service type deployed on a node, information such as the + * status of the service type registration on a node. + */ +public class DeployedServiceTypeInfoInner { + /** + * Name of the service type as specified in the service manifest. + */ + @JsonProperty(value = "ServiceTypeName") + private String serviceTypeName; + + /** + * The name of the service manifest in which this service type is defined. + */ + @JsonProperty(value = "ServiceManifestName") + private String serviceManifestName; + + /** + * The name of the code package that registered the service type. + */ + @JsonProperty(value = "CodePackageName") + private String codePackageName; + + /** + * The status of the service type registration on the node. Possible values + * include: 'Invalid', 'Disabled', 'Enabled', 'Registered'. + */ + @JsonProperty(value = "Status") + private ServiceTypeRegistrationStatus status; + + /** + * 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. + */ + @JsonProperty(value = "ServicePackageActivationId") + private String servicePackageActivationId; + + /** + * Get name of the service type as specified in the service manifest. + * + * @return the serviceTypeName value + */ + public String serviceTypeName() { + return this.serviceTypeName; + } + + /** + * Set name of the service type as specified in the service manifest. + * + * @param serviceTypeName the serviceTypeName value to set + * @return the DeployedServiceTypeInfoInner object itself. + */ + public DeployedServiceTypeInfoInner withServiceTypeName(String serviceTypeName) { + this.serviceTypeName = serviceTypeName; + return this; + } + + /** + * Get the name of the service manifest in which this service type is defined. + * + * @return the serviceManifestName value + */ + public String serviceManifestName() { + return this.serviceManifestName; + } + + /** + * Set the name of the service manifest in which this service type is defined. + * + * @param serviceManifestName the serviceManifestName value to set + * @return the DeployedServiceTypeInfoInner object itself. + */ + public DeployedServiceTypeInfoInner withServiceManifestName(String serviceManifestName) { + this.serviceManifestName = serviceManifestName; + return this; + } + + /** + * Get the name of the code package that registered the service type. + * + * @return the codePackageName value + */ + public String codePackageName() { + return this.codePackageName; + } + + /** + * Set the name of the code package that registered the service type. + * + * @param codePackageName the codePackageName value to set + * @return the DeployedServiceTypeInfoInner object itself. + */ + public DeployedServiceTypeInfoInner withCodePackageName(String codePackageName) { + this.codePackageName = codePackageName; + return this; + } + + /** + * Get the status of the service type registration on the node. Possible values include: 'Invalid', 'Disabled', 'Enabled', 'Registered'. + * + * @return the status value + */ + public ServiceTypeRegistrationStatus status() { + return this.status; + } + + /** + * Set the status of the service type registration on the node. Possible values include: 'Invalid', 'Disabled', 'Enabled', 'Registered'. + * + * @param status the status value to set + * @return the DeployedServiceTypeInfoInner object itself. + */ + public DeployedServiceTypeInfoInner withStatus(ServiceTypeRegistrationStatus status) { + this.status = status; + return this; + } + + /** + * Get 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. + * + * @return the servicePackageActivationId value + */ + public String servicePackageActivationId() { + return this.servicePackageActivationId; + } + + /** + * Set 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 servicePackageActivationId the servicePackageActivationId value to set + * @return the DeployedServiceTypeInfoInner object itself. + */ + public DeployedServiceTypeInfoInner withServicePackageActivationId(String servicePackageActivationId) { + this.servicePackageActivationId = servicePackageActivationId; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/FabricCodeVersionInfoInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/FabricCodeVersionInfoInner.java new file mode 100644 index 0000000000000..42a90812ece66 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/FabricCodeVersionInfoInner.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about a Service Fabric code version. + */ +public class FabricCodeVersionInfoInner { + /** + * The product version of Service Fabric. + */ + @JsonProperty(value = "CodeVersion") + private String codeVersion; + + /** + * Get the product version of Service Fabric. + * + * @return the codeVersion value + */ + public String codeVersion() { + return this.codeVersion; + } + + /** + * Set the product version of Service Fabric. + * + * @param codeVersion the codeVersion value to set + * @return the FabricCodeVersionInfoInner object itself. + */ + public FabricCodeVersionInfoInner withCodeVersion(String codeVersion) { + this.codeVersion = codeVersion; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/FabricConfigVersionInfoInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/FabricConfigVersionInfoInner.java new file mode 100644 index 0000000000000..be67e88fc80de --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/FabricConfigVersionInfoInner.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about a Service Fabric config version. + */ +public class FabricConfigVersionInfoInner { + /** + * The config version of Service Fabric. + */ + @JsonProperty(value = "ConfigVersion") + private String configVersion; + + /** + * Get the config version of Service Fabric. + * + * @return the configVersion value + */ + public String configVersion() { + return this.configVersion; + } + + /** + * Set the config version of Service Fabric. + * + * @param configVersion the configVersion value to set + * @return the FabricConfigVersionInfoInner object itself. + */ + public FabricConfigVersionInfoInner withConfigVersion(String configVersion) { + this.configVersion = configVersion; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/FabricEventInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/FabricEventInner.java new file mode 100644 index 0000000000000..f53e08e34d341 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/FabricEventInner.java @@ -0,0 +1,111 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import java.util.UUID; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Represents the base for all Fabric Events. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("FabricEvent") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "ApplicationEvent", value = ApplicationEventInner.class), + @JsonSubTypes.Type(name = "ClusterEvent", value = ClusterEventInner.class), + @JsonSubTypes.Type(name = "ContainerInstanceEvent", value = ContainerInstanceEventInner.class), + @JsonSubTypes.Type(name = "NodeEvent", value = NodeEventInner.class), + @JsonSubTypes.Type(name = "PartitionEvent", value = PartitionEventInner.class), + @JsonSubTypes.Type(name = "ReplicaEvent", value = ReplicaEventInner.class), + @JsonSubTypes.Type(name = "ServiceEvent", value = ServiceEventInner.class) +}) +public class FabricEventInner { + /** + * The identifier for the FabricEvent instance. + */ + @JsonProperty(value = "EventInstanceId", required = true) + private UUID eventInstanceId; + + /** + * The time event was logged. + */ + @JsonProperty(value = "TimeStamp", required = true) + private DateTime timeStamp; + + /** + * Shows there is existing related events available. + */ + @JsonProperty(value = "HasCorrelatedEvents") + private Boolean hasCorrelatedEvents; + + /** + * Get the identifier for the FabricEvent instance. + * + * @return the eventInstanceId value + */ + public UUID eventInstanceId() { + return this.eventInstanceId; + } + + /** + * Set the identifier for the FabricEvent instance. + * + * @param eventInstanceId the eventInstanceId value to set + * @return the FabricEventInner object itself. + */ + public FabricEventInner withEventInstanceId(UUID eventInstanceId) { + this.eventInstanceId = eventInstanceId; + return this; + } + + /** + * Get the time event was logged. + * + * @return the timeStamp value + */ + public DateTime timeStamp() { + return this.timeStamp; + } + + /** + * Set the time event was logged. + * + * @param timeStamp the timeStamp value to set + * @return the FabricEventInner object itself. + */ + public FabricEventInner withTimeStamp(DateTime timeStamp) { + this.timeStamp = timeStamp; + return this; + } + + /** + * Get shows there is existing related events available. + * + * @return the hasCorrelatedEvents value + */ + public Boolean hasCorrelatedEvents() { + return this.hasCorrelatedEvents; + } + + /** + * Set shows there is existing related events available. + * + * @param hasCorrelatedEvents the hasCorrelatedEvents value to set + * @return the FabricEventInner object itself. + */ + public FabricEventInner withHasCorrelatedEvents(Boolean hasCorrelatedEvents) { + this.hasCorrelatedEvents = hasCorrelatedEvents; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/FailedPropertyBatchInfoInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/FailedPropertyBatchInfoInner.java new file mode 100644 index 0000000000000..6cdb050153ec7 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/FailedPropertyBatchInfoInner.java @@ -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. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.PropertyBatchInfo; + +/** + * Derived from PropertyBatchInfo. Represents the property batch failing. + * Contains information about the specific batch failure. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("Failed") +public class FailedPropertyBatchInfoInner extends PropertyBatchInfo { + /** + * The error message of the failed operation. Describes the exception + * thrown due to the first unsuccessful operation in the property batch. + */ + @JsonProperty(value = "ErrorMessage") + private String errorMessage; + + /** + * The index of the unsuccessful operation in the property batch. + */ + @JsonProperty(value = "OperationIndex") + private Integer operationIndex; + + /** + * Get the error message of the failed operation. Describes the exception thrown due to the first unsuccessful operation in the property batch. + * + * @return the errorMessage value + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set the error message of the failed operation. Describes the exception thrown due to the first unsuccessful operation in the property batch. + * + * @param errorMessage the errorMessage value to set + * @return the FailedPropertyBatchInfoInner object itself. + */ + public FailedPropertyBatchInfoInner withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Get the index of the unsuccessful operation in the property batch. + * + * @return the operationIndex value + */ + public Integer operationIndex() { + return this.operationIndex; + } + + /** + * Set the index of the unsuccessful operation in the property batch. + * + * @param operationIndex the operationIndex value to set + * @return the FailedPropertyBatchInfoInner object itself. + */ + public FailedPropertyBatchInfoInner withOperationIndex(Integer operationIndex) { + this.operationIndex = operationIndex; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ImageStoreContentInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ImageStoreContentInner.java new file mode 100644 index 0000000000000..60c5638c50bdd --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ImageStoreContentInner.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import java.util.List; +import com.microsoft.azure.servicefabric.FileInfo; +import com.microsoft.azure.servicefabric.FolderInfo; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about the image store content. + */ +public class ImageStoreContentInner { + /** + * The list of image store file info objects represents files found under + * the given image store relative path. + */ + @JsonProperty(value = "StoreFiles") + private List storeFiles; + + /** + * The list of image store folder info objects represents subfolders found + * under the given image store relative path. + */ + @JsonProperty(value = "StoreFolders") + private List storeFolders; + + /** + * Get the list of image store file info objects represents files found under the given image store relative path. + * + * @return the storeFiles value + */ + public List storeFiles() { + return this.storeFiles; + } + + /** + * Set the list of image store file info objects represents files found under the given image store relative path. + * + * @param storeFiles the storeFiles value to set + * @return the ImageStoreContentInner object itself. + */ + public ImageStoreContentInner withStoreFiles(List storeFiles) { + this.storeFiles = storeFiles; + return this; + } + + /** + * Get the list of image store folder info objects represents subfolders found under the given image store relative path. + * + * @return the storeFolders value + */ + public List storeFolders() { + return this.storeFolders; + } + + /** + * Set the list of image store folder info objects represents subfolders found under the given image store relative path. + * + * @param storeFolders the storeFolders value to set + * @return the ImageStoreContentInner object itself. + */ + public ImageStoreContentInner withStoreFolders(List storeFolders) { + this.storeFolders = storeFolders; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/NodeEventInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/NodeEventInner.java new file mode 100644 index 0000000000000..44775c9c44ed1 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/NodeEventInner.java @@ -0,0 +1,67 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Represents the base for all Node Events. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("NodeEvent") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "NodeAborted", value = NodeAbortedEvent.class), + @JsonSubTypes.Type(name = "NodeAborting", value = NodeAbortingEvent.class), + @JsonSubTypes.Type(name = "NodeAdded", value = NodeAddedEvent.class), + @JsonSubTypes.Type(name = "NodeClose", value = NodeCloseEvent.class), + @JsonSubTypes.Type(name = "NodeClosing", value = NodeClosingEvent.class), + @JsonSubTypes.Type(name = "NodeDeactivateComplete", value = NodeDeactivateCompleteEvent.class), + @JsonSubTypes.Type(name = "NodeDeactivateStart", value = NodeDeactivateStartEvent.class), + @JsonSubTypes.Type(name = "NodeDown", value = NodeDownEvent.class), + @JsonSubTypes.Type(name = "NodeHealthReportCreated", value = NodeHealthReportCreatedEvent.class), + @JsonSubTypes.Type(name = "NodeHealthReportExpired", value = NodeHealthReportExpiredEvent.class), + @JsonSubTypes.Type(name = "NodeOpenedSuccess", value = NodeOpenedSuccessEvent.class), + @JsonSubTypes.Type(name = "NodeOpenFailed", value = NodeOpenFailedEvent.class), + @JsonSubTypes.Type(name = "NodeOpening", value = NodeOpeningEvent.class), + @JsonSubTypes.Type(name = "NodeRemoved", value = NodeRemovedEvent.class), + @JsonSubTypes.Type(name = "NodeUp", value = NodeUpEvent.class), + @JsonSubTypes.Type(name = "ChaosRestartNodeFaultCompleted", value = ChaosRestartNodeFaultCompletedEvent.class), + @JsonSubTypes.Type(name = "ChaosRestartNodeFaultScheduled", value = ChaosRestartNodeFaultScheduledEvent.class) +}) +public class NodeEventInner extends FabricEventInner { + /** + * The name of a Service Fabric node. + */ + @JsonProperty(value = "NodeName", required = true) + private String nodeName; + + /** + * Get the name of a Service Fabric node. + * + * @return the nodeName value + */ + public String nodeName() { + return this.nodeName; + } + + /** + * Set the name of a Service Fabric node. + * + * @param nodeName the nodeName value to set + * @return the NodeEventInner object itself. + */ + public NodeEventInner withNodeName(String nodeName) { + this.nodeName = nodeName; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/NodeHealthInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/NodeHealthInner.java new file mode 100644 index 0000000000000..e033444d7841f --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/NodeHealthInner.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.servicefabric.EntityHealth; + +/** + * Information about the health of a Service Fabric node. + */ +public class NodeHealthInner extends EntityHealth { + /** + * Name of the node whose health information is described by this object. + */ + @JsonProperty(value = "Name") + private String name; + + /** + * Get name of the node whose health information is described by this object. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the node whose health information is described by this object. + * + * @param name the name value to set + * @return the NodeHealthInner object itself. + */ + public NodeHealthInner withName(String name) { + this.name = name; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/NodeInfoInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/NodeInfoInner.java new file mode 100644 index 0000000000000..69e9e21d843a0 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/NodeInfoInner.java @@ -0,0 +1,504 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.microsoft.azure.servicefabric.NodeStatus; +import com.microsoft.azure.servicefabric.HealthState; +import com.microsoft.azure.servicefabric.NodeId; +import com.microsoft.azure.servicefabric.NodeDeactivationInfo; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about a node in Service Fabric cluster. + */ +public class NodeInfoInner { + /** + * The name of a Service Fabric node. + */ + @JsonProperty(value = "Name") + private String name; + + /** + * The IP address or fully qualified domain name of the node. + */ + @JsonProperty(value = "IpAddressOrFQDN") + private String ipAddressOrFQDN; + + /** + * The type of the node. + */ + @JsonProperty(value = "Type") + private String type; + + /** + * The version of Service Fabric binaries that the node is running. + */ + @JsonProperty(value = "CodeVersion") + private String codeVersion; + + /** + * The version of Service Fabric cluster manifest that the node is using. + */ + @JsonProperty(value = "ConfigVersion") + private String configVersion; + + /** + * The status of the node. Possible values include: 'Invalid', 'Up', + * 'Down', 'Enabling', 'Disabling', 'Disabled', 'Unknown', 'Removed'. + */ + @JsonProperty(value = "NodeStatus") + private NodeStatus nodeStatus; + + /** + * Time in seconds since the node has been in NodeStatus Up. Value zero + * indicates that the node is not Up. + */ + @JsonProperty(value = "NodeUpTimeInSeconds") + private String nodeUpTimeInSeconds; + + /** + * 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'. + */ + @JsonProperty(value = "HealthState") + private HealthState healthState; + + /** + * 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. + */ + @JsonProperty(value = "IsSeedNode") + private Boolean isSeedNode; + + /** + * The upgrade domain of the node. + */ + @JsonProperty(value = "UpgradeDomain") + private String upgradeDomain; + + /** + * The fault domain of the node. + */ + @JsonProperty(value = "FaultDomain") + private String faultDomain; + + /** + * An internal ID used by Service Fabric to uniquely identify a node. Node + * Id is deterministically generated from node name. + */ + @JsonProperty(value = "Id") + private NodeId id; + + /** + * 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. + */ + @JsonProperty(value = "InstanceId") + private String instanceId; + + /** + * Information about the node deactivation. This information is valid for a + * node that is undergoing deactivation or has already been deactivated. + */ + @JsonProperty(value = "NodeDeactivationInfo") + private NodeDeactivationInfo nodeDeactivationInfo; + + /** + * Indicates if the node is stopped by calling stop node API or not. + * Returns true if the node is stopped, otherwise false. + */ + @JsonProperty(value = "IsStopped") + private Boolean isStopped; + + /** + * Time in seconds since the node has been in NodeStatus Down. Value zero + * indicates node is not NodeStatus Down. + */ + @JsonProperty(value = "NodeDownTimeInSeconds") + private String nodeDownTimeInSeconds; + + /** + * Date time in UTC when the node came up. If the node has never been up + * then this value will be zero date time. + */ + @JsonProperty(value = "NodeUpAt") + private DateTime nodeUpAt; + + /** + * Date time in UTC when the node went down. If node has never been down + * then this value will be zero date time. + */ + @JsonProperty(value = "NodeDownAt") + private DateTime nodeDownAt; + + /** + * Get the name of a Service Fabric node. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of a Service Fabric node. + * + * @param name the name value to set + * @return the NodeInfoInner object itself. + */ + public NodeInfoInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the IP address or fully qualified domain name of the node. + * + * @return the ipAddressOrFQDN value + */ + public String ipAddressOrFQDN() { + return this.ipAddressOrFQDN; + } + + /** + * Set the IP address or fully qualified domain name of the node. + * + * @param ipAddressOrFQDN the ipAddressOrFQDN value to set + * @return the NodeInfoInner object itself. + */ + public NodeInfoInner withIpAddressOrFQDN(String ipAddressOrFQDN) { + this.ipAddressOrFQDN = ipAddressOrFQDN; + return this; + } + + /** + * Get the type of the node. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the type of the node. + * + * @param type the type value to set + * @return the NodeInfoInner object itself. + */ + public NodeInfoInner withType(String type) { + this.type = type; + return this; + } + + /** + * Get the version of Service Fabric binaries that the node is running. + * + * @return the codeVersion value + */ + public String codeVersion() { + return this.codeVersion; + } + + /** + * Set the version of Service Fabric binaries that the node is running. + * + * @param codeVersion the codeVersion value to set + * @return the NodeInfoInner object itself. + */ + public NodeInfoInner withCodeVersion(String codeVersion) { + this.codeVersion = codeVersion; + return this; + } + + /** + * Get the version of Service Fabric cluster manifest that the node is using. + * + * @return the configVersion value + */ + public String configVersion() { + return this.configVersion; + } + + /** + * Set the version of Service Fabric cluster manifest that the node is using. + * + * @param configVersion the configVersion value to set + * @return the NodeInfoInner object itself. + */ + public NodeInfoInner withConfigVersion(String configVersion) { + this.configVersion = configVersion; + return this; + } + + /** + * Get the status of the node. Possible values include: 'Invalid', 'Up', 'Down', 'Enabling', 'Disabling', 'Disabled', 'Unknown', 'Removed'. + * + * @return the nodeStatus value + */ + public NodeStatus nodeStatus() { + return this.nodeStatus; + } + + /** + * Set the status of the node. Possible values include: 'Invalid', 'Up', 'Down', 'Enabling', 'Disabling', 'Disabled', 'Unknown', 'Removed'. + * + * @param nodeStatus the nodeStatus value to set + * @return the NodeInfoInner object itself. + */ + public NodeInfoInner withNodeStatus(NodeStatus nodeStatus) { + this.nodeStatus = nodeStatus; + return this; + } + + /** + * Get time in seconds since the node has been in NodeStatus Up. Value zero indicates that the node is not Up. + * + * @return the nodeUpTimeInSeconds value + */ + public String nodeUpTimeInSeconds() { + return this.nodeUpTimeInSeconds; + } + + /** + * Set time in seconds since the node has been in NodeStatus Up. Value zero indicates that the node is not Up. + * + * @param nodeUpTimeInSeconds the nodeUpTimeInSeconds value to set + * @return the NodeInfoInner object itself. + */ + public NodeInfoInner withNodeUpTimeInSeconds(String nodeUpTimeInSeconds) { + this.nodeUpTimeInSeconds = nodeUpTimeInSeconds; + return this; + } + + /** + * Get 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'. + * + * @return the healthState value + */ + public HealthState healthState() { + return this.healthState; + } + + /** + * Set 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 healthState the healthState value to set + * @return the NodeInfoInner object itself. + */ + public NodeInfoInner withHealthState(HealthState healthState) { + this.healthState = healthState; + return this; + } + + /** + * Get 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. + * + * @return the isSeedNode value + */ + public Boolean isSeedNode() { + return this.isSeedNode; + } + + /** + * Set 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. + * + * @param isSeedNode the isSeedNode value to set + * @return the NodeInfoInner object itself. + */ + public NodeInfoInner withIsSeedNode(Boolean isSeedNode) { + this.isSeedNode = isSeedNode; + return this; + } + + /** + * Get the upgrade domain of the node. + * + * @return the upgradeDomain value + */ + public String upgradeDomain() { + return this.upgradeDomain; + } + + /** + * Set the upgrade domain of the node. + * + * @param upgradeDomain the upgradeDomain value to set + * @return the NodeInfoInner object itself. + */ + public NodeInfoInner withUpgradeDomain(String upgradeDomain) { + this.upgradeDomain = upgradeDomain; + return this; + } + + /** + * Get the fault domain of the node. + * + * @return the faultDomain value + */ + public String faultDomain() { + return this.faultDomain; + } + + /** + * Set the fault domain of the node. + * + * @param faultDomain the faultDomain value to set + * @return the NodeInfoInner object itself. + */ + public NodeInfoInner withFaultDomain(String faultDomain) { + this.faultDomain = faultDomain; + return this; + } + + /** + * Get an internal ID used by Service Fabric to uniquely identify a node. Node Id is deterministically generated from node name. + * + * @return the id value + */ + public NodeId id() { + return this.id; + } + + /** + * Set an internal ID used by Service Fabric to uniquely identify a node. Node Id is deterministically generated from node name. + * + * @param id the id value to set + * @return the NodeInfoInner object itself. + */ + public NodeInfoInner withId(NodeId id) { + this.id = id; + return this; + } + + /** + * Get 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. + * + * @return the instanceId value + */ + public String instanceId() { + return this.instanceId; + } + + /** + * Set 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. + * + * @param instanceId the instanceId value to set + * @return the NodeInfoInner object itself. + */ + public NodeInfoInner withInstanceId(String instanceId) { + this.instanceId = instanceId; + return this; + } + + /** + * Get information about the node deactivation. This information is valid for a node that is undergoing deactivation or has already been deactivated. + * + * @return the nodeDeactivationInfo value + */ + public NodeDeactivationInfo nodeDeactivationInfo() { + return this.nodeDeactivationInfo; + } + + /** + * Set information about the node deactivation. This information is valid for a node that is undergoing deactivation or has already been deactivated. + * + * @param nodeDeactivationInfo the nodeDeactivationInfo value to set + * @return the NodeInfoInner object itself. + */ + public NodeInfoInner withNodeDeactivationInfo(NodeDeactivationInfo nodeDeactivationInfo) { + this.nodeDeactivationInfo = nodeDeactivationInfo; + return this; + } + + /** + * Get indicates if the node is stopped by calling stop node API or not. Returns true if the node is stopped, otherwise false. + * + * @return the isStopped value + */ + public Boolean isStopped() { + return this.isStopped; + } + + /** + * Set indicates if the node is stopped by calling stop node API or not. Returns true if the node is stopped, otherwise false. + * + * @param isStopped the isStopped value to set + * @return the NodeInfoInner object itself. + */ + public NodeInfoInner withIsStopped(Boolean isStopped) { + this.isStopped = isStopped; + return this; + } + + /** + * Get time in seconds since the node has been in NodeStatus Down. Value zero indicates node is not NodeStatus Down. + * + * @return the nodeDownTimeInSeconds value + */ + public String nodeDownTimeInSeconds() { + return this.nodeDownTimeInSeconds; + } + + /** + * Set time in seconds since the node has been in NodeStatus Down. Value zero indicates node is not NodeStatus Down. + * + * @param nodeDownTimeInSeconds the nodeDownTimeInSeconds value to set + * @return the NodeInfoInner object itself. + */ + public NodeInfoInner withNodeDownTimeInSeconds(String nodeDownTimeInSeconds) { + this.nodeDownTimeInSeconds = nodeDownTimeInSeconds; + return this; + } + + /** + * Get date time in UTC when the node came up. If the node has never been up then this value will be zero date time. + * + * @return the nodeUpAt value + */ + public DateTime nodeUpAt() { + return this.nodeUpAt; + } + + /** + * Set date time in UTC when the node came up. If the node has never been up then this value will be zero date time. + * + * @param nodeUpAt the nodeUpAt value to set + * @return the NodeInfoInner object itself. + */ + public NodeInfoInner withNodeUpAt(DateTime nodeUpAt) { + this.nodeUpAt = nodeUpAt; + return this; + } + + /** + * Get date time in UTC when the node went down. If node has never been down then this value will be zero date time. + * + * @return the nodeDownAt value + */ + public DateTime nodeDownAt() { + return this.nodeDownAt; + } + + /** + * Set date time in UTC when the node went down. If node has never been down then this value will be zero date time. + * + * @param nodeDownAt the nodeDownAt value to set + * @return the NodeInfoInner object itself. + */ + public NodeInfoInner withNodeDownAt(DateTime nodeDownAt) { + this.nodeDownAt = nodeDownAt; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/NodeLoadInfoInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/NodeLoadInfoInner.java new file mode 100644 index 0000000000000..536c14901497f --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/NodeLoadInfoInner.java @@ -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. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import java.util.List; +import com.microsoft.azure.servicefabric.NodeLoadMetricInformation; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about load on a Service Fabric node. It holds a summary of all + * metrics and their load on a node. + */ +public class NodeLoadInfoInner { + /** + * Name of the node for which the load information is provided by this + * object. + */ + @JsonProperty(value = "NodeName") + private String nodeName; + + /** + * List that contains metrics and their load information on this node. + */ + @JsonProperty(value = "NodeLoadMetricInformation") + private List nodeLoadMetricInformation; + + /** + * Get name of the node for which the load information is provided by this object. + * + * @return the nodeName value + */ + public String nodeName() { + return this.nodeName; + } + + /** + * Set name of the node for which the load information is provided by this object. + * + * @param nodeName the nodeName value to set + * @return the NodeLoadInfoInner object itself. + */ + public NodeLoadInfoInner withNodeName(String nodeName) { + this.nodeName = nodeName; + return this; + } + + /** + * Get list that contains metrics and their load information on this node. + * + * @return the nodeLoadMetricInformation value + */ + public List nodeLoadMetricInformation() { + return this.nodeLoadMetricInformation; + } + + /** + * Set list that contains metrics and their load information on this node. + * + * @param nodeLoadMetricInformation the nodeLoadMetricInformation value to set + * @return the NodeLoadInfoInner object itself. + */ + public NodeLoadInfoInner withNodeLoadMetricInformation(List nodeLoadMetricInformation) { + this.nodeLoadMetricInformation = nodeLoadMetricInformation; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/NodeTransitionProgressInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/NodeTransitionProgressInner.java new file mode 100644 index 0000000000000..f19f0f3bf7ed0 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/NodeTransitionProgressInner.java @@ -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. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.microsoft.azure.servicefabric.OperationState; +import com.microsoft.azure.servicefabric.NodeTransitionResult; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about an NodeTransition operation. This class contains an + * OperationState and a NodeTransitionResult. The NodeTransitionResult is not + * valid until OperationState + * is Completed or Faulted. + */ +public class NodeTransitionProgressInner { + /** + * The state of the operation. Possible values include: 'Invalid', + * 'Running', 'RollingBack', 'Completed', 'Faulted', 'Cancelled', + * 'ForceCancelled'. + */ + @JsonProperty(value = "State") + private OperationState state; + + /** + * Represents information about an operation in a terminal state (Completed + * or Faulted). + */ + @JsonProperty(value = "NodeTransitionResult") + private NodeTransitionResult nodeTransitionResult; + + /** + * Get the state of the operation. Possible values include: 'Invalid', 'Running', 'RollingBack', 'Completed', 'Faulted', 'Cancelled', 'ForceCancelled'. + * + * @return the state value + */ + public OperationState state() { + return this.state; + } + + /** + * Set the state of the operation. Possible values include: 'Invalid', 'Running', 'RollingBack', 'Completed', 'Faulted', 'Cancelled', 'ForceCancelled'. + * + * @param state the state value to set + * @return the NodeTransitionProgressInner object itself. + */ + public NodeTransitionProgressInner withState(OperationState state) { + this.state = state; + return this; + } + + /** + * Get represents information about an operation in a terminal state (Completed or Faulted). + * + * @return the nodeTransitionResult value + */ + public NodeTransitionResult nodeTransitionResult() { + return this.nodeTransitionResult; + } + + /** + * Set represents information about an operation in a terminal state (Completed or Faulted). + * + * @param nodeTransitionResult the nodeTransitionResult value to set + * @return the NodeTransitionProgressInner object itself. + */ + public NodeTransitionProgressInner withNodeTransitionResult(NodeTransitionResult nodeTransitionResult) { + this.nodeTransitionResult = nodeTransitionResult; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/OperationStatusInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/OperationStatusInner.java new file mode 100644 index 0000000000000..579aee90b7964 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/OperationStatusInner.java @@ -0,0 +1,104 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import java.util.UUID; +import com.microsoft.azure.servicefabric.OperationState; +import com.microsoft.azure.servicefabric.OperationType; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains the OperationId, OperationState, and OperationType for user-induced + * operations. + */ +public class OperationStatusInner { + /** + * A GUID that identifies a call to this API. This is also passed into the + * corresponding GetProgress API. + */ + @JsonProperty(value = "OperationId") + private UUID operationId; + + /** + * The state of the operation. Possible values include: 'Invalid', + * 'Running', 'RollingBack', 'Completed', 'Faulted', 'Cancelled', + * 'ForceCancelled'. + */ + @JsonProperty(value = "State") + private OperationState state; + + /** + * The type of the operation. Possible values include: 'Invalid', + * 'PartitionDataLoss', 'PartitionQuorumLoss', 'PartitionRestart', + * 'NodeTransition'. + */ + @JsonProperty(value = "Type") + private OperationType type; + + /** + * Get a GUID that identifies a call to this API. This is also passed into the corresponding GetProgress API. + * + * @return the operationId value + */ + public UUID operationId() { + return this.operationId; + } + + /** + * Set a GUID that identifies a call to this API. This is also passed into the corresponding GetProgress API. + * + * @param operationId the operationId value to set + * @return the OperationStatusInner object itself. + */ + public OperationStatusInner withOperationId(UUID operationId) { + this.operationId = operationId; + return this; + } + + /** + * Get the state of the operation. Possible values include: 'Invalid', 'Running', 'RollingBack', 'Completed', 'Faulted', 'Cancelled', 'ForceCancelled'. + * + * @return the state value + */ + public OperationState state() { + return this.state; + } + + /** + * Set the state of the operation. Possible values include: 'Invalid', 'Running', 'RollingBack', 'Completed', 'Faulted', 'Cancelled', 'ForceCancelled'. + * + * @param state the state value to set + * @return the OperationStatusInner object itself. + */ + public OperationStatusInner withState(OperationState state) { + this.state = state; + return this; + } + + /** + * Get the type of the operation. Possible values include: 'Invalid', 'PartitionDataLoss', 'PartitionQuorumLoss', 'PartitionRestart', 'NodeTransition'. + * + * @return the type value + */ + public OperationType type() { + return this.type; + } + + /** + * Set the type of the operation. Possible values include: 'Invalid', 'PartitionDataLoss', 'PartitionQuorumLoss', 'PartitionRestart', 'NodeTransition'. + * + * @param type the type value to set + * @return the OperationStatusInner object itself. + */ + public OperationStatusInner withType(OperationType type) { + this.type = type; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedApplicationInfoListInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedApplicationInfoListInner.java new file mode 100644 index 0000000000000..55553672cdc92 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedApplicationInfoListInner.java @@ -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. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list of applications in the cluster. The list is paged when all of the + * results cannot fit in a single message. The next set of results can be + * obtained by executing the same query with the continuation token provided in + * this list. + */ +public class PagedApplicationInfoListInner { + /** + * 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. + */ + @JsonProperty(value = "ContinuationToken") + private String continuationToken; + + /** + * List of application information. + */ + @JsonProperty(value = "Items") + private List items; + + /** + * Get 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. + * + * @return the continuationToken value + */ + public String continuationToken() { + return this.continuationToken; + } + + /** + * Set 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. + * + * @param continuationToken the continuationToken value to set + * @return the PagedApplicationInfoListInner object itself. + */ + public PagedApplicationInfoListInner withContinuationToken(String continuationToken) { + this.continuationToken = continuationToken; + return this; + } + + /** + * Get list of application information. + * + * @return the items value + */ + public List items() { + return this.items; + } + + /** + * Set list of application information. + * + * @param items the items value to set + * @return the PagedApplicationInfoListInner object itself. + */ + public PagedApplicationInfoListInner withItems(List items) { + this.items = items; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedApplicationTypeInfoListInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedApplicationTypeInfoListInner.java new file mode 100644 index 0000000000000..9363078bc11d7 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedApplicationTypeInfoListInner.java @@ -0,0 +1,79 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import java.util.List; +import com.microsoft.azure.servicefabric.ApplicationTypeInfo; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list of application types that are provisioned or being provisioned in + * the cluster. The list is paged when all of the results cannot fit in a + * single message. The next set of results can be obtained by executing the + * same query with the continuation token provided in this list. + */ +public class PagedApplicationTypeInfoListInner { + /** + * 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. + */ + @JsonProperty(value = "ContinuationToken") + private String continuationToken; + + /** + * List of application type information. + */ + @JsonProperty(value = "Items") + private List items; + + /** + * Get 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. + * + * @return the continuationToken value + */ + public String continuationToken() { + return this.continuationToken; + } + + /** + * Set 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. + * + * @param continuationToken the continuationToken value to set + * @return the PagedApplicationTypeInfoListInner object itself. + */ + public PagedApplicationTypeInfoListInner withContinuationToken(String continuationToken) { + this.continuationToken = continuationToken; + return this; + } + + /** + * Get list of application type information. + * + * @return the items value + */ + public List items() { + return this.items; + } + + /** + * Set list of application type information. + * + * @param items the items value to set + * @return the PagedApplicationTypeInfoListInner object itself. + */ + public PagedApplicationTypeInfoListInner withItems(List items) { + this.items = items; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedBackupConfigurationInfoListInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedBackupConfigurationInfoListInner.java new file mode 100644 index 0000000000000..786278f8433bc --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedBackupConfigurationInfoListInner.java @@ -0,0 +1,79 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import java.util.List; +import com.microsoft.azure.servicefabric.BackupConfigurationInfo; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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. + */ +public class PagedBackupConfigurationInfoListInner { + /** + * 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. + */ + @JsonProperty(value = "ContinuationToken") + private String continuationToken; + + /** + * List of backup configuration information. + */ + @JsonProperty(value = "Items") + private List items; + + /** + * Get 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. + * + * @return the continuationToken value + */ + public String continuationToken() { + return this.continuationToken; + } + + /** + * Set 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. + * + * @param continuationToken the continuationToken value to set + * @return the PagedBackupConfigurationInfoListInner object itself. + */ + public PagedBackupConfigurationInfoListInner withContinuationToken(String continuationToken) { + this.continuationToken = continuationToken; + return this; + } + + /** + * Get list of backup configuration information. + * + * @return the items value + */ + public List items() { + return this.items; + } + + /** + * Set list of backup configuration information. + * + * @param items the items value to set + * @return the PagedBackupConfigurationInfoListInner object itself. + */ + public PagedBackupConfigurationInfoListInner withItems(List items) { + this.items = items; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedBackupEntityListInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedBackupEntityListInner.java new file mode 100644 index 0000000000000..43d6bea3b2795 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedBackupEntityListInner.java @@ -0,0 +1,79 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import java.util.List; +import com.microsoft.azure.servicefabric.BackupEntity; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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. + */ +public class PagedBackupEntityListInner { + /** + * 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. + */ + @JsonProperty(value = "ContinuationToken") + private String continuationToken; + + /** + * List of backup entity information. + */ + @JsonProperty(value = "Items") + private List items; + + /** + * Get 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. + * + * @return the continuationToken value + */ + public String continuationToken() { + return this.continuationToken; + } + + /** + * Set 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. + * + * @param continuationToken the continuationToken value to set + * @return the PagedBackupEntityListInner object itself. + */ + public PagedBackupEntityListInner withContinuationToken(String continuationToken) { + this.continuationToken = continuationToken; + return this; + } + + /** + * Get list of backup entity information. + * + * @return the items value + */ + public List items() { + return this.items; + } + + /** + * Set list of backup entity information. + * + * @param items the items value to set + * @return the PagedBackupEntityListInner object itself. + */ + public PagedBackupEntityListInner withItems(List items) { + this.items = items; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedBackupInfoListInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedBackupInfoListInner.java new file mode 100644 index 0000000000000..98fb945d620a0 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedBackupInfoListInner.java @@ -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. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import java.util.List; +import com.microsoft.azure.servicefabric.BackupInfo; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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. + */ +public class PagedBackupInfoListInner { + /** + * 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. + */ + @JsonProperty(value = "ContinuationToken") + private String continuationToken; + + /** + * List of backup information. + */ + @JsonProperty(value = "Items") + private List items; + + /** + * Get 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. + * + * @return the continuationToken value + */ + public String continuationToken() { + return this.continuationToken; + } + + /** + * Set 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. + * + * @param continuationToken the continuationToken value to set + * @return the PagedBackupInfoListInner object itself. + */ + public PagedBackupInfoListInner withContinuationToken(String continuationToken) { + this.continuationToken = continuationToken; + return this; + } + + /** + * Get list of backup information. + * + * @return the items value + */ + public List items() { + return this.items; + } + + /** + * Set list of backup information. + * + * @param items the items value to set + * @return the PagedBackupInfoListInner object itself. + */ + public PagedBackupInfoListInner withItems(List items) { + this.items = items; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedBackupPolicyDescriptionListInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedBackupPolicyDescriptionListInner.java new file mode 100644 index 0000000000000..afe9fa20dd12b --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedBackupPolicyDescriptionListInner.java @@ -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. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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. + */ +public class PagedBackupPolicyDescriptionListInner { + /** + * 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. + */ + @JsonProperty(value = "ContinuationToken") + private String continuationToken; + + /** + * The list of backup policies information. + */ + @JsonProperty(value = "Items") + private List items; + + /** + * Get 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. + * + * @return the continuationToken value + */ + public String continuationToken() { + return this.continuationToken; + } + + /** + * Set 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. + * + * @param continuationToken the continuationToken value to set + * @return the PagedBackupPolicyDescriptionListInner object itself. + */ + public PagedBackupPolicyDescriptionListInner withContinuationToken(String continuationToken) { + this.continuationToken = continuationToken; + return this; + } + + /** + * Get the list of backup policies information. + * + * @return the items value + */ + public List items() { + return this.items; + } + + /** + * Set the list of backup policies information. + * + * @param items the items value to set + * @return the PagedBackupPolicyDescriptionListInner object itself. + */ + public PagedBackupPolicyDescriptionListInner withItems(List items) { + this.items = items; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedComposeDeploymentStatusInfoListInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedComposeDeploymentStatusInfoListInner.java new file mode 100644 index 0000000000000..2d6a8fd0569eb --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedComposeDeploymentStatusInfoListInner.java @@ -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. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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. + */ +public class PagedComposeDeploymentStatusInfoListInner { + /** + * 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. + */ + @JsonProperty(value = "ContinuationToken") + private String continuationToken; + + /** + * List of compose deployment status information. + */ + @JsonProperty(value = "Items") + private List items; + + /** + * Get 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. + * + * @return the continuationToken value + */ + public String continuationToken() { + return this.continuationToken; + } + + /** + * Set 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. + * + * @param continuationToken the continuationToken value to set + * @return the PagedComposeDeploymentStatusInfoListInner object itself. + */ + public PagedComposeDeploymentStatusInfoListInner withContinuationToken(String continuationToken) { + this.continuationToken = continuationToken; + return this; + } + + /** + * Get list of compose deployment status information. + * + * @return the items value + */ + public List items() { + return this.items; + } + + /** + * Set list of compose deployment status information. + * + * @param items the items value to set + * @return the PagedComposeDeploymentStatusInfoListInner object itself. + */ + public PagedComposeDeploymentStatusInfoListInner withItems(List items) { + this.items = items; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedDeployedApplicationInfoListInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedDeployedApplicationInfoListInner.java new file mode 100644 index 0000000000000..cbc56a0ac4f85 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedDeployedApplicationInfoListInner.java @@ -0,0 +1,79 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list of deployed applications in activating, downloading, or active + * states on a node. + * The list is paged when all of the results cannot fit in a single message. + * The next set of results can be obtained by executing the same query with the + * continuation token provided in this list. + */ +public class PagedDeployedApplicationInfoListInner { + /** + * 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. + */ + @JsonProperty(value = "ContinuationToken") + private String continuationToken; + + /** + * List of deployed application information. + */ + @JsonProperty(value = "Items") + private List items; + + /** + * Get 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. + * + * @return the continuationToken value + */ + public String continuationToken() { + return this.continuationToken; + } + + /** + * Set 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. + * + * @param continuationToken the continuationToken value to set + * @return the PagedDeployedApplicationInfoListInner object itself. + */ + public PagedDeployedApplicationInfoListInner withContinuationToken(String continuationToken) { + this.continuationToken = continuationToken; + return this; + } + + /** + * Get list of deployed application information. + * + * @return the items value + */ + public List items() { + return this.items; + } + + /** + * Set list of deployed application information. + * + * @param items the items value to set + * @return the PagedDeployedApplicationInfoListInner object itself. + */ + public PagedDeployedApplicationInfoListInner withItems(List items) { + this.items = items; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedNodeInfoListInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedNodeInfoListInner.java new file mode 100644 index 0000000000000..234599a8ececb --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedNodeInfoListInner.java @@ -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. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list of nodes in the cluster. The list is paged when all of the results + * cannot fit in a single message. The next set of results can be obtained by + * executing the same query with the continuation token provided in this list. + */ +public class PagedNodeInfoListInner { + /** + * 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. + */ + @JsonProperty(value = "ContinuationToken") + private String continuationToken; + + /** + * List of node information. + */ + @JsonProperty(value = "Items") + private List items; + + /** + * Get 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. + * + * @return the continuationToken value + */ + public String continuationToken() { + return this.continuationToken; + } + + /** + * Set 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. + * + * @param continuationToken the continuationToken value to set + * @return the PagedNodeInfoListInner object itself. + */ + public PagedNodeInfoListInner withContinuationToken(String continuationToken) { + this.continuationToken = continuationToken; + return this; + } + + /** + * Get list of node information. + * + * @return the items value + */ + public List items() { + return this.items; + } + + /** + * Set list of node information. + * + * @param items the items value to set + * @return the PagedNodeInfoListInner object itself. + */ + public PagedNodeInfoListInner withItems(List items) { + this.items = items; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedPropertyInfoListInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedPropertyInfoListInner.java new file mode 100644 index 0000000000000..2d7013d2e6a2e --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedPropertyInfoListInner.java @@ -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. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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. + */ +public class PagedPropertyInfoListInner { + /** + * 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. + */ + @JsonProperty(value = "ContinuationToken") + private String continuationToken; + + /** + * Indicates whether any property under the given name has been modified + * during the enumeration. If there was a modification, this property value + * is false. + */ + @JsonProperty(value = "IsConsistent") + private Boolean isConsistent; + + /** + * List of property information. + */ + @JsonProperty(value = "Properties") + private List properties; + + /** + * Get 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. + * + * @return the continuationToken value + */ + public String continuationToken() { + return this.continuationToken; + } + + /** + * Set 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. + * + * @param continuationToken the continuationToken value to set + * @return the PagedPropertyInfoListInner object itself. + */ + public PagedPropertyInfoListInner withContinuationToken(String continuationToken) { + this.continuationToken = continuationToken; + return this; + } + + /** + * Get indicates whether any property under the given name has been modified during the enumeration. If there was a modification, this property value is false. + * + * @return the isConsistent value + */ + public Boolean isConsistent() { + return this.isConsistent; + } + + /** + * Set indicates whether any property under the given name has been modified during the enumeration. If there was a modification, this property value is false. + * + * @param isConsistent the isConsistent value to set + * @return the PagedPropertyInfoListInner object itself. + */ + public PagedPropertyInfoListInner withIsConsistent(Boolean isConsistent) { + this.isConsistent = isConsistent; + return this; + } + + /** + * Get list of property information. + * + * @return the properties value + */ + public List properties() { + return this.properties; + } + + /** + * Set list of property information. + * + * @param properties the properties value to set + * @return the PagedPropertyInfoListInner object itself. + */ + public PagedPropertyInfoListInner withProperties(List properties) { + this.properties = properties; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedReplicaInfoListInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedReplicaInfoListInner.java new file mode 100644 index 0000000000000..e1a3d4546c9c7 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedReplicaInfoListInner.java @@ -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. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list of replicas in the cluster for a given partition. The list is paged + * when all of the results cannot fit in a single message. The next set of + * results can be obtained by executing the same query with the continuation + * token provided in this list. + */ +public class PagedReplicaInfoListInner { + /** + * 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. + */ + @JsonProperty(value = "ContinuationToken") + private String continuationToken; + + /** + * List of replica information. + */ + @JsonProperty(value = "Items") + private List items; + + /** + * Get 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. + * + * @return the continuationToken value + */ + public String continuationToken() { + return this.continuationToken; + } + + /** + * Set 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. + * + * @param continuationToken the continuationToken value to set + * @return the PagedReplicaInfoListInner object itself. + */ + public PagedReplicaInfoListInner withContinuationToken(String continuationToken) { + this.continuationToken = continuationToken; + return this; + } + + /** + * Get list of replica information. + * + * @return the items value + */ + public List items() { + return this.items; + } + + /** + * Set list of replica information. + * + * @param items the items value to set + * @return the PagedReplicaInfoListInner object itself. + */ + public PagedReplicaInfoListInner withItems(List items) { + this.items = items; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedServiceInfoListInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedServiceInfoListInner.java new file mode 100644 index 0000000000000..c8c4bf3213f71 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedServiceInfoListInner.java @@ -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. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list of services in the cluster for an application. The list is paged + * when all of the results cannot fit in a single message. The next set of + * results can be obtained by executing the same query with the continuation + * token provided in this list. + */ +public class PagedServiceInfoListInner { + /** + * 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. + */ + @JsonProperty(value = "ContinuationToken") + private String continuationToken; + + /** + * List of service information. + */ + @JsonProperty(value = "Items") + private List items; + + /** + * Get 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. + * + * @return the continuationToken value + */ + public String continuationToken() { + return this.continuationToken; + } + + /** + * Set 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. + * + * @param continuationToken the continuationToken value to set + * @return the PagedServiceInfoListInner object itself. + */ + public PagedServiceInfoListInner withContinuationToken(String continuationToken) { + this.continuationToken = continuationToken; + return this; + } + + /** + * Get list of service information. + * + * @return the items value + */ + public List items() { + return this.items; + } + + /** + * Set list of service information. + * + * @param items the items value to set + * @return the PagedServiceInfoListInner object itself. + */ + public PagedServiceInfoListInner withItems(List items) { + this.items = items; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedServicePartitionInfoListInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedServicePartitionInfoListInner.java new file mode 100644 index 0000000000000..b37ad7c76178c --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedServicePartitionInfoListInner.java @@ -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. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list of partition in the cluster for a service. The list is paged when + * all of the results cannot fit in a single message. The next set of results + * can be obtained by executing the same query with the continuation token + * provided in this list. + */ +public class PagedServicePartitionInfoListInner { + /** + * 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. + */ + @JsonProperty(value = "ContinuationToken") + private String continuationToken; + + /** + * List of service partition information. + */ + @JsonProperty(value = "Items") + private List items; + + /** + * Get 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. + * + * @return the continuationToken value + */ + public String continuationToken() { + return this.continuationToken; + } + + /** + * Set 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. + * + * @param continuationToken the continuationToken value to set + * @return the PagedServicePartitionInfoListInner object itself. + */ + public PagedServicePartitionInfoListInner withContinuationToken(String continuationToken) { + this.continuationToken = continuationToken; + return this; + } + + /** + * Get list of service partition information. + * + * @return the items value + */ + public List items() { + return this.items; + } + + /** + * Set list of service partition information. + * + * @param items the items value to set + * @return the PagedServicePartitionInfoListInner object itself. + */ + public PagedServicePartitionInfoListInner withItems(List items) { + this.items = items; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedServiceResourceDescriptionListInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedServiceResourceDescriptionListInner.java new file mode 100644 index 0000000000000..4946d4c248353 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedServiceResourceDescriptionListInner.java @@ -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. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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. + */ +public class PagedServiceResourceDescriptionListInner { + /** + * 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. + */ + @JsonProperty(value = "ContinuationToken") + private String continuationToken; + + /** + * List of service resource description. + */ + @JsonProperty(value = "Items") + private List items; + + /** + * Get 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. + * + * @return the continuationToken value + */ + public String continuationToken() { + return this.continuationToken; + } + + /** + * Set 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. + * + * @param continuationToken the continuationToken value to set + * @return the PagedServiceResourceDescriptionListInner object itself. + */ + public PagedServiceResourceDescriptionListInner withContinuationToken(String continuationToken) { + this.continuationToken = continuationToken; + return this; + } + + /** + * Get list of service resource description. + * + * @return the items value + */ + public List items() { + return this.items; + } + + /** + * Set list of service resource description. + * + * @param items the items value to set + * @return the PagedServiceResourceDescriptionListInner object itself. + */ + public PagedServiceResourceDescriptionListInner withItems(List items) { + this.items = items; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedServiceResourceReplicaDescriptionListInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedServiceResourceReplicaDescriptionListInner.java new file mode 100644 index 0000000000000..abbdbae95ae38 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedServiceResourceReplicaDescriptionListInner.java @@ -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. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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. + */ +public class PagedServiceResourceReplicaDescriptionListInner { + /** + * 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. + */ + @JsonProperty(value = "ContinuationToken") + private String continuationToken; + + /** + * List of service resource description. + */ + @JsonProperty(value = "Items") + private List items; + + /** + * Get 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. + * + * @return the continuationToken value + */ + public String continuationToken() { + return this.continuationToken; + } + + /** + * Set 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. + * + * @param continuationToken the continuationToken value to set + * @return the PagedServiceResourceReplicaDescriptionListInner object itself. + */ + public PagedServiceResourceReplicaDescriptionListInner withContinuationToken(String continuationToken) { + this.continuationToken = continuationToken; + return this; + } + + /** + * Get list of service resource description. + * + * @return the items value + */ + public List items() { + return this.items; + } + + /** + * Set list of service resource description. + * + * @param items the items value to set + * @return the PagedServiceResourceReplicaDescriptionListInner object itself. + */ + public PagedServiceResourceReplicaDescriptionListInner withItems(List items) { + this.items = items; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedSubNameInfoListInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedSubNameInfoListInner.java new file mode 100644 index 0000000000000..ae0151b1fdc73 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedSubNameInfoListInner.java @@ -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. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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. + */ +public class PagedSubNameInfoListInner { + /** + * 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. + */ + @JsonProperty(value = "ContinuationToken") + private String continuationToken; + + /** + * Indicates whether any name under the given name has been modified during + * the enumeration. If there was a modification, this property value is + * false. + */ + @JsonProperty(value = "IsConsistent") + private Boolean isConsistent; + + /** + * List of the child names. + */ + @JsonProperty(value = "SubNames") + private List subNames; + + /** + * Get 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. + * + * @return the continuationToken value + */ + public String continuationToken() { + return this.continuationToken; + } + + /** + * Set 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. + * + * @param continuationToken the continuationToken value to set + * @return the PagedSubNameInfoListInner object itself. + */ + public PagedSubNameInfoListInner withContinuationToken(String continuationToken) { + this.continuationToken = continuationToken; + return this; + } + + /** + * Get indicates whether any name under the given name has been modified during the enumeration. If there was a modification, this property value is false. + * + * @return the isConsistent value + */ + public Boolean isConsistent() { + return this.isConsistent; + } + + /** + * Set indicates whether any name under the given name has been modified during the enumeration. If there was a modification, this property value is false. + * + * @param isConsistent the isConsistent value to set + * @return the PagedSubNameInfoListInner object itself. + */ + public PagedSubNameInfoListInner withIsConsistent(Boolean isConsistent) { + this.isConsistent = isConsistent; + return this; + } + + /** + * Get list of the child names. + * + * @return the subNames value + */ + public List subNames() { + return this.subNames; + } + + /** + * Set list of the child names. + * + * @param subNames the subNames value to set + * @return the PagedSubNameInfoListInner object itself. + */ + public PagedSubNameInfoListInner withSubNames(List subNames) { + this.subNames = subNames; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PartitionBackupConfigurationInfoInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PartitionBackupConfigurationInfoInner.java new file mode 100644 index 0000000000000..3a012a54aaa91 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PartitionBackupConfigurationInfoInner.java @@ -0,0 +1,80 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.BackupConfigurationInfo; + +/** + * Backup configuration information, for a specific partition, specifying what + * backup policy is being applied and suspend description, if any. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("Partition") +public class PartitionBackupConfigurationInfoInner extends BackupConfigurationInfo { + /** + * The full name of the service with 'fabric:' URI scheme. + */ + @JsonProperty(value = "ServiceName") + private String serviceName; + + /** + * 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. + */ + @JsonProperty(value = "PartitionId") + private UUID partitionId; + + /** + * Get the full name of the service with 'fabric:' URI scheme. + * + * @return the serviceName value + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set the full name of the service with 'fabric:' URI scheme. + * + * @param serviceName the serviceName value to set + * @return the PartitionBackupConfigurationInfoInner object itself. + */ + public PartitionBackupConfigurationInfoInner withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Get 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. + * + * @return the partitionId value + */ + public UUID partitionId() { + return this.partitionId; + } + + /** + * Set 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. + * + * @param partitionId the partitionId value to set + * @return the PartitionBackupConfigurationInfoInner object itself. + */ + public PartitionBackupConfigurationInfoInner withPartitionId(UUID partitionId) { + this.partitionId = partitionId; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PartitionDataLossProgressInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PartitionDataLossProgressInner.java new file mode 100644 index 0000000000000..0250c4e049ab3 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PartitionDataLossProgressInner.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.microsoft.azure.servicefabric.OperationState; +import com.microsoft.azure.servicefabric.InvokeDataLossResult; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about a partition data loss user-induced operation. + */ +public class PartitionDataLossProgressInner { + /** + * The state of the operation. Possible values include: 'Invalid', + * 'Running', 'RollingBack', 'Completed', 'Faulted', 'Cancelled', + * 'ForceCancelled'. + */ + @JsonProperty(value = "State") + private OperationState state; + + /** + * Represents information about an operation in a terminal state (Completed + * or Faulted). + */ + @JsonProperty(value = "InvokeDataLossResult") + private InvokeDataLossResult invokeDataLossResult; + + /** + * Get the state of the operation. Possible values include: 'Invalid', 'Running', 'RollingBack', 'Completed', 'Faulted', 'Cancelled', 'ForceCancelled'. + * + * @return the state value + */ + public OperationState state() { + return this.state; + } + + /** + * Set the state of the operation. Possible values include: 'Invalid', 'Running', 'RollingBack', 'Completed', 'Faulted', 'Cancelled', 'ForceCancelled'. + * + * @param state the state value to set + * @return the PartitionDataLossProgressInner object itself. + */ + public PartitionDataLossProgressInner withState(OperationState state) { + this.state = state; + return this; + } + + /** + * Get represents information about an operation in a terminal state (Completed or Faulted). + * + * @return the invokeDataLossResult value + */ + public InvokeDataLossResult invokeDataLossResult() { + return this.invokeDataLossResult; + } + + /** + * Set represents information about an operation in a terminal state (Completed or Faulted). + * + * @param invokeDataLossResult the invokeDataLossResult value to set + * @return the PartitionDataLossProgressInner object itself. + */ + public PartitionDataLossProgressInner withInvokeDataLossResult(InvokeDataLossResult invokeDataLossResult) { + this.invokeDataLossResult = invokeDataLossResult; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PartitionEventInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PartitionEventInner.java new file mode 100644 index 0000000000000..13f44eb30ce1b --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PartitionEventInner.java @@ -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. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Represents the base for all Partition Events. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("PartitionEvent") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "PartitionAnalysisEvent", value = PartitionAnalysisEvent.class), + @JsonSubTypes.Type(name = "PartitionHealthReportCreated", value = PartitionHealthReportCreatedEvent.class), + @JsonSubTypes.Type(name = "PartitionHealthReportExpired", value = PartitionHealthReportExpiredEvent.class), + @JsonSubTypes.Type(name = "PartitionReconfigurationCompleted", value = PartitionReconfigurationCompletedEvent.class), + @JsonSubTypes.Type(name = "ChaosMoveSecondaryFaultScheduled", value = ChaosMoveSecondaryFaultScheduledEvent.class), + @JsonSubTypes.Type(name = "ChaosMovePrimaryFaultScheduled", value = ChaosMovePrimaryFaultScheduledEvent.class) +}) +public class PartitionEventInner extends FabricEventInner { + /** + * 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. + */ + @JsonProperty(value = "PartitionId", required = true) + private UUID partitionId; + + /** + * Get 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. + * + * @return the partitionId value + */ + public UUID partitionId() { + return this.partitionId; + } + + /** + * Set 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. + * + * @param partitionId the partitionId value to set + * @return the PartitionEventInner object itself. + */ + public PartitionEventInner withPartitionId(UUID partitionId) { + this.partitionId = partitionId; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PartitionHealthInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PartitionHealthInner.java new file mode 100644 index 0000000000000..cf1f188307e66 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PartitionHealthInner.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import java.util.UUID; +import java.util.List; +import com.microsoft.azure.servicefabric.ReplicaHealthState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.servicefabric.EntityHealth; + +/** + * Information about the health of a Service Fabric partition. + */ +public class PartitionHealthInner extends EntityHealth { + /** + * ID of the partition whose health information is described by this + * object. + */ + @JsonProperty(value = "PartitionId") + private UUID partitionId; + + /** + * The list of replica health states associated with the partition. + */ + @JsonProperty(value = "ReplicaHealthStates") + private List replicaHealthStates; + + /** + * Get iD of the partition whose health information is described by this object. + * + * @return the partitionId value + */ + public UUID partitionId() { + return this.partitionId; + } + + /** + * Set iD of the partition whose health information is described by this object. + * + * @param partitionId the partitionId value to set + * @return the PartitionHealthInner object itself. + */ + public PartitionHealthInner withPartitionId(UUID partitionId) { + this.partitionId = partitionId; + return this; + } + + /** + * Get the list of replica health states associated with the partition. + * + * @return the replicaHealthStates value + */ + public List replicaHealthStates() { + return this.replicaHealthStates; + } + + /** + * Set the list of replica health states associated with the partition. + * + * @param replicaHealthStates the replicaHealthStates value to set + * @return the PartitionHealthInner object itself. + */ + public PartitionHealthInner withReplicaHealthStates(List replicaHealthStates) { + this.replicaHealthStates = replicaHealthStates; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PartitionLoadInformationInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PartitionLoadInformationInner.java new file mode 100644 index 0000000000000..35d4b0ff2f046 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PartitionLoadInformationInner.java @@ -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. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import java.util.UUID; +import java.util.List; +import com.microsoft.azure.servicefabric.LoadMetricReport; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents load information for a partition, which contains the primary and + * secondary reported load metrics. + * In case there is no load reported, PartitionLoadInformation will contain the + * default load for the service of the partition. + * For default loads, LoadMetricReport's LastReportedUtc is set to 0. + */ +public class PartitionLoadInformationInner { + /** + * Id of the partition. + */ + @JsonProperty(value = "PartitionId") + private UUID partitionId; + + /** + * Array of load reports from the primary replica for this partition. + */ + @JsonProperty(value = "PrimaryLoadMetricReports") + private List primaryLoadMetricReports; + + /** + * Array of aggregated load reports from all secondary replicas for this + * partition. + * Array only contains the latest reported load for each metric. + */ + @JsonProperty(value = "SecondaryLoadMetricReports") + private List secondaryLoadMetricReports; + + /** + * Get id of the partition. + * + * @return the partitionId value + */ + public UUID partitionId() { + return this.partitionId; + } + + /** + * Set id of the partition. + * + * @param partitionId the partitionId value to set + * @return the PartitionLoadInformationInner object itself. + */ + public PartitionLoadInformationInner withPartitionId(UUID partitionId) { + this.partitionId = partitionId; + return this; + } + + /** + * Get array of load reports from the primary replica for this partition. + * + * @return the primaryLoadMetricReports value + */ + public List primaryLoadMetricReports() { + return this.primaryLoadMetricReports; + } + + /** + * Set array of load reports from the primary replica for this partition. + * + * @param primaryLoadMetricReports the primaryLoadMetricReports value to set + * @return the PartitionLoadInformationInner object itself. + */ + public PartitionLoadInformationInner withPrimaryLoadMetricReports(List primaryLoadMetricReports) { + this.primaryLoadMetricReports = primaryLoadMetricReports; + return this; + } + + /** + * Get array of aggregated load reports from all secondary replicas for this partition. + Array only contains the latest reported load for each metric. + * + * @return the secondaryLoadMetricReports value + */ + public List secondaryLoadMetricReports() { + return this.secondaryLoadMetricReports; + } + + /** + * Set array of aggregated load reports from all secondary replicas for this partition. + Array only contains the latest reported load for each metric. + * + * @param secondaryLoadMetricReports the secondaryLoadMetricReports value to set + * @return the PartitionLoadInformationInner object itself. + */ + public PartitionLoadInformationInner withSecondaryLoadMetricReports(List secondaryLoadMetricReports) { + this.secondaryLoadMetricReports = secondaryLoadMetricReports; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PartitionQuorumLossProgressInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PartitionQuorumLossProgressInner.java new file mode 100644 index 0000000000000..710fd5ce2938c --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PartitionQuorumLossProgressInner.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.microsoft.azure.servicefabric.OperationState; +import com.microsoft.azure.servicefabric.InvokeQuorumLossResult; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about a partition quorum loss user-induced operation. + */ +public class PartitionQuorumLossProgressInner { + /** + * The state of the operation. Possible values include: 'Invalid', + * 'Running', 'RollingBack', 'Completed', 'Faulted', 'Cancelled', + * 'ForceCancelled'. + */ + @JsonProperty(value = "State") + private OperationState state; + + /** + * Represents information about an operation in a terminal state (Completed + * or Faulted). + */ + @JsonProperty(value = "InvokeQuorumLossResult") + private InvokeQuorumLossResult invokeQuorumLossResult; + + /** + * Get the state of the operation. Possible values include: 'Invalid', 'Running', 'RollingBack', 'Completed', 'Faulted', 'Cancelled', 'ForceCancelled'. + * + * @return the state value + */ + public OperationState state() { + return this.state; + } + + /** + * Set the state of the operation. Possible values include: 'Invalid', 'Running', 'RollingBack', 'Completed', 'Faulted', 'Cancelled', 'ForceCancelled'. + * + * @param state the state value to set + * @return the PartitionQuorumLossProgressInner object itself. + */ + public PartitionQuorumLossProgressInner withState(OperationState state) { + this.state = state; + return this; + } + + /** + * Get represents information about an operation in a terminal state (Completed or Faulted). + * + * @return the invokeQuorumLossResult value + */ + public InvokeQuorumLossResult invokeQuorumLossResult() { + return this.invokeQuorumLossResult; + } + + /** + * Set represents information about an operation in a terminal state (Completed or Faulted). + * + * @param invokeQuorumLossResult the invokeQuorumLossResult value to set + * @return the PartitionQuorumLossProgressInner object itself. + */ + public PartitionQuorumLossProgressInner withInvokeQuorumLossResult(InvokeQuorumLossResult invokeQuorumLossResult) { + this.invokeQuorumLossResult = invokeQuorumLossResult; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PartitionRestartProgressInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PartitionRestartProgressInner.java new file mode 100644 index 0000000000000..7a1a1eb5bc0d5 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PartitionRestartProgressInner.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.microsoft.azure.servicefabric.OperationState; +import com.microsoft.azure.servicefabric.RestartPartitionResult; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about a partition restart user-induced operation. + */ +public class PartitionRestartProgressInner { + /** + * The state of the operation. Possible values include: 'Invalid', + * 'Running', 'RollingBack', 'Completed', 'Faulted', 'Cancelled', + * 'ForceCancelled'. + */ + @JsonProperty(value = "State") + private OperationState state; + + /** + * Represents information about an operation in a terminal state (Completed + * or Faulted). + */ + @JsonProperty(value = "RestartPartitionResult") + private RestartPartitionResult restartPartitionResult; + + /** + * Get the state of the operation. Possible values include: 'Invalid', 'Running', 'RollingBack', 'Completed', 'Faulted', 'Cancelled', 'ForceCancelled'. + * + * @return the state value + */ + public OperationState state() { + return this.state; + } + + /** + * Set the state of the operation. Possible values include: 'Invalid', 'Running', 'RollingBack', 'Completed', 'Faulted', 'Cancelled', 'ForceCancelled'. + * + * @param state the state value to set + * @return the PartitionRestartProgressInner object itself. + */ + public PartitionRestartProgressInner withState(OperationState state) { + this.state = state; + return this; + } + + /** + * Get represents information about an operation in a terminal state (Completed or Faulted). + * + * @return the restartPartitionResult value + */ + public RestartPartitionResult restartPartitionResult() { + return this.restartPartitionResult; + } + + /** + * Set represents information about an operation in a terminal state (Completed or Faulted). + * + * @param restartPartitionResult the restartPartitionResult value to set + * @return the PartitionRestartProgressInner object itself. + */ + public PartitionRestartProgressInner withRestartPartitionResult(RestartPartitionResult restartPartitionResult) { + this.restartPartitionResult = restartPartitionResult; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PropertyInfoInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PropertyInfoInner.java new file mode 100644 index 0000000000000..429bf9cbe760a --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PropertyInfoInner.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.microsoft.azure.servicefabric.PropertyValue; +import com.microsoft.azure.servicefabric.PropertyMetadata; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about a Service Fabric property. + */ +public class PropertyInfoInner { + /** + * The name of the Service Fabric property. + */ + @JsonProperty(value = "Name", required = true) + private String name; + + /** + * Describes a Service Fabric property value. + */ + @JsonProperty(value = "Value") + private PropertyValue value; + + /** + * The metadata associated with a property, including the property's name. + */ + @JsonProperty(value = "Metadata", required = true) + private PropertyMetadata metadata; + + /** + * Get the name of the Service Fabric property. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the Service Fabric property. + * + * @param name the name value to set + * @return the PropertyInfoInner object itself. + */ + public PropertyInfoInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get describes a Service Fabric property value. + * + * @return the value value + */ + public PropertyValue value() { + return this.value; + } + + /** + * Set describes a Service Fabric property value. + * + * @param value the value value to set + * @return the PropertyInfoInner object itself. + */ + public PropertyInfoInner withValue(PropertyValue value) { + this.value = value; + return this; + } + + /** + * Get the metadata associated with a property, including the property's name. + * + * @return the metadata value + */ + public PropertyMetadata metadata() { + return this.metadata; + } + + /** + * Set the metadata associated with a property, including the property's name. + * + * @param metadata the metadata value to set + * @return the PropertyInfoInner object itself. + */ + public PropertyInfoInner withMetadata(PropertyMetadata metadata) { + this.metadata = metadata; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/RepairTaskInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/RepairTaskInner.java new file mode 100644 index 0000000000000..b2d773a917825 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/RepairTaskInner.java @@ -0,0 +1,566 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.microsoft.azure.servicefabric.State; +import com.microsoft.azure.servicefabric.RepairTargetDescriptionBase; +import com.microsoft.azure.servicefabric.RepairImpactDescriptionBase; +import com.microsoft.azure.servicefabric.ResultStatus; +import com.microsoft.azure.servicefabric.RepairTaskHistory; +import com.microsoft.azure.servicefabric.RepairTaskHealthCheckState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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. + */ +public class RepairTaskInner { + /** + * The ID of the repair task. + */ + @JsonProperty(value = "TaskId", required = true) + private String taskId; + + /** + * 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. + */ + @JsonProperty(value = "Version") + private String version; + + /** + * 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. + */ + @JsonProperty(value = "Description") + private String description; + + /** + * 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'. + */ + @JsonProperty(value = "State", required = true) + private State state; + + /** + * 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. + */ + @JsonProperty(value = "Flags") + private Integer flags; + + /** + * The requested repair action. Must be specified when the repair task is + * created, and is immutable once set. + */ + @JsonProperty(value = "Action", required = true) + private String action; + + /** + * 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. + */ + @JsonProperty(value = "Target") + private RepairTargetDescriptionBase target; + + /** + * The name of the repair executor. Must be specified in Claimed and later + * states, and is immutable once set. + */ + @JsonProperty(value = "Executor") + private String executor; + + /** + * A data string that the repair executor can use to store its internal + * state. + */ + @JsonProperty(value = "ExecutorData") + private String executorData; + + /** + * 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. + */ + @JsonProperty(value = "Impact") + private RepairImpactDescriptionBase impact; + + /** + * 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'. + */ + @JsonProperty(value = "ResultStatus") + private ResultStatus resultStatus; + + /** + * 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. + */ + @JsonProperty(value = "ResultCode") + private Integer resultCode; + + /** + * 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. + */ + @JsonProperty(value = "ResultDetails") + private String resultDetails; + + /** + * An object that contains timestamps of the repair task's state + * transitions. + * These timestamps are updated by the system, and cannot be directly + * modified. + */ + @JsonProperty(value = "History") + private RepairTaskHistory history; + + /** + * The workflow state of the health check when the repair task is in the + * Preparing state. Possible values include: 'NotStarted', 'InProgress', + * 'Succeeded', 'Skipped', 'TimedOut'. + */ + @JsonProperty(value = "PreparingHealthCheckState") + private RepairTaskHealthCheckState preparingHealthCheckState; + + /** + * The workflow state of the health check when the repair task is in the + * Restoring state. Possible values include: 'NotStarted', 'InProgress', + * 'Succeeded', 'Skipped', 'TimedOut'. + */ + @JsonProperty(value = "RestoringHealthCheckState") + private RepairTaskHealthCheckState restoringHealthCheckState; + + /** + * A value to determine if health checks will be performed when the repair + * task enters the Preparing state. + */ + @JsonProperty(value = "PerformPreparingHealthCheck") + private Boolean performPreparingHealthCheck; + + /** + * A value to determine if health checks will be performed when the repair + * task enters the Restoring state. + */ + @JsonProperty(value = "PerformRestoringHealthCheck") + private Boolean performRestoringHealthCheck; + + /** + * Get the ID of the repair task. + * + * @return the taskId value + */ + public String taskId() { + return this.taskId; + } + + /** + * Set the ID of the repair task. + * + * @param taskId the taskId value to set + * @return the RepairTaskInner object itself. + */ + public RepairTaskInner withTaskId(String taskId) { + this.taskId = taskId; + return this; + } + + /** + * Get 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. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Set 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 version the version value to set + * @return the RepairTaskInner object itself. + */ + public RepairTaskInner withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get 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. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set 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 description the description value to set + * @return the RepairTaskInner object itself. + */ + public RepairTaskInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get 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'. + * + * @return the state value + */ + public State state() { + return this.state; + } + + /** + * Set 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 state the state value to set + * @return the RepairTaskInner object itself. + */ + public RepairTaskInner withState(State state) { + this.state = state; + return this; + } + + /** + * Get 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. + * + * @return the flags value + */ + public Integer flags() { + return this.flags; + } + + /** + * Set 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 flags the flags value to set + * @return the RepairTaskInner object itself. + */ + public RepairTaskInner withFlags(Integer flags) { + this.flags = flags; + return this; + } + + /** + * Get the requested repair action. Must be specified when the repair task is created, and is immutable once set. + * + * @return the action value + */ + public String action() { + return this.action; + } + + /** + * Set the requested repair action. Must be specified when the repair task is created, and is immutable once set. + * + * @param action the action value to set + * @return the RepairTaskInner object itself. + */ + public RepairTaskInner withAction(String action) { + this.action = action; + return this; + } + + /** + * Get 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. + * + * @return the target value + */ + public RepairTargetDescriptionBase target() { + return this.target; + } + + /** + * Set 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 target the target value to set + * @return the RepairTaskInner object itself. + */ + public RepairTaskInner withTarget(RepairTargetDescriptionBase target) { + this.target = target; + return this; + } + + /** + * Get the name of the repair executor. Must be specified in Claimed and later states, and is immutable once set. + * + * @return the executor value + */ + public String executor() { + return this.executor; + } + + /** + * Set the name of the repair executor. Must be specified in Claimed and later states, and is immutable once set. + * + * @param executor the executor value to set + * @return the RepairTaskInner object itself. + */ + public RepairTaskInner withExecutor(String executor) { + this.executor = executor; + return this; + } + + /** + * Get a data string that the repair executor can use to store its internal state. + * + * @return the executorData value + */ + public String executorData() { + return this.executorData; + } + + /** + * Set a data string that the repair executor can use to store its internal state. + * + * @param executorData the executorData value to set + * @return the RepairTaskInner object itself. + */ + public RepairTaskInner withExecutorData(String executorData) { + this.executorData = executorData; + return this; + } + + /** + * Get 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. + * + * @return the impact value + */ + public RepairImpactDescriptionBase impact() { + return this.impact; + } + + /** + * Set 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 impact the impact value to set + * @return the RepairTaskInner object itself. + */ + public RepairTaskInner withImpact(RepairImpactDescriptionBase impact) { + this.impact = impact; + return this; + } + + /** + * Get 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'. + * + * @return the resultStatus value + */ + public ResultStatus resultStatus() { + return this.resultStatus; + } + + /** + * Set 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 resultStatus the resultStatus value to set + * @return the RepairTaskInner object itself. + */ + public RepairTaskInner withResultStatus(ResultStatus resultStatus) { + this.resultStatus = resultStatus; + return this; + } + + /** + * Get 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. + * + * @return the resultCode value + */ + public Integer resultCode() { + return this.resultCode; + } + + /** + * Set 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 resultCode the resultCode value to set + * @return the RepairTaskInner object itself. + */ + public RepairTaskInner withResultCode(Integer resultCode) { + this.resultCode = resultCode; + return this; + } + + /** + * Get 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. + * + * @return the resultDetails value + */ + public String resultDetails() { + return this.resultDetails; + } + + /** + * Set 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 resultDetails the resultDetails value to set + * @return the RepairTaskInner object itself. + */ + public RepairTaskInner withResultDetails(String resultDetails) { + this.resultDetails = resultDetails; + return this; + } + + /** + * Get an object that contains timestamps of the repair task's state transitions. + These timestamps are updated by the system, and cannot be directly modified. + * + * @return the history value + */ + public RepairTaskHistory history() { + return this.history; + } + + /** + * Set 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 history the history value to set + * @return the RepairTaskInner object itself. + */ + public RepairTaskInner withHistory(RepairTaskHistory history) { + this.history = history; + return this; + } + + /** + * Get the workflow state of the health check when the repair task is in the Preparing state. Possible values include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', 'TimedOut'. + * + * @return the preparingHealthCheckState value + */ + public RepairTaskHealthCheckState preparingHealthCheckState() { + return this.preparingHealthCheckState; + } + + /** + * Set 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 preparingHealthCheckState the preparingHealthCheckState value to set + * @return the RepairTaskInner object itself. + */ + public RepairTaskInner withPreparingHealthCheckState(RepairTaskHealthCheckState preparingHealthCheckState) { + this.preparingHealthCheckState = preparingHealthCheckState; + return this; + } + + /** + * Get the workflow state of the health check when the repair task is in the Restoring state. Possible values include: 'NotStarted', 'InProgress', 'Succeeded', 'Skipped', 'TimedOut'. + * + * @return the restoringHealthCheckState value + */ + public RepairTaskHealthCheckState restoringHealthCheckState() { + return this.restoringHealthCheckState; + } + + /** + * Set 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 restoringHealthCheckState the restoringHealthCheckState value to set + * @return the RepairTaskInner object itself. + */ + public RepairTaskInner withRestoringHealthCheckState(RepairTaskHealthCheckState restoringHealthCheckState) { + this.restoringHealthCheckState = restoringHealthCheckState; + return this; + } + + /** + * Get a value to determine if health checks will be performed when the repair task enters the Preparing state. + * + * @return the performPreparingHealthCheck value + */ + public Boolean performPreparingHealthCheck() { + return this.performPreparingHealthCheck; + } + + /** + * Set a value to determine if health checks will be performed when the repair task enters the Preparing state. + * + * @param performPreparingHealthCheck the performPreparingHealthCheck value to set + * @return the RepairTaskInner object itself. + */ + public RepairTaskInner withPerformPreparingHealthCheck(Boolean performPreparingHealthCheck) { + this.performPreparingHealthCheck = performPreparingHealthCheck; + return this; + } + + /** + * Get a value to determine if health checks will be performed when the repair task enters the Restoring state. + * + * @return the performRestoringHealthCheck value + */ + public Boolean performRestoringHealthCheck() { + return this.performRestoringHealthCheck; + } + + /** + * Set a value to determine if health checks will be performed when the repair task enters the Restoring state. + * + * @param performRestoringHealthCheck the performRestoringHealthCheck value to set + * @return the RepairTaskInner object itself. + */ + public RepairTaskInner withPerformRestoringHealthCheck(Boolean performRestoringHealthCheck) { + this.performRestoringHealthCheck = performRestoringHealthCheck; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/RepairTaskUpdateInfoInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/RepairTaskUpdateInfoInner.java new file mode 100644 index 0000000000000..8ddafd038d3e4 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/RepairTaskUpdateInfoInner.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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. + */ +public class RepairTaskUpdateInfoInner { + /** + * The new version of the repair task. + */ + @JsonProperty(value = "Version", required = true) + private String version; + + /** + * Get the new version of the repair task. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Set the new version of the repair task. + * + * @param version the version value to set + * @return the RepairTaskUpdateInfoInner object itself. + */ + public RepairTaskUpdateInfoInner withVersion(String version) { + this.version = version; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ReplicaEventInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ReplicaEventInner.java new file mode 100644 index 0000000000000..5cddf06d6e2a6 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ReplicaEventInner.java @@ -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. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Represents the base for all Replica Events. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ReplicaEvent") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "StatefulReplicaHealthReportCreated", value = StatefulReplicaHealthReportCreatedEvent.class), + @JsonSubTypes.Type(name = "StatefulReplicaHealthReportExpired", value = StatefulReplicaHealthReportExpiredEvent.class), + @JsonSubTypes.Type(name = "StatelessReplicaHealthReportCreated", value = StatelessReplicaHealthReportCreatedEvent.class), + @JsonSubTypes.Type(name = "StatelessReplicaHealthReportExpired", value = StatelessReplicaHealthReportExpiredEvent.class), + @JsonSubTypes.Type(name = "ChaosRemoveReplicaFaultScheduled", value = ChaosRemoveReplicaFaultScheduledEvent.class), + @JsonSubTypes.Type(name = "ChaosRemoveReplicaFaultCompleted", value = ChaosRemoveReplicaFaultCompletedEvent.class), + @JsonSubTypes.Type(name = "ChaosRestartReplicaFaultScheduled", value = ChaosRestartReplicaFaultScheduledEvent.class) +}) +public class ReplicaEventInner extends FabricEventInner { + /** + * 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. + */ + @JsonProperty(value = "PartitionId", required = true) + private UUID partitionId; + + /** + * 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. + */ + @JsonProperty(value = "ReplicaId", required = true) + private long replicaId; + + /** + * Get 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. + * + * @return the partitionId value + */ + public UUID partitionId() { + return this.partitionId; + } + + /** + * Set 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. + * + * @param partitionId the partitionId value to set + * @return the ReplicaEventInner object itself. + */ + public ReplicaEventInner withPartitionId(UUID partitionId) { + this.partitionId = partitionId; + return this; + } + + /** + * Get 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. + * + * @return the replicaId value + */ + public long replicaId() { + return this.replicaId; + } + + /** + * Set 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. + * + * @param replicaId the replicaId value to set + * @return the ReplicaEventInner object itself. + */ + public ReplicaEventInner withReplicaId(long replicaId) { + this.replicaId = replicaId; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ReplicaHealthInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ReplicaHealthInner.java new file mode 100644 index 0000000000000..383ec6983aa4a --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ReplicaHealthInner.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.microsoft.azure.servicefabric.EntityHealth; + +/** + * Represents a base class for stateful service replica or stateless service + * instance health. + * Contains the replica aggregated health state, the health events and the + * unhealthy evaluations. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ServiceKind") +@JsonTypeName("ReplicaHealth") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Stateful", value = StatefulServiceReplicaHealth.class), + @JsonSubTypes.Type(name = "Stateless", value = StatelessServiceInstanceHealth.class) +}) +public class ReplicaHealthInner extends EntityHealth { + /** + * Id of the partition to which this replica belongs. + */ + @JsonProperty(value = "PartitionId") + private UUID partitionId; + + /** + * Get id of the partition to which this replica belongs. + * + * @return the partitionId value + */ + public UUID partitionId() { + return this.partitionId; + } + + /** + * Set id of the partition to which this replica belongs. + * + * @param partitionId the partitionId value to set + * @return the ReplicaHealthInner object itself. + */ + public ReplicaHealthInner withPartitionId(UUID partitionId) { + this.partitionId = partitionId; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ReplicaInfoInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ReplicaInfoInner.java new file mode 100644 index 0000000000000..cb500636f4288 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ReplicaInfoInner.java @@ -0,0 +1,162 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.microsoft.azure.servicefabric.ReplicaStatus; +import com.microsoft.azure.servicefabric.HealthState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Information about the identity, status, health, node name, uptime, and other + * details about the replica. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ServiceKind") +@JsonTypeName("ReplicaInfo") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Stateful", value = StatefulServiceReplicaInfo.class), + @JsonSubTypes.Type(name = "Stateless", value = StatelessServiceInstanceInfo.class) +}) +public class ReplicaInfoInner { + /** + * The status of a replica of a service. Possible values include: + * 'Invalid', 'InBuild', 'Standby', 'Ready', 'Down', 'Dropped'. + */ + @JsonProperty(value = "ReplicaStatus") + private ReplicaStatus replicaStatus; + + /** + * 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'. + */ + @JsonProperty(value = "HealthState") + private HealthState healthState; + + /** + * The name of a Service Fabric node. + */ + @JsonProperty(value = "NodeName") + private String nodeName; + + /** + * The address the replica is listening on. + */ + @JsonProperty(value = "Address") + private String address; + + /** + * The last in build duration of the replica in seconds. + */ + @JsonProperty(value = "LastInBuildDurationInSeconds") + private String lastInBuildDurationInSeconds; + + /** + * Get the status of a replica of a service. Possible values include: 'Invalid', 'InBuild', 'Standby', 'Ready', 'Down', 'Dropped'. + * + * @return the replicaStatus value + */ + public ReplicaStatus replicaStatus() { + return this.replicaStatus; + } + + /** + * Set the status of a replica of a service. Possible values include: 'Invalid', 'InBuild', 'Standby', 'Ready', 'Down', 'Dropped'. + * + * @param replicaStatus the replicaStatus value to set + * @return the ReplicaInfoInner object itself. + */ + public ReplicaInfoInner withReplicaStatus(ReplicaStatus replicaStatus) { + this.replicaStatus = replicaStatus; + return this; + } + + /** + * Get 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'. + * + * @return the healthState value + */ + public HealthState healthState() { + return this.healthState; + } + + /** + * Set 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 healthState the healthState value to set + * @return the ReplicaInfoInner object itself. + */ + public ReplicaInfoInner withHealthState(HealthState healthState) { + this.healthState = healthState; + return this; + } + + /** + * Get the name of a Service Fabric node. + * + * @return the nodeName value + */ + public String nodeName() { + return this.nodeName; + } + + /** + * Set the name of a Service Fabric node. + * + * @param nodeName the nodeName value to set + * @return the ReplicaInfoInner object itself. + */ + public ReplicaInfoInner withNodeName(String nodeName) { + this.nodeName = nodeName; + return this; + } + + /** + * Get the address the replica is listening on. + * + * @return the address value + */ + public String address() { + return this.address; + } + + /** + * Set the address the replica is listening on. + * + * @param address the address value to set + * @return the ReplicaInfoInner object itself. + */ + public ReplicaInfoInner withAddress(String address) { + this.address = address; + return this; + } + + /** + * Get the last in build duration of the replica in seconds. + * + * @return the lastInBuildDurationInSeconds value + */ + public String lastInBuildDurationInSeconds() { + return this.lastInBuildDurationInSeconds; + } + + /** + * Set the last in build duration of the replica in seconds. + * + * @param lastInBuildDurationInSeconds the lastInBuildDurationInSeconds value to set + * @return the ReplicaInfoInner object itself. + */ + public ReplicaInfoInner withLastInBuildDurationInSeconds(String lastInBuildDurationInSeconds) { + this.lastInBuildDurationInSeconds = lastInBuildDurationInSeconds; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ResolvedServicePartitionInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ResolvedServicePartitionInner.java new file mode 100644 index 0000000000000..fd0070c611b94 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ResolvedServicePartitionInner.java @@ -0,0 +1,126 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.microsoft.azure.servicefabric.PartitionInformation; +import java.util.List; +import com.microsoft.azure.servicefabric.ResolvedServiceEndpoint; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about a service partition and its associated endpoints. + */ +public class ResolvedServicePartitionInner { + /** + * The full name of the service with 'fabric:' URI scheme. + */ + @JsonProperty(value = "Name", required = true) + private String name; + + /** + * A representation of the resolved partition. + */ + @JsonProperty(value = "PartitionInformation", required = true) + private PartitionInformation partitionInformation; + + /** + * List of resolved service endpoints of a service partition. + */ + @JsonProperty(value = "Endpoints", required = true) + private List endpoints; + + /** + * 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. + */ + @JsonProperty(value = "Version", required = true) + private String version; + + /** + * Get the full name of the service with 'fabric:' URI scheme. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the full name of the service with 'fabric:' URI scheme. + * + * @param name the name value to set + * @return the ResolvedServicePartitionInner object itself. + */ + public ResolvedServicePartitionInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get a representation of the resolved partition. + * + * @return the partitionInformation value + */ + public PartitionInformation partitionInformation() { + return this.partitionInformation; + } + + /** + * Set a representation of the resolved partition. + * + * @param partitionInformation the partitionInformation value to set + * @return the ResolvedServicePartitionInner object itself. + */ + public ResolvedServicePartitionInner withPartitionInformation(PartitionInformation partitionInformation) { + this.partitionInformation = partitionInformation; + return this; + } + + /** + * Get list of resolved service endpoints of a service partition. + * + * @return the endpoints value + */ + public List endpoints() { + return this.endpoints; + } + + /** + * Set list of resolved service endpoints of a service partition. + * + * @param endpoints the endpoints value to set + * @return the ResolvedServicePartitionInner object itself. + */ + public ResolvedServicePartitionInner withEndpoints(List endpoints) { + this.endpoints = endpoints; + return this; + } + + /** + * Get 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. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Set 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. + * + * @param version the version value to set + * @return the ResolvedServicePartitionInner object itself. + */ + public ResolvedServicePartitionInner withVersion(String version) { + this.version = version; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/RestoreProgressInfoInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/RestoreProgressInfoInner.java new file mode 100644 index 0000000000000..decd85afa0547 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/RestoreProgressInfoInner.java @@ -0,0 +1,155 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.microsoft.azure.servicefabric.RestoreState; +import org.joda.time.DateTime; +import com.microsoft.azure.servicefabric.BackupEpoch; +import com.microsoft.azure.servicefabric.FabricErrorError; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the progress of a restore operation on a partition. + */ +public class RestoreProgressInfoInner { + /** + * Represents the current state of the partition restore operation. + * . Possible values include: 'Invalid', 'Accepted', 'RestoreInProgress', + * 'Success', 'Failure', 'Timeout'. + */ + @JsonProperty(value = "RestoreState") + private RestoreState restoreState; + + /** + * Timestamp when operation succeeded or failed. + */ + @JsonProperty(value = "TimeStampUtc") + private DateTime timeStampUtc; + + /** + * Describes the epoch at which the partition is restored. + */ + @JsonProperty(value = "RestoredEpoch") + private BackupEpoch restoredEpoch; + + /** + * Restored LSN. + */ + @JsonProperty(value = "RestoredLsn") + private String restoredLsn; + + /** + * Denotes the failure encountered in performing restore operation. + */ + @JsonProperty(value = "FailureError") + private FabricErrorError failureError; + + /** + * Get represents the current state of the partition restore operation. + . Possible values include: 'Invalid', 'Accepted', 'RestoreInProgress', 'Success', 'Failure', 'Timeout'. + * + * @return the restoreState value + */ + public RestoreState restoreState() { + return this.restoreState; + } + + /** + * Set represents the current state of the partition restore operation. + . Possible values include: 'Invalid', 'Accepted', 'RestoreInProgress', 'Success', 'Failure', 'Timeout'. + * + * @param restoreState the restoreState value to set + * @return the RestoreProgressInfoInner object itself. + */ + public RestoreProgressInfoInner withRestoreState(RestoreState restoreState) { + this.restoreState = restoreState; + return this; + } + + /** + * Get timestamp when operation succeeded or failed. + * + * @return the timeStampUtc value + */ + public DateTime timeStampUtc() { + return this.timeStampUtc; + } + + /** + * Set timestamp when operation succeeded or failed. + * + * @param timeStampUtc the timeStampUtc value to set + * @return the RestoreProgressInfoInner object itself. + */ + public RestoreProgressInfoInner withTimeStampUtc(DateTime timeStampUtc) { + this.timeStampUtc = timeStampUtc; + return this; + } + + /** + * Get describes the epoch at which the partition is restored. + * + * @return the restoredEpoch value + */ + public BackupEpoch restoredEpoch() { + return this.restoredEpoch; + } + + /** + * Set describes the epoch at which the partition is restored. + * + * @param restoredEpoch the restoredEpoch value to set + * @return the RestoreProgressInfoInner object itself. + */ + public RestoreProgressInfoInner withRestoredEpoch(BackupEpoch restoredEpoch) { + this.restoredEpoch = restoredEpoch; + return this; + } + + /** + * Get restored LSN. + * + * @return the restoredLsn value + */ + public String restoredLsn() { + return this.restoredLsn; + } + + /** + * Set restored LSN. + * + * @param restoredLsn the restoredLsn value to set + * @return the RestoreProgressInfoInner object itself. + */ + public RestoreProgressInfoInner withRestoredLsn(String restoredLsn) { + this.restoredLsn = restoredLsn; + return this; + } + + /** + * Get denotes the failure encountered in performing restore operation. + * + * @return the failureError value + */ + public FabricErrorError failureError() { + return this.failureError; + } + + /** + * Set denotes the failure encountered in performing restore operation. + * + * @param failureError the failureError value to set + * @return the RestoreProgressInfoInner object itself. + */ + public RestoreProgressInfoInner withFailureError(FabricErrorError failureError) { + this.failureError = failureError; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceDescriptionInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceDescriptionInner.java new file mode 100644 index 0000000000000..e10380c40c958 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceDescriptionInner.java @@ -0,0 +1,407 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import java.util.List; +import com.microsoft.azure.servicefabric.PartitionSchemeDescription; +import com.microsoft.azure.servicefabric.ServiceCorrelationDescription; +import com.microsoft.azure.servicefabric.ServiceLoadMetricDescription; +import com.microsoft.azure.servicefabric.ServicePlacementPolicyDescription; +import com.microsoft.azure.servicefabric.MoveCost; +import com.microsoft.azure.servicefabric.ServicePackageActivationMode; +import com.microsoft.azure.servicefabric.ScalingPolicyDescription; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * A ServiceDescription contains all of the information necessary to create a + * service. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ServiceKind") +@JsonTypeName("ServiceDescription") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Stateful", value = StatefulServiceDescription.class), + @JsonSubTypes.Type(name = "Stateless", value = StatelessServiceDescription.class) +}) +public class ServiceDescriptionInner { + /** + * The name of the application, including the 'fabric:' URI scheme. + */ + @JsonProperty(value = "ApplicationName") + private String applicationName; + + /** + * The full name of the service with 'fabric:' URI scheme. + */ + @JsonProperty(value = "ServiceName", required = true) + private String serviceName; + + /** + * Name of the service type as specified in the service manifest. + */ + @JsonProperty(value = "ServiceTypeName", required = true) + private String serviceTypeName; + + /** + * The initialization data as an array of bytes. Initialization data is + * passed to service instances or replicas when they are created. + */ + @JsonProperty(value = "InitializationData") + private List initializationData; + + /** + * The partition description as an object. + */ + @JsonProperty(value = "PartitionDescription", required = true) + private PartitionSchemeDescription partitionDescription; + + /** + * 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)". + */ + @JsonProperty(value = "PlacementConstraints") + private String placementConstraints; + + /** + * The correlation scheme. + */ + @JsonProperty(value = "CorrelationScheme") + private List correlationScheme; + + /** + * The service load metrics. + */ + @JsonProperty(value = "ServiceLoadMetrics") + private List serviceLoadMetrics; + + /** + * The service placement policies. + */ + @JsonProperty(value = "ServicePlacementPolicies") + private List servicePlacementPolicies; + + /** + * The move cost for the service. Possible values include: 'Zero', 'Low', + * 'Medium', 'High'. + */ + @JsonProperty(value = "DefaultMoveCost") + private MoveCost defaultMoveCost; + + /** + * Indicates if the DefaultMoveCost property is specified. + */ + @JsonProperty(value = "IsDefaultMoveCostSpecified") + private Boolean isDefaultMoveCostSpecified; + + /** + * The activation mode of service package to be used for a service. + * Possible values include: 'SharedProcess', 'ExclusiveProcess'. + */ + @JsonProperty(value = "ServicePackageActivationMode") + private ServicePackageActivationMode servicePackageActivationMode; + + /** + * The DNS name of the service. It requires the DNS system service to be + * enabled in Service Fabric cluster. + */ + @JsonProperty(value = "ServiceDnsName") + private String serviceDnsName; + + /** + * Scaling policies for this service. + */ + @JsonProperty(value = "ScalingPolicies") + private List scalingPolicies; + + /** + * Get the name of the application, including the 'fabric:' URI scheme. + * + * @return the applicationName value + */ + public String applicationName() { + return this.applicationName; + } + + /** + * Set the name of the application, including the 'fabric:' URI scheme. + * + * @param applicationName the applicationName value to set + * @return the ServiceDescriptionInner object itself. + */ + public ServiceDescriptionInner withApplicationName(String applicationName) { + this.applicationName = applicationName; + return this; + } + + /** + * Get the full name of the service with 'fabric:' URI scheme. + * + * @return the serviceName value + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set the full name of the service with 'fabric:' URI scheme. + * + * @param serviceName the serviceName value to set + * @return the ServiceDescriptionInner object itself. + */ + public ServiceDescriptionInner withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Get name of the service type as specified in the service manifest. + * + * @return the serviceTypeName value + */ + public String serviceTypeName() { + return this.serviceTypeName; + } + + /** + * Set name of the service type as specified in the service manifest. + * + * @param serviceTypeName the serviceTypeName value to set + * @return the ServiceDescriptionInner object itself. + */ + public ServiceDescriptionInner withServiceTypeName(String serviceTypeName) { + this.serviceTypeName = serviceTypeName; + return this; + } + + /** + * Get the initialization data as an array of bytes. Initialization data is passed to service instances or replicas when they are created. + * + * @return the initializationData value + */ + public List initializationData() { + return this.initializationData; + } + + /** + * Set the initialization data as an array of bytes. Initialization data is passed to service instances or replicas when they are created. + * + * @param initializationData the initializationData value to set + * @return the ServiceDescriptionInner object itself. + */ + public ServiceDescriptionInner withInitializationData(List initializationData) { + this.initializationData = initializationData; + return this; + } + + /** + * Get the partition description as an object. + * + * @return the partitionDescription value + */ + public PartitionSchemeDescription partitionDescription() { + return this.partitionDescription; + } + + /** + * Set the partition description as an object. + * + * @param partitionDescription the partitionDescription value to set + * @return the ServiceDescriptionInner object itself. + */ + public ServiceDescriptionInner withPartitionDescription(PartitionSchemeDescription partitionDescription) { + this.partitionDescription = partitionDescription; + return this; + } + + /** + * Get 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)". + * + * @return the placementConstraints value + */ + public String placementConstraints() { + return this.placementConstraints; + } + + /** + * Set 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 placementConstraints the placementConstraints value to set + * @return the ServiceDescriptionInner object itself. + */ + public ServiceDescriptionInner withPlacementConstraints(String placementConstraints) { + this.placementConstraints = placementConstraints; + return this; + } + + /** + * Get the correlation scheme. + * + * @return the correlationScheme value + */ + public List correlationScheme() { + return this.correlationScheme; + } + + /** + * Set the correlation scheme. + * + * @param correlationScheme the correlationScheme value to set + * @return the ServiceDescriptionInner object itself. + */ + public ServiceDescriptionInner withCorrelationScheme(List correlationScheme) { + this.correlationScheme = correlationScheme; + return this; + } + + /** + * Get the service load metrics. + * + * @return the serviceLoadMetrics value + */ + public List serviceLoadMetrics() { + return this.serviceLoadMetrics; + } + + /** + * Set the service load metrics. + * + * @param serviceLoadMetrics the serviceLoadMetrics value to set + * @return the ServiceDescriptionInner object itself. + */ + public ServiceDescriptionInner withServiceLoadMetrics(List serviceLoadMetrics) { + this.serviceLoadMetrics = serviceLoadMetrics; + return this; + } + + /** + * Get the service placement policies. + * + * @return the servicePlacementPolicies value + */ + public List servicePlacementPolicies() { + return this.servicePlacementPolicies; + } + + /** + * Set the service placement policies. + * + * @param servicePlacementPolicies the servicePlacementPolicies value to set + * @return the ServiceDescriptionInner object itself. + */ + public ServiceDescriptionInner withServicePlacementPolicies(List servicePlacementPolicies) { + this.servicePlacementPolicies = servicePlacementPolicies; + return this; + } + + /** + * Get the move cost for the service. Possible values include: 'Zero', 'Low', 'Medium', 'High'. + * + * @return the defaultMoveCost value + */ + public MoveCost defaultMoveCost() { + return this.defaultMoveCost; + } + + /** + * Set the move cost for the service. Possible values include: 'Zero', 'Low', 'Medium', 'High'. + * + * @param defaultMoveCost the defaultMoveCost value to set + * @return the ServiceDescriptionInner object itself. + */ + public ServiceDescriptionInner withDefaultMoveCost(MoveCost defaultMoveCost) { + this.defaultMoveCost = defaultMoveCost; + return this; + } + + /** + * Get indicates if the DefaultMoveCost property is specified. + * + * @return the isDefaultMoveCostSpecified value + */ + public Boolean isDefaultMoveCostSpecified() { + return this.isDefaultMoveCostSpecified; + } + + /** + * Set indicates if the DefaultMoveCost property is specified. + * + * @param isDefaultMoveCostSpecified the isDefaultMoveCostSpecified value to set + * @return the ServiceDescriptionInner object itself. + */ + public ServiceDescriptionInner withIsDefaultMoveCostSpecified(Boolean isDefaultMoveCostSpecified) { + this.isDefaultMoveCostSpecified = isDefaultMoveCostSpecified; + return this; + } + + /** + * Get the activation mode of service package to be used for a service. Possible values include: 'SharedProcess', 'ExclusiveProcess'. + * + * @return the servicePackageActivationMode value + */ + public ServicePackageActivationMode servicePackageActivationMode() { + return this.servicePackageActivationMode; + } + + /** + * Set the activation mode of service package to be used for a service. Possible values include: 'SharedProcess', 'ExclusiveProcess'. + * + * @param servicePackageActivationMode the servicePackageActivationMode value to set + * @return the ServiceDescriptionInner object itself. + */ + public ServiceDescriptionInner withServicePackageActivationMode(ServicePackageActivationMode servicePackageActivationMode) { + this.servicePackageActivationMode = servicePackageActivationMode; + return this; + } + + /** + * Get the DNS name of the service. It requires the DNS system service to be enabled in Service Fabric cluster. + * + * @return the serviceDnsName value + */ + public String serviceDnsName() { + return this.serviceDnsName; + } + + /** + * Set the DNS name of the service. It requires the DNS system service to be enabled in Service Fabric cluster. + * + * @param serviceDnsName the serviceDnsName value to set + * @return the ServiceDescriptionInner object itself. + */ + public ServiceDescriptionInner withServiceDnsName(String serviceDnsName) { + this.serviceDnsName = serviceDnsName; + return this; + } + + /** + * Get scaling policies for this service. + * + * @return the scalingPolicies value + */ + public List scalingPolicies() { + return this.scalingPolicies; + } + + /** + * Set scaling policies for this service. + * + * @param scalingPolicies the scalingPolicies value to set + * @return the ServiceDescriptionInner object itself. + */ + public ServiceDescriptionInner withScalingPolicies(List scalingPolicies) { + this.scalingPolicies = scalingPolicies; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceEventInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceEventInner.java new file mode 100644 index 0000000000000..2bbf020ba99a3 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceEventInner.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Represents the base for all Service Events. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ServiceEvent") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "ServiceCreated", value = ServiceCreatedEvent.class), + @JsonSubTypes.Type(name = "ServiceDeleted", value = ServiceDeletedEvent.class), + @JsonSubTypes.Type(name = "ServiceHealthReportCreated", value = ServiceHealthReportCreatedEvent.class), + @JsonSubTypes.Type(name = "ServiceHealthReportExpired", value = ServiceHealthReportExpiredEvent.class) +}) +public class ServiceEventInner extends FabricEventInner { + /** + * The identity of the service. This ID is an encoded representation of the + * service name. This is used in the REST APIs to identify the service + * resource. + * Starting in version 6.0, hierarchical names are delimited with the "\~" + * character. For example, if the service name is + * "fabric:/myapp/app1/svc1", + * the service identity would be "myapp~app1\~svc1" in 6.0+ and + * "myapp/app1/svc1" in previous versions. + */ + @JsonProperty(value = "ServiceId", required = true) + private String serviceId; + + /** + * Get the identity of the service. This ID is an encoded representation of the service name. This is used in the REST APIs to identify the service resource. + Starting in version 6.0, hierarchical names are delimited with the "\~" character. For example, if the service name is "fabric:/myapp/app1/svc1", + the service identity would be "myapp~app1\~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. + * + * @return the serviceId value + */ + public String serviceId() { + return this.serviceId; + } + + /** + * Set the identity of the service. This ID is an encoded representation of the service name. This is used in the REST APIs to identify the service resource. + Starting in version 6.0, hierarchical names are delimited with the "\~" character. For example, if the service name is "fabric:/myapp/app1/svc1", + the service identity would be "myapp~app1\~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. + * + * @param serviceId the serviceId value to set + * @return the ServiceEventInner object itself. + */ + public ServiceEventInner withServiceId(String serviceId) { + this.serviceId = serviceId; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceFabricClientAPIsImpl.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceFabricClientAPIsImpl.java new file mode 100644 index 0000000000000..620754a291d94 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceFabricClientAPIsImpl.java @@ -0,0 +1,37196 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.servicefabric.ApplicationDescription; +import com.microsoft.azure.servicefabric.ApplicationHealthPolicy; +import com.microsoft.azure.servicefabric.ApplicationUpgradeDescription; +import com.microsoft.azure.servicefabric.ApplicationUpgradeUpdateDescription; +import com.microsoft.azure.servicefabric.BackupPartitionDescription; +import com.microsoft.azure.servicefabric.BackupStorageDescription; +import com.microsoft.azure.servicefabric.ChaosParameters; +import com.microsoft.azure.servicefabric.ClusterConfigurationUpgradeDescription; +import com.microsoft.azure.servicefabric.ClusterHealthChunkQueryDescription; +import com.microsoft.azure.servicefabric.ClusterHealthPolicies; +import com.microsoft.azure.servicefabric.ClusterHealthPolicy; +import com.microsoft.azure.servicefabric.ComposeDeploymentUpgradeDescription; +import com.microsoft.azure.servicefabric.ContainerApiRequestBody; +import com.microsoft.azure.servicefabric.CreateComposeDeploymentDescription; +import com.microsoft.azure.servicefabric.DataLossMode; +import com.microsoft.azure.servicefabric.DeactivationIntent; +import com.microsoft.azure.servicefabric.DeactivationIntentDescription; +import com.microsoft.azure.servicefabric.DeployServicePackageToNodeDescription; +import com.microsoft.azure.servicefabric.EnableBackupDescription; +import com.microsoft.azure.servicefabric.FabricErrorException; +import com.microsoft.azure.servicefabric.GetBackupByStorageQueryDescription; +import com.microsoft.azure.servicefabric.HealthInformation; +import com.microsoft.azure.servicefabric.ImageStoreCopyDescription; +import com.microsoft.azure.servicefabric.NameDescription; +import com.microsoft.azure.servicefabric.NodeStatusFilter; +import com.microsoft.azure.servicefabric.NodeTransitionType; +import com.microsoft.azure.servicefabric.PropertyBatchDescriptionList; +import com.microsoft.azure.servicefabric.PropertyBatchInfo; +import com.microsoft.azure.servicefabric.PropertyBatchOperation; +import com.microsoft.azure.servicefabric.PropertyDescription; +import com.microsoft.azure.servicefabric.ProvisionApplicationTypeDescriptionBase; +import com.microsoft.azure.servicefabric.ProvisionFabricDescription; +import com.microsoft.azure.servicefabric.QuorumLossMode; +import com.microsoft.azure.servicefabric.RepairTaskApproveDescription; +import com.microsoft.azure.servicefabric.RepairTaskCancelDescription; +import com.microsoft.azure.servicefabric.RepairTaskDeleteDescription; +import com.microsoft.azure.servicefabric.RepairTaskUpdateHealthPolicyDescription; +import com.microsoft.azure.servicefabric.ReplicaHealthReportServiceKind; +import com.microsoft.azure.servicefabric.RestartDeployedCodePackageDescription; +import com.microsoft.azure.servicefabric.RestartNodeDescription; +import com.microsoft.azure.servicefabric.RestartPartitionMode; +import com.microsoft.azure.servicefabric.RestorePartitionDescription; +import com.microsoft.azure.servicefabric.ResumeApplicationUpgradeDescription; +import com.microsoft.azure.servicefabric.ResumeClusterUpgradeDescription; +import com.microsoft.azure.servicefabric.ServiceFromTemplateDescription; +import com.microsoft.azure.servicefabric.ServiceUpdateDescription; +import com.microsoft.azure.servicefabric.StartClusterUpgradeDescription; +import com.microsoft.azure.servicefabric.UnprovisionApplicationTypeDescriptionInfo; +import com.microsoft.azure.servicefabric.UnprovisionFabricDescription; +import com.microsoft.azure.servicefabric.UpdateClusterUpgradeDescription; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.UUID; +import okhttp3.ResponseBody; +import org.joda.time.DateTime; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * Initializes a new instance of the ServiceFabricClientAPIsImpl class. + */ +public class ServiceFabricClientAPIsImpl extends AzureServiceClient { + /** The Retrofit service to perform REST calls. */ + private ServiceFabricClientAPIsService service; + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public ServiceFabricClientAPIsImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public ServiceFabricClientAPIsImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public ServiceFabricClientAPIsImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * Initializes an instance of ServiceFabricClientAPIs client. + * + * @param credentials the management credentials for Azure + */ + public ServiceFabricClientAPIsImpl(ServiceClientCredentials credentials) { + this("http://localhost:19080", credentials); + } + + /** + * Initializes an instance of ServiceFabricClientAPIs client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public ServiceFabricClientAPIsImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of ServiceFabricClientAPIs client. + * + * @param restClient the REST client to connect to Azure. + */ + public ServiceFabricClientAPIsImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.azureClient = new AzureClient(this); + initializeService(); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "ServiceFabricClientAPIs", "6.3.0.9"); + } + + private void initializeService() { + service = restClient().retrofit().create(ServiceFabricClientAPIsService.class); + } + + /** + * The interface defining all the services for ServiceFabricClientAPIs to be + * used by Retrofit to perform actually REST calls. + */ + interface ServiceFabricClientAPIsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getClusterManifest" }) + @GET("$/GetClusterManifest") + Observable> getClusterManifest(@Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getClusterHealth" }) + @GET("$/GetClusterHealth") + Observable> getClusterHealth(@Query("api-version") String apiVersion, @Query("NodesHealthStateFilter") Integer nodesHealthStateFilter, @Query("ApplicationsHealthStateFilter") Integer applicationsHealthStateFilter, @Query("EventsHealthStateFilter") Integer eventsHealthStateFilter, @Query("ExcludeHealthStatistics") Boolean excludeHealthStatistics, @Query("IncludeSystemApplicationHealthStatistics") Boolean includeSystemApplicationHealthStatistics, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getClusterHealthUsingPolicy" }) + @POST("$/GetClusterHealth") + Observable> getClusterHealthUsingPolicy(@Query("api-version") String apiVersion, @Query("NodesHealthStateFilter") Integer nodesHealthStateFilter, @Query("ApplicationsHealthStateFilter") Integer applicationsHealthStateFilter, @Query("EventsHealthStateFilter") Integer eventsHealthStateFilter, @Query("ExcludeHealthStatistics") Boolean excludeHealthStatistics, @Query("IncludeSystemApplicationHealthStatistics") Boolean includeSystemApplicationHealthStatistics, @Body ClusterHealthPolicies clusterHealthPolicies, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getClusterHealthChunk" }) + @GET("$/GetClusterHealthChunk") + Observable> getClusterHealthChunk(@Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getClusterHealthChunkUsingPolicyAndAdvancedFilters" }) + @POST("$/GetClusterHealthChunk") + Observable> getClusterHealthChunkUsingPolicyAndAdvancedFilters(@Query("api-version") String apiVersion, @Body ClusterHealthChunkQueryDescription clusterHealthChunkQueryDescription, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs reportClusterHealth" }) + @POST("$/ReportClusterHealth") + Observable> reportClusterHealth(@Query("api-version") String apiVersion, @Body HealthInformation healthInformation, @Query("Immediate") Boolean immediate, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getProvisionedFabricCodeVersionInfoList" }) + @GET("$/GetProvisionedCodeVersions") + Observable> getProvisionedFabricCodeVersionInfoList(@Query("api-version") String apiVersion, @Query("CodeVersion") String codeVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getProvisionedFabricConfigVersionInfoList" }) + @GET("$/GetProvisionedConfigVersions") + Observable> getProvisionedFabricConfigVersionInfoList(@Query("api-version") String apiVersion, @Query("ConfigVersion") String configVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getClusterUpgradeProgress" }) + @GET("$/GetUpgradeProgress") + Observable> getClusterUpgradeProgress(@Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getClusterConfiguration" }) + @GET("$/GetClusterConfiguration") + Observable> getClusterConfiguration(@Query("api-version") String apiVersion, @Query("ConfigurationApiVersion") String configurationApiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getClusterConfigurationUpgradeStatus" }) + @GET("$/GetClusterConfigurationUpgradeStatus") + Observable> getClusterConfigurationUpgradeStatus(@Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getUpgradeOrchestrationServiceState" }) + @GET("$/GetUpgradeOrchestrationServiceState") + Observable> getUpgradeOrchestrationServiceState(@Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs setUpgradeOrchestrationServiceState" }) + @POST("$/SetUpgradeOrchestrationServiceState") + Observable> setUpgradeOrchestrationServiceState(@Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Body UpgradeOrchestrationServiceStateInner upgradeOrchestrationServiceState, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs provisionCluster" }) + @POST("$/Provision") + Observable> provisionCluster(@Query("api-version") String apiVersion, @Body ProvisionFabricDescription provisionFabricDescription, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs unprovisionCluster" }) + @POST("$/Unprovision") + Observable> unprovisionCluster(@Query("api-version") String apiVersion, @Body UnprovisionFabricDescription unprovisionFabricDescription, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs rollbackClusterUpgrade" }) + @POST("$/RollbackUpgrade") + Observable> rollbackClusterUpgrade(@Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs resumeClusterUpgrade" }) + @POST("$/MoveToNextUpgradeDomain") + Observable> resumeClusterUpgrade(@Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Body ResumeClusterUpgradeDescription resumeClusterUpgradeDescription, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs startClusterUpgrade" }) + @POST("$/Upgrade") + Observable> startClusterUpgrade(@Query("api-version") String apiVersion, @Body StartClusterUpgradeDescription startClusterUpgradeDescription, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs startClusterConfigurationUpgrade" }) + @POST("$/StartClusterConfigurationUpgrade") + Observable> startClusterConfigurationUpgrade(@Query("api-version") String apiVersion, @Body ClusterConfigurationUpgradeDescription clusterConfigurationUpgradeDescription, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs updateClusterUpgrade" }) + @POST("$/UpdateUpgrade") + Observable> updateClusterUpgrade(@Query("api-version") String apiVersion, @Body UpdateClusterUpgradeDescription updateClusterUpgradeDescription, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getAadMetadata" }) + @GET("$/GetAadMetadata") + Observable> getAadMetadata(@Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getNodeInfoList" }) + @GET("Nodes") + Observable> getNodeInfoList(@Query("api-version") String apiVersion, @Query(value = "ContinuationToken", encoded = true) String continuationToken, @Query("NodeStatusFilter") NodeStatusFilter nodeStatusFilter1, @Query("MaxResults") Long maxResults, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getNodeInfo" }) + @GET("Nodes/{nodeName}") + Observable> getNodeInfo(@Path("nodeName") String nodeName, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getNodeHealth" }) + @GET("Nodes/{nodeName}/$/GetHealth") + Observable> getNodeHealth(@Path("nodeName") String nodeName, @Query("api-version") String apiVersion, @Query("EventsHealthStateFilter") Integer eventsHealthStateFilter, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getNodeHealthUsingPolicy" }) + @POST("Nodes/{nodeName}/$/GetHealth") + Observable> getNodeHealthUsingPolicy(@Path("nodeName") String nodeName, @Query("api-version") String apiVersion, @Query("EventsHealthStateFilter") Integer eventsHealthStateFilter, @Body ClusterHealthPolicy clusterHealthPolicy, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs reportNodeHealth" }) + @POST("Nodes/{nodeName}/$/ReportHealth") + Observable> reportNodeHealth(@Path("nodeName") String nodeName, @Query("api-version") String apiVersion, @Body HealthInformation healthInformation, @Query("Immediate") Boolean immediate, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getNodeLoadInfo" }) + @GET("Nodes/{nodeName}/$/GetLoadInformation") + Observable> getNodeLoadInfo(@Path("nodeName") String nodeName, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs disableNode" }) + @POST("Nodes/{nodeName}/$/Deactivate") + Observable> disableNode(@Path("nodeName") String nodeName, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Body DeactivationIntentDescription deactivationIntentDescription, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs enableNode" }) + @POST("Nodes/{nodeName}/$/Activate") + Observable> enableNode(@Path("nodeName") String nodeName, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs removeNodeState" }) + @POST("Nodes/{nodeName}/$/RemoveNodeState") + Observable> removeNodeState(@Path("nodeName") String nodeName, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs restartNode" }) + @POST("Nodes/{nodeName}/$/Restart") + Observable> restartNode(@Path("nodeName") String nodeName, @Query("api-version") String apiVersion, @Body RestartNodeDescription restartNodeDescription, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getApplicationTypeInfoList" }) + @GET("ApplicationTypes") + Observable> getApplicationTypeInfoList(@Query("api-version") String apiVersion, @Query("ApplicationTypeDefinitionKindFilter") Integer applicationTypeDefinitionKindFilter, @Query("ExcludeApplicationParameters") Boolean excludeApplicationParameters, @Query(value = "ContinuationToken", encoded = true) String continuationToken, @Query("MaxResults") Long maxResults, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getApplicationTypeInfoListByName" }) + @GET("ApplicationTypes/{applicationTypeName}") + Observable> getApplicationTypeInfoListByName(@Path("applicationTypeName") String applicationTypeName1, @Query("api-version") String apiVersion, @Query("ApplicationTypeVersion") String applicationTypeVersion, @Query("ExcludeApplicationParameters") Boolean excludeApplicationParameters, @Query(value = "ContinuationToken", encoded = true) String continuationToken, @Query("MaxResults") Long maxResults, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs provisionApplicationType" }) + @POST("ApplicationTypes/$/Provision") + Observable> provisionApplicationType(@Query("api-version") String apiVersion, @Body ProvisionApplicationTypeDescriptionBase provisionApplicationTypeDescriptionBaseRequiredBodyParam, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs unprovisionApplicationType" }) + @POST("ApplicationTypes/{applicationTypeName}/$/Unprovision") + Observable> unprovisionApplicationType(@Path("applicationTypeName") String applicationTypeName1, @Query("api-version") String apiVersion, @Body UnprovisionApplicationTypeDescriptionInfo unprovisionApplicationTypeDescriptionInfo, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getServiceTypeInfoList" }) + @GET("ApplicationTypes/{applicationTypeName}/$/GetServiceTypes") + Observable> getServiceTypeInfoList(@Path("applicationTypeName") String applicationTypeName1, @Query("api-version") String apiVersion, @Query("ApplicationTypeVersion") String applicationTypeVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getServiceTypeInfoByName" }) + @GET("ApplicationTypes/{applicationTypeName}/$/GetServiceTypes/{serviceTypeName}") + Observable> getServiceTypeInfoByName(@Path("applicationTypeName") String applicationTypeName1, @Path(value = "serviceTypeName", encoded = true) String serviceTypeName1, @Query("api-version") String apiVersion, @Query("ApplicationTypeVersion") String applicationTypeVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getServiceManifest" }) + @GET("ApplicationTypes/{applicationTypeName}/$/GetServiceManifest") + Observable> getServiceManifest(@Path("applicationTypeName") String applicationTypeName1, @Query("api-version") String apiVersion, @Query("ApplicationTypeVersion") String applicationTypeVersion, @Query("ServiceManifestName") String serviceManifestName, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getDeployedServiceTypeInfoList" }) + @GET("Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServiceTypes") + Observable> getDeployedServiceTypeInfoList(@Path("nodeName") String nodeName, @Path(value = "applicationId", encoded = true) String applicationId, @Query("api-version") String apiVersion, @Query("ServiceManifestName") String serviceManifestName, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getDeployedServiceTypeInfoByName" }) + @GET("Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServiceTypes/{serviceTypeName}") + Observable> getDeployedServiceTypeInfoByName(@Path("nodeName") String nodeName, @Path(value = "applicationId", encoded = true) String applicationId, @Path(value = "serviceTypeName", encoded = true) String serviceTypeName1, @Query("api-version") String apiVersion, @Query("ServiceManifestName") String serviceManifestName, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs createApplication" }) + @POST("Applications/$/Create") + Observable> createApplication(@Query("api-version") String apiVersion, @Body ApplicationDescription applicationDescription, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs deleteApplication" }) + @POST("Applications/{applicationId}/$/Delete") + Observable> deleteApplication(@Path(value = "applicationId", encoded = true) String applicationId, @Query("api-version") String apiVersion, @Query("ForceRemove") Boolean forceRemove, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getApplicationLoadInfo" }) + @GET("Applications/{applicationId}/$/GetLoadInformation") + Observable> getApplicationLoadInfo(@Path(value = "applicationId", encoded = true) String applicationId, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getApplicationInfoList" }) + @GET("Applications") + Observable> getApplicationInfoList(@Query("api-version") String apiVersion, @Query("ApplicationDefinitionKindFilter") Integer applicationDefinitionKindFilter, @Query("ApplicationTypeName") String applicationTypeName, @Query("ExcludeApplicationParameters") Boolean excludeApplicationParameters, @Query(value = "ContinuationToken", encoded = true) String continuationToken, @Query("MaxResults") Long maxResults, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getApplicationInfo" }) + @GET("Applications/{applicationId}") + Observable> getApplicationInfo(@Path(value = "applicationId", encoded = true) String applicationId, @Query("api-version") String apiVersion, @Query("ExcludeApplicationParameters") Boolean excludeApplicationParameters, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getApplicationHealth" }) + @GET("Applications/{applicationId}/$/GetHealth") + Observable> getApplicationHealth(@Path(value = "applicationId", encoded = true) String applicationId, @Query("api-version") String apiVersion, @Query("EventsHealthStateFilter") Integer eventsHealthStateFilter, @Query("DeployedApplicationsHealthStateFilter") Integer deployedApplicationsHealthStateFilter, @Query("ServicesHealthStateFilter") Integer servicesHealthStateFilter, @Query("ExcludeHealthStatistics") Boolean excludeHealthStatistics, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getApplicationHealthUsingPolicy" }) + @POST("Applications/{applicationId}/$/GetHealth") + Observable> getApplicationHealthUsingPolicy(@Path(value = "applicationId", encoded = true) String applicationId, @Query("api-version") String apiVersion, @Query("EventsHealthStateFilter") Integer eventsHealthStateFilter, @Query("DeployedApplicationsHealthStateFilter") Integer deployedApplicationsHealthStateFilter, @Query("ServicesHealthStateFilter") Integer servicesHealthStateFilter, @Query("ExcludeHealthStatistics") Boolean excludeHealthStatistics, @Body ApplicationHealthPolicy applicationHealthPolicy, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs reportApplicationHealth" }) + @POST("Applications/{applicationId}/$/ReportHealth") + Observable> reportApplicationHealth(@Path(value = "applicationId", encoded = true) String applicationId, @Query("api-version") String apiVersion, @Body HealthInformation healthInformation, @Query("Immediate") Boolean immediate, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs startApplicationUpgrade" }) + @POST("Applications/{applicationId}/$/Upgrade") + Observable> startApplicationUpgrade(@Path(value = "applicationId", encoded = true) String applicationId, @Query("api-version") String apiVersion, @Body ApplicationUpgradeDescription applicationUpgradeDescription, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getApplicationUpgrade" }) + @GET("Applications/{applicationId}/$/GetUpgradeProgress") + Observable> getApplicationUpgrade(@Path(value = "applicationId", encoded = true) String applicationId, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs updateApplicationUpgrade" }) + @POST("Applications/{applicationId}/$/UpdateUpgrade") + Observable> updateApplicationUpgrade(@Path(value = "applicationId", encoded = true) String applicationId, @Query("api-version") String apiVersion, @Body ApplicationUpgradeUpdateDescription applicationUpgradeUpdateDescription, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs resumeApplicationUpgrade" }) + @POST("Applications/{applicationId}/$/MoveToNextUpgradeDomain") + Observable> resumeApplicationUpgrade(@Path(value = "applicationId", encoded = true) String applicationId, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Body ResumeApplicationUpgradeDescription resumeApplicationUpgradeDescription, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs rollbackApplicationUpgrade" }) + @POST("Applications/{applicationId}/$/RollbackUpgrade") + Observable> rollbackApplicationUpgrade(@Path(value = "applicationId", encoded = true) String applicationId, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getDeployedApplicationInfoList" }) + @GET("Nodes/{nodeName}/$/GetApplications") + Observable> getDeployedApplicationInfoList(@Path("nodeName") String nodeName, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Query("IncludeHealthState") Boolean includeHealthState, @Query(value = "ContinuationToken", encoded = true) String continuationToken, @Query("MaxResults") Long maxResults, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getDeployedApplicationInfo" }) + @GET("Nodes/{nodeName}/$/GetApplications/{applicationId}") + Observable> getDeployedApplicationInfo(@Path("nodeName") String nodeName, @Path(value = "applicationId", encoded = true) String applicationId, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Query("IncludeHealthState") Boolean includeHealthState, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getDeployedApplicationHealth" }) + @GET("Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetHealth") + Observable> getDeployedApplicationHealth(@Path("nodeName") String nodeName, @Path(value = "applicationId", encoded = true) String applicationId, @Query("api-version") String apiVersion, @Query("EventsHealthStateFilter") Integer eventsHealthStateFilter, @Query("DeployedServicePackagesHealthStateFilter") Integer deployedServicePackagesHealthStateFilter, @Query("ExcludeHealthStatistics") Boolean excludeHealthStatistics, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getDeployedApplicationHealthUsingPolicy" }) + @POST("Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetHealth") + Observable> getDeployedApplicationHealthUsingPolicy(@Path("nodeName") String nodeName, @Path(value = "applicationId", encoded = true) String applicationId, @Query("api-version") String apiVersion, @Query("EventsHealthStateFilter") Integer eventsHealthStateFilter, @Query("DeployedServicePackagesHealthStateFilter") Integer deployedServicePackagesHealthStateFilter, @Body ApplicationHealthPolicy applicationHealthPolicy, @Query("ExcludeHealthStatistics") Boolean excludeHealthStatistics, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs reportDeployedApplicationHealth" }) + @POST("Nodes/{nodeName}/$/GetApplications/{applicationId}/$/ReportHealth") + Observable> reportDeployedApplicationHealth(@Path("nodeName") String nodeName, @Path(value = "applicationId", encoded = true) String applicationId, @Query("api-version") String apiVersion, @Body HealthInformation healthInformation, @Query("Immediate") Boolean immediate, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getApplicationManifest" }) + @GET("ApplicationTypes/{applicationTypeName}/$/GetApplicationManifest") + Observable> getApplicationManifest(@Path("applicationTypeName") String applicationTypeName1, @Query("api-version") String apiVersion, @Query("ApplicationTypeVersion") String applicationTypeVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getServiceInfoList" }) + @GET("Applications/{applicationId}/$/GetServices") + Observable> getServiceInfoList(@Path(value = "applicationId", encoded = true) String applicationId, @Query("ServiceTypeName") String serviceTypeName, @Query("api-version") String apiVersion, @Query(value = "ContinuationToken", encoded = true) String continuationToken, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getServiceInfo" }) + @GET("Applications/{applicationId}/$/GetServices/{serviceId}") + Observable> getServiceInfo(@Path(value = "applicationId", encoded = true) String applicationId, @Path(value = "serviceId", encoded = true) String serviceId, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getApplicationNameInfo" }) + @GET("Services/{serviceId}/$/GetApplicationName") + Observable> getApplicationNameInfo(@Path(value = "serviceId", encoded = true) String serviceId, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs createService" }) + @POST("Applications/{applicationId}/$/GetServices/$/Create") + Observable> createService(@Path(value = "applicationId", encoded = true) String applicationId, @Query("api-version") String apiVersion, @Body ServiceDescriptionInner serviceDescription, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs createServiceFromTemplate" }) + @POST("Applications/{applicationId}/$/GetServices/$/CreateFromTemplate") + Observable> createServiceFromTemplate(@Path(value = "applicationId", encoded = true) String applicationId, @Query("api-version") String apiVersion, @Body ServiceFromTemplateDescription serviceFromTemplateDescription, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs deleteService" }) + @POST("Services/{serviceId}/$/Delete") + Observable> deleteService(@Path(value = "serviceId", encoded = true) String serviceId, @Query("api-version") String apiVersion, @Query("ForceRemove") Boolean forceRemove, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs updateService" }) + @POST("Services/{serviceId}/$/Update") + Observable> updateService(@Path(value = "serviceId", encoded = true) String serviceId, @Query("api-version") String apiVersion, @Body ServiceUpdateDescription serviceUpdateDescription, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getServiceDescription" }) + @GET("Services/{serviceId}/$/GetDescription") + Observable> getServiceDescription(@Path(value = "serviceId", encoded = true) String serviceId, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getServiceHealth" }) + @GET("Services/{serviceId}/$/GetHealth") + Observable> getServiceHealth(@Path(value = "serviceId", encoded = true) String serviceId, @Query("api-version") String apiVersion, @Query("EventsHealthStateFilter") Integer eventsHealthStateFilter, @Query("PartitionsHealthStateFilter") Integer partitionsHealthStateFilter, @Query("ExcludeHealthStatistics") Boolean excludeHealthStatistics, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getServiceHealthUsingPolicy" }) + @POST("Services/{serviceId}/$/GetHealth") + Observable> getServiceHealthUsingPolicy(@Path(value = "serviceId", encoded = true) String serviceId, @Query("api-version") String apiVersion, @Query("EventsHealthStateFilter") Integer eventsHealthStateFilter, @Query("PartitionsHealthStateFilter") Integer partitionsHealthStateFilter, @Body ApplicationHealthPolicy applicationHealthPolicy, @Query("ExcludeHealthStatistics") Boolean excludeHealthStatistics, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs reportServiceHealth" }) + @POST("Services/{serviceId}/$/ReportHealth") + Observable> reportServiceHealth(@Path(value = "serviceId", encoded = true) String serviceId, @Query("api-version") String apiVersion, @Body HealthInformation healthInformation, @Query("Immediate") Boolean immediate, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs resolveService" }) + @GET("Services/{serviceId}/$/ResolvePartition") + Observable> resolveService(@Path(value = "serviceId", encoded = true) String serviceId, @Query("api-version") String apiVersion, @Query("PartitionKeyType") Integer partitionKeyType, @Query(value = "PartitionKeyValue", encoded = true) String partitionKeyValue, @Query(value = "PreviousRspVersion", encoded = true) String previousRspVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getPartitionInfoList" }) + @GET("Services/{serviceId}/$/GetPartitions") + Observable> getPartitionInfoList(@Path(value = "serviceId", encoded = true) String serviceId, @Query("api-version") String apiVersion, @Query(value = "ContinuationToken", encoded = true) String continuationToken, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getPartitionInfo" }) + @GET("Partitions/{partitionId}") + Observable> getPartitionInfo(@Path(value = "partitionId", encoded = true) UUID partitionId1, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getServiceNameInfo" }) + @GET("Partitions/{partitionId}/$/GetServiceName") + Observable> getServiceNameInfo(@Path(value = "partitionId", encoded = true) UUID partitionId1, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getPartitionHealth" }) + @GET("Partitions/{partitionId}/$/GetHealth") + Observable> getPartitionHealth(@Path(value = "partitionId", encoded = true) UUID partitionId1, @Query("api-version") String apiVersion, @Query("EventsHealthStateFilter") Integer eventsHealthStateFilter, @Query("ReplicasHealthStateFilter") Integer replicasHealthStateFilter, @Query("ExcludeHealthStatistics") Boolean excludeHealthStatistics, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getPartitionHealthUsingPolicy" }) + @POST("Partitions/{partitionId}/$/GetHealth") + Observable> getPartitionHealthUsingPolicy(@Path(value = "partitionId", encoded = true) UUID partitionId1, @Query("api-version") String apiVersion, @Query("EventsHealthStateFilter") Integer eventsHealthStateFilter, @Query("ReplicasHealthStateFilter") Integer replicasHealthStateFilter, @Body ApplicationHealthPolicy applicationHealthPolicy, @Query("ExcludeHealthStatistics") Boolean excludeHealthStatistics, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs reportPartitionHealth" }) + @POST("Partitions/{partitionId}/$/ReportHealth") + Observable> reportPartitionHealth(@Path(value = "partitionId", encoded = true) UUID partitionId1, @Query("api-version") String apiVersion, @Body HealthInformation healthInformation, @Query("Immediate") Boolean immediate, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getPartitionLoadInformation" }) + @GET("Partitions/{partitionId}/$/GetLoadInformation") + Observable> getPartitionLoadInformation(@Path(value = "partitionId", encoded = true) UUID partitionId1, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs resetPartitionLoad" }) + @POST("Partitions/{partitionId}/$/ResetLoad") + Observable> resetPartitionLoad(@Path(value = "partitionId", encoded = true) UUID partitionId1, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs recoverPartition" }) + @POST("Partitions/{partitionId}/$/Recover") + Observable> recoverPartition(@Path(value = "partitionId", encoded = true) UUID partitionId1, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs recoverServicePartitions" }) + @POST("Services/$/{serviceId}/$/GetPartitions/$/Recover") + Observable> recoverServicePartitions(@Path(value = "serviceId", encoded = true) String serviceId, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs recoverSystemPartitions" }) + @POST("$/RecoverSystemPartitions") + Observable> recoverSystemPartitions(@Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs recoverAllPartitions" }) + @POST("$/RecoverAllPartitions") + Observable> recoverAllPartitions(@Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs createRepairTask" }) + @POST("$/CreateRepairTask") + Observable> createRepairTask(@Query("api-version") String apiVersion, @Body RepairTaskInner repairTask, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs cancelRepairTask" }) + @POST("$/CancelRepairTask") + Observable> cancelRepairTask(@Query("api-version") String apiVersion, @Body RepairTaskCancelDescription repairTaskCancelDescription, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs deleteRepairTask" }) + @POST("$/DeleteRepairTask") + Observable> deleteRepairTask(@Query("api-version") String apiVersion, @Body RepairTaskDeleteDescription repairTaskDeleteDescription, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getRepairTaskList" }) + @GET("$/GetRepairTaskList") + Observable> getRepairTaskList(@Query("api-version") String apiVersion, @Query("TaskIdFilter") String taskIdFilter, @Query("StateFilter") Integer stateFilter, @Query("ExecutorFilter") String executorFilter, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs forceApproveRepairTask" }) + @POST("$/ForceApproveRepairTask") + Observable> forceApproveRepairTask(@Query("api-version") String apiVersion, @Body RepairTaskApproveDescription repairTaskApproveDescription, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs updateRepairTaskHealthPolicy" }) + @POST("$/UpdateRepairTaskHealthPolicy") + Observable> updateRepairTaskHealthPolicy(@Query("api-version") String apiVersion, @Body RepairTaskUpdateHealthPolicyDescription repairTaskUpdateHealthPolicyDescription, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs updateRepairExecutionState" }) + @POST("$/UpdateRepairExecutionState") + Observable> updateRepairExecutionState(@Query("api-version") String apiVersion, @Body RepairTaskInner repairTask, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getReplicaInfoList" }) + @GET("Partitions/{partitionId}/$/GetReplicas") + Observable> getReplicaInfoList(@Path(value = "partitionId", encoded = true) UUID partitionId1, @Query("api-version") String apiVersion, @Query(value = "ContinuationToken", encoded = true) String continuationToken, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getReplicaInfo" }) + @GET("Partitions/{partitionId}/$/GetReplicas/{replicaId}") + Observable> getReplicaInfo(@Path(value = "partitionId", encoded = true) UUID partitionId1, @Path(value = "replicaId", encoded = true) String replicaId, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getReplicaHealth" }) + @GET("Partitions/{partitionId}/$/GetReplicas/{replicaId}/$/GetHealth") + Observable> getReplicaHealth(@Path(value = "partitionId", encoded = true) UUID partitionId1, @Path(value = "replicaId", encoded = true) String replicaId, @Query("api-version") String apiVersion, @Query("EventsHealthStateFilter") Integer eventsHealthStateFilter, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getReplicaHealthUsingPolicy" }) + @POST("Partitions/{partitionId}/$/GetReplicas/{replicaId}/$/GetHealth") + Observable> getReplicaHealthUsingPolicy(@Path(value = "partitionId", encoded = true) UUID partitionId1, @Path(value = "replicaId", encoded = true) String replicaId, @Query("api-version") String apiVersion, @Query("EventsHealthStateFilter") Integer eventsHealthStateFilter, @Body ApplicationHealthPolicy applicationHealthPolicy, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs reportReplicaHealth" }) + @POST("Partitions/{partitionId}/$/GetReplicas/{replicaId}/$/ReportHealth") + Observable> reportReplicaHealth(@Path(value = "partitionId", encoded = true) UUID partitionId1, @Path(value = "replicaId", encoded = true) String replicaId, @Query("api-version") String apiVersion, @Query("ReplicaHealthReportServiceKind") ReplicaHealthReportServiceKind replicaHealthReportServiceKind1, @Body HealthInformation healthInformation, @Query("Immediate") Boolean immediate, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getDeployedServiceReplicaInfoList" }) + @GET("Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetReplicas") + Observable> getDeployedServiceReplicaInfoList(@Path("nodeName") String nodeName, @Path(value = "applicationId", encoded = true) String applicationId, @Query("api-version") String apiVersion, @Query("PartitionId") UUID partitionId, @Query("ServiceManifestName") String serviceManifestName, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getDeployedServiceReplicaDetailInfo" }) + @GET("Nodes/{nodeName}/$/GetPartitions/{partitionId}/$/GetReplicas/{replicaId}/$/GetDetail") + Observable> getDeployedServiceReplicaDetailInfo(@Path("nodeName") String nodeName, @Path(value = "partitionId", encoded = true) UUID partitionId1, @Path(value = "replicaId", encoded = true) String replicaId, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getDeployedServiceReplicaDetailInfoByPartitionId" }) + @GET("Nodes/{nodeName}/$/GetPartitions/{partitionId}/$/GetReplicas") + Observable> getDeployedServiceReplicaDetailInfoByPartitionId(@Path("nodeName") String nodeName, @Path(value = "partitionId", encoded = true) UUID partitionId1, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs restartReplica" }) + @POST("Nodes/{nodeName}/$/GetPartitions/{partitionId}/$/GetReplicas/{replicaId}/$/Restart") + Observable> restartReplica(@Path("nodeName") String nodeName, @Path(value = "partitionId", encoded = true) UUID partitionId1, @Path(value = "replicaId", encoded = true) String replicaId, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs removeReplica" }) + @POST("Nodes/{nodeName}/$/GetPartitions/{partitionId}/$/GetReplicas/{replicaId}/$/Delete") + Observable> removeReplica(@Path("nodeName") String nodeName, @Path(value = "partitionId", encoded = true) UUID partitionId1, @Path(value = "replicaId", encoded = true) String replicaId, @Query("api-version") String apiVersion, @Query("ForceRemove") Boolean forceRemove, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getDeployedServicePackageInfoList" }) + @GET("Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServicePackages") + Observable> getDeployedServicePackageInfoList(@Path("nodeName") String nodeName, @Path(value = "applicationId", encoded = true) String applicationId, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getDeployedServicePackageInfoListByName" }) + @GET("Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServicePackages/{servicePackageName}") + Observable> getDeployedServicePackageInfoListByName(@Path("nodeName") String nodeName, @Path(value = "applicationId", encoded = true) String applicationId, @Path(value = "servicePackageName", encoded = true) String servicePackageName, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getDeployedServicePackageHealth" }) + @GET("Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServicePackages/{servicePackageName}/$/GetHealth") + Observable> getDeployedServicePackageHealth(@Path("nodeName") String nodeName, @Path(value = "applicationId", encoded = true) String applicationId, @Path(value = "servicePackageName", encoded = true) String servicePackageName, @Query("api-version") String apiVersion, @Query("EventsHealthStateFilter") Integer eventsHealthStateFilter, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getDeployedServicePackageHealthUsingPolicy" }) + @POST("Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServicePackages/{servicePackageName}/$/GetHealth") + Observable> getDeployedServicePackageHealthUsingPolicy(@Path("nodeName") String nodeName, @Path(value = "applicationId", encoded = true) String applicationId, @Path(value = "servicePackageName", encoded = true) String servicePackageName, @Query("api-version") String apiVersion, @Query("EventsHealthStateFilter") Integer eventsHealthStateFilter, @Body ApplicationHealthPolicy applicationHealthPolicy, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs reportDeployedServicePackageHealth" }) + @POST("Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServicePackages/{servicePackageName}/$/ReportHealth") + Observable> reportDeployedServicePackageHealth(@Path("nodeName") String nodeName, @Path(value = "applicationId", encoded = true) String applicationId, @Path(value = "servicePackageName", encoded = true) String servicePackageName, @Query("api-version") String apiVersion, @Body HealthInformation healthInformation, @Query("Immediate") Boolean immediate, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs deployServicePackageToNode" }) + @POST("Nodes/{nodeName}/$/DeployServicePackage") + Observable> deployServicePackageToNode(@Path("nodeName") String nodeName, @Query("api-version") String apiVersion, @Body DeployServicePackageToNodeDescription deployServicePackageToNodeDescription, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getDeployedCodePackageInfoList" }) + @GET("Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetCodePackages") + Observable> getDeployedCodePackageInfoList(@Path("nodeName") String nodeName, @Path(value = "applicationId", encoded = true) String applicationId, @Query("api-version") String apiVersion, @Query("ServiceManifestName") String serviceManifestName, @Query("CodePackageName") String codePackageName, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs restartDeployedCodePackage" }) + @POST("Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetCodePackages/$/Restart") + Observable> restartDeployedCodePackage(@Path("nodeName") String nodeName, @Path(value = "applicationId", encoded = true) String applicationId, @Query("api-version") String apiVersion, @Body RestartDeployedCodePackageDescription restartDeployedCodePackageDescription, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getContainerLogsDeployedOnNode" }) + @GET("Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetCodePackages/$/ContainerLogs") + Observable> getContainerLogsDeployedOnNode(@Path("nodeName") String nodeName, @Path(value = "applicationId", encoded = true) String applicationId, @Query("api-version") String apiVersion, @Query("ServiceManifestName") String serviceManifestName, @Query("CodePackageName") String codePackageName, @Query("Tail") String tail, @Query("Previous") Boolean previous, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs invokeContainerApi" }) + @POST("Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetCodePackages/$/ContainerApi") + Observable> invokeContainerApi(@Path("nodeName") String nodeName, @Path(value = "applicationId", encoded = true) String applicationId, @Query("api-version") String apiVersion, @Query("ServiceManifestName") String serviceManifestName, @Query("CodePackageName") String codePackageName, @Query("CodePackageInstanceId") String codePackageInstanceId, @Query("timeout") Long timeout, @Body ContainerApiRequestBody containerApiRequestBody, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs createComposeDeployment" }) + @PUT("ComposeDeployments/$/Create") + Observable> createComposeDeployment(@Query("api-version") String apiVersion, @Body CreateComposeDeploymentDescription createComposeDeploymentDescription, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getComposeDeploymentStatus" }) + @GET("ComposeDeployments/{deploymentName}") + Observable> getComposeDeploymentStatus(@Path(value = "deploymentName", encoded = true) String deploymentName, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getComposeDeploymentStatusList" }) + @GET("ComposeDeployments") + Observable> getComposeDeploymentStatusList(@Query("api-version") String apiVersion, @Query(value = "ContinuationToken", encoded = true) String continuationToken, @Query("MaxResults") Long maxResults, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getComposeDeploymentUpgradeProgress" }) + @GET("ComposeDeployments/{deploymentName}/$/GetUpgradeProgress") + Observable> getComposeDeploymentUpgradeProgress(@Path(value = "deploymentName", encoded = true) String deploymentName, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs removeComposeDeployment" }) + @POST("ComposeDeployments/{deploymentName}/$/Delete") + Observable> removeComposeDeployment(@Path(value = "deploymentName", encoded = true) String deploymentName, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs startComposeDeploymentUpgrade" }) + @POST("ComposeDeployments/{deploymentName}/$/Upgrade") + Observable> startComposeDeploymentUpgrade(@Path(value = "deploymentName", encoded = true) String deploymentName, @Query("api-version") String apiVersion, @Body ComposeDeploymentUpgradeDescription composeDeploymentUpgradeDescription, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getChaos" }) + @GET("Tools/Chaos") + Observable> getChaos(@Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs startChaos" }) + @POST("Tools/Chaos/$/Start") + Observable> startChaos(@Query("api-version") String apiVersion, @Body ChaosParameters chaosParameters, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs stopChaos" }) + @POST("Tools/Chaos/$/Stop") + Observable> stopChaos(@Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getChaosEvents" }) + @GET("Tools/Chaos/Events") + Observable> getChaosEvents(@Query("api-version") String apiVersion, @Query(value = "ContinuationToken", encoded = true) String continuationToken, @Query("StartTimeUtc") String startTimeUtc, @Query("EndTimeUtc") String endTimeUtc, @Query("MaxResults") Long maxResults, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getChaosSchedule" }) + @GET("Tools/Chaos/Schedule") + Observable> getChaosSchedule(@Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs postChaosSchedule" }) + @POST("Tools/Chaos/Schedule") + Observable> postChaosSchedule(@Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Body ChaosScheduleDescriptionInner chaosSchedule, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs uploadFile" }) + @PUT("ImageStore/{contentPath}") + Observable> uploadFile(@Path("contentPath") String contentPath, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getImageStoreContent" }) + @GET("ImageStore/{contentPath}") + Observable> getImageStoreContent(@Path("contentPath") String contentPath, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs deleteImageStoreContent" }) + @HTTP(path = "ImageStore/{contentPath}", method = "DELETE", hasBody = true) + Observable> deleteImageStoreContent(@Path("contentPath") String contentPath, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getImageStoreRootContent" }) + @GET("ImageStore") + Observable> getImageStoreRootContent(@Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs copyImageStoreContent" }) + @POST("ImageStore/$/Copy") + Observable> copyImageStoreContent(@Query("api-version") String apiVersion, @Body ImageStoreCopyDescription imageStoreCopyDescription, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs deleteImageStoreUploadSession" }) + @HTTP(path = "ImageStore/$/DeleteUploadSession", method = "DELETE", hasBody = true) + Observable> deleteImageStoreUploadSession(@Query("api-version") String apiVersion, @Query("session-id") UUID sessionId, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs commitImageStoreUploadSession" }) + @POST("ImageStore/$/CommitUploadSession") + Observable> commitImageStoreUploadSession(@Query("api-version") String apiVersion, @Query("session-id") UUID sessionId, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getImageStoreUploadSessionById" }) + @GET("ImageStore/$/GetUploadSession") + Observable> getImageStoreUploadSessionById(@Query("api-version") String apiVersion, @Query("session-id") UUID sessionId, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getImageStoreUploadSessionByPath" }) + @GET("ImageStore/{contentPath}/$/GetUploadSession") + Observable> getImageStoreUploadSessionByPath(@Path("contentPath") String contentPath, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs uploadFileChunk" }) + @PUT("ImageStore/{contentPath}/$/UploadChunk") + Observable> uploadFileChunk(@Path("contentPath") String contentPath, @Query("api-version") String apiVersion, @Query("session-id") UUID sessionId, @Header("Content-Range") String contentRange, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs invokeInfrastructureCommand" }) + @POST("$/InvokeInfrastructureCommand") + Observable> invokeInfrastructureCommand(@Query("api-version") String apiVersion, @Query("Command") String command, @Query("ServiceId") String serviceId1, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs invokeInfrastructureQuery" }) + @GET("$/InvokeInfrastructureQuery") + Observable> invokeInfrastructureQuery(@Query("api-version") String apiVersion, @Query("Command") String command, @Query("ServiceId") String serviceId1, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs startDataLoss" }) + @POST("Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/StartDataLoss") + Observable> startDataLoss(@Path(value = "serviceId", encoded = true) String serviceId, @Path(value = "partitionId", encoded = true) UUID partitionId1, @Query("api-version") String apiVersion, @Query("OperationId") UUID operationId, @Query("DataLossMode") DataLossMode dataLossMode1, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getDataLossProgress" }) + @GET("Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/GetDataLossProgress") + Observable> getDataLossProgress(@Path(value = "serviceId", encoded = true) String serviceId, @Path(value = "partitionId", encoded = true) UUID partitionId1, @Query("api-version") String apiVersion, @Query("OperationId") UUID operationId, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs startQuorumLoss" }) + @POST("Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/StartQuorumLoss") + Observable> startQuorumLoss(@Path(value = "serviceId", encoded = true) String serviceId, @Path(value = "partitionId", encoded = true) UUID partitionId1, @Query("api-version") String apiVersion, @Query("OperationId") UUID operationId, @Query("QuorumLossMode") QuorumLossMode quorumLossMode1, @Query("QuorumLossDuration") int quorumLossDuration, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getQuorumLossProgress" }) + @GET("Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/GetQuorumLossProgress") + Observable> getQuorumLossProgress(@Path(value = "serviceId", encoded = true) String serviceId, @Path(value = "partitionId", encoded = true) UUID partitionId1, @Query("api-version") String apiVersion, @Query("OperationId") UUID operationId, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs startPartitionRestart" }) + @POST("Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/StartRestart") + Observable> startPartitionRestart(@Path(value = "serviceId", encoded = true) String serviceId, @Path(value = "partitionId", encoded = true) UUID partitionId1, @Query("api-version") String apiVersion, @Query("OperationId") UUID operationId, @Query("RestartPartitionMode") RestartPartitionMode restartPartitionMode1, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getPartitionRestartProgress" }) + @GET("Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/GetRestartProgress") + Observable> getPartitionRestartProgress(@Path(value = "serviceId", encoded = true) String serviceId, @Path(value = "partitionId", encoded = true) UUID partitionId1, @Query("api-version") String apiVersion, @Query("OperationId") UUID operationId, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs startNodeTransition" }) + @POST("Faults/Nodes/{nodeName}/$/StartTransition/") + Observable> startNodeTransition(@Path("nodeName") String nodeName, @Query("api-version") String apiVersion, @Query("OperationId") UUID operationId, @Query("NodeTransitionType") NodeTransitionType nodeTransitionType1, @Query("NodeInstanceId") String nodeInstanceId, @Query("StopDurationInSeconds") int stopDurationInSeconds, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getNodeTransitionProgress" }) + @GET("Faults/Nodes/{nodeName}/$/GetTransitionProgress") + Observable> getNodeTransitionProgress(@Path("nodeName") String nodeName, @Query("api-version") String apiVersion, @Query("OperationId") UUID operationId, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getFaultOperationList" }) + @GET("Faults/") + Observable> getFaultOperationList(@Query("api-version") String apiVersion, @Query("TypeFilter") int typeFilter, @Query("StateFilter") int stateFilter, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs cancelOperation" }) + @POST("Faults/$/Cancel") + Observable> cancelOperation(@Query("api-version") String apiVersion, @Query("OperationId") UUID operationId, @Query("Force") boolean force, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs createBackupPolicy" }) + @POST("BackupRestore/BackupPolicies/$/Create") + Observable> createBackupPolicy(@Body BackupPolicyDescriptionInner backupPolicyDescription, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs deleteBackupPolicy" }) + @POST("BackupRestore/BackupPolicies/{backupPolicyName}/$/Delete") + Observable> deleteBackupPolicy(@Path("backupPolicyName") String backupPolicyName, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getBackupPolicyList" }) + @GET("BackupRestore/BackupPolicies") + Observable> getBackupPolicyList(@Query("api-version") String apiVersion, @Query(value = "ContinuationToken", encoded = true) String continuationToken, @Query("MaxResults") Long maxResults, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getBackupPolicyByName" }) + @GET("BackupRestore/BackupPolicies/{backupPolicyName}") + Observable> getBackupPolicyByName(@Path("backupPolicyName") String backupPolicyName, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getAllEntitiesBackedUpByPolicy" }) + @GET("BackupRestore/BackupPolicies/{backupPolicyName}/$/GetBackupEnabledEntities") + Observable> getAllEntitiesBackedUpByPolicy(@Path("backupPolicyName") String backupPolicyName, @Query("api-version") String apiVersion, @Query(value = "ContinuationToken", encoded = true) String continuationToken, @Query("MaxResults") Long maxResults, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs updateBackupPolicy" }) + @POST("BackupRestore/BackupPolicies/{backupPolicyName}/$/Update") + Observable> updateBackupPolicy(@Path("backupPolicyName") String backupPolicyName, @Body BackupPolicyDescriptionInner backupPolicyDescription, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs enableApplicationBackup" }) + @POST("Applications/{applicationId}/$/EnableBackup") + Observable> enableApplicationBackup(@Path(value = "applicationId", encoded = true) String applicationId, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Body EnableBackupDescription enableBackupDescription, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs disableApplicationBackup" }) + @POST("Applications/{applicationId}/$/DisableBackup") + Observable> disableApplicationBackup(@Path(value = "applicationId", encoded = true) String applicationId, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getApplicationBackupConfigurationInfo" }) + @GET("Applications/{applicationId}/$/GetBackupConfigurationInfo") + Observable> getApplicationBackupConfigurationInfo(@Path(value = "applicationId", encoded = true) String applicationId, @Query("api-version") String apiVersion, @Query(value = "ContinuationToken", encoded = true) String continuationToken, @Query("MaxResults") Long maxResults, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getApplicationBackupList" }) + @GET("Applications/{applicationId}/$/GetBackups") + Observable> getApplicationBackupList(@Path(value = "applicationId", encoded = true) String applicationId, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Query("Latest") Boolean latest, @Query("StartDateTimeFilter") DateTime startDateTimeFilter, @Query("EndDateTimeFilter") DateTime endDateTimeFilter, @Query(value = "ContinuationToken", encoded = true) String continuationToken, @Query("MaxResults") Long maxResults, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs suspendApplicationBackup" }) + @POST("Applications/{applicationId}/$/SuspendBackup") + Observable> suspendApplicationBackup(@Path(value = "applicationId", encoded = true) String applicationId, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs resumeApplicationBackup" }) + @POST("Applications/{applicationId}/$/ResumeBackup") + Observable> resumeApplicationBackup(@Path(value = "applicationId", encoded = true) String applicationId, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs enableServiceBackup" }) + @POST("Services/{serviceId}/$/EnableBackup") + Observable> enableServiceBackup(@Path(value = "serviceId", encoded = true) String serviceId, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Body EnableBackupDescription enableBackupDescription, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs disableServiceBackup" }) + @POST("Services/{serviceId}/$/DisableBackup") + Observable> disableServiceBackup(@Path(value = "serviceId", encoded = true) String serviceId, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getServiceBackupConfigurationInfo" }) + @GET("Services/{serviceId}/$/GetBackupConfigurationInfo") + Observable> getServiceBackupConfigurationInfo(@Path(value = "serviceId", encoded = true) String serviceId, @Query("api-version") String apiVersion, @Query(value = "ContinuationToken", encoded = true) String continuationToken, @Query("MaxResults") Long maxResults, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getServiceBackupList" }) + @GET("Services/{serviceId}/$/GetBackups") + Observable> getServiceBackupList(@Path(value = "serviceId", encoded = true) String serviceId, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Query("Latest") Boolean latest, @Query("StartDateTimeFilter") DateTime startDateTimeFilter, @Query("EndDateTimeFilter") DateTime endDateTimeFilter, @Query(value = "ContinuationToken", encoded = true) String continuationToken, @Query("MaxResults") Long maxResults, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs suspendServiceBackup" }) + @POST("Services/{serviceId}/$/SuspendBackup") + Observable> suspendServiceBackup(@Path(value = "serviceId", encoded = true) String serviceId, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs resumeServiceBackup" }) + @POST("Services/{serviceId}/$/ResumeBackup") + Observable> resumeServiceBackup(@Path(value = "serviceId", encoded = true) String serviceId, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs enablePartitionBackup" }) + @POST("Partitions/{partitionId}/$/EnableBackup") + Observable> enablePartitionBackup(@Path(value = "partitionId", encoded = true) UUID partitionId1, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Body EnableBackupDescription enableBackupDescription, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs disablePartitionBackup" }) + @POST("Partitions/{partitionId}/$/DisableBackup") + Observable> disablePartitionBackup(@Path(value = "partitionId", encoded = true) UUID partitionId1, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getPartitionBackupConfigurationInfo" }) + @GET("Partitions/{partitionId}/$/GetBackupConfigurationInfo") + Observable> getPartitionBackupConfigurationInfo(@Path(value = "partitionId", encoded = true) UUID partitionId1, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getPartitionBackupList" }) + @GET("Partitions/{partitionId}/$/GetBackups") + Observable> getPartitionBackupList(@Path(value = "partitionId", encoded = true) UUID partitionId1, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Query("Latest") Boolean latest, @Query("StartDateTimeFilter") DateTime startDateTimeFilter, @Query("EndDateTimeFilter") DateTime endDateTimeFilter, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs suspendPartitionBackup" }) + @POST("Partitions/{partitionId}/$/SuspendBackup") + Observable> suspendPartitionBackup(@Path(value = "partitionId", encoded = true) UUID partitionId1, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs resumePartitionBackup" }) + @POST("Partitions/{partitionId}/$/ResumeBackup") + Observable> resumePartitionBackup(@Path(value = "partitionId", encoded = true) UUID partitionId1, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs backupPartition" }) + @POST("Partitions/{partitionId}/$/Backup") + Observable> backupPartition(@Path(value = "partitionId", encoded = true) UUID partitionId1, @Query("BackupTimeout") Integer backupTimeout, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Body BackupPartitionDescription backupPartitionDescription, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getPartitionBackupProgress" }) + @GET("Partitions/{partitionId}/$/GetBackupProgress") + Observable> getPartitionBackupProgress(@Path(value = "partitionId", encoded = true) UUID partitionId1, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs restorePartition" }) + @POST("Partitions/{partitionId}/$/Restore") + Observable> restorePartition(@Path(value = "partitionId", encoded = true) UUID partitionId1, @Body RestorePartitionDescription restorePartitionDescription, @Query("RestoreTimeout") Integer restoreTimeout, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getPartitionRestoreProgress" }) + @GET("Partitions/{partitionId}/$/GetRestoreProgress") + Observable> getPartitionRestoreProgress(@Path(value = "partitionId", encoded = true) UUID partitionId1, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getBackupsFromBackupLocation" }) + @POST("BackupRestore/$/GetBackups") + Observable> getBackupsFromBackupLocation(@Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Query(value = "ContinuationToken", encoded = true) String continuationToken, @Query("MaxResults") Long maxResults, @Body GetBackupByStorageQueryDescription getBackupByStorageQueryDescription, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs createName" }) + @POST("Names/$/Create") + Observable> createName(@Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Body NameDescription nameDescription, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getNameExistsInfo" }) + @GET("Names/{nameId}") + Observable> getNameExistsInfo(@Path(value = "nameId", encoded = true) String nameId, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs deleteName" }) + @HTTP(path = "Names/{nameId}", method = "DELETE", hasBody = true) + Observable> deleteName(@Path(value = "nameId", encoded = true) String nameId, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getSubNameInfoList" }) + @GET("Names/{nameId}/$/GetSubNames") + Observable> getSubNameInfoList(@Path(value = "nameId", encoded = true) String nameId, @Query("api-version") String apiVersion, @Query("Recursive") Boolean recursive, @Query(value = "ContinuationToken", encoded = true) String continuationToken, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getPropertyInfoList" }) + @GET("Names/{nameId}/$/GetProperties") + Observable> getPropertyInfoList(@Path(value = "nameId", encoded = true) String nameId, @Query("api-version") String apiVersion, @Query("IncludeValues") Boolean includeValues, @Query(value = "ContinuationToken", encoded = true) String continuationToken, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs putProperty" }) + @PUT("Names/{nameId}/$/GetProperty") + Observable> putProperty(@Path(value = "nameId", encoded = true) String nameId, @Query("api-version") String apiVersion, @Body PropertyDescription propertyDescription, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getPropertyInfo" }) + @GET("Names/{nameId}/$/GetProperty") + Observable> getPropertyInfo(@Path(value = "nameId", encoded = true) String nameId, @Query("api-version") String apiVersion, @Query("PropertyName") String propertyName, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs deleteProperty" }) + @HTTP(path = "Names/{nameId}/$/GetProperty", method = "DELETE", hasBody = true) + Observable> deleteProperty(@Path(value = "nameId", encoded = true) String nameId, @Query("api-version") String apiVersion, @Query("PropertyName") String propertyName, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs submitPropertyBatch" }) + @POST("Names/{nameId}/$/GetProperties/$/SubmitBatch") + Observable> submitPropertyBatch(@Path(value = "nameId", encoded = true) String nameId, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Body PropertyBatchDescriptionList propertyBatchDescriptionList, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getClusterEventList" }) + @GET("EventsStore/Cluster/Events") + Observable> getClusterEventList(@Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Query("StartTimeUtc") String startTimeUtc, @Query("EndTimeUtc") String endTimeUtc, @Query("EventsTypesFilter") String eventsTypesFilter, @Query("ExcludeAnalysisEvents") Boolean excludeAnalysisEvents, @Query("SkipCorrelationLookup") Boolean skipCorrelationLookup, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getContainersEventList" }) + @GET("EventsStore/Containers/Events") + Observable> getContainersEventList(@Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Query("StartTimeUtc") String startTimeUtc, @Query("EndTimeUtc") String endTimeUtc, @Query("EventsTypesFilter") String eventsTypesFilter, @Query("ExcludeAnalysisEvents") Boolean excludeAnalysisEvents, @Query("SkipCorrelationLookup") Boolean skipCorrelationLookup, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getNodeEventList" }) + @GET("EventsStore/Nodes/{nodeName}/$/Events") + Observable> getNodeEventList(@Path("nodeName") String nodeName, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Query("StartTimeUtc") String startTimeUtc, @Query("EndTimeUtc") String endTimeUtc, @Query("EventsTypesFilter") String eventsTypesFilter, @Query("ExcludeAnalysisEvents") Boolean excludeAnalysisEvents, @Query("SkipCorrelationLookup") Boolean skipCorrelationLookup, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getNodesEventList" }) + @GET("EventsStore/Nodes/Events") + Observable> getNodesEventList(@Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Query("StartTimeUtc") String startTimeUtc, @Query("EndTimeUtc") String endTimeUtc, @Query("EventsTypesFilter") String eventsTypesFilter, @Query("ExcludeAnalysisEvents") Boolean excludeAnalysisEvents, @Query("SkipCorrelationLookup") Boolean skipCorrelationLookup, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getApplicationEventList" }) + @GET("EventsStore/Applications/{applicationId}/$/Events") + Observable> getApplicationEventList(@Path(value = "applicationId", encoded = true) String applicationId, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Query("StartTimeUtc") String startTimeUtc, @Query("EndTimeUtc") String endTimeUtc, @Query("EventsTypesFilter") String eventsTypesFilter, @Query("ExcludeAnalysisEvents") Boolean excludeAnalysisEvents, @Query("SkipCorrelationLookup") Boolean skipCorrelationLookup, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getApplicationsEventList" }) + @GET("EventsStore/Applications/Events") + Observable> getApplicationsEventList(@Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Query("StartTimeUtc") String startTimeUtc, @Query("EndTimeUtc") String endTimeUtc, @Query("EventsTypesFilter") String eventsTypesFilter, @Query("ExcludeAnalysisEvents") Boolean excludeAnalysisEvents, @Query("SkipCorrelationLookup") Boolean skipCorrelationLookup, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getServiceEventList" }) + @GET("EventsStore/Services/{serviceId}/$/Events") + Observable> getServiceEventList(@Path(value = "serviceId", encoded = true) String serviceId, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Query("StartTimeUtc") String startTimeUtc, @Query("EndTimeUtc") String endTimeUtc, @Query("EventsTypesFilter") String eventsTypesFilter, @Query("ExcludeAnalysisEvents") Boolean excludeAnalysisEvents, @Query("SkipCorrelationLookup") Boolean skipCorrelationLookup, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getServicesEventList" }) + @GET("EventsStore/Services/Events") + Observable> getServicesEventList(@Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Query("StartTimeUtc") String startTimeUtc, @Query("EndTimeUtc") String endTimeUtc, @Query("EventsTypesFilter") String eventsTypesFilter, @Query("ExcludeAnalysisEvents") Boolean excludeAnalysisEvents, @Query("SkipCorrelationLookup") Boolean skipCorrelationLookup, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getPartitionEventList" }) + @GET("EventsStore/Partitions/{partitionId}/$/Events") + Observable> getPartitionEventList(@Path(value = "partitionId", encoded = true) UUID partitionId1, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Query("StartTimeUtc") String startTimeUtc, @Query("EndTimeUtc") String endTimeUtc, @Query("EventsTypesFilter") String eventsTypesFilter, @Query("ExcludeAnalysisEvents") Boolean excludeAnalysisEvents, @Query("SkipCorrelationLookup") Boolean skipCorrelationLookup, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getPartitionsEventList" }) + @GET("EventsStore/Partitions/Events") + Observable> getPartitionsEventList(@Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Query("StartTimeUtc") String startTimeUtc, @Query("EndTimeUtc") String endTimeUtc, @Query("EventsTypesFilter") String eventsTypesFilter, @Query("ExcludeAnalysisEvents") Boolean excludeAnalysisEvents, @Query("SkipCorrelationLookup") Boolean skipCorrelationLookup, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getPartitionReplicaEventList" }) + @GET("EventsStore/Partitions/{partitionId}/$/Replicas/{replicaId}/$/Events") + Observable> getPartitionReplicaEventList(@Path(value = "partitionId", encoded = true) UUID partitionId1, @Path(value = "replicaId", encoded = true) String replicaId, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Query("StartTimeUtc") String startTimeUtc, @Query("EndTimeUtc") String endTimeUtc, @Query("EventsTypesFilter") String eventsTypesFilter, @Query("ExcludeAnalysisEvents") Boolean excludeAnalysisEvents, @Query("SkipCorrelationLookup") Boolean skipCorrelationLookup, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getPartitionReplicasEventList" }) + @GET("EventsStore/Partitions/{partitionId}/$/Replicas/Events") + Observable> getPartitionReplicasEventList(@Path(value = "partitionId", encoded = true) UUID partitionId1, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Query("StartTimeUtc") String startTimeUtc, @Query("EndTimeUtc") String endTimeUtc, @Query("EventsTypesFilter") String eventsTypesFilter, @Query("ExcludeAnalysisEvents") Boolean excludeAnalysisEvents, @Query("SkipCorrelationLookup") Boolean skipCorrelationLookup, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getCorrelatedEventList" }) + @GET("EventsStore/CorrelatedEvents/{eventInstanceId}/$/Events") + Observable> getCorrelatedEventList(@Path("eventInstanceId") String eventInstanceId, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs createApplicationResource" }) + @PUT("Resources/Applications/{applicationResourceName}") + Observable> createApplicationResource(@Path(value = "applicationResourceName", encoded = true) String applicationResourceName, @Query("api-version") String apiVersion, @Body ApplicationResourceDescriptionInner applicationResourceDescription, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getApplicationResource" }) + @GET("Resources/Applications/{applicationResourceName}") + Observable> getApplicationResource(@Path(value = "applicationResourceName", encoded = true) String applicationResourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs deleteApplicationResource" }) + @HTTP(path = "Resources/Applications/{applicationResourceName}", method = "DELETE", hasBody = true) + Observable> deleteApplicationResource(@Path(value = "applicationResourceName", encoded = true) String applicationResourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getServices" }) + @GET("Resources/Applications/{applicationResourceName}/Services") + Observable> getServices(@Path(value = "applicationResourceName", encoded = true) String applicationResourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getService" }) + @GET("Resources/Applications/{applicationResourceName}/Services/{serviceResourceName}") + Observable> getService(@Path(value = "applicationResourceName", encoded = true) String applicationResourceName, @Path(value = "serviceResourceName", encoded = true) String serviceResourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getReplicas" }) + @GET("Resources/Applications/{applicationResourceName}/Services/{serviceResourceName}/replicas") + Observable> getReplicas(@Path(value = "applicationResourceName", encoded = true) String applicationResourceName, @Path(value = "serviceResourceName", encoded = true) String serviceResourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getReplica" }) + @GET("Resources/Applications/{applicationResourceName}/Services/{serviceResourceName}/Replicas/{replicaName}") + Observable> getReplica(@Path(value = "applicationResourceName", encoded = true) String applicationResourceName, @Path(value = "serviceResourceName", encoded = true) String serviceResourceName, @Path(value = "replicaName", encoded = true) String replicaName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs createVolumeResource" }) + @PUT("Resources/Volumes/{volumeResourceName}") + Observable> createVolumeResource(@Path(value = "volumeResourceName", encoded = true) String volumeResourceName, @Query("api-version") String apiVersion, @Body VolumeResourceDescriptionInner volumeResourceDescription, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getVolumeResource" }) + @GET("Resources/Volumes/{volumeResourceName}") + Observable> getVolumeResource(@Path(value = "volumeResourceName", encoded = true) String volumeResourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs deleteVolumeResource" }) + @HTTP(path = "Resources/Volumes/{volumeResourceName}", method = "DELETE", hasBody = true) + Observable> deleteVolumeResource(@Path(value = "volumeResourceName", encoded = true) String volumeResourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get the Service Fabric cluster manifest. + * Get the Service Fabric cluster manifest. The cluster manifest contains properties of the cluster that include different node types on the cluster, + security configurations, fault, and upgrade domain topologies, etc. + These properties are specified as part of the ClusterConfig.JSON file while deploying a stand-alone cluster. However, most of the information in the cluster manifest + is generated internally by service fabric during cluster deployment in other deployment scenarios (e.g. when using Azure portal). + The contents of the cluster manifest are for informational purposes only and users are not expected to take a dependency on the format of the file contents or its interpretation. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterManifestInner object if successful. + */ + public ClusterManifestInner getClusterManifest() { + return getClusterManifestWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get the Service Fabric cluster manifest. + * Get the Service Fabric cluster manifest. The cluster manifest contains properties of the cluster that include different node types on the cluster, + security configurations, fault, and upgrade domain topologies, etc. + These properties are specified as part of the ClusterConfig.JSON file while deploying a stand-alone cluster. However, most of the information in the cluster manifest + is generated internally by service fabric during cluster deployment in other deployment scenarios (e.g. when using Azure portal). + The contents of the cluster manifest are for informational purposes only and users are not expected to take a dependency on the format of the file contents or its interpretation. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getClusterManifestAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getClusterManifestWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get the Service Fabric cluster manifest. + * Get the Service Fabric cluster manifest. The cluster manifest contains properties of the cluster that include different node types on the cluster, + security configurations, fault, and upgrade domain topologies, etc. + These properties are specified as part of the ClusterConfig.JSON file while deploying a stand-alone cluster. However, most of the information in the cluster manifest + is generated internally by service fabric during cluster deployment in other deployment scenarios (e.g. when using Azure portal). + The contents of the cluster manifest are for informational purposes only and users are not expected to take a dependency on the format of the file contents or its interpretation. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterManifestInner object + */ + public Observable getClusterManifestAsync() { + return getClusterManifestWithServiceResponseAsync().map(new Func1, ClusterManifestInner>() { + @Override + public ClusterManifestInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the Service Fabric cluster manifest. + * Get the Service Fabric cluster manifest. The cluster manifest contains properties of the cluster that include different node types on the cluster, + security configurations, fault, and upgrade domain topologies, etc. + These properties are specified as part of the ClusterConfig.JSON file while deploying a stand-alone cluster. However, most of the information in the cluster manifest + is generated internally by service fabric during cluster deployment in other deployment scenarios (e.g. when using Azure portal). + The contents of the cluster manifest are for informational purposes only and users are not expected to take a dependency on the format of the file contents or its interpretation. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterManifestInner object + */ + public Observable> getClusterManifestWithServiceResponseAsync() { + final String apiVersion = "6.0"; + final Long timeout = null; + return service.getClusterManifest(apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getClusterManifestDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get the Service Fabric cluster manifest. + * Get the Service Fabric cluster manifest. The cluster manifest contains properties of the cluster that include different node types on the cluster, + security configurations, fault, and upgrade domain topologies, etc. + These properties are specified as part of the ClusterConfig.JSON file while deploying a stand-alone cluster. However, most of the information in the cluster manifest + is generated internally by service fabric during cluster deployment in other deployment scenarios (e.g. when using Azure portal). + The contents of the cluster manifest are for informational purposes only and users are not expected to take a dependency on the format of the file contents or its interpretation. + * + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterManifestInner object if successful. + */ + public ClusterManifestInner getClusterManifest(Long timeout) { + return getClusterManifestWithServiceResponseAsync(timeout).toBlocking().single().body(); + } + + /** + * Get the Service Fabric cluster manifest. + * Get the Service Fabric cluster manifest. The cluster manifest contains properties of the cluster that include different node types on the cluster, + security configurations, fault, and upgrade domain topologies, etc. + These properties are specified as part of the ClusterConfig.JSON file while deploying a stand-alone cluster. However, most of the information in the cluster manifest + is generated internally by service fabric during cluster deployment in other deployment scenarios (e.g. when using Azure portal). + The contents of the cluster manifest are for informational purposes only and users are not expected to take a dependency on the format of the file contents or its interpretation. + * + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getClusterManifestAsync(Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getClusterManifestWithServiceResponseAsync(timeout), serviceCallback); + } + + /** + * Get the Service Fabric cluster manifest. + * Get the Service Fabric cluster manifest. The cluster manifest contains properties of the cluster that include different node types on the cluster, + security configurations, fault, and upgrade domain topologies, etc. + These properties are specified as part of the ClusterConfig.JSON file while deploying a stand-alone cluster. However, most of the information in the cluster manifest + is generated internally by service fabric during cluster deployment in other deployment scenarios (e.g. when using Azure portal). + The contents of the cluster manifest are for informational purposes only and users are not expected to take a dependency on the format of the file contents or its interpretation. + * + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterManifestInner object + */ + public Observable getClusterManifestAsync(Long timeout) { + return getClusterManifestWithServiceResponseAsync(timeout).map(new Func1, ClusterManifestInner>() { + @Override + public ClusterManifestInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the Service Fabric cluster manifest. + * Get the Service Fabric cluster manifest. The cluster manifest contains properties of the cluster that include different node types on the cluster, + security configurations, fault, and upgrade domain topologies, etc. + These properties are specified as part of the ClusterConfig.JSON file while deploying a stand-alone cluster. However, most of the information in the cluster manifest + is generated internally by service fabric during cluster deployment in other deployment scenarios (e.g. when using Azure portal). + The contents of the cluster manifest are for informational purposes only and users are not expected to take a dependency on the format of the file contents or its interpretation. + * + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterManifestInner object + */ + public Observable> getClusterManifestWithServiceResponseAsync(Long timeout) { + final String apiVersion = "6.0"; + return service.getClusterManifest(apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getClusterManifestDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getClusterManifestDelegate(Response response) throws FabricErrorException, IOException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the health of a Service Fabric cluster. + * Use EventsHealthStateFilter to filter the collection of health events reported on the cluster based on the health state. + Similarly, use NodesHealthStateFilter and ApplicationsHealthStateFilter to filter the collection of nodes and applications returned based on their aggregated health state. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterHealthInner object if successful. + */ + public ClusterHealthInner getClusterHealth() { + return getClusterHealthWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Gets the health of a Service Fabric cluster. + * Use EventsHealthStateFilter to filter the collection of health events reported on the cluster based on the health state. + Similarly, use NodesHealthStateFilter and ApplicationsHealthStateFilter to filter the collection of nodes and applications returned based on their aggregated health state. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getClusterHealthAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getClusterHealthWithServiceResponseAsync(), serviceCallback); + } + + /** + * Gets the health of a Service Fabric cluster. + * Use EventsHealthStateFilter to filter the collection of health events reported on the cluster based on the health state. + Similarly, use NodesHealthStateFilter and ApplicationsHealthStateFilter to filter the collection of nodes and applications returned based on their aggregated health state. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterHealthInner object + */ + public Observable getClusterHealthAsync() { + return getClusterHealthWithServiceResponseAsync().map(new Func1, ClusterHealthInner>() { + @Override + public ClusterHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the health of a Service Fabric cluster. + * Use EventsHealthStateFilter to filter the collection of health events reported on the cluster based on the health state. + Similarly, use NodesHealthStateFilter and ApplicationsHealthStateFilter to filter the collection of nodes and applications returned based on their aggregated health state. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterHealthInner object + */ + public Observable> getClusterHealthWithServiceResponseAsync() { + final String apiVersion = "6.0"; + final Integer nodesHealthStateFilter = null; + final Integer applicationsHealthStateFilter = null; + final Integer eventsHealthStateFilter = null; + final Boolean excludeHealthStatistics = null; + final Boolean includeSystemApplicationHealthStatistics = null; + final Long timeout = null; + return service.getClusterHealth(apiVersion, nodesHealthStateFilter, applicationsHealthStateFilter, eventsHealthStateFilter, excludeHealthStatistics, includeSystemApplicationHealthStatistics, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getClusterHealthDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the health of a Service Fabric cluster. + * Use EventsHealthStateFilter to filter the collection of health events reported on the cluster based on the health state. + Similarly, use NodesHealthStateFilter and ApplicationsHealthStateFilter to filter the collection of nodes and applications returned based on their aggregated health state. + * + * @param nodesHealthStateFilter Allows filtering of the node health state objects returned in the result of cluster health query + based on their health state. The possible values for this parameter include integer value of one of the + following health states. Only nodes that match the filter are returned. All nodes are used to evaluate the aggregated health state. + If not specified, all entries are returned. + The state values are flag-based enumeration, so the value could be a combination of these values obtained using bitwise 'OR' operator. + For example, if the provided value is 6 then health state of nodes with HealthState value of OK (2) and Warning (4) are returned. + - Default - Default value. Matches any HealthState. The value is zero. + - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given collection of states. The value is 1. + - Ok - Filter that matches input with HealthState value Ok. The value is 2. + - Warning - Filter that matches input with HealthState value Warning. The value is 4. + - Error - Filter that matches input with HealthState value Error. The value is 8. + - All - Filter that matches input with any HealthState value. The value is 65535. + * @param applicationsHealthStateFilter Allows filtering of the application health state objects returned in the result of cluster health + query based on their health state. + The possible values for this parameter include integer value obtained from members or bitwise operations + on members of HealthStateFilter enumeration. Only applications that match the filter are returned. + All applications are used to evaluate the aggregated health state. If not specified, all entries are returned. + The state values are flag-based enumeration, so the value could be a combination of these values obtained using bitwise 'OR' operator. + For example, if the provided value is 6 then health state of applications with HealthState value of OK (2) and Warning (4) are returned. + - Default - Default value. Matches any HealthState. The value is zero. + - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given collection of states. The value is 1. + - Ok - Filter that matches input with HealthState value Ok. The value is 2. + - Warning - Filter that matches input with HealthState value Warning. The value is 4. + - Error - Filter that matches input with HealthState value Error. The value is 8. + - All - Filter that matches input with any HealthState value. The value is 65535. + * @param 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 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 includeSystemApplicationHealthStatistics Indicates whether the health statistics should include the fabric:/System application health statistics. False by default. + If IncludeSystemApplicationHealthStatistics is set to true, the health statistics include the entities that belong to the fabric:/System application. + Otherwise, the query result includes health statistics only for user applications. + The health statistics must be included in the query result for this parameter to be applied. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterHealthInner object if successful. + */ + public ClusterHealthInner getClusterHealth(Integer nodesHealthStateFilter, Integer applicationsHealthStateFilter, Integer eventsHealthStateFilter, Boolean excludeHealthStatistics, Boolean includeSystemApplicationHealthStatistics, Long timeout) { + return getClusterHealthWithServiceResponseAsync(nodesHealthStateFilter, applicationsHealthStateFilter, eventsHealthStateFilter, excludeHealthStatistics, includeSystemApplicationHealthStatistics, timeout).toBlocking().single().body(); + } + + /** + * Gets the health of a Service Fabric cluster. + * Use EventsHealthStateFilter to filter the collection of health events reported on the cluster based on the health state. + Similarly, use NodesHealthStateFilter and ApplicationsHealthStateFilter to filter the collection of nodes and applications returned based on their aggregated health state. + * + * @param nodesHealthStateFilter Allows filtering of the node health state objects returned in the result of cluster health query + based on their health state. The possible values for this parameter include integer value of one of the + following health states. Only nodes that match the filter are returned. All nodes are used to evaluate the aggregated health state. + If not specified, all entries are returned. + The state values are flag-based enumeration, so the value could be a combination of these values obtained using bitwise 'OR' operator. + For example, if the provided value is 6 then health state of nodes with HealthState value of OK (2) and Warning (4) are returned. + - Default - Default value. Matches any HealthState. The value is zero. + - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given collection of states. The value is 1. + - Ok - Filter that matches input with HealthState value Ok. The value is 2. + - Warning - Filter that matches input with HealthState value Warning. The value is 4. + - Error - Filter that matches input with HealthState value Error. The value is 8. + - All - Filter that matches input with any HealthState value. The value is 65535. + * @param applicationsHealthStateFilter Allows filtering of the application health state objects returned in the result of cluster health + query based on their health state. + The possible values for this parameter include integer value obtained from members or bitwise operations + on members of HealthStateFilter enumeration. Only applications that match the filter are returned. + All applications are used to evaluate the aggregated health state. If not specified, all entries are returned. + The state values are flag-based enumeration, so the value could be a combination of these values obtained using bitwise 'OR' operator. + For example, if the provided value is 6 then health state of applications with HealthState value of OK (2) and Warning (4) are returned. + - Default - Default value. Matches any HealthState. The value is zero. + - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given collection of states. The value is 1. + - Ok - Filter that matches input with HealthState value Ok. The value is 2. + - Warning - Filter that matches input with HealthState value Warning. The value is 4. + - Error - Filter that matches input with HealthState value Error. The value is 8. + - All - Filter that matches input with any HealthState value. The value is 65535. + * @param 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 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 includeSystemApplicationHealthStatistics Indicates whether the health statistics should include the fabric:/System application health statistics. False by default. + If IncludeSystemApplicationHealthStatistics is set to true, the health statistics include the entities that belong to the fabric:/System application. + Otherwise, the query result includes health statistics only for user applications. + The health statistics must be included in the query result for this parameter to be applied. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getClusterHealthAsync(Integer nodesHealthStateFilter, Integer applicationsHealthStateFilter, Integer eventsHealthStateFilter, Boolean excludeHealthStatistics, Boolean includeSystemApplicationHealthStatistics, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getClusterHealthWithServiceResponseAsync(nodesHealthStateFilter, applicationsHealthStateFilter, eventsHealthStateFilter, excludeHealthStatistics, includeSystemApplicationHealthStatistics, timeout), serviceCallback); + } + + /** + * Gets the health of a Service Fabric cluster. + * Use EventsHealthStateFilter to filter the collection of health events reported on the cluster based on the health state. + Similarly, use NodesHealthStateFilter and ApplicationsHealthStateFilter to filter the collection of nodes and applications returned based on their aggregated health state. + * + * @param nodesHealthStateFilter Allows filtering of the node health state objects returned in the result of cluster health query + based on their health state. The possible values for this parameter include integer value of one of the + following health states. Only nodes that match the filter are returned. All nodes are used to evaluate the aggregated health state. + If not specified, all entries are returned. + The state values are flag-based enumeration, so the value could be a combination of these values obtained using bitwise 'OR' operator. + For example, if the provided value is 6 then health state of nodes with HealthState value of OK (2) and Warning (4) are returned. + - Default - Default value. Matches any HealthState. The value is zero. + - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given collection of states. The value is 1. + - Ok - Filter that matches input with HealthState value Ok. The value is 2. + - Warning - Filter that matches input with HealthState value Warning. The value is 4. + - Error - Filter that matches input with HealthState value Error. The value is 8. + - All - Filter that matches input with any HealthState value. The value is 65535. + * @param applicationsHealthStateFilter Allows filtering of the application health state objects returned in the result of cluster health + query based on their health state. + The possible values for this parameter include integer value obtained from members or bitwise operations + on members of HealthStateFilter enumeration. Only applications that match the filter are returned. + All applications are used to evaluate the aggregated health state. If not specified, all entries are returned. + The state values are flag-based enumeration, so the value could be a combination of these values obtained using bitwise 'OR' operator. + For example, if the provided value is 6 then health state of applications with HealthState value of OK (2) and Warning (4) are returned. + - Default - Default value. Matches any HealthState. The value is zero. + - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given collection of states. The value is 1. + - Ok - Filter that matches input with HealthState value Ok. The value is 2. + - Warning - Filter that matches input with HealthState value Warning. The value is 4. + - Error - Filter that matches input with HealthState value Error. The value is 8. + - All - Filter that matches input with any HealthState value. The value is 65535. + * @param 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 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 includeSystemApplicationHealthStatistics Indicates whether the health statistics should include the fabric:/System application health statistics. False by default. + If IncludeSystemApplicationHealthStatistics is set to true, the health statistics include the entities that belong to the fabric:/System application. + Otherwise, the query result includes health statistics only for user applications. + The health statistics must be included in the query result for this parameter to be applied. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterHealthInner object + */ + public Observable getClusterHealthAsync(Integer nodesHealthStateFilter, Integer applicationsHealthStateFilter, Integer eventsHealthStateFilter, Boolean excludeHealthStatistics, Boolean includeSystemApplicationHealthStatistics, Long timeout) { + return getClusterHealthWithServiceResponseAsync(nodesHealthStateFilter, applicationsHealthStateFilter, eventsHealthStateFilter, excludeHealthStatistics, includeSystemApplicationHealthStatistics, timeout).map(new Func1, ClusterHealthInner>() { + @Override + public ClusterHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the health of a Service Fabric cluster. + * Use EventsHealthStateFilter to filter the collection of health events reported on the cluster based on the health state. + Similarly, use NodesHealthStateFilter and ApplicationsHealthStateFilter to filter the collection of nodes and applications returned based on their aggregated health state. + * + * @param nodesHealthStateFilter Allows filtering of the node health state objects returned in the result of cluster health query + based on their health state. The possible values for this parameter include integer value of one of the + following health states. Only nodes that match the filter are returned. All nodes are used to evaluate the aggregated health state. + If not specified, all entries are returned. + The state values are flag-based enumeration, so the value could be a combination of these values obtained using bitwise 'OR' operator. + For example, if the provided value is 6 then health state of nodes with HealthState value of OK (2) and Warning (4) are returned. + - Default - Default value. Matches any HealthState. The value is zero. + - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given collection of states. The value is 1. + - Ok - Filter that matches input with HealthState value Ok. The value is 2. + - Warning - Filter that matches input with HealthState value Warning. The value is 4. + - Error - Filter that matches input with HealthState value Error. The value is 8. + - All - Filter that matches input with any HealthState value. The value is 65535. + * @param applicationsHealthStateFilter Allows filtering of the application health state objects returned in the result of cluster health + query based on their health state. + The possible values for this parameter include integer value obtained from members or bitwise operations + on members of HealthStateFilter enumeration. Only applications that match the filter are returned. + All applications are used to evaluate the aggregated health state. If not specified, all entries are returned. + The state values are flag-based enumeration, so the value could be a combination of these values obtained using bitwise 'OR' operator. + For example, if the provided value is 6 then health state of applications with HealthState value of OK (2) and Warning (4) are returned. + - Default - Default value. Matches any HealthState. The value is zero. + - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given collection of states. The value is 1. + - Ok - Filter that matches input with HealthState value Ok. The value is 2. + - Warning - Filter that matches input with HealthState value Warning. The value is 4. + - Error - Filter that matches input with HealthState value Error. The value is 8. + - All - Filter that matches input with any HealthState value. The value is 65535. + * @param 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 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 includeSystemApplicationHealthStatistics Indicates whether the health statistics should include the fabric:/System application health statistics. False by default. + If IncludeSystemApplicationHealthStatistics is set to true, the health statistics include the entities that belong to the fabric:/System application. + Otherwise, the query result includes health statistics only for user applications. + The health statistics must be included in the query result for this parameter to be applied. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterHealthInner object + */ + public Observable> getClusterHealthWithServiceResponseAsync(Integer nodesHealthStateFilter, Integer applicationsHealthStateFilter, Integer eventsHealthStateFilter, Boolean excludeHealthStatistics, Boolean includeSystemApplicationHealthStatistics, Long timeout) { + final String apiVersion = "6.0"; + return service.getClusterHealth(apiVersion, nodesHealthStateFilter, applicationsHealthStateFilter, eventsHealthStateFilter, excludeHealthStatistics, includeSystemApplicationHealthStatistics, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getClusterHealthDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getClusterHealthDelegate(Response response) throws FabricErrorException, IOException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the health of a Service Fabric cluster using the specified policy. + * Use EventsHealthStateFilter to filter the collection of health events reported on the cluster based on the health state. + Similarly, use NodesHealthStateFilter and ApplicationsHealthStateFilter to filter the collection of nodes and applications returned based on their aggregated health state. + Use ClusterHealthPolicies to override the health policies used to evaluate the health. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterHealthInner object if successful. + */ + public ClusterHealthInner getClusterHealthUsingPolicy() { + return getClusterHealthUsingPolicyWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Gets the health of a Service Fabric cluster using the specified policy. + * Use EventsHealthStateFilter to filter the collection of health events reported on the cluster based on the health state. + Similarly, use NodesHealthStateFilter and ApplicationsHealthStateFilter to filter the collection of nodes and applications returned based on their aggregated health state. + Use ClusterHealthPolicies to override the health policies used to evaluate the health. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getClusterHealthUsingPolicyAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getClusterHealthUsingPolicyWithServiceResponseAsync(), serviceCallback); + } + + /** + * Gets the health of a Service Fabric cluster using the specified policy. + * Use EventsHealthStateFilter to filter the collection of health events reported on the cluster based on the health state. + Similarly, use NodesHealthStateFilter and ApplicationsHealthStateFilter to filter the collection of nodes and applications returned based on their aggregated health state. + Use ClusterHealthPolicies to override the health policies used to evaluate the health. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterHealthInner object + */ + public Observable getClusterHealthUsingPolicyAsync() { + return getClusterHealthUsingPolicyWithServiceResponseAsync().map(new Func1, ClusterHealthInner>() { + @Override + public ClusterHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the health of a Service Fabric cluster using the specified policy. + * Use EventsHealthStateFilter to filter the collection of health events reported on the cluster based on the health state. + Similarly, use NodesHealthStateFilter and ApplicationsHealthStateFilter to filter the collection of nodes and applications returned based on their aggregated health state. + Use ClusterHealthPolicies to override the health policies used to evaluate the health. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterHealthInner object + */ + public Observable> getClusterHealthUsingPolicyWithServiceResponseAsync() { + final String apiVersion = "6.0"; + final Integer nodesHealthStateFilter = null; + final Integer applicationsHealthStateFilter = null; + final Integer eventsHealthStateFilter = null; + final Boolean excludeHealthStatistics = null; + final Boolean includeSystemApplicationHealthStatistics = null; + final ClusterHealthPolicies clusterHealthPolicies = null; + final Long timeout = null; + return service.getClusterHealthUsingPolicy(apiVersion, nodesHealthStateFilter, applicationsHealthStateFilter, eventsHealthStateFilter, excludeHealthStatistics, includeSystemApplicationHealthStatistics, clusterHealthPolicies, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getClusterHealthUsingPolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the health of a Service Fabric cluster using the specified policy. + * Use EventsHealthStateFilter to filter the collection of health events reported on the cluster based on the health state. + Similarly, use NodesHealthStateFilter and ApplicationsHealthStateFilter to filter the collection of nodes and applications returned based on their aggregated health state. + Use ClusterHealthPolicies to override the health policies used to evaluate the health. + * + * @param nodesHealthStateFilter Allows filtering of the node health state objects returned in the result of cluster health query + based on their health state. The possible values for this parameter include integer value of one of the + following health states. Only nodes that match the filter are returned. All nodes are used to evaluate the aggregated health state. + If not specified, all entries are returned. + The state values are flag-based enumeration, so the value could be a combination of these values obtained using bitwise 'OR' operator. + For example, if the provided value is 6 then health state of nodes with HealthState value of OK (2) and Warning (4) are returned. + - Default - Default value. Matches any HealthState. The value is zero. + - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given collection of states. The value is 1. + - Ok - Filter that matches input with HealthState value Ok. The value is 2. + - Warning - Filter that matches input with HealthState value Warning. The value is 4. + - Error - Filter that matches input with HealthState value Error. The value is 8. + - All - Filter that matches input with any HealthState value. The value is 65535. + * @param applicationsHealthStateFilter Allows filtering of the application health state objects returned in the result of cluster health + query based on their health state. + The possible values for this parameter include integer value obtained from members or bitwise operations + on members of HealthStateFilter enumeration. Only applications that match the filter are returned. + All applications are used to evaluate the aggregated health state. If not specified, all entries are returned. + The state values are flag-based enumeration, so the value could be a combination of these values obtained using bitwise 'OR' operator. + For example, if the provided value is 6 then health state of applications with HealthState value of OK (2) and Warning (4) are returned. + - Default - Default value. Matches any HealthState. The value is zero. + - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given collection of states. The value is 1. + - Ok - Filter that matches input with HealthState value Ok. The value is 2. + - Warning - Filter that matches input with HealthState value Warning. The value is 4. + - Error - Filter that matches input with HealthState value Error. The value is 8. + - All - Filter that matches input with any HealthState value. The value is 65535. + * @param 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 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 includeSystemApplicationHealthStatistics Indicates whether the health statistics should include the fabric:/System application health statistics. False by default. + If IncludeSystemApplicationHealthStatistics is set to true, the health statistics include the entities that belong to the fabric:/System application. + Otherwise, the query result includes health statistics only for user applications. + The health statistics must be included in the query result for this parameter to be applied. + * @param clusterHealthPolicies Describes the health policies used to evaluate the cluster health. + If not present, the health evaluation uses the cluster health policy defined in the cluster manifest or the default cluster health policy. + By default, each application is evaluated using its specific application health policy, defined in the application manifest, or the default health policy, if no policy is defined in manifest. + If the application health policy map is specified, and it has an entry for an application, the specified application health policy + is used to evaluate the application health. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterHealthInner object if successful. + */ + public ClusterHealthInner getClusterHealthUsingPolicy(Integer nodesHealthStateFilter, Integer applicationsHealthStateFilter, Integer eventsHealthStateFilter, Boolean excludeHealthStatistics, Boolean includeSystemApplicationHealthStatistics, ClusterHealthPolicies clusterHealthPolicies, Long timeout) { + return getClusterHealthUsingPolicyWithServiceResponseAsync(nodesHealthStateFilter, applicationsHealthStateFilter, eventsHealthStateFilter, excludeHealthStatistics, includeSystemApplicationHealthStatistics, clusterHealthPolicies, timeout).toBlocking().single().body(); + } + + /** + * Gets the health of a Service Fabric cluster using the specified policy. + * Use EventsHealthStateFilter to filter the collection of health events reported on the cluster based on the health state. + Similarly, use NodesHealthStateFilter and ApplicationsHealthStateFilter to filter the collection of nodes and applications returned based on their aggregated health state. + Use ClusterHealthPolicies to override the health policies used to evaluate the health. + * + * @param nodesHealthStateFilter Allows filtering of the node health state objects returned in the result of cluster health query + based on their health state. The possible values for this parameter include integer value of one of the + following health states. Only nodes that match the filter are returned. All nodes are used to evaluate the aggregated health state. + If not specified, all entries are returned. + The state values are flag-based enumeration, so the value could be a combination of these values obtained using bitwise 'OR' operator. + For example, if the provided value is 6 then health state of nodes with HealthState value of OK (2) and Warning (4) are returned. + - Default - Default value. Matches any HealthState. The value is zero. + - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given collection of states. The value is 1. + - Ok - Filter that matches input with HealthState value Ok. The value is 2. + - Warning - Filter that matches input with HealthState value Warning. The value is 4. + - Error - Filter that matches input with HealthState value Error. The value is 8. + - All - Filter that matches input with any HealthState value. The value is 65535. + * @param applicationsHealthStateFilter Allows filtering of the application health state objects returned in the result of cluster health + query based on their health state. + The possible values for this parameter include integer value obtained from members or bitwise operations + on members of HealthStateFilter enumeration. Only applications that match the filter are returned. + All applications are used to evaluate the aggregated health state. If not specified, all entries are returned. + The state values are flag-based enumeration, so the value could be a combination of these values obtained using bitwise 'OR' operator. + For example, if the provided value is 6 then health state of applications with HealthState value of OK (2) and Warning (4) are returned. + - Default - Default value. Matches any HealthState. The value is zero. + - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given collection of states. The value is 1. + - Ok - Filter that matches input with HealthState value Ok. The value is 2. + - Warning - Filter that matches input with HealthState value Warning. The value is 4. + - Error - Filter that matches input with HealthState value Error. The value is 8. + - All - Filter that matches input with any HealthState value. The value is 65535. + * @param 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 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 includeSystemApplicationHealthStatistics Indicates whether the health statistics should include the fabric:/System application health statistics. False by default. + If IncludeSystemApplicationHealthStatistics is set to true, the health statistics include the entities that belong to the fabric:/System application. + Otherwise, the query result includes health statistics only for user applications. + The health statistics must be included in the query result for this parameter to be applied. + * @param clusterHealthPolicies Describes the health policies used to evaluate the cluster health. + If not present, the health evaluation uses the cluster health policy defined in the cluster manifest or the default cluster health policy. + By default, each application is evaluated using its specific application health policy, defined in the application manifest, or the default health policy, if no policy is defined in manifest. + If the application health policy map is specified, and it has an entry for an application, the specified application health policy + is used to evaluate the application health. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getClusterHealthUsingPolicyAsync(Integer nodesHealthStateFilter, Integer applicationsHealthStateFilter, Integer eventsHealthStateFilter, Boolean excludeHealthStatistics, Boolean includeSystemApplicationHealthStatistics, ClusterHealthPolicies clusterHealthPolicies, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getClusterHealthUsingPolicyWithServiceResponseAsync(nodesHealthStateFilter, applicationsHealthStateFilter, eventsHealthStateFilter, excludeHealthStatistics, includeSystemApplicationHealthStatistics, clusterHealthPolicies, timeout), serviceCallback); + } + + /** + * Gets the health of a Service Fabric cluster using the specified policy. + * Use EventsHealthStateFilter to filter the collection of health events reported on the cluster based on the health state. + Similarly, use NodesHealthStateFilter and ApplicationsHealthStateFilter to filter the collection of nodes and applications returned based on their aggregated health state. + Use ClusterHealthPolicies to override the health policies used to evaluate the health. + * + * @param nodesHealthStateFilter Allows filtering of the node health state objects returned in the result of cluster health query + based on their health state. The possible values for this parameter include integer value of one of the + following health states. Only nodes that match the filter are returned. All nodes are used to evaluate the aggregated health state. + If not specified, all entries are returned. + The state values are flag-based enumeration, so the value could be a combination of these values obtained using bitwise 'OR' operator. + For example, if the provided value is 6 then health state of nodes with HealthState value of OK (2) and Warning (4) are returned. + - Default - Default value. Matches any HealthState. The value is zero. + - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given collection of states. The value is 1. + - Ok - Filter that matches input with HealthState value Ok. The value is 2. + - Warning - Filter that matches input with HealthState value Warning. The value is 4. + - Error - Filter that matches input with HealthState value Error. The value is 8. + - All - Filter that matches input with any HealthState value. The value is 65535. + * @param applicationsHealthStateFilter Allows filtering of the application health state objects returned in the result of cluster health + query based on their health state. + The possible values for this parameter include integer value obtained from members or bitwise operations + on members of HealthStateFilter enumeration. Only applications that match the filter are returned. + All applications are used to evaluate the aggregated health state. If not specified, all entries are returned. + The state values are flag-based enumeration, so the value could be a combination of these values obtained using bitwise 'OR' operator. + For example, if the provided value is 6 then health state of applications with HealthState value of OK (2) and Warning (4) are returned. + - Default - Default value. Matches any HealthState. The value is zero. + - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given collection of states. The value is 1. + - Ok - Filter that matches input with HealthState value Ok. The value is 2. + - Warning - Filter that matches input with HealthState value Warning. The value is 4. + - Error - Filter that matches input with HealthState value Error. The value is 8. + - All - Filter that matches input with any HealthState value. The value is 65535. + * @param 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 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 includeSystemApplicationHealthStatistics Indicates whether the health statistics should include the fabric:/System application health statistics. False by default. + If IncludeSystemApplicationHealthStatistics is set to true, the health statistics include the entities that belong to the fabric:/System application. + Otherwise, the query result includes health statistics only for user applications. + The health statistics must be included in the query result for this parameter to be applied. + * @param clusterHealthPolicies Describes the health policies used to evaluate the cluster health. + If not present, the health evaluation uses the cluster health policy defined in the cluster manifest or the default cluster health policy. + By default, each application is evaluated using its specific application health policy, defined in the application manifest, or the default health policy, if no policy is defined in manifest. + If the application health policy map is specified, and it has an entry for an application, the specified application health policy + is used to evaluate the application health. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterHealthInner object + */ + public Observable getClusterHealthUsingPolicyAsync(Integer nodesHealthStateFilter, Integer applicationsHealthStateFilter, Integer eventsHealthStateFilter, Boolean excludeHealthStatistics, Boolean includeSystemApplicationHealthStatistics, ClusterHealthPolicies clusterHealthPolicies, Long timeout) { + return getClusterHealthUsingPolicyWithServiceResponseAsync(nodesHealthStateFilter, applicationsHealthStateFilter, eventsHealthStateFilter, excludeHealthStatistics, includeSystemApplicationHealthStatistics, clusterHealthPolicies, timeout).map(new Func1, ClusterHealthInner>() { + @Override + public ClusterHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the health of a Service Fabric cluster using the specified policy. + * Use EventsHealthStateFilter to filter the collection of health events reported on the cluster based on the health state. + Similarly, use NodesHealthStateFilter and ApplicationsHealthStateFilter to filter the collection of nodes and applications returned based on their aggregated health state. + Use ClusterHealthPolicies to override the health policies used to evaluate the health. + * + * @param nodesHealthStateFilter Allows filtering of the node health state objects returned in the result of cluster health query + based on their health state. The possible values for this parameter include integer value of one of the + following health states. Only nodes that match the filter are returned. All nodes are used to evaluate the aggregated health state. + If not specified, all entries are returned. + The state values are flag-based enumeration, so the value could be a combination of these values obtained using bitwise 'OR' operator. + For example, if the provided value is 6 then health state of nodes with HealthState value of OK (2) and Warning (4) are returned. + - Default - Default value. Matches any HealthState. The value is zero. + - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given collection of states. The value is 1. + - Ok - Filter that matches input with HealthState value Ok. The value is 2. + - Warning - Filter that matches input with HealthState value Warning. The value is 4. + - Error - Filter that matches input with HealthState value Error. The value is 8. + - All - Filter that matches input with any HealthState value. The value is 65535. + * @param applicationsHealthStateFilter Allows filtering of the application health state objects returned in the result of cluster health + query based on their health state. + The possible values for this parameter include integer value obtained from members or bitwise operations + on members of HealthStateFilter enumeration. Only applications that match the filter are returned. + All applications are used to evaluate the aggregated health state. If not specified, all entries are returned. + The state values are flag-based enumeration, so the value could be a combination of these values obtained using bitwise 'OR' operator. + For example, if the provided value is 6 then health state of applications with HealthState value of OK (2) and Warning (4) are returned. + - Default - Default value. Matches any HealthState. The value is zero. + - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given collection of states. The value is 1. + - Ok - Filter that matches input with HealthState value Ok. The value is 2. + - Warning - Filter that matches input with HealthState value Warning. The value is 4. + - Error - Filter that matches input with HealthState value Error. The value is 8. + - All - Filter that matches input with any HealthState value. The value is 65535. + * @param 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 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 includeSystemApplicationHealthStatistics Indicates whether the health statistics should include the fabric:/System application health statistics. False by default. + If IncludeSystemApplicationHealthStatistics is set to true, the health statistics include the entities that belong to the fabric:/System application. + Otherwise, the query result includes health statistics only for user applications. + The health statistics must be included in the query result for this parameter to be applied. + * @param clusterHealthPolicies Describes the health policies used to evaluate the cluster health. + If not present, the health evaluation uses the cluster health policy defined in the cluster manifest or the default cluster health policy. + By default, each application is evaluated using its specific application health policy, defined in the application manifest, or the default health policy, if no policy is defined in manifest. + If the application health policy map is specified, and it has an entry for an application, the specified application health policy + is used to evaluate the application health. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterHealthInner object + */ + public Observable> getClusterHealthUsingPolicyWithServiceResponseAsync(Integer nodesHealthStateFilter, Integer applicationsHealthStateFilter, Integer eventsHealthStateFilter, Boolean excludeHealthStatistics, Boolean includeSystemApplicationHealthStatistics, ClusterHealthPolicies clusterHealthPolicies, Long timeout) { + Validator.validate(clusterHealthPolicies); + final String apiVersion = "6.0"; + return service.getClusterHealthUsingPolicy(apiVersion, nodesHealthStateFilter, applicationsHealthStateFilter, eventsHealthStateFilter, excludeHealthStatistics, includeSystemApplicationHealthStatistics, clusterHealthPolicies, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getClusterHealthUsingPolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getClusterHealthUsingPolicyDelegate(Response response) throws FabricErrorException, IOException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the health of a Service Fabric cluster using health chunks. + * Gets the health of a Service Fabric cluster using health chunks. Includes the aggregated health state of the cluster, but none of the cluster entities. + To expand the cluster health and get the health state of all or some of the entities, use the POST URI and specify the cluster health chunk query description. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterHealthChunkInner object if successful. + */ + public ClusterHealthChunkInner getClusterHealthChunk() { + return getClusterHealthChunkWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Gets the health of a Service Fabric cluster using health chunks. + * Gets the health of a Service Fabric cluster using health chunks. Includes the aggregated health state of the cluster, but none of the cluster entities. + To expand the cluster health and get the health state of all or some of the entities, use the POST URI and specify the cluster health chunk query description. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getClusterHealthChunkAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getClusterHealthChunkWithServiceResponseAsync(), serviceCallback); + } + + /** + * Gets the health of a Service Fabric cluster using health chunks. + * Gets the health of a Service Fabric cluster using health chunks. Includes the aggregated health state of the cluster, but none of the cluster entities. + To expand the cluster health and get the health state of all or some of the entities, use the POST URI and specify the cluster health chunk query description. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterHealthChunkInner object + */ + public Observable getClusterHealthChunkAsync() { + return getClusterHealthChunkWithServiceResponseAsync().map(new Func1, ClusterHealthChunkInner>() { + @Override + public ClusterHealthChunkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the health of a Service Fabric cluster using health chunks. + * Gets the health of a Service Fabric cluster using health chunks. Includes the aggregated health state of the cluster, but none of the cluster entities. + To expand the cluster health and get the health state of all or some of the entities, use the POST URI and specify the cluster health chunk query description. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterHealthChunkInner object + */ + public Observable> getClusterHealthChunkWithServiceResponseAsync() { + final String apiVersion = "6.0"; + final Long timeout = null; + return service.getClusterHealthChunk(apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getClusterHealthChunkDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the health of a Service Fabric cluster using health chunks. + * Gets the health of a Service Fabric cluster using health chunks. Includes the aggregated health state of the cluster, but none of the cluster entities. + To expand the cluster health and get the health state of all or some of the entities, use the POST URI and specify the cluster health chunk query description. + * + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterHealthChunkInner object if successful. + */ + public ClusterHealthChunkInner getClusterHealthChunk(Long timeout) { + return getClusterHealthChunkWithServiceResponseAsync(timeout).toBlocking().single().body(); + } + + /** + * Gets the health of a Service Fabric cluster using health chunks. + * Gets the health of a Service Fabric cluster using health chunks. Includes the aggregated health state of the cluster, but none of the cluster entities. + To expand the cluster health and get the health state of all or some of the entities, use the POST URI and specify the cluster health chunk query description. + * + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getClusterHealthChunkAsync(Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getClusterHealthChunkWithServiceResponseAsync(timeout), serviceCallback); + } + + /** + * Gets the health of a Service Fabric cluster using health chunks. + * Gets the health of a Service Fabric cluster using health chunks. Includes the aggregated health state of the cluster, but none of the cluster entities. + To expand the cluster health and get the health state of all or some of the entities, use the POST URI and specify the cluster health chunk query description. + * + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterHealthChunkInner object + */ + public Observable getClusterHealthChunkAsync(Long timeout) { + return getClusterHealthChunkWithServiceResponseAsync(timeout).map(new Func1, ClusterHealthChunkInner>() { + @Override + public ClusterHealthChunkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the health of a Service Fabric cluster using health chunks. + * Gets the health of a Service Fabric cluster using health chunks. Includes the aggregated health state of the cluster, but none of the cluster entities. + To expand the cluster health and get the health state of all or some of the entities, use the POST URI and specify the cluster health chunk query description. + * + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterHealthChunkInner object + */ + public Observable> getClusterHealthChunkWithServiceResponseAsync(Long timeout) { + final String apiVersion = "6.0"; + return service.getClusterHealthChunk(apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getClusterHealthChunkDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getClusterHealthChunkDelegate(Response response) throws FabricErrorException, IOException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the health of a Service Fabric cluster using health chunks. + * Gets the health of a Service Fabric cluster using health chunks. The health evaluation is done based on the input cluster health chunk query description. + The query description allows users to specify health policies for evaluating the cluster and its children. + Users can specify very flexible filters to select which cluster entities to return. The selection can be done based on the entities health state and based on the hierarchy. + The query can return multi-level children of the entities based on the specified filters. For example, it can return one application with a specified name, and for this application, return + only services that are in Error or Warning, and all partitions and replicas for one of these services. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterHealthChunkInner object if successful. + */ + public ClusterHealthChunkInner getClusterHealthChunkUsingPolicyAndAdvancedFilters() { + return getClusterHealthChunkUsingPolicyAndAdvancedFiltersWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Gets the health of a Service Fabric cluster using health chunks. + * Gets the health of a Service Fabric cluster using health chunks. The health evaluation is done based on the input cluster health chunk query description. + The query description allows users to specify health policies for evaluating the cluster and its children. + Users can specify very flexible filters to select which cluster entities to return. The selection can be done based on the entities health state and based on the hierarchy. + The query can return multi-level children of the entities based on the specified filters. For example, it can return one application with a specified name, and for this application, return + only services that are in Error or Warning, and all partitions and replicas for one of these services. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getClusterHealthChunkUsingPolicyAndAdvancedFiltersAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getClusterHealthChunkUsingPolicyAndAdvancedFiltersWithServiceResponseAsync(), serviceCallback); + } + + /** + * Gets the health of a Service Fabric cluster using health chunks. + * Gets the health of a Service Fabric cluster using health chunks. The health evaluation is done based on the input cluster health chunk query description. + The query description allows users to specify health policies for evaluating the cluster and its children. + Users can specify very flexible filters to select which cluster entities to return. The selection can be done based on the entities health state and based on the hierarchy. + The query can return multi-level children of the entities based on the specified filters. For example, it can return one application with a specified name, and for this application, return + only services that are in Error or Warning, and all partitions and replicas for one of these services. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterHealthChunkInner object + */ + public Observable getClusterHealthChunkUsingPolicyAndAdvancedFiltersAsync() { + return getClusterHealthChunkUsingPolicyAndAdvancedFiltersWithServiceResponseAsync().map(new Func1, ClusterHealthChunkInner>() { + @Override + public ClusterHealthChunkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the health of a Service Fabric cluster using health chunks. + * Gets the health of a Service Fabric cluster using health chunks. The health evaluation is done based on the input cluster health chunk query description. + The query description allows users to specify health policies for evaluating the cluster and its children. + Users can specify very flexible filters to select which cluster entities to return. The selection can be done based on the entities health state and based on the hierarchy. + The query can return multi-level children of the entities based on the specified filters. For example, it can return one application with a specified name, and for this application, return + only services that are in Error or Warning, and all partitions and replicas for one of these services. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterHealthChunkInner object + */ + public Observable> getClusterHealthChunkUsingPolicyAndAdvancedFiltersWithServiceResponseAsync() { + final String apiVersion = "6.0"; + final ClusterHealthChunkQueryDescription clusterHealthChunkQueryDescription = null; + final Long timeout = null; + return service.getClusterHealthChunkUsingPolicyAndAdvancedFilters(apiVersion, clusterHealthChunkQueryDescription, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getClusterHealthChunkUsingPolicyAndAdvancedFiltersDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the health of a Service Fabric cluster using health chunks. + * Gets the health of a Service Fabric cluster using health chunks. The health evaluation is done based on the input cluster health chunk query description. + The query description allows users to specify health policies for evaluating the cluster and its children. + Users can specify very flexible filters to select which cluster entities to return. The selection can be done based on the entities health state and based on the hierarchy. + The query can return multi-level children of the entities based on the specified filters. For example, it can return one application with a specified name, and for this application, return + only services that are in Error or Warning, and all partitions and replicas for one of these services. + * + * @param clusterHealthChunkQueryDescription Describes the cluster and application health policies used to evaluate the cluster health and the filters to select which cluster entities to be returned. + If the cluster health policy is present, it is used to evaluate the cluster events and the cluster nodes. If not present, the health evaluation uses the cluster health policy defined in the cluster manifest or the default cluster health policy. + By default, each application is evaluated using its specific application health policy, defined in the application manifest, or the default health policy, if no policy is defined in manifest. + If the application health policy map is specified, and it has an entry for an application, the specified application health policy + is used to evaluate the application health. + Users can specify very flexible filters to select which cluster entities to include in response. The selection can be done based on the entities health state and based on the hierarchy. + The query can return multi-level children of the entities based on the specified filters. For example, it can return one application with a specified name, and for this application, return + only services that are in Error or Warning, and all partitions and replicas for one of these services. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterHealthChunkInner object if successful. + */ + public ClusterHealthChunkInner getClusterHealthChunkUsingPolicyAndAdvancedFilters(ClusterHealthChunkQueryDescription clusterHealthChunkQueryDescription, Long timeout) { + return getClusterHealthChunkUsingPolicyAndAdvancedFiltersWithServiceResponseAsync(clusterHealthChunkQueryDescription, timeout).toBlocking().single().body(); + } + + /** + * Gets the health of a Service Fabric cluster using health chunks. + * Gets the health of a Service Fabric cluster using health chunks. The health evaluation is done based on the input cluster health chunk query description. + The query description allows users to specify health policies for evaluating the cluster and its children. + Users can specify very flexible filters to select which cluster entities to return. The selection can be done based on the entities health state and based on the hierarchy. + The query can return multi-level children of the entities based on the specified filters. For example, it can return one application with a specified name, and for this application, return + only services that are in Error or Warning, and all partitions and replicas for one of these services. + * + * @param clusterHealthChunkQueryDescription Describes the cluster and application health policies used to evaluate the cluster health and the filters to select which cluster entities to be returned. + If the cluster health policy is present, it is used to evaluate the cluster events and the cluster nodes. If not present, the health evaluation uses the cluster health policy defined in the cluster manifest or the default cluster health policy. + By default, each application is evaluated using its specific application health policy, defined in the application manifest, or the default health policy, if no policy is defined in manifest. + If the application health policy map is specified, and it has an entry for an application, the specified application health policy + is used to evaluate the application health. + Users can specify very flexible filters to select which cluster entities to include in response. The selection can be done based on the entities health state and based on the hierarchy. + The query can return multi-level children of the entities based on the specified filters. For example, it can return one application with a specified name, and for this application, return + only services that are in Error or Warning, and all partitions and replicas for one of these services. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getClusterHealthChunkUsingPolicyAndAdvancedFiltersAsync(ClusterHealthChunkQueryDescription clusterHealthChunkQueryDescription, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getClusterHealthChunkUsingPolicyAndAdvancedFiltersWithServiceResponseAsync(clusterHealthChunkQueryDescription, timeout), serviceCallback); + } + + /** + * Gets the health of a Service Fabric cluster using health chunks. + * Gets the health of a Service Fabric cluster using health chunks. The health evaluation is done based on the input cluster health chunk query description. + The query description allows users to specify health policies for evaluating the cluster and its children. + Users can specify very flexible filters to select which cluster entities to return. The selection can be done based on the entities health state and based on the hierarchy. + The query can return multi-level children of the entities based on the specified filters. For example, it can return one application with a specified name, and for this application, return + only services that are in Error or Warning, and all partitions and replicas for one of these services. + * + * @param clusterHealthChunkQueryDescription Describes the cluster and application health policies used to evaluate the cluster health and the filters to select which cluster entities to be returned. + If the cluster health policy is present, it is used to evaluate the cluster events and the cluster nodes. If not present, the health evaluation uses the cluster health policy defined in the cluster manifest or the default cluster health policy. + By default, each application is evaluated using its specific application health policy, defined in the application manifest, or the default health policy, if no policy is defined in manifest. + If the application health policy map is specified, and it has an entry for an application, the specified application health policy + is used to evaluate the application health. + Users can specify very flexible filters to select which cluster entities to include in response. The selection can be done based on the entities health state and based on the hierarchy. + The query can return multi-level children of the entities based on the specified filters. For example, it can return one application with a specified name, and for this application, return + only services that are in Error or Warning, and all partitions and replicas for one of these services. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterHealthChunkInner object + */ + public Observable getClusterHealthChunkUsingPolicyAndAdvancedFiltersAsync(ClusterHealthChunkQueryDescription clusterHealthChunkQueryDescription, Long timeout) { + return getClusterHealthChunkUsingPolicyAndAdvancedFiltersWithServiceResponseAsync(clusterHealthChunkQueryDescription, timeout).map(new Func1, ClusterHealthChunkInner>() { + @Override + public ClusterHealthChunkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the health of a Service Fabric cluster using health chunks. + * Gets the health of a Service Fabric cluster using health chunks. The health evaluation is done based on the input cluster health chunk query description. + The query description allows users to specify health policies for evaluating the cluster and its children. + Users can specify very flexible filters to select which cluster entities to return. The selection can be done based on the entities health state and based on the hierarchy. + The query can return multi-level children of the entities based on the specified filters. For example, it can return one application with a specified name, and for this application, return + only services that are in Error or Warning, and all partitions and replicas for one of these services. + * + * @param clusterHealthChunkQueryDescription Describes the cluster and application health policies used to evaluate the cluster health and the filters to select which cluster entities to be returned. + If the cluster health policy is present, it is used to evaluate the cluster events and the cluster nodes. If not present, the health evaluation uses the cluster health policy defined in the cluster manifest or the default cluster health policy. + By default, each application is evaluated using its specific application health policy, defined in the application manifest, or the default health policy, if no policy is defined in manifest. + If the application health policy map is specified, and it has an entry for an application, the specified application health policy + is used to evaluate the application health. + Users can specify very flexible filters to select which cluster entities to include in response. The selection can be done based on the entities health state and based on the hierarchy. + The query can return multi-level children of the entities based on the specified filters. For example, it can return one application with a specified name, and for this application, return + only services that are in Error or Warning, and all partitions and replicas for one of these services. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterHealthChunkInner object + */ + public Observable> getClusterHealthChunkUsingPolicyAndAdvancedFiltersWithServiceResponseAsync(ClusterHealthChunkQueryDescription clusterHealthChunkQueryDescription, Long timeout) { + Validator.validate(clusterHealthChunkQueryDescription); + final String apiVersion = "6.0"; + return service.getClusterHealthChunkUsingPolicyAndAdvancedFilters(apiVersion, clusterHealthChunkQueryDescription, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getClusterHealthChunkUsingPolicyAndAdvancedFiltersDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getClusterHealthChunkUsingPolicyAndAdvancedFiltersDelegate(Response response) throws FabricErrorException, IOException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Sends a health report on the Service Fabric cluster. + * Sends a health report on a Service Fabric cluster. The report must contain the information about the source of the health report and property on which it is reported. + The report is sent to a Service Fabric gateway node, which forwards to the health store. + The report may be accepted by the gateway, but rejected by the health store after extra validation. + For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. + To see whether the report was applied in the health store, run GetClusterHealth and check that the report appears in the HealthEvents section. + * + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void reportClusterHealth(HealthInformation healthInformation) { + reportClusterHealthWithServiceResponseAsync(healthInformation).toBlocking().single().body(); + } + + /** + * Sends a health report on the Service Fabric cluster. + * Sends a health report on a Service Fabric cluster. The report must contain the information about the source of the health report and property on which it is reported. + The report is sent to a Service Fabric gateway node, which forwards to the health store. + The report may be accepted by the gateway, but rejected by the health store after extra validation. + For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. + To see whether the report was applied in the health store, run GetClusterHealth and check that the report appears in the HealthEvents section. + * + * @param 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture reportClusterHealthAsync(HealthInformation healthInformation, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(reportClusterHealthWithServiceResponseAsync(healthInformation), serviceCallback); + } + + /** + * Sends a health report on the Service Fabric cluster. + * Sends a health report on a Service Fabric cluster. The report must contain the information about the source of the health report and property on which it is reported. + The report is sent to a Service Fabric gateway node, which forwards to the health store. + The report may be accepted by the gateway, but rejected by the health store after extra validation. + For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. + To see whether the report was applied in the health store, run GetClusterHealth and check that the report appears in the HealthEvents section. + * + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable reportClusterHealthAsync(HealthInformation healthInformation) { + return reportClusterHealthWithServiceResponseAsync(healthInformation).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Sends a health report on the Service Fabric cluster. + * Sends a health report on a Service Fabric cluster. The report must contain the information about the source of the health report and property on which it is reported. + The report is sent to a Service Fabric gateway node, which forwards to the health store. + The report may be accepted by the gateway, but rejected by the health store after extra validation. + For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. + To see whether the report was applied in the health store, run GetClusterHealth and check that the report appears in the HealthEvents section. + * + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> reportClusterHealthWithServiceResponseAsync(HealthInformation healthInformation) { + if (healthInformation == null) { + throw new IllegalArgumentException("Parameter healthInformation is required and cannot be null."); + } + Validator.validate(healthInformation); + final String apiVersion = "6.0"; + final Boolean immediate = null; + final Long timeout = null; + return service.reportClusterHealth(apiVersion, healthInformation, immediate, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = reportClusterHealthDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Sends a health report on the Service Fabric cluster. + * Sends a health report on a Service Fabric cluster. The report must contain the information about the source of the health report and property on which it is reported. + The report is sent to a Service Fabric gateway node, which forwards to the health store. + The report may be accepted by the gateway, but rejected by the health store after extra validation. + For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. + To see whether the report was applied in the health store, run GetClusterHealth and check that the report appears in the HealthEvents section. + * + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void reportClusterHealth(HealthInformation healthInformation, Boolean immediate, Long timeout) { + reportClusterHealthWithServiceResponseAsync(healthInformation, immediate, timeout).toBlocking().single().body(); + } + + /** + * Sends a health report on the Service Fabric cluster. + * Sends a health report on a Service Fabric cluster. The report must contain the information about the source of the health report and property on which it is reported. + The report is sent to a Service Fabric gateway node, which forwards to the health store. + The report may be accepted by the gateway, but rejected by the health store after extra validation. + For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. + To see whether the report was applied in the health store, run GetClusterHealth and check that the report appears in the HealthEvents section. + * + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture reportClusterHealthAsync(HealthInformation healthInformation, Boolean immediate, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(reportClusterHealthWithServiceResponseAsync(healthInformation, immediate, timeout), serviceCallback); + } + + /** + * Sends a health report on the Service Fabric cluster. + * Sends a health report on a Service Fabric cluster. The report must contain the information about the source of the health report and property on which it is reported. + The report is sent to a Service Fabric gateway node, which forwards to the health store. + The report may be accepted by the gateway, but rejected by the health store after extra validation. + For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. + To see whether the report was applied in the health store, run GetClusterHealth and check that the report appears in the HealthEvents section. + * + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable reportClusterHealthAsync(HealthInformation healthInformation, Boolean immediate, Long timeout) { + return reportClusterHealthWithServiceResponseAsync(healthInformation, immediate, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Sends a health report on the Service Fabric cluster. + * Sends a health report on a Service Fabric cluster. The report must contain the information about the source of the health report and property on which it is reported. + The report is sent to a Service Fabric gateway node, which forwards to the health store. + The report may be accepted by the gateway, but rejected by the health store after extra validation. + For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. + To see whether the report was applied in the health store, run GetClusterHealth and check that the report appears in the HealthEvents section. + * + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> reportClusterHealthWithServiceResponseAsync(HealthInformation healthInformation, Boolean immediate, Long timeout) { + if (healthInformation == null) { + throw new IllegalArgumentException("Parameter healthInformation is required and cannot be null."); + } + Validator.validate(healthInformation); + final String apiVersion = "6.0"; + return service.reportClusterHealth(apiVersion, healthInformation, immediate, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = reportClusterHealthDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse reportClusterHealthDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<FabricCodeVersionInfoInner> object if successful. + */ + public List getProvisionedFabricCodeVersionInfoList() { + return getProvisionedFabricCodeVersionInfoListWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getProvisionedFabricCodeVersionInfoListAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getProvisionedFabricCodeVersionInfoListWithServiceResponseAsync(), serviceCallback); + } + + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<FabricCodeVersionInfoInner> object + */ + public Observable> getProvisionedFabricCodeVersionInfoListAsync() { + return getProvisionedFabricCodeVersionInfoListWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<FabricCodeVersionInfoInner> object + */ + public Observable>> getProvisionedFabricCodeVersionInfoListWithServiceResponseAsync() { + final String apiVersion = "6.0"; + final String codeVersion = null; + final Long timeout = null; + return service.getProvisionedFabricCodeVersionInfoList(apiVersion, codeVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getProvisionedFabricCodeVersionInfoListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 codeVersion The product version of Service Fabric. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<FabricCodeVersionInfoInner> object if successful. + */ + public List getProvisionedFabricCodeVersionInfoList(String codeVersion, Long timeout) { + return getProvisionedFabricCodeVersionInfoListWithServiceResponseAsync(codeVersion, timeout).toBlocking().single().body(); + } + + /** + * 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 codeVersion The product version of Service Fabric. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getProvisionedFabricCodeVersionInfoListAsync(String codeVersion, Long timeout, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getProvisionedFabricCodeVersionInfoListWithServiceResponseAsync(codeVersion, timeout), serviceCallback); + } + + /** + * 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 codeVersion The product version of Service Fabric. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<FabricCodeVersionInfoInner> object + */ + public Observable> getProvisionedFabricCodeVersionInfoListAsync(String codeVersion, Long timeout) { + return getProvisionedFabricCodeVersionInfoListWithServiceResponseAsync(codeVersion, timeout).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 codeVersion The product version of Service Fabric. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<FabricCodeVersionInfoInner> object + */ + public Observable>> getProvisionedFabricCodeVersionInfoListWithServiceResponseAsync(String codeVersion, Long timeout) { + final String apiVersion = "6.0"; + return service.getProvisionedFabricCodeVersionInfoList(apiVersion, codeVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getProvisionedFabricCodeVersionInfoListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getProvisionedFabricCodeVersionInfoListDelegate(Response response) throws FabricErrorException, IOException { + return this.restClient().responseBuilderFactory()., FabricErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<FabricConfigVersionInfoInner> object if successful. + */ + public List getProvisionedFabricConfigVersionInfoList() { + return getProvisionedFabricConfigVersionInfoListWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getProvisionedFabricConfigVersionInfoListAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getProvisionedFabricConfigVersionInfoListWithServiceResponseAsync(), serviceCallback); + } + + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<FabricConfigVersionInfoInner> object + */ + public Observable> getProvisionedFabricConfigVersionInfoListAsync() { + return getProvisionedFabricConfigVersionInfoListWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<FabricConfigVersionInfoInner> object + */ + public Observable>> getProvisionedFabricConfigVersionInfoListWithServiceResponseAsync() { + final String apiVersion = "6.0"; + final String configVersion = null; + final Long timeout = null; + return service.getProvisionedFabricConfigVersionInfoList(apiVersion, configVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getProvisionedFabricConfigVersionInfoListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 configVersion The config version of Service Fabric. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<FabricConfigVersionInfoInner> object if successful. + */ + public List getProvisionedFabricConfigVersionInfoList(String configVersion, Long timeout) { + return getProvisionedFabricConfigVersionInfoListWithServiceResponseAsync(configVersion, timeout).toBlocking().single().body(); + } + + /** + * 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 configVersion The config version of Service Fabric. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getProvisionedFabricConfigVersionInfoListAsync(String configVersion, Long timeout, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getProvisionedFabricConfigVersionInfoListWithServiceResponseAsync(configVersion, timeout), serviceCallback); + } + + /** + * 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 configVersion The config version of Service Fabric. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<FabricConfigVersionInfoInner> object + */ + public Observable> getProvisionedFabricConfigVersionInfoListAsync(String configVersion, Long timeout) { + return getProvisionedFabricConfigVersionInfoListWithServiceResponseAsync(configVersion, timeout).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 configVersion The config version of Service Fabric. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<FabricConfigVersionInfoInner> object + */ + public Observable>> getProvisionedFabricConfigVersionInfoListWithServiceResponseAsync(String configVersion, Long timeout) { + final String apiVersion = "6.0"; + return service.getProvisionedFabricConfigVersionInfoList(apiVersion, configVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getProvisionedFabricConfigVersionInfoListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getProvisionedFabricConfigVersionInfoListDelegate(Response response) throws FabricErrorException, IOException { + return this.restClient().responseBuilderFactory()., FabricErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterUpgradeProgressObjectInner object if successful. + */ + public ClusterUpgradeProgressObjectInner getClusterUpgradeProgress() { + return getClusterUpgradeProgressWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getClusterUpgradeProgressAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getClusterUpgradeProgressWithServiceResponseAsync(), serviceCallback); + } + + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterUpgradeProgressObjectInner object + */ + public Observable getClusterUpgradeProgressAsync() { + return getClusterUpgradeProgressWithServiceResponseAsync().map(new Func1, ClusterUpgradeProgressObjectInner>() { + @Override + public ClusterUpgradeProgressObjectInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterUpgradeProgressObjectInner object + */ + public Observable> getClusterUpgradeProgressWithServiceResponseAsync() { + final String apiVersion = "6.0"; + final Long timeout = null; + return service.getClusterUpgradeProgress(apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getClusterUpgradeProgressDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterUpgradeProgressObjectInner object if successful. + */ + public ClusterUpgradeProgressObjectInner getClusterUpgradeProgress(Long timeout) { + return getClusterUpgradeProgressWithServiceResponseAsync(timeout).toBlocking().single().body(); + } + + /** + * 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getClusterUpgradeProgressAsync(Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getClusterUpgradeProgressWithServiceResponseAsync(timeout), serviceCallback); + } + + /** + * 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterUpgradeProgressObjectInner object + */ + public Observable getClusterUpgradeProgressAsync(Long timeout) { + return getClusterUpgradeProgressWithServiceResponseAsync(timeout).map(new Func1, ClusterUpgradeProgressObjectInner>() { + @Override + public ClusterUpgradeProgressObjectInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterUpgradeProgressObjectInner object + */ + public Observable> getClusterUpgradeProgressWithServiceResponseAsync(Long timeout) { + final String apiVersion = "6.0"; + return service.getClusterUpgradeProgress(apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getClusterUpgradeProgressDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getClusterUpgradeProgressDelegate(Response response) throws FabricErrorException, IOException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 configurationApiVersion The API version of the Standalone cluster json configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterConfigurationInner object if successful. + */ + public ClusterConfigurationInner getClusterConfiguration(String configurationApiVersion) { + return getClusterConfigurationWithServiceResponseAsync(configurationApiVersion).toBlocking().single().body(); + } + + /** + * 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 configurationApiVersion The API version of the Standalone cluster json configuration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getClusterConfigurationAsync(String configurationApiVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getClusterConfigurationWithServiceResponseAsync(configurationApiVersion), serviceCallback); + } + + /** + * 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 configurationApiVersion The API version of the Standalone cluster json configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterConfigurationInner object + */ + public Observable getClusterConfigurationAsync(String configurationApiVersion) { + return getClusterConfigurationWithServiceResponseAsync(configurationApiVersion).map(new Func1, ClusterConfigurationInner>() { + @Override + public ClusterConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 configurationApiVersion The API version of the Standalone cluster json configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterConfigurationInner object + */ + public Observable> getClusterConfigurationWithServiceResponseAsync(String configurationApiVersion) { + if (configurationApiVersion == null) { + throw new IllegalArgumentException("Parameter configurationApiVersion is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + return service.getClusterConfiguration(apiVersion, configurationApiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getClusterConfigurationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 configurationApiVersion The API version of the Standalone cluster json configuration. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterConfigurationInner object if successful. + */ + public ClusterConfigurationInner getClusterConfiguration(String configurationApiVersion, Long timeout) { + return getClusterConfigurationWithServiceResponseAsync(configurationApiVersion, timeout).toBlocking().single().body(); + } + + /** + * 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 configurationApiVersion The API version of the Standalone cluster json configuration. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getClusterConfigurationAsync(String configurationApiVersion, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getClusterConfigurationWithServiceResponseAsync(configurationApiVersion, timeout), serviceCallback); + } + + /** + * 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 configurationApiVersion The API version of the Standalone cluster json configuration. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterConfigurationInner object + */ + public Observable getClusterConfigurationAsync(String configurationApiVersion, Long timeout) { + return getClusterConfigurationWithServiceResponseAsync(configurationApiVersion, timeout).map(new Func1, ClusterConfigurationInner>() { + @Override + public ClusterConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 configurationApiVersion The API version of the Standalone cluster json configuration. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterConfigurationInner object + */ + public Observable> getClusterConfigurationWithServiceResponseAsync(String configurationApiVersion, Long timeout) { + if (configurationApiVersion == null) { + throw new IllegalArgumentException("Parameter configurationApiVersion is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.getClusterConfiguration(apiVersion, configurationApiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getClusterConfigurationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getClusterConfigurationDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Get the cluster configuration upgrade status of a Service Fabric standalone cluster. + * Get the cluster configuration upgrade status details of a Service Fabric standalone cluster. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterConfigurationUpgradeStatusInfoInner object if successful. + */ + public ClusterConfigurationUpgradeStatusInfoInner getClusterConfigurationUpgradeStatus() { + return getClusterConfigurationUpgradeStatusWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get the cluster configuration upgrade status of a Service Fabric standalone cluster. + * Get the cluster configuration upgrade status details of a Service Fabric standalone cluster. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getClusterConfigurationUpgradeStatusAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getClusterConfigurationUpgradeStatusWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get the cluster configuration upgrade status of a Service Fabric standalone cluster. + * Get the cluster configuration upgrade status details of a Service Fabric standalone cluster. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterConfigurationUpgradeStatusInfoInner object + */ + public Observable getClusterConfigurationUpgradeStatusAsync() { + return getClusterConfigurationUpgradeStatusWithServiceResponseAsync().map(new Func1, ClusterConfigurationUpgradeStatusInfoInner>() { + @Override + public ClusterConfigurationUpgradeStatusInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the cluster configuration upgrade status of a Service Fabric standalone cluster. + * Get the cluster configuration upgrade status details of a Service Fabric standalone cluster. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterConfigurationUpgradeStatusInfoInner object + */ + public Observable> getClusterConfigurationUpgradeStatusWithServiceResponseAsync() { + final String apiVersion = "6.0"; + final Long timeout = null; + return service.getClusterConfigurationUpgradeStatus(apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getClusterConfigurationUpgradeStatusDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get the cluster configuration upgrade status of a Service Fabric standalone cluster. + * Get the cluster configuration upgrade status details of a Service Fabric standalone cluster. + * + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterConfigurationUpgradeStatusInfoInner object if successful. + */ + public ClusterConfigurationUpgradeStatusInfoInner getClusterConfigurationUpgradeStatus(Long timeout) { + return getClusterConfigurationUpgradeStatusWithServiceResponseAsync(timeout).toBlocking().single().body(); + } + + /** + * Get the cluster configuration upgrade status of a Service Fabric standalone cluster. + * Get the cluster configuration upgrade status details of a Service Fabric standalone cluster. + * + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getClusterConfigurationUpgradeStatusAsync(Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getClusterConfigurationUpgradeStatusWithServiceResponseAsync(timeout), serviceCallback); + } + + /** + * Get the cluster configuration upgrade status of a Service Fabric standalone cluster. + * Get the cluster configuration upgrade status details of a Service Fabric standalone cluster. + * + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterConfigurationUpgradeStatusInfoInner object + */ + public Observable getClusterConfigurationUpgradeStatusAsync(Long timeout) { + return getClusterConfigurationUpgradeStatusWithServiceResponseAsync(timeout).map(new Func1, ClusterConfigurationUpgradeStatusInfoInner>() { + @Override + public ClusterConfigurationUpgradeStatusInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the cluster configuration upgrade status of a Service Fabric standalone cluster. + * Get the cluster configuration upgrade status details of a Service Fabric standalone cluster. + * + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterConfigurationUpgradeStatusInfoInner object + */ + public Observable> getClusterConfigurationUpgradeStatusWithServiceResponseAsync(Long timeout) { + final String apiVersion = "6.0"; + return service.getClusterConfigurationUpgradeStatus(apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getClusterConfigurationUpgradeStatusDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getClusterConfigurationUpgradeStatusDelegate(Response response) throws FabricErrorException, IOException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Get the service state of Service Fabric Upgrade Orchestration Service. + * Get the service state of Service Fabric Upgrade Orchestration Service. This API is internally used for support purposes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the UpgradeOrchestrationServiceStateInner object if successful. + */ + public UpgradeOrchestrationServiceStateInner getUpgradeOrchestrationServiceState() { + return getUpgradeOrchestrationServiceStateWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get the service state of Service Fabric Upgrade Orchestration Service. + * Get the service state of Service Fabric Upgrade Orchestration Service. This API is internally used for support purposes. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getUpgradeOrchestrationServiceStateAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getUpgradeOrchestrationServiceStateWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get the service state of Service Fabric Upgrade Orchestration Service. + * Get the service state of Service Fabric Upgrade Orchestration Service. This API is internally used for support purposes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UpgradeOrchestrationServiceStateInner object + */ + public Observable getUpgradeOrchestrationServiceStateAsync() { + return getUpgradeOrchestrationServiceStateWithServiceResponseAsync().map(new Func1, UpgradeOrchestrationServiceStateInner>() { + @Override + public UpgradeOrchestrationServiceStateInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the service state of Service Fabric Upgrade Orchestration Service. + * Get the service state of Service Fabric Upgrade Orchestration Service. This API is internally used for support purposes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UpgradeOrchestrationServiceStateInner object + */ + public Observable> getUpgradeOrchestrationServiceStateWithServiceResponseAsync() { + final String apiVersion = "6.0"; + final Long timeout = null; + return service.getUpgradeOrchestrationServiceState(apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getUpgradeOrchestrationServiceStateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get the service state of Service Fabric Upgrade Orchestration Service. + * Get the service state of Service Fabric Upgrade Orchestration Service. This API is internally used for support purposes. + * + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the UpgradeOrchestrationServiceStateInner object if successful. + */ + public UpgradeOrchestrationServiceStateInner getUpgradeOrchestrationServiceState(Long timeout) { + return getUpgradeOrchestrationServiceStateWithServiceResponseAsync(timeout).toBlocking().single().body(); + } + + /** + * Get the service state of Service Fabric Upgrade Orchestration Service. + * Get the service state of Service Fabric Upgrade Orchestration Service. This API is internally used for support purposes. + * + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getUpgradeOrchestrationServiceStateAsync(Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getUpgradeOrchestrationServiceStateWithServiceResponseAsync(timeout), serviceCallback); + } + + /** + * Get the service state of Service Fabric Upgrade Orchestration Service. + * Get the service state of Service Fabric Upgrade Orchestration Service. This API is internally used for support purposes. + * + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UpgradeOrchestrationServiceStateInner object + */ + public Observable getUpgradeOrchestrationServiceStateAsync(Long timeout) { + return getUpgradeOrchestrationServiceStateWithServiceResponseAsync(timeout).map(new Func1, UpgradeOrchestrationServiceStateInner>() { + @Override + public UpgradeOrchestrationServiceStateInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the service state of Service Fabric Upgrade Orchestration Service. + * Get the service state of Service Fabric Upgrade Orchestration Service. This API is internally used for support purposes. + * + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UpgradeOrchestrationServiceStateInner object + */ + public Observable> getUpgradeOrchestrationServiceStateWithServiceResponseAsync(Long timeout) { + final String apiVersion = "6.0"; + return service.getUpgradeOrchestrationServiceState(apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getUpgradeOrchestrationServiceStateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getUpgradeOrchestrationServiceStateDelegate(Response response) throws FabricErrorException, IOException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the UpgradeOrchestrationServiceStateSummaryInner object if successful. + */ + public UpgradeOrchestrationServiceStateSummaryInner setUpgradeOrchestrationServiceState() { + return setUpgradeOrchestrationServiceStateWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture setUpgradeOrchestrationServiceStateAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(setUpgradeOrchestrationServiceStateWithServiceResponseAsync(), serviceCallback); + } + + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UpgradeOrchestrationServiceStateSummaryInner object + */ + public Observable setUpgradeOrchestrationServiceStateAsync() { + return setUpgradeOrchestrationServiceStateWithServiceResponseAsync().map(new Func1, UpgradeOrchestrationServiceStateSummaryInner>() { + @Override + public UpgradeOrchestrationServiceStateSummaryInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UpgradeOrchestrationServiceStateSummaryInner object + */ + public Observable> setUpgradeOrchestrationServiceStateWithServiceResponseAsync() { + final String apiVersion = "6.0"; + final Long timeout = null; + final String serviceState = null; + UpgradeOrchestrationServiceStateInner upgradeOrchestrationServiceState = new UpgradeOrchestrationServiceStateInner(); + upgradeOrchestrationServiceState.withServiceState(null); + return service.setUpgradeOrchestrationServiceState(apiVersion, timeout, this.acceptLanguage(), upgradeOrchestrationServiceState, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = setUpgradeOrchestrationServiceStateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceState The state of Service Fabric Upgrade Orchestration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the UpgradeOrchestrationServiceStateSummaryInner object if successful. + */ + public UpgradeOrchestrationServiceStateSummaryInner setUpgradeOrchestrationServiceState(Long timeout, String serviceState) { + return setUpgradeOrchestrationServiceStateWithServiceResponseAsync(timeout, serviceState).toBlocking().single().body(); + } + + /** + * 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceState The state of Service Fabric Upgrade Orchestration Service. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture setUpgradeOrchestrationServiceStateAsync(Long timeout, String serviceState, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(setUpgradeOrchestrationServiceStateWithServiceResponseAsync(timeout, serviceState), serviceCallback); + } + + /** + * 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceState The state of Service Fabric Upgrade Orchestration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UpgradeOrchestrationServiceStateSummaryInner object + */ + public Observable setUpgradeOrchestrationServiceStateAsync(Long timeout, String serviceState) { + return setUpgradeOrchestrationServiceStateWithServiceResponseAsync(timeout, serviceState).map(new Func1, UpgradeOrchestrationServiceStateSummaryInner>() { + @Override + public UpgradeOrchestrationServiceStateSummaryInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceState The state of Service Fabric Upgrade Orchestration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UpgradeOrchestrationServiceStateSummaryInner object + */ + public Observable> setUpgradeOrchestrationServiceStateWithServiceResponseAsync(Long timeout, String serviceState) { + final String apiVersion = "6.0"; + UpgradeOrchestrationServiceStateInner upgradeOrchestrationServiceState = new UpgradeOrchestrationServiceStateInner(); + upgradeOrchestrationServiceState.withServiceState(serviceState); + return service.setUpgradeOrchestrationServiceState(apiVersion, timeout, this.acceptLanguage(), upgradeOrchestrationServiceState, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = setUpgradeOrchestrationServiceStateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse setUpgradeOrchestrationServiceStateDelegate(Response response) throws FabricErrorException, IOException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 provisionFabricDescription Describes the parameters for provisioning a cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void provisionCluster(ProvisionFabricDescription provisionFabricDescription) { + provisionClusterWithServiceResponseAsync(provisionFabricDescription).toBlocking().single().body(); + } + + /** + * 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 provisionFabricDescription Describes the parameters for provisioning a cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture provisionClusterAsync(ProvisionFabricDescription provisionFabricDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(provisionClusterWithServiceResponseAsync(provisionFabricDescription), serviceCallback); + } + + /** + * 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 provisionFabricDescription Describes the parameters for provisioning a cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable provisionClusterAsync(ProvisionFabricDescription provisionFabricDescription) { + return provisionClusterWithServiceResponseAsync(provisionFabricDescription).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 provisionFabricDescription Describes the parameters for provisioning a cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> provisionClusterWithServiceResponseAsync(ProvisionFabricDescription provisionFabricDescription) { + if (provisionFabricDescription == null) { + throw new IllegalArgumentException("Parameter provisionFabricDescription is required and cannot be null."); + } + Validator.validate(provisionFabricDescription); + final String apiVersion = "6.0"; + final Long timeout = null; + return service.provisionCluster(apiVersion, provisionFabricDescription, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = provisionClusterDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 provisionFabricDescription Describes the parameters for provisioning a cluster. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void provisionCluster(ProvisionFabricDescription provisionFabricDescription, Long timeout) { + provisionClusterWithServiceResponseAsync(provisionFabricDescription, timeout).toBlocking().single().body(); + } + + /** + * 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 provisionFabricDescription Describes the parameters for provisioning a cluster. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture provisionClusterAsync(ProvisionFabricDescription provisionFabricDescription, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(provisionClusterWithServiceResponseAsync(provisionFabricDescription, timeout), serviceCallback); + } + + /** + * 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 provisionFabricDescription Describes the parameters for provisioning a cluster. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable provisionClusterAsync(ProvisionFabricDescription provisionFabricDescription, Long timeout) { + return provisionClusterWithServiceResponseAsync(provisionFabricDescription, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 provisionFabricDescription Describes the parameters for provisioning a cluster. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> provisionClusterWithServiceResponseAsync(ProvisionFabricDescription provisionFabricDescription, Long timeout) { + if (provisionFabricDescription == null) { + throw new IllegalArgumentException("Parameter provisionFabricDescription is required and cannot be null."); + } + Validator.validate(provisionFabricDescription); + final String apiVersion = "6.0"; + return service.provisionCluster(apiVersion, provisionFabricDescription, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = provisionClusterDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse provisionClusterDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Unprovision the code or configuration packages of a Service Fabric cluster. + * It is supported to unprovision code and configuration separately. + * + * @param unprovisionFabricDescription Describes the parameters for unprovisioning a cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void unprovisionCluster(UnprovisionFabricDescription unprovisionFabricDescription) { + unprovisionClusterWithServiceResponseAsync(unprovisionFabricDescription).toBlocking().single().body(); + } + + /** + * Unprovision the code or configuration packages of a Service Fabric cluster. + * It is supported to unprovision code and configuration separately. + * + * @param unprovisionFabricDescription Describes the parameters for unprovisioning a cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture unprovisionClusterAsync(UnprovisionFabricDescription unprovisionFabricDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(unprovisionClusterWithServiceResponseAsync(unprovisionFabricDescription), serviceCallback); + } + + /** + * Unprovision the code or configuration packages of a Service Fabric cluster. + * It is supported to unprovision code and configuration separately. + * + * @param unprovisionFabricDescription Describes the parameters for unprovisioning a cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable unprovisionClusterAsync(UnprovisionFabricDescription unprovisionFabricDescription) { + return unprovisionClusterWithServiceResponseAsync(unprovisionFabricDescription).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Unprovision the code or configuration packages of a Service Fabric cluster. + * It is supported to unprovision code and configuration separately. + * + * @param unprovisionFabricDescription Describes the parameters for unprovisioning a cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> unprovisionClusterWithServiceResponseAsync(UnprovisionFabricDescription unprovisionFabricDescription) { + if (unprovisionFabricDescription == null) { + throw new IllegalArgumentException("Parameter unprovisionFabricDescription is required and cannot be null."); + } + Validator.validate(unprovisionFabricDescription); + final String apiVersion = "6.0"; + final Long timeout = null; + return service.unprovisionCluster(apiVersion, unprovisionFabricDescription, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = unprovisionClusterDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Unprovision the code or configuration packages of a Service Fabric cluster. + * It is supported to unprovision code and configuration separately. + * + * @param unprovisionFabricDescription Describes the parameters for unprovisioning a cluster. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void unprovisionCluster(UnprovisionFabricDescription unprovisionFabricDescription, Long timeout) { + unprovisionClusterWithServiceResponseAsync(unprovisionFabricDescription, timeout).toBlocking().single().body(); + } + + /** + * Unprovision the code or configuration packages of a Service Fabric cluster. + * It is supported to unprovision code and configuration separately. + * + * @param unprovisionFabricDescription Describes the parameters for unprovisioning a cluster. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture unprovisionClusterAsync(UnprovisionFabricDescription unprovisionFabricDescription, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(unprovisionClusterWithServiceResponseAsync(unprovisionFabricDescription, timeout), serviceCallback); + } + + /** + * Unprovision the code or configuration packages of a Service Fabric cluster. + * It is supported to unprovision code and configuration separately. + * + * @param unprovisionFabricDescription Describes the parameters for unprovisioning a cluster. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable unprovisionClusterAsync(UnprovisionFabricDescription unprovisionFabricDescription, Long timeout) { + return unprovisionClusterWithServiceResponseAsync(unprovisionFabricDescription, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Unprovision the code or configuration packages of a Service Fabric cluster. + * It is supported to unprovision code and configuration separately. + * + * @param unprovisionFabricDescription Describes the parameters for unprovisioning a cluster. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> unprovisionClusterWithServiceResponseAsync(UnprovisionFabricDescription unprovisionFabricDescription, Long timeout) { + if (unprovisionFabricDescription == null) { + throw new IllegalArgumentException("Parameter unprovisionFabricDescription is required and cannot be null."); + } + Validator.validate(unprovisionFabricDescription); + final String apiVersion = "6.0"; + return service.unprovisionCluster(apiVersion, unprovisionFabricDescription, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = unprovisionClusterDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse unprovisionClusterDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Rollback the upgrade of a Service Fabric cluster. + * Rollback the code or configuration upgrade of a Service Fabric cluster. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void rollbackClusterUpgrade() { + rollbackClusterUpgradeWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Rollback the upgrade of a Service Fabric cluster. + * Rollback the code or configuration upgrade of a Service Fabric cluster. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture rollbackClusterUpgradeAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(rollbackClusterUpgradeWithServiceResponseAsync(), serviceCallback); + } + + /** + * Rollback the upgrade of a Service Fabric cluster. + * Rollback the code or configuration upgrade of a Service Fabric cluster. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable rollbackClusterUpgradeAsync() { + return rollbackClusterUpgradeWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Rollback the upgrade of a Service Fabric cluster. + * Rollback the code or configuration upgrade of a Service Fabric cluster. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> rollbackClusterUpgradeWithServiceResponseAsync() { + final String apiVersion = "6.0"; + final Long timeout = null; + return service.rollbackClusterUpgrade(apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = rollbackClusterUpgradeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Rollback the upgrade of a Service Fabric cluster. + * Rollback the code or configuration upgrade of a Service Fabric cluster. + * + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void rollbackClusterUpgrade(Long timeout) { + rollbackClusterUpgradeWithServiceResponseAsync(timeout).toBlocking().single().body(); + } + + /** + * Rollback the upgrade of a Service Fabric cluster. + * Rollback the code or configuration upgrade of a Service Fabric cluster. + * + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture rollbackClusterUpgradeAsync(Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(rollbackClusterUpgradeWithServiceResponseAsync(timeout), serviceCallback); + } + + /** + * Rollback the upgrade of a Service Fabric cluster. + * Rollback the code or configuration upgrade of a Service Fabric cluster. + * + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable rollbackClusterUpgradeAsync(Long timeout) { + return rollbackClusterUpgradeWithServiceResponseAsync(timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Rollback the upgrade of a Service Fabric cluster. + * Rollback the code or configuration upgrade of a Service Fabric cluster. + * + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> rollbackClusterUpgradeWithServiceResponseAsync(Long timeout) { + final String apiVersion = "6.0"; + return service.rollbackClusterUpgrade(apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = rollbackClusterUpgradeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse rollbackClusterUpgradeDelegate(Response response) throws FabricErrorException, IOException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 upgradeDomain The next upgrade domain for this cluster upgrade. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void resumeClusterUpgrade(String upgradeDomain) { + resumeClusterUpgradeWithServiceResponseAsync(upgradeDomain).toBlocking().single().body(); + } + + /** + * 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 upgradeDomain The next upgrade domain for this cluster upgrade. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture resumeClusterUpgradeAsync(String upgradeDomain, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resumeClusterUpgradeWithServiceResponseAsync(upgradeDomain), serviceCallback); + } + + /** + * 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 upgradeDomain The next upgrade domain for this cluster upgrade. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable resumeClusterUpgradeAsync(String upgradeDomain) { + return resumeClusterUpgradeWithServiceResponseAsync(upgradeDomain).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 upgradeDomain The next upgrade domain for this cluster upgrade. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> resumeClusterUpgradeWithServiceResponseAsync(String upgradeDomain) { + if (upgradeDomain == null) { + throw new IllegalArgumentException("Parameter upgradeDomain is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + ResumeClusterUpgradeDescription resumeClusterUpgradeDescription = new ResumeClusterUpgradeDescription(); + resumeClusterUpgradeDescription.withUpgradeDomain(upgradeDomain); + return service.resumeClusterUpgrade(apiVersion, timeout, this.acceptLanguage(), resumeClusterUpgradeDescription, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = resumeClusterUpgradeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 upgradeDomain The next upgrade domain for this cluster upgrade. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void resumeClusterUpgrade(String upgradeDomain, Long timeout) { + resumeClusterUpgradeWithServiceResponseAsync(upgradeDomain, timeout).toBlocking().single().body(); + } + + /** + * 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 upgradeDomain The next upgrade domain for this cluster upgrade. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture resumeClusterUpgradeAsync(String upgradeDomain, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resumeClusterUpgradeWithServiceResponseAsync(upgradeDomain, timeout), serviceCallback); + } + + /** + * 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 upgradeDomain The next upgrade domain for this cluster upgrade. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable resumeClusterUpgradeAsync(String upgradeDomain, Long timeout) { + return resumeClusterUpgradeWithServiceResponseAsync(upgradeDomain, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 upgradeDomain The next upgrade domain for this cluster upgrade. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> resumeClusterUpgradeWithServiceResponseAsync(String upgradeDomain, Long timeout) { + if (upgradeDomain == null) { + throw new IllegalArgumentException("Parameter upgradeDomain is required and cannot be null."); + } + final String apiVersion = "6.0"; + ResumeClusterUpgradeDescription resumeClusterUpgradeDescription = new ResumeClusterUpgradeDescription(); + resumeClusterUpgradeDescription.withUpgradeDomain(upgradeDomain); + return service.resumeClusterUpgrade(apiVersion, timeout, this.acceptLanguage(), resumeClusterUpgradeDescription, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = resumeClusterUpgradeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse resumeClusterUpgradeDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 startClusterUpgradeDescription Describes the parameters for starting a cluster upgrade. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void startClusterUpgrade(StartClusterUpgradeDescription startClusterUpgradeDescription) { + startClusterUpgradeWithServiceResponseAsync(startClusterUpgradeDescription).toBlocking().single().body(); + } + + /** + * 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 startClusterUpgradeDescription Describes the parameters for starting a cluster upgrade. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture startClusterUpgradeAsync(StartClusterUpgradeDescription startClusterUpgradeDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startClusterUpgradeWithServiceResponseAsync(startClusterUpgradeDescription), serviceCallback); + } + + /** + * 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 startClusterUpgradeDescription Describes the parameters for starting a cluster upgrade. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable startClusterUpgradeAsync(StartClusterUpgradeDescription startClusterUpgradeDescription) { + return startClusterUpgradeWithServiceResponseAsync(startClusterUpgradeDescription).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 startClusterUpgradeDescription Describes the parameters for starting a cluster upgrade. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> startClusterUpgradeWithServiceResponseAsync(StartClusterUpgradeDescription startClusterUpgradeDescription) { + if (startClusterUpgradeDescription == null) { + throw new IllegalArgumentException("Parameter startClusterUpgradeDescription is required and cannot be null."); + } + Validator.validate(startClusterUpgradeDescription); + final String apiVersion = "6.0"; + final Long timeout = null; + return service.startClusterUpgrade(apiVersion, startClusterUpgradeDescription, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = startClusterUpgradeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 startClusterUpgradeDescription Describes the parameters for starting a cluster upgrade. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void startClusterUpgrade(StartClusterUpgradeDescription startClusterUpgradeDescription, Long timeout) { + startClusterUpgradeWithServiceResponseAsync(startClusterUpgradeDescription, timeout).toBlocking().single().body(); + } + + /** + * 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 startClusterUpgradeDescription Describes the parameters for starting a cluster upgrade. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture startClusterUpgradeAsync(StartClusterUpgradeDescription startClusterUpgradeDescription, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startClusterUpgradeWithServiceResponseAsync(startClusterUpgradeDescription, timeout), serviceCallback); + } + + /** + * 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 startClusterUpgradeDescription Describes the parameters for starting a cluster upgrade. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable startClusterUpgradeAsync(StartClusterUpgradeDescription startClusterUpgradeDescription, Long timeout) { + return startClusterUpgradeWithServiceResponseAsync(startClusterUpgradeDescription, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 startClusterUpgradeDescription Describes the parameters for starting a cluster upgrade. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> startClusterUpgradeWithServiceResponseAsync(StartClusterUpgradeDescription startClusterUpgradeDescription, Long timeout) { + if (startClusterUpgradeDescription == null) { + throw new IllegalArgumentException("Parameter startClusterUpgradeDescription is required and cannot be null."); + } + Validator.validate(startClusterUpgradeDescription); + final String apiVersion = "6.0"; + return service.startClusterUpgrade(apiVersion, startClusterUpgradeDescription, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = startClusterUpgradeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse startClusterUpgradeDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 clusterConfigurationUpgradeDescription Parameters for a standalone cluster configuration upgrade. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void startClusterConfigurationUpgrade(ClusterConfigurationUpgradeDescription clusterConfigurationUpgradeDescription) { + startClusterConfigurationUpgradeWithServiceResponseAsync(clusterConfigurationUpgradeDescription).toBlocking().single().body(); + } + + /** + * 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 clusterConfigurationUpgradeDescription Parameters for a standalone cluster configuration upgrade. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture startClusterConfigurationUpgradeAsync(ClusterConfigurationUpgradeDescription clusterConfigurationUpgradeDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startClusterConfigurationUpgradeWithServiceResponseAsync(clusterConfigurationUpgradeDescription), serviceCallback); + } + + /** + * 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 clusterConfigurationUpgradeDescription Parameters for a standalone cluster configuration upgrade. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable startClusterConfigurationUpgradeAsync(ClusterConfigurationUpgradeDescription clusterConfigurationUpgradeDescription) { + return startClusterConfigurationUpgradeWithServiceResponseAsync(clusterConfigurationUpgradeDescription).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 clusterConfigurationUpgradeDescription Parameters for a standalone cluster configuration upgrade. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> startClusterConfigurationUpgradeWithServiceResponseAsync(ClusterConfigurationUpgradeDescription clusterConfigurationUpgradeDescription) { + if (clusterConfigurationUpgradeDescription == null) { + throw new IllegalArgumentException("Parameter clusterConfigurationUpgradeDescription is required and cannot be null."); + } + Validator.validate(clusterConfigurationUpgradeDescription); + final String apiVersion = "6.0"; + final Long timeout = null; + return service.startClusterConfigurationUpgrade(apiVersion, clusterConfigurationUpgradeDescription, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = startClusterConfigurationUpgradeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 clusterConfigurationUpgradeDescription Parameters for a standalone cluster configuration upgrade. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void startClusterConfigurationUpgrade(ClusterConfigurationUpgradeDescription clusterConfigurationUpgradeDescription, Long timeout) { + startClusterConfigurationUpgradeWithServiceResponseAsync(clusterConfigurationUpgradeDescription, timeout).toBlocking().single().body(); + } + + /** + * 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 clusterConfigurationUpgradeDescription Parameters for a standalone cluster configuration upgrade. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture startClusterConfigurationUpgradeAsync(ClusterConfigurationUpgradeDescription clusterConfigurationUpgradeDescription, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startClusterConfigurationUpgradeWithServiceResponseAsync(clusterConfigurationUpgradeDescription, timeout), serviceCallback); + } + + /** + * 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 clusterConfigurationUpgradeDescription Parameters for a standalone cluster configuration upgrade. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable startClusterConfigurationUpgradeAsync(ClusterConfigurationUpgradeDescription clusterConfigurationUpgradeDescription, Long timeout) { + return startClusterConfigurationUpgradeWithServiceResponseAsync(clusterConfigurationUpgradeDescription, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 clusterConfigurationUpgradeDescription Parameters for a standalone cluster configuration upgrade. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> startClusterConfigurationUpgradeWithServiceResponseAsync(ClusterConfigurationUpgradeDescription clusterConfigurationUpgradeDescription, Long timeout) { + if (clusterConfigurationUpgradeDescription == null) { + throw new IllegalArgumentException("Parameter clusterConfigurationUpgradeDescription is required and cannot be null."); + } + Validator.validate(clusterConfigurationUpgradeDescription); + final String apiVersion = "6.0"; + return service.startClusterConfigurationUpgrade(apiVersion, clusterConfigurationUpgradeDescription, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = startClusterConfigurationUpgradeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse startClusterConfigurationUpgradeDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Update the upgrade parameters of a Service Fabric cluster upgrade. + * Update the upgrade parameters used during a Service Fabric cluster upgrade. + * + * @param updateClusterUpgradeDescription Parameters for updating a cluster upgrade. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void updateClusterUpgrade(UpdateClusterUpgradeDescription updateClusterUpgradeDescription) { + updateClusterUpgradeWithServiceResponseAsync(updateClusterUpgradeDescription).toBlocking().single().body(); + } + + /** + * Update the upgrade parameters of a Service Fabric cluster upgrade. + * Update the upgrade parameters used during a Service Fabric cluster upgrade. + * + * @param updateClusterUpgradeDescription Parameters for updating a cluster upgrade. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateClusterUpgradeAsync(UpdateClusterUpgradeDescription updateClusterUpgradeDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateClusterUpgradeWithServiceResponseAsync(updateClusterUpgradeDescription), serviceCallback); + } + + /** + * Update the upgrade parameters of a Service Fabric cluster upgrade. + * Update the upgrade parameters used during a Service Fabric cluster upgrade. + * + * @param updateClusterUpgradeDescription Parameters for updating a cluster upgrade. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable updateClusterUpgradeAsync(UpdateClusterUpgradeDescription updateClusterUpgradeDescription) { + return updateClusterUpgradeWithServiceResponseAsync(updateClusterUpgradeDescription).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update the upgrade parameters of a Service Fabric cluster upgrade. + * Update the upgrade parameters used during a Service Fabric cluster upgrade. + * + * @param updateClusterUpgradeDescription Parameters for updating a cluster upgrade. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> updateClusterUpgradeWithServiceResponseAsync(UpdateClusterUpgradeDescription updateClusterUpgradeDescription) { + if (updateClusterUpgradeDescription == null) { + throw new IllegalArgumentException("Parameter updateClusterUpgradeDescription is required and cannot be null."); + } + Validator.validate(updateClusterUpgradeDescription); + final String apiVersion = "6.0"; + final Long timeout = null; + return service.updateClusterUpgrade(apiVersion, updateClusterUpgradeDescription, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateClusterUpgradeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Update the upgrade parameters of a Service Fabric cluster upgrade. + * Update the upgrade parameters used during a Service Fabric cluster upgrade. + * + * @param updateClusterUpgradeDescription Parameters for updating a cluster upgrade. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void updateClusterUpgrade(UpdateClusterUpgradeDescription updateClusterUpgradeDescription, Long timeout) { + updateClusterUpgradeWithServiceResponseAsync(updateClusterUpgradeDescription, timeout).toBlocking().single().body(); + } + + /** + * Update the upgrade parameters of a Service Fabric cluster upgrade. + * Update the upgrade parameters used during a Service Fabric cluster upgrade. + * + * @param updateClusterUpgradeDescription Parameters for updating a cluster upgrade. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateClusterUpgradeAsync(UpdateClusterUpgradeDescription updateClusterUpgradeDescription, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateClusterUpgradeWithServiceResponseAsync(updateClusterUpgradeDescription, timeout), serviceCallback); + } + + /** + * Update the upgrade parameters of a Service Fabric cluster upgrade. + * Update the upgrade parameters used during a Service Fabric cluster upgrade. + * + * @param updateClusterUpgradeDescription Parameters for updating a cluster upgrade. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable updateClusterUpgradeAsync(UpdateClusterUpgradeDescription updateClusterUpgradeDescription, Long timeout) { + return updateClusterUpgradeWithServiceResponseAsync(updateClusterUpgradeDescription, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update the upgrade parameters of a Service Fabric cluster upgrade. + * Update the upgrade parameters used during a Service Fabric cluster upgrade. + * + * @param updateClusterUpgradeDescription Parameters for updating a cluster upgrade. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> updateClusterUpgradeWithServiceResponseAsync(UpdateClusterUpgradeDescription updateClusterUpgradeDescription, Long timeout) { + if (updateClusterUpgradeDescription == null) { + throw new IllegalArgumentException("Parameter updateClusterUpgradeDescription is required and cannot be null."); + } + Validator.validate(updateClusterUpgradeDescription); + final String apiVersion = "6.0"; + return service.updateClusterUpgrade(apiVersion, updateClusterUpgradeDescription, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateClusterUpgradeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateClusterUpgradeDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AadMetadataObjectInner object if successful. + */ + public AadMetadataObjectInner getAadMetadata() { + return getAadMetadataWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAadMetadataAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getAadMetadataWithServiceResponseAsync(), serviceCallback); + } + + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AadMetadataObjectInner object + */ + public Observable getAadMetadataAsync() { + return getAadMetadataWithServiceResponseAsync().map(new Func1, AadMetadataObjectInner>() { + @Override + public AadMetadataObjectInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AadMetadataObjectInner object + */ + public Observable> getAadMetadataWithServiceResponseAsync() { + final String apiVersion = "6.0"; + final Long timeout = null; + return service.getAadMetadata(apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getAadMetadataDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AadMetadataObjectInner object if successful. + */ + public AadMetadataObjectInner getAadMetadata(Long timeout) { + return getAadMetadataWithServiceResponseAsync(timeout).toBlocking().single().body(); + } + + /** + * 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAadMetadataAsync(Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getAadMetadataWithServiceResponseAsync(timeout), serviceCallback); + } + + /** + * 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AadMetadataObjectInner object + */ + public Observable getAadMetadataAsync(Long timeout) { + return getAadMetadataWithServiceResponseAsync(timeout).map(new Func1, AadMetadataObjectInner>() { + @Override + public AadMetadataObjectInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AadMetadataObjectInner object + */ + public Observable> getAadMetadataWithServiceResponseAsync(Long timeout) { + final String apiVersion = "6.0"; + return service.getAadMetadata(apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getAadMetadataDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getAadMetadataDelegate(Response response) throws FabricErrorException, IOException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedNodeInfoListInner object if successful. + */ + public PagedNodeInfoListInner getNodeInfoList() { + return getNodeInfoListWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNodeInfoListAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNodeInfoListWithServiceResponseAsync(), serviceCallback); + } + + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedNodeInfoListInner object + */ + public Observable getNodeInfoListAsync() { + return getNodeInfoListWithServiceResponseAsync().map(new Func1, PagedNodeInfoListInner>() { + @Override + public PagedNodeInfoListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedNodeInfoListInner object + */ + public Observable> getNodeInfoListWithServiceResponseAsync() { + final String apiVersion = "6.3"; + final String continuationToken = null; + final NodeStatusFilter nodeStatusFilter = null; + final Long maxResults = null; + final Long timeout = null; + return service.getNodeInfoList(apiVersion, continuationToken, nodeStatusFilter, maxResults, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getNodeInfoListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedNodeInfoListInner object if successful. + */ + public PagedNodeInfoListInner getNodeInfoList(String continuationToken, NodeStatusFilter nodeStatusFilter, Long maxResults, Long timeout) { + return getNodeInfoListWithServiceResponseAsync(continuationToken, nodeStatusFilter, maxResults, timeout).toBlocking().single().body(); + } + + /** + * 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 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNodeInfoListAsync(String continuationToken, NodeStatusFilter nodeStatusFilter, Long maxResults, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNodeInfoListWithServiceResponseAsync(continuationToken, nodeStatusFilter, maxResults, timeout), serviceCallback); + } + + /** + * 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 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedNodeInfoListInner object + */ + public Observable getNodeInfoListAsync(String continuationToken, NodeStatusFilter nodeStatusFilter, Long maxResults, Long timeout) { + return getNodeInfoListWithServiceResponseAsync(continuationToken, nodeStatusFilter, maxResults, timeout).map(new Func1, PagedNodeInfoListInner>() { + @Override + public PagedNodeInfoListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedNodeInfoListInner object + */ + public Observable> getNodeInfoListWithServiceResponseAsync(String continuationToken, NodeStatusFilter nodeStatusFilter, Long maxResults, Long timeout) { + final String apiVersion = "6.3"; + return service.getNodeInfoList(apiVersion, continuationToken, nodeStatusFilter, maxResults, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getNodeInfoListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getNodeInfoListDelegate(Response response) throws FabricErrorException, IOException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 nodeName The name of the node. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NodeInfoInner object if successful. + */ + public NodeInfoInner getNodeInfo(String nodeName) { + return getNodeInfoWithServiceResponseAsync(nodeName).toBlocking().single().body(); + } + + /** + * 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 nodeName The name of the node. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNodeInfoAsync(String nodeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNodeInfoWithServiceResponseAsync(nodeName), serviceCallback); + } + + /** + * 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 nodeName The name of the node. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NodeInfoInner object + */ + public Observable getNodeInfoAsync(String nodeName) { + return getNodeInfoWithServiceResponseAsync(nodeName).map(new Func1, NodeInfoInner>() { + @Override + public NodeInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 nodeName The name of the node. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NodeInfoInner object + */ + public Observable> getNodeInfoWithServiceResponseAsync(String nodeName) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + return service.getNodeInfo(nodeName, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getNodeInfoDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 nodeName The name of the node. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NodeInfoInner object if successful. + */ + public NodeInfoInner getNodeInfo(String nodeName, Long timeout) { + return getNodeInfoWithServiceResponseAsync(nodeName, timeout).toBlocking().single().body(); + } + + /** + * 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 nodeName The name of the node. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNodeInfoAsync(String nodeName, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNodeInfoWithServiceResponseAsync(nodeName, timeout), serviceCallback); + } + + /** + * 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 nodeName The name of the node. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NodeInfoInner object + */ + public Observable getNodeInfoAsync(String nodeName, Long timeout) { + return getNodeInfoWithServiceResponseAsync(nodeName, timeout).map(new Func1, NodeInfoInner>() { + @Override + public NodeInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 nodeName The name of the node. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NodeInfoInner object + */ + public Observable> getNodeInfoWithServiceResponseAsync(String nodeName, Long timeout) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.getNodeInfo(nodeName, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getNodeInfoDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getNodeInfoDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the health of a Service Fabric node. + * Gets the health of a Service Fabric node. Use EventsHealthStateFilter to filter the collection of health events reported on the node based on the health state. If the node that you specify by name does not exist in the health store, this returns an error. + * + * @param nodeName The name of the node. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NodeHealthInner object if successful. + */ + public NodeHealthInner getNodeHealth(String nodeName) { + return getNodeHealthWithServiceResponseAsync(nodeName).toBlocking().single().body(); + } + + /** + * Gets the health of a Service Fabric node. + * Gets the health of a Service Fabric node. Use EventsHealthStateFilter to filter the collection of health events reported on the node based on the health state. If the node that you specify by name does not exist in the health store, this returns an error. + * + * @param nodeName The name of the node. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNodeHealthAsync(String nodeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNodeHealthWithServiceResponseAsync(nodeName), serviceCallback); + } + + /** + * Gets the health of a Service Fabric node. + * Gets the health of a Service Fabric node. Use EventsHealthStateFilter to filter the collection of health events reported on the node based on the health state. If the node that you specify by name does not exist in the health store, this returns an error. + * + * @param nodeName The name of the node. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NodeHealthInner object + */ + public Observable getNodeHealthAsync(String nodeName) { + return getNodeHealthWithServiceResponseAsync(nodeName).map(new Func1, NodeHealthInner>() { + @Override + public NodeHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the health of a Service Fabric node. + * Gets the health of a Service Fabric node. Use EventsHealthStateFilter to filter the collection of health events reported on the node based on the health state. If the node that you specify by name does not exist in the health store, this returns an error. + * + * @param nodeName The name of the node. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NodeHealthInner object + */ + public Observable> getNodeHealthWithServiceResponseAsync(String nodeName) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Integer eventsHealthStateFilter = null; + final Long timeout = null; + return service.getNodeHealth(nodeName, apiVersion, eventsHealthStateFilter, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getNodeHealthDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the health of a Service Fabric node. + * Gets the health of a Service Fabric node. Use EventsHealthStateFilter to filter the collection of health events reported on the node based on the health state. If the node that you specify by name does not exist in the health store, this returns an error. + * + * @param nodeName The name of the node. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NodeHealthInner object if successful. + */ + public NodeHealthInner getNodeHealth(String nodeName, Integer eventsHealthStateFilter, Long timeout) { + return getNodeHealthWithServiceResponseAsync(nodeName, eventsHealthStateFilter, timeout).toBlocking().single().body(); + } + + /** + * Gets the health of a Service Fabric node. + * Gets the health of a Service Fabric node. Use EventsHealthStateFilter to filter the collection of health events reported on the node based on the health state. If the node that you specify by name does not exist in the health store, this returns an error. + * + * @param nodeName The name of the node. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNodeHealthAsync(String nodeName, Integer eventsHealthStateFilter, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNodeHealthWithServiceResponseAsync(nodeName, eventsHealthStateFilter, timeout), serviceCallback); + } + + /** + * Gets the health of a Service Fabric node. + * Gets the health of a Service Fabric node. Use EventsHealthStateFilter to filter the collection of health events reported on the node based on the health state. If the node that you specify by name does not exist in the health store, this returns an error. + * + * @param nodeName The name of the node. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NodeHealthInner object + */ + public Observable getNodeHealthAsync(String nodeName, Integer eventsHealthStateFilter, Long timeout) { + return getNodeHealthWithServiceResponseAsync(nodeName, eventsHealthStateFilter, timeout).map(new Func1, NodeHealthInner>() { + @Override + public NodeHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the health of a Service Fabric node. + * Gets the health of a Service Fabric node. Use EventsHealthStateFilter to filter the collection of health events reported on the node based on the health state. If the node that you specify by name does not exist in the health store, this returns an error. + * + * @param nodeName The name of the node. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NodeHealthInner object + */ + public Observable> getNodeHealthWithServiceResponseAsync(String nodeName, Integer eventsHealthStateFilter, Long timeout) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.getNodeHealth(nodeName, apiVersion, eventsHealthStateFilter, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getNodeHealthDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getNodeHealthDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the health of a Service Fabric node, by using the specified health policy. + * Gets the health of a Service Fabric node. Use EventsHealthStateFilter to filter the collection of health events reported on the node based on the health state. Use ClusterHealthPolicy in the POST body to override the health policies used to evaluate the health. If the node that you specify by name does not exist in the health store, this returns an error. + * + * @param nodeName The name of the node. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NodeHealthInner object if successful. + */ + public NodeHealthInner getNodeHealthUsingPolicy(String nodeName) { + return getNodeHealthUsingPolicyWithServiceResponseAsync(nodeName).toBlocking().single().body(); + } + + /** + * Gets the health of a Service Fabric node, by using the specified health policy. + * Gets the health of a Service Fabric node. Use EventsHealthStateFilter to filter the collection of health events reported on the node based on the health state. Use ClusterHealthPolicy in the POST body to override the health policies used to evaluate the health. If the node that you specify by name does not exist in the health store, this returns an error. + * + * @param nodeName The name of the node. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNodeHealthUsingPolicyAsync(String nodeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNodeHealthUsingPolicyWithServiceResponseAsync(nodeName), serviceCallback); + } + + /** + * Gets the health of a Service Fabric node, by using the specified health policy. + * Gets the health of a Service Fabric node. Use EventsHealthStateFilter to filter the collection of health events reported on the node based on the health state. Use ClusterHealthPolicy in the POST body to override the health policies used to evaluate the health. If the node that you specify by name does not exist in the health store, this returns an error. + * + * @param nodeName The name of the node. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NodeHealthInner object + */ + public Observable getNodeHealthUsingPolicyAsync(String nodeName) { + return getNodeHealthUsingPolicyWithServiceResponseAsync(nodeName).map(new Func1, NodeHealthInner>() { + @Override + public NodeHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the health of a Service Fabric node, by using the specified health policy. + * Gets the health of a Service Fabric node. Use EventsHealthStateFilter to filter the collection of health events reported on the node based on the health state. Use ClusterHealthPolicy in the POST body to override the health policies used to evaluate the health. If the node that you specify by name does not exist in the health store, this returns an error. + * + * @param nodeName The name of the node. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NodeHealthInner object + */ + public Observable> getNodeHealthUsingPolicyWithServiceResponseAsync(String nodeName) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Integer eventsHealthStateFilter = null; + final ClusterHealthPolicy clusterHealthPolicy = null; + final Long timeout = null; + return service.getNodeHealthUsingPolicy(nodeName, apiVersion, eventsHealthStateFilter, clusterHealthPolicy, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getNodeHealthUsingPolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the health of a Service Fabric node, by using the specified health policy. + * Gets the health of a Service Fabric node. Use EventsHealthStateFilter to filter the collection of health events reported on the node based on the health state. Use ClusterHealthPolicy in the POST body to override the health policies used to evaluate the health. If the node that you specify by name does not exist in the health store, this returns an error. + * + * @param nodeName The name of the node. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NodeHealthInner object if successful. + */ + public NodeHealthInner getNodeHealthUsingPolicy(String nodeName, Integer eventsHealthStateFilter, ClusterHealthPolicy clusterHealthPolicy, Long timeout) { + return getNodeHealthUsingPolicyWithServiceResponseAsync(nodeName, eventsHealthStateFilter, clusterHealthPolicy, timeout).toBlocking().single().body(); + } + + /** + * Gets the health of a Service Fabric node, by using the specified health policy. + * Gets the health of a Service Fabric node. Use EventsHealthStateFilter to filter the collection of health events reported on the node based on the health state. Use ClusterHealthPolicy in the POST body to override the health policies used to evaluate the health. If the node that you specify by name does not exist in the health store, this returns an error. + * + * @param nodeName The name of the node. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNodeHealthUsingPolicyAsync(String nodeName, Integer eventsHealthStateFilter, ClusterHealthPolicy clusterHealthPolicy, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNodeHealthUsingPolicyWithServiceResponseAsync(nodeName, eventsHealthStateFilter, clusterHealthPolicy, timeout), serviceCallback); + } + + /** + * Gets the health of a Service Fabric node, by using the specified health policy. + * Gets the health of a Service Fabric node. Use EventsHealthStateFilter to filter the collection of health events reported on the node based on the health state. Use ClusterHealthPolicy in the POST body to override the health policies used to evaluate the health. If the node that you specify by name does not exist in the health store, this returns an error. + * + * @param nodeName The name of the node. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NodeHealthInner object + */ + public Observable getNodeHealthUsingPolicyAsync(String nodeName, Integer eventsHealthStateFilter, ClusterHealthPolicy clusterHealthPolicy, Long timeout) { + return getNodeHealthUsingPolicyWithServiceResponseAsync(nodeName, eventsHealthStateFilter, clusterHealthPolicy, timeout).map(new Func1, NodeHealthInner>() { + @Override + public NodeHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the health of a Service Fabric node, by using the specified health policy. + * Gets the health of a Service Fabric node. Use EventsHealthStateFilter to filter the collection of health events reported on the node based on the health state. Use ClusterHealthPolicy in the POST body to override the health policies used to evaluate the health. If the node that you specify by name does not exist in the health store, this returns an error. + * + * @param nodeName The name of the node. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NodeHealthInner object + */ + public Observable> getNodeHealthUsingPolicyWithServiceResponseAsync(String nodeName, Integer eventsHealthStateFilter, ClusterHealthPolicy clusterHealthPolicy, Long timeout) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + Validator.validate(clusterHealthPolicy); + final String apiVersion = "6.0"; + return service.getNodeHealthUsingPolicy(nodeName, apiVersion, eventsHealthStateFilter, clusterHealthPolicy, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getNodeHealthUsingPolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getNodeHealthUsingPolicyDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 nodeName The name of the node. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void reportNodeHealth(String nodeName, HealthInformation healthInformation) { + reportNodeHealthWithServiceResponseAsync(nodeName, healthInformation).toBlocking().single().body(); + } + + /** + * 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 nodeName The name of the node. + * @param 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture reportNodeHealthAsync(String nodeName, HealthInformation healthInformation, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(reportNodeHealthWithServiceResponseAsync(nodeName, healthInformation), serviceCallback); + } + + /** + * 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 nodeName The name of the node. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable reportNodeHealthAsync(String nodeName, HealthInformation healthInformation) { + return reportNodeHealthWithServiceResponseAsync(nodeName, healthInformation).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 nodeName The name of the node. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> reportNodeHealthWithServiceResponseAsync(String nodeName, HealthInformation healthInformation) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (healthInformation == null) { + throw new IllegalArgumentException("Parameter healthInformation is required and cannot be null."); + } + Validator.validate(healthInformation); + final String apiVersion = "6.0"; + final Boolean immediate = null; + final Long timeout = null; + return service.reportNodeHealth(nodeName, apiVersion, healthInformation, immediate, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = reportNodeHealthDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 nodeName The name of the node. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void reportNodeHealth(String nodeName, HealthInformation healthInformation, Boolean immediate, Long timeout) { + reportNodeHealthWithServiceResponseAsync(nodeName, healthInformation, immediate, timeout).toBlocking().single().body(); + } + + /** + * 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 nodeName The name of the node. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture reportNodeHealthAsync(String nodeName, HealthInformation healthInformation, Boolean immediate, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(reportNodeHealthWithServiceResponseAsync(nodeName, healthInformation, immediate, timeout), serviceCallback); + } + + /** + * 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 nodeName The name of the node. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable reportNodeHealthAsync(String nodeName, HealthInformation healthInformation, Boolean immediate, Long timeout) { + return reportNodeHealthWithServiceResponseAsync(nodeName, healthInformation, immediate, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 nodeName The name of the node. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> reportNodeHealthWithServiceResponseAsync(String nodeName, HealthInformation healthInformation, Boolean immediate, Long timeout) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (healthInformation == null) { + throw new IllegalArgumentException("Parameter healthInformation is required and cannot be null."); + } + Validator.validate(healthInformation); + final String apiVersion = "6.0"; + return service.reportNodeHealth(nodeName, apiVersion, healthInformation, immediate, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = reportNodeHealthDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse reportNodeHealthDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the load information of a Service Fabric node. + * Retrieves the load information of a Service Fabric node for all the metrics that have load or capacity defined. + * + * @param nodeName The name of the node. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NodeLoadInfoInner object if successful. + */ + public NodeLoadInfoInner getNodeLoadInfo(String nodeName) { + return getNodeLoadInfoWithServiceResponseAsync(nodeName).toBlocking().single().body(); + } + + /** + * Gets the load information of a Service Fabric node. + * Retrieves the load information of a Service Fabric node for all the metrics that have load or capacity defined. + * + * @param nodeName The name of the node. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNodeLoadInfoAsync(String nodeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNodeLoadInfoWithServiceResponseAsync(nodeName), serviceCallback); + } + + /** + * Gets the load information of a Service Fabric node. + * Retrieves the load information of a Service Fabric node for all the metrics that have load or capacity defined. + * + * @param nodeName The name of the node. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NodeLoadInfoInner object + */ + public Observable getNodeLoadInfoAsync(String nodeName) { + return getNodeLoadInfoWithServiceResponseAsync(nodeName).map(new Func1, NodeLoadInfoInner>() { + @Override + public NodeLoadInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the load information of a Service Fabric node. + * Retrieves the load information of a Service Fabric node for all the metrics that have load or capacity defined. + * + * @param nodeName The name of the node. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NodeLoadInfoInner object + */ + public Observable> getNodeLoadInfoWithServiceResponseAsync(String nodeName) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + return service.getNodeLoadInfo(nodeName, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getNodeLoadInfoDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the load information of a Service Fabric node. + * Retrieves the load information of a Service Fabric node for all the metrics that have load or capacity defined. + * + * @param nodeName The name of the node. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NodeLoadInfoInner object if successful. + */ + public NodeLoadInfoInner getNodeLoadInfo(String nodeName, Long timeout) { + return getNodeLoadInfoWithServiceResponseAsync(nodeName, timeout).toBlocking().single().body(); + } + + /** + * Gets the load information of a Service Fabric node. + * Retrieves the load information of a Service Fabric node for all the metrics that have load or capacity defined. + * + * @param nodeName The name of the node. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNodeLoadInfoAsync(String nodeName, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNodeLoadInfoWithServiceResponseAsync(nodeName, timeout), serviceCallback); + } + + /** + * Gets the load information of a Service Fabric node. + * Retrieves the load information of a Service Fabric node for all the metrics that have load or capacity defined. + * + * @param nodeName The name of the node. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NodeLoadInfoInner object + */ + public Observable getNodeLoadInfoAsync(String nodeName, Long timeout) { + return getNodeLoadInfoWithServiceResponseAsync(nodeName, timeout).map(new Func1, NodeLoadInfoInner>() { + @Override + public NodeLoadInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the load information of a Service Fabric node. + * Retrieves the load information of a Service Fabric node for all the metrics that have load or capacity defined. + * + * @param nodeName The name of the node. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NodeLoadInfoInner object + */ + public Observable> getNodeLoadInfoWithServiceResponseAsync(String nodeName, Long timeout) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.getNodeLoadInfo(nodeName, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getNodeLoadInfoDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getNodeLoadInfoDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Deactivate a Service Fabric cluster node with the specified deactivation intent. + * Deactivate a Service Fabric cluster node with the specified deactivation intent. Once the deactivation is in progress, the deactivation intent can be increased, but not decreased (for example, a node that is deactivated with the Pause intent can be deactivated further with Restart, but not the other way around. Nodes may be reactivated using the Activate a node operation any time after they are deactivated. If the deactivation is not complete, this will cancel the deactivation. A node that goes down and comes back up while deactivated will still need to be reactivated before services will be placed on that node. + * + * @param nodeName The name of the node. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void disableNode(String nodeName) { + disableNodeWithServiceResponseAsync(nodeName).toBlocking().single().body(); + } + + /** + * Deactivate a Service Fabric cluster node with the specified deactivation intent. + * Deactivate a Service Fabric cluster node with the specified deactivation intent. Once the deactivation is in progress, the deactivation intent can be increased, but not decreased (for example, a node that is deactivated with the Pause intent can be deactivated further with Restart, but not the other way around. Nodes may be reactivated using the Activate a node operation any time after they are deactivated. If the deactivation is not complete, this will cancel the deactivation. A node that goes down and comes back up while deactivated will still need to be reactivated before services will be placed on that node. + * + * @param nodeName The name of the node. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture disableNodeAsync(String nodeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(disableNodeWithServiceResponseAsync(nodeName), serviceCallback); + } + + /** + * Deactivate a Service Fabric cluster node with the specified deactivation intent. + * Deactivate a Service Fabric cluster node with the specified deactivation intent. Once the deactivation is in progress, the deactivation intent can be increased, but not decreased (for example, a node that is deactivated with the Pause intent can be deactivated further with Restart, but not the other way around. Nodes may be reactivated using the Activate a node operation any time after they are deactivated. If the deactivation is not complete, this will cancel the deactivation. A node that goes down and comes back up while deactivated will still need to be reactivated before services will be placed on that node. + * + * @param nodeName The name of the node. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable disableNodeAsync(String nodeName) { + return disableNodeWithServiceResponseAsync(nodeName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deactivate a Service Fabric cluster node with the specified deactivation intent. + * Deactivate a Service Fabric cluster node with the specified deactivation intent. Once the deactivation is in progress, the deactivation intent can be increased, but not decreased (for example, a node that is deactivated with the Pause intent can be deactivated further with Restart, but not the other way around. Nodes may be reactivated using the Activate a node operation any time after they are deactivated. If the deactivation is not complete, this will cancel the deactivation. A node that goes down and comes back up while deactivated will still need to be reactivated before services will be placed on that node. + * + * @param nodeName The name of the node. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> disableNodeWithServiceResponseAsync(String nodeName) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + final DeactivationIntent deactivationIntent = null; + DeactivationIntentDescription deactivationIntentDescription = new DeactivationIntentDescription(); + deactivationIntentDescription.withDeactivationIntent(null); + return service.disableNode(nodeName, apiVersion, timeout, this.acceptLanguage(), deactivationIntentDescription, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = disableNodeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Deactivate a Service Fabric cluster node with the specified deactivation intent. + * Deactivate a Service Fabric cluster node with the specified deactivation intent. Once the deactivation is in progress, the deactivation intent can be increased, but not decreased (for example, a node that is deactivated with the Pause intent can be deactivated further with Restart, but not the other way around. Nodes may be reactivated using the Activate a node operation any time after they are deactivated. If the deactivation is not complete, this will cancel the deactivation. A node that goes down and comes back up while deactivated will still need to be reactivated before services will be placed on that node. + * + * @param nodeName The name of the node. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param deactivationIntent Describes the intent or reason for deactivating the node. The possible values are following. + . Possible values include: 'Pause', 'Restart', 'RemoveData' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void disableNode(String nodeName, Long timeout, DeactivationIntent deactivationIntent) { + disableNodeWithServiceResponseAsync(nodeName, timeout, deactivationIntent).toBlocking().single().body(); + } + + /** + * Deactivate a Service Fabric cluster node with the specified deactivation intent. + * Deactivate a Service Fabric cluster node with the specified deactivation intent. Once the deactivation is in progress, the deactivation intent can be increased, but not decreased (for example, a node that is deactivated with the Pause intent can be deactivated further with Restart, but not the other way around. Nodes may be reactivated using the Activate a node operation any time after they are deactivated. If the deactivation is not complete, this will cancel the deactivation. A node that goes down and comes back up while deactivated will still need to be reactivated before services will be placed on that node. + * + * @param nodeName The name of the node. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param deactivationIntent Describes the intent or reason for deactivating the node. The possible values are following. + . Possible values include: 'Pause', 'Restart', 'RemoveData' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture disableNodeAsync(String nodeName, Long timeout, DeactivationIntent deactivationIntent, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(disableNodeWithServiceResponseAsync(nodeName, timeout, deactivationIntent), serviceCallback); + } + + /** + * Deactivate a Service Fabric cluster node with the specified deactivation intent. + * Deactivate a Service Fabric cluster node with the specified deactivation intent. Once the deactivation is in progress, the deactivation intent can be increased, but not decreased (for example, a node that is deactivated with the Pause intent can be deactivated further with Restart, but not the other way around. Nodes may be reactivated using the Activate a node operation any time after they are deactivated. If the deactivation is not complete, this will cancel the deactivation. A node that goes down and comes back up while deactivated will still need to be reactivated before services will be placed on that node. + * + * @param nodeName The name of the node. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param deactivationIntent Describes the intent or reason for deactivating the node. The possible values are following. + . Possible values include: 'Pause', 'Restart', 'RemoveData' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable disableNodeAsync(String nodeName, Long timeout, DeactivationIntent deactivationIntent) { + return disableNodeWithServiceResponseAsync(nodeName, timeout, deactivationIntent).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deactivate a Service Fabric cluster node with the specified deactivation intent. + * Deactivate a Service Fabric cluster node with the specified deactivation intent. Once the deactivation is in progress, the deactivation intent can be increased, but not decreased (for example, a node that is deactivated with the Pause intent can be deactivated further with Restart, but not the other way around. Nodes may be reactivated using the Activate a node operation any time after they are deactivated. If the deactivation is not complete, this will cancel the deactivation. A node that goes down and comes back up while deactivated will still need to be reactivated before services will be placed on that node. + * + * @param nodeName The name of the node. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param deactivationIntent Describes the intent or reason for deactivating the node. The possible values are following. + . Possible values include: 'Pause', 'Restart', 'RemoveData' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> disableNodeWithServiceResponseAsync(String nodeName, Long timeout, DeactivationIntent deactivationIntent) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + final String apiVersion = "6.0"; + DeactivationIntentDescription deactivationIntentDescription = new DeactivationIntentDescription(); + deactivationIntentDescription.withDeactivationIntent(deactivationIntent); + return service.disableNode(nodeName, apiVersion, timeout, this.acceptLanguage(), deactivationIntentDescription, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = disableNodeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse disableNodeDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Activate a Service Fabric cluster node that is currently deactivated. + * Activates a Service Fabric cluster node that is currently deactivated. Once activated, the node will again become a viable target for placing new replicas, and any deactivated replicas remaining on the node will be reactivated. + * + * @param nodeName The name of the node. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void enableNode(String nodeName) { + enableNodeWithServiceResponseAsync(nodeName).toBlocking().single().body(); + } + + /** + * Activate a Service Fabric cluster node that is currently deactivated. + * Activates a Service Fabric cluster node that is currently deactivated. Once activated, the node will again become a viable target for placing new replicas, and any deactivated replicas remaining on the node will be reactivated. + * + * @param nodeName The name of the node. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture enableNodeAsync(String nodeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(enableNodeWithServiceResponseAsync(nodeName), serviceCallback); + } + + /** + * Activate a Service Fabric cluster node that is currently deactivated. + * Activates a Service Fabric cluster node that is currently deactivated. Once activated, the node will again become a viable target for placing new replicas, and any deactivated replicas remaining on the node will be reactivated. + * + * @param nodeName The name of the node. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable enableNodeAsync(String nodeName) { + return enableNodeWithServiceResponseAsync(nodeName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Activate a Service Fabric cluster node that is currently deactivated. + * Activates a Service Fabric cluster node that is currently deactivated. Once activated, the node will again become a viable target for placing new replicas, and any deactivated replicas remaining on the node will be reactivated. + * + * @param nodeName The name of the node. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> enableNodeWithServiceResponseAsync(String nodeName) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + return service.enableNode(nodeName, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = enableNodeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Activate a Service Fabric cluster node that is currently deactivated. + * Activates a Service Fabric cluster node that is currently deactivated. Once activated, the node will again become a viable target for placing new replicas, and any deactivated replicas remaining on the node will be reactivated. + * + * @param nodeName The name of the node. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void enableNode(String nodeName, Long timeout) { + enableNodeWithServiceResponseAsync(nodeName, timeout).toBlocking().single().body(); + } + + /** + * Activate a Service Fabric cluster node that is currently deactivated. + * Activates a Service Fabric cluster node that is currently deactivated. Once activated, the node will again become a viable target for placing new replicas, and any deactivated replicas remaining on the node will be reactivated. + * + * @param nodeName The name of the node. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture enableNodeAsync(String nodeName, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(enableNodeWithServiceResponseAsync(nodeName, timeout), serviceCallback); + } + + /** + * Activate a Service Fabric cluster node that is currently deactivated. + * Activates a Service Fabric cluster node that is currently deactivated. Once activated, the node will again become a viable target for placing new replicas, and any deactivated replicas remaining on the node will be reactivated. + * + * @param nodeName The name of the node. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable enableNodeAsync(String nodeName, Long timeout) { + return enableNodeWithServiceResponseAsync(nodeName, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Activate a Service Fabric cluster node that is currently deactivated. + * Activates a Service Fabric cluster node that is currently deactivated. Once activated, the node will again become a viable target for placing new replicas, and any deactivated replicas remaining on the node will be reactivated. + * + * @param nodeName The name of the node. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> enableNodeWithServiceResponseAsync(String nodeName, Long timeout) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.enableNode(nodeName, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = enableNodeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse enableNodeDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Notifies Service Fabric that the persisted state on a node has been permanently removed or lost. + * This implies that it is not possible to recover the persisted state of that node. This generally happens if a hard disk has been wiped clean, or if a hard disk crashes. The node has to be down for this operation to be successful. This operation lets Service Fabric know that the replicas on that node no longer exist, and that Service Fabric should stop waiting for those replicas to come back up. Do not run this cmdlet if the state on the node has not been removed and the node can come back up with its state intact. + * + * @param nodeName The name of the node. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void removeNodeState(String nodeName) { + removeNodeStateWithServiceResponseAsync(nodeName).toBlocking().single().body(); + } + + /** + * Notifies Service Fabric that the persisted state on a node has been permanently removed or lost. + * This implies that it is not possible to recover the persisted state of that node. This generally happens if a hard disk has been wiped clean, or if a hard disk crashes. The node has to be down for this operation to be successful. This operation lets Service Fabric know that the replicas on that node no longer exist, and that Service Fabric should stop waiting for those replicas to come back up. Do not run this cmdlet if the state on the node has not been removed and the node can come back up with its state intact. + * + * @param nodeName The name of the node. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture removeNodeStateAsync(String nodeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(removeNodeStateWithServiceResponseAsync(nodeName), serviceCallback); + } + + /** + * Notifies Service Fabric that the persisted state on a node has been permanently removed or lost. + * This implies that it is not possible to recover the persisted state of that node. This generally happens if a hard disk has been wiped clean, or if a hard disk crashes. The node has to be down for this operation to be successful. This operation lets Service Fabric know that the replicas on that node no longer exist, and that Service Fabric should stop waiting for those replicas to come back up. Do not run this cmdlet if the state on the node has not been removed and the node can come back up with its state intact. + * + * @param nodeName The name of the node. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable removeNodeStateAsync(String nodeName) { + return removeNodeStateWithServiceResponseAsync(nodeName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Notifies Service Fabric that the persisted state on a node has been permanently removed or lost. + * This implies that it is not possible to recover the persisted state of that node. This generally happens if a hard disk has been wiped clean, or if a hard disk crashes. The node has to be down for this operation to be successful. This operation lets Service Fabric know that the replicas on that node no longer exist, and that Service Fabric should stop waiting for those replicas to come back up. Do not run this cmdlet if the state on the node has not been removed and the node can come back up with its state intact. + * + * @param nodeName The name of the node. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> removeNodeStateWithServiceResponseAsync(String nodeName) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + return service.removeNodeState(nodeName, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = removeNodeStateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Notifies Service Fabric that the persisted state on a node has been permanently removed or lost. + * This implies that it is not possible to recover the persisted state of that node. This generally happens if a hard disk has been wiped clean, or if a hard disk crashes. The node has to be down for this operation to be successful. This operation lets Service Fabric know that the replicas on that node no longer exist, and that Service Fabric should stop waiting for those replicas to come back up. Do not run this cmdlet if the state on the node has not been removed and the node can come back up with its state intact. + * + * @param nodeName The name of the node. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void removeNodeState(String nodeName, Long timeout) { + removeNodeStateWithServiceResponseAsync(nodeName, timeout).toBlocking().single().body(); + } + + /** + * Notifies Service Fabric that the persisted state on a node has been permanently removed or lost. + * This implies that it is not possible to recover the persisted state of that node. This generally happens if a hard disk has been wiped clean, or if a hard disk crashes. The node has to be down for this operation to be successful. This operation lets Service Fabric know that the replicas on that node no longer exist, and that Service Fabric should stop waiting for those replicas to come back up. Do not run this cmdlet if the state on the node has not been removed and the node can come back up with its state intact. + * + * @param nodeName The name of the node. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture removeNodeStateAsync(String nodeName, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(removeNodeStateWithServiceResponseAsync(nodeName, timeout), serviceCallback); + } + + /** + * Notifies Service Fabric that the persisted state on a node has been permanently removed or lost. + * This implies that it is not possible to recover the persisted state of that node. This generally happens if a hard disk has been wiped clean, or if a hard disk crashes. The node has to be down for this operation to be successful. This operation lets Service Fabric know that the replicas on that node no longer exist, and that Service Fabric should stop waiting for those replicas to come back up. Do not run this cmdlet if the state on the node has not been removed and the node can come back up with its state intact. + * + * @param nodeName The name of the node. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable removeNodeStateAsync(String nodeName, Long timeout) { + return removeNodeStateWithServiceResponseAsync(nodeName, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Notifies Service Fabric that the persisted state on a node has been permanently removed or lost. + * This implies that it is not possible to recover the persisted state of that node. This generally happens if a hard disk has been wiped clean, or if a hard disk crashes. The node has to be down for this operation to be successful. This operation lets Service Fabric know that the replicas on that node no longer exist, and that Service Fabric should stop waiting for those replicas to come back up. Do not run this cmdlet if the state on the node has not been removed and the node can come back up with its state intact. + * + * @param nodeName The name of the node. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> removeNodeStateWithServiceResponseAsync(String nodeName, Long timeout) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.removeNodeState(nodeName, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = removeNodeStateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse removeNodeStateDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Restarts a Service Fabric cluster node. + * Restarts a Service Fabric cluster node that is already started. + * + * @param nodeName The name of the node. + * @param restartNodeDescription The instance of the node to be restarted and a flag indicating the need to take dump of the fabric process. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void restartNode(String nodeName, RestartNodeDescription restartNodeDescription) { + restartNodeWithServiceResponseAsync(nodeName, restartNodeDescription).toBlocking().single().body(); + } + + /** + * Restarts a Service Fabric cluster node. + * Restarts a Service Fabric cluster node that is already started. + * + * @param nodeName The name of the node. + * @param restartNodeDescription The instance of the node to be restarted and a flag indicating the need to take dump of the fabric process. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture restartNodeAsync(String nodeName, RestartNodeDescription restartNodeDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(restartNodeWithServiceResponseAsync(nodeName, restartNodeDescription), serviceCallback); + } + + /** + * Restarts a Service Fabric cluster node. + * Restarts a Service Fabric cluster node that is already started. + * + * @param nodeName The name of the node. + * @param restartNodeDescription The instance of the node to be restarted and a flag indicating the need to take dump of the fabric process. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable restartNodeAsync(String nodeName, RestartNodeDescription restartNodeDescription) { + return restartNodeWithServiceResponseAsync(nodeName, restartNodeDescription).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Restarts a Service Fabric cluster node. + * Restarts a Service Fabric cluster node that is already started. + * + * @param nodeName The name of the node. + * @param restartNodeDescription The instance of the node to be restarted and a flag indicating the need to take dump of the fabric process. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> restartNodeWithServiceResponseAsync(String nodeName, RestartNodeDescription restartNodeDescription) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (restartNodeDescription == null) { + throw new IllegalArgumentException("Parameter restartNodeDescription is required and cannot be null."); + } + Validator.validate(restartNodeDescription); + final String apiVersion = "6.0"; + final Long timeout = null; + return service.restartNode(nodeName, apiVersion, restartNodeDescription, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = restartNodeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Restarts a Service Fabric cluster node. + * Restarts a Service Fabric cluster node that is already started. + * + * @param nodeName The name of the node. + * @param restartNodeDescription The instance of the node to be restarted and a flag indicating the need to take dump of the fabric process. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void restartNode(String nodeName, RestartNodeDescription restartNodeDescription, Long timeout) { + restartNodeWithServiceResponseAsync(nodeName, restartNodeDescription, timeout).toBlocking().single().body(); + } + + /** + * Restarts a Service Fabric cluster node. + * Restarts a Service Fabric cluster node that is already started. + * + * @param nodeName The name of the node. + * @param restartNodeDescription The instance of the node to be restarted and a flag indicating the need to take dump of the fabric process. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture restartNodeAsync(String nodeName, RestartNodeDescription restartNodeDescription, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(restartNodeWithServiceResponseAsync(nodeName, restartNodeDescription, timeout), serviceCallback); + } + + /** + * Restarts a Service Fabric cluster node. + * Restarts a Service Fabric cluster node that is already started. + * + * @param nodeName The name of the node. + * @param restartNodeDescription The instance of the node to be restarted and a flag indicating the need to take dump of the fabric process. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable restartNodeAsync(String nodeName, RestartNodeDescription restartNodeDescription, Long timeout) { + return restartNodeWithServiceResponseAsync(nodeName, restartNodeDescription, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Restarts a Service Fabric cluster node. + * Restarts a Service Fabric cluster node that is already started. + * + * @param nodeName The name of the node. + * @param restartNodeDescription The instance of the node to be restarted and a flag indicating the need to take dump of the fabric process. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> restartNodeWithServiceResponseAsync(String nodeName, RestartNodeDescription restartNodeDescription, Long timeout) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (restartNodeDescription == null) { + throw new IllegalArgumentException("Parameter restartNodeDescription is required and cannot be null."); + } + Validator.validate(restartNodeDescription); + final String apiVersion = "6.0"; + return service.restartNode(nodeName, apiVersion, restartNodeDescription, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = restartNodeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse restartNodeDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedApplicationTypeInfoListInner object if successful. + */ + public PagedApplicationTypeInfoListInner getApplicationTypeInfoList() { + return getApplicationTypeInfoListWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getApplicationTypeInfoListAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getApplicationTypeInfoListWithServiceResponseAsync(), serviceCallback); + } + + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedApplicationTypeInfoListInner object + */ + public Observable getApplicationTypeInfoListAsync() { + return getApplicationTypeInfoListWithServiceResponseAsync().map(new Func1, PagedApplicationTypeInfoListInner>() { + @Override + public PagedApplicationTypeInfoListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedApplicationTypeInfoListInner object + */ + public Observable> getApplicationTypeInfoListWithServiceResponseAsync() { + final String apiVersion = "6.0"; + final Integer applicationTypeDefinitionKindFilter = null; + final Boolean excludeApplicationParameters = null; + final String continuationToken = null; + final Long maxResults = null; + final Long timeout = null; + return service.getApplicationTypeInfoList(apiVersion, applicationTypeDefinitionKindFilter, excludeApplicationParameters, continuationToken, maxResults, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getApplicationTypeInfoListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 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 excludeApplicationParameters The flag that specifies whether application parameters will be excluded from the result. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedApplicationTypeInfoListInner object if successful. + */ + public PagedApplicationTypeInfoListInner getApplicationTypeInfoList(Integer applicationTypeDefinitionKindFilter, Boolean excludeApplicationParameters, String continuationToken, Long maxResults, Long timeout) { + return getApplicationTypeInfoListWithServiceResponseAsync(applicationTypeDefinitionKindFilter, excludeApplicationParameters, continuationToken, maxResults, timeout).toBlocking().single().body(); + } + + /** + * 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 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 excludeApplicationParameters The flag that specifies whether application parameters will be excluded from the result. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getApplicationTypeInfoListAsync(Integer applicationTypeDefinitionKindFilter, Boolean excludeApplicationParameters, String continuationToken, Long maxResults, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getApplicationTypeInfoListWithServiceResponseAsync(applicationTypeDefinitionKindFilter, excludeApplicationParameters, continuationToken, maxResults, timeout), serviceCallback); + } + + /** + * 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 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 excludeApplicationParameters The flag that specifies whether application parameters will be excluded from the result. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedApplicationTypeInfoListInner object + */ + public Observable getApplicationTypeInfoListAsync(Integer applicationTypeDefinitionKindFilter, Boolean excludeApplicationParameters, String continuationToken, Long maxResults, Long timeout) { + return getApplicationTypeInfoListWithServiceResponseAsync(applicationTypeDefinitionKindFilter, excludeApplicationParameters, continuationToken, maxResults, timeout).map(new Func1, PagedApplicationTypeInfoListInner>() { + @Override + public PagedApplicationTypeInfoListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 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 excludeApplicationParameters The flag that specifies whether application parameters will be excluded from the result. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedApplicationTypeInfoListInner object + */ + public Observable> getApplicationTypeInfoListWithServiceResponseAsync(Integer applicationTypeDefinitionKindFilter, Boolean excludeApplicationParameters, String continuationToken, Long maxResults, Long timeout) { + final String apiVersion = "6.0"; + return service.getApplicationTypeInfoList(apiVersion, applicationTypeDefinitionKindFilter, excludeApplicationParameters, continuationToken, maxResults, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getApplicationTypeInfoListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getApplicationTypeInfoListDelegate(Response response) throws FabricErrorException, IOException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 applicationTypeName The name of the application type. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedApplicationTypeInfoListInner object if successful. + */ + public PagedApplicationTypeInfoListInner getApplicationTypeInfoListByName(String applicationTypeName) { + return getApplicationTypeInfoListByNameWithServiceResponseAsync(applicationTypeName).toBlocking().single().body(); + } + + /** + * 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 applicationTypeName The name of the application type. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getApplicationTypeInfoListByNameAsync(String applicationTypeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getApplicationTypeInfoListByNameWithServiceResponseAsync(applicationTypeName), serviceCallback); + } + + /** + * 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 applicationTypeName The name of the application type. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedApplicationTypeInfoListInner object + */ + public Observable getApplicationTypeInfoListByNameAsync(String applicationTypeName) { + return getApplicationTypeInfoListByNameWithServiceResponseAsync(applicationTypeName).map(new Func1, PagedApplicationTypeInfoListInner>() { + @Override + public PagedApplicationTypeInfoListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 applicationTypeName The name of the application type. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedApplicationTypeInfoListInner object + */ + public Observable> getApplicationTypeInfoListByNameWithServiceResponseAsync(String applicationTypeName) { + if (applicationTypeName == null) { + throw new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null."); + } + final String apiVersion = "6.0"; + final String applicationTypeVersion = null; + final Boolean excludeApplicationParameters = null; + final String continuationToken = null; + final Long maxResults = null; + final Long timeout = null; + return service.getApplicationTypeInfoListByName(applicationTypeName, apiVersion, applicationTypeVersion, excludeApplicationParameters, continuationToken, maxResults, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getApplicationTypeInfoListByNameDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 applicationTypeName The name of the application type. + * @param applicationTypeVersion The version of the application type. + * @param excludeApplicationParameters The flag that specifies whether application parameters will be excluded from the result. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedApplicationTypeInfoListInner object if successful. + */ + public PagedApplicationTypeInfoListInner getApplicationTypeInfoListByName(String applicationTypeName, String applicationTypeVersion, Boolean excludeApplicationParameters, String continuationToken, Long maxResults, Long timeout) { + return getApplicationTypeInfoListByNameWithServiceResponseAsync(applicationTypeName, applicationTypeVersion, excludeApplicationParameters, continuationToken, maxResults, timeout).toBlocking().single().body(); + } + + /** + * 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 applicationTypeName The name of the application type. + * @param applicationTypeVersion The version of the application type. + * @param excludeApplicationParameters The flag that specifies whether application parameters will be excluded from the result. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getApplicationTypeInfoListByNameAsync(String applicationTypeName, String applicationTypeVersion, Boolean excludeApplicationParameters, String continuationToken, Long maxResults, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getApplicationTypeInfoListByNameWithServiceResponseAsync(applicationTypeName, applicationTypeVersion, excludeApplicationParameters, continuationToken, maxResults, timeout), serviceCallback); + } + + /** + * 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 applicationTypeName The name of the application type. + * @param applicationTypeVersion The version of the application type. + * @param excludeApplicationParameters The flag that specifies whether application parameters will be excluded from the result. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedApplicationTypeInfoListInner object + */ + public Observable getApplicationTypeInfoListByNameAsync(String applicationTypeName, String applicationTypeVersion, Boolean excludeApplicationParameters, String continuationToken, Long maxResults, Long timeout) { + return getApplicationTypeInfoListByNameWithServiceResponseAsync(applicationTypeName, applicationTypeVersion, excludeApplicationParameters, continuationToken, maxResults, timeout).map(new Func1, PagedApplicationTypeInfoListInner>() { + @Override + public PagedApplicationTypeInfoListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 applicationTypeName The name of the application type. + * @param applicationTypeVersion The version of the application type. + * @param excludeApplicationParameters The flag that specifies whether application parameters will be excluded from the result. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedApplicationTypeInfoListInner object + */ + public Observable> getApplicationTypeInfoListByNameWithServiceResponseAsync(String applicationTypeName, String applicationTypeVersion, Boolean excludeApplicationParameters, String continuationToken, Long maxResults, Long timeout) { + if (applicationTypeName == null) { + throw new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.getApplicationTypeInfoListByName(applicationTypeName, apiVersion, applicationTypeVersion, excludeApplicationParameters, continuationToken, maxResults, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getApplicationTypeInfoListByNameDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getApplicationTypeInfoListByNameDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 provisionApplicationTypeDescriptionBaseRequiredBodyParam The base type of provision application type description which supports either image store-based provision or external store-based provision. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void provisionApplicationType(ProvisionApplicationTypeDescriptionBase provisionApplicationTypeDescriptionBaseRequiredBodyParam) { + provisionApplicationTypeWithServiceResponseAsync(provisionApplicationTypeDescriptionBaseRequiredBodyParam).toBlocking().single().body(); + } + + /** + * 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 provisionApplicationTypeDescriptionBaseRequiredBodyParam The base type of provision application type description which supports either image store-based provision or external store-based provision. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture provisionApplicationTypeAsync(ProvisionApplicationTypeDescriptionBase provisionApplicationTypeDescriptionBaseRequiredBodyParam, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(provisionApplicationTypeWithServiceResponseAsync(provisionApplicationTypeDescriptionBaseRequiredBodyParam), serviceCallback); + } + + /** + * 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 provisionApplicationTypeDescriptionBaseRequiredBodyParam The base type of provision application type description which supports either image store-based provision or external store-based provision. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable provisionApplicationTypeAsync(ProvisionApplicationTypeDescriptionBase provisionApplicationTypeDescriptionBaseRequiredBodyParam) { + return provisionApplicationTypeWithServiceResponseAsync(provisionApplicationTypeDescriptionBaseRequiredBodyParam).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 provisionApplicationTypeDescriptionBaseRequiredBodyParam The base type of provision application type description which supports either image store-based provision or external store-based provision. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> provisionApplicationTypeWithServiceResponseAsync(ProvisionApplicationTypeDescriptionBase provisionApplicationTypeDescriptionBaseRequiredBodyParam) { + if (provisionApplicationTypeDescriptionBaseRequiredBodyParam == null) { + throw new IllegalArgumentException("Parameter provisionApplicationTypeDescriptionBaseRequiredBodyParam is required and cannot be null."); + } + Validator.validate(provisionApplicationTypeDescriptionBaseRequiredBodyParam); + final String apiVersion = "6.2"; + final Long timeout = null; + return service.provisionApplicationType(apiVersion, provisionApplicationTypeDescriptionBaseRequiredBodyParam, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = provisionApplicationTypeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 provisionApplicationTypeDescriptionBaseRequiredBodyParam The base type of provision application type description which supports either image store-based provision or external store-based provision. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void provisionApplicationType(ProvisionApplicationTypeDescriptionBase provisionApplicationTypeDescriptionBaseRequiredBodyParam, Long timeout) { + provisionApplicationTypeWithServiceResponseAsync(provisionApplicationTypeDescriptionBaseRequiredBodyParam, timeout).toBlocking().single().body(); + } + + /** + * 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 provisionApplicationTypeDescriptionBaseRequiredBodyParam The base type of provision application type description which supports either image store-based provision or external store-based provision. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture provisionApplicationTypeAsync(ProvisionApplicationTypeDescriptionBase provisionApplicationTypeDescriptionBaseRequiredBodyParam, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(provisionApplicationTypeWithServiceResponseAsync(provisionApplicationTypeDescriptionBaseRequiredBodyParam, timeout), serviceCallback); + } + + /** + * 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 provisionApplicationTypeDescriptionBaseRequiredBodyParam The base type of provision application type description which supports either image store-based provision or external store-based provision. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable provisionApplicationTypeAsync(ProvisionApplicationTypeDescriptionBase provisionApplicationTypeDescriptionBaseRequiredBodyParam, Long timeout) { + return provisionApplicationTypeWithServiceResponseAsync(provisionApplicationTypeDescriptionBaseRequiredBodyParam, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 provisionApplicationTypeDescriptionBaseRequiredBodyParam The base type of provision application type description which supports either image store-based provision or external store-based provision. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> provisionApplicationTypeWithServiceResponseAsync(ProvisionApplicationTypeDescriptionBase provisionApplicationTypeDescriptionBaseRequiredBodyParam, Long timeout) { + if (provisionApplicationTypeDescriptionBaseRequiredBodyParam == null) { + throw new IllegalArgumentException("Parameter provisionApplicationTypeDescriptionBaseRequiredBodyParam is required and cannot be null."); + } + Validator.validate(provisionApplicationTypeDescriptionBaseRequiredBodyParam); + final String apiVersion = "6.2"; + return service.provisionApplicationType(apiVersion, provisionApplicationTypeDescriptionBaseRequiredBodyParam, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = provisionApplicationTypeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse provisionApplicationTypeDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 applicationTypeName The name of the application type. + * @param unprovisionApplicationTypeDescriptionInfo The relative path for the application package in the image store specified during the prior copy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void unprovisionApplicationType(String applicationTypeName, UnprovisionApplicationTypeDescriptionInfo unprovisionApplicationTypeDescriptionInfo) { + unprovisionApplicationTypeWithServiceResponseAsync(applicationTypeName, unprovisionApplicationTypeDescriptionInfo).toBlocking().single().body(); + } + + /** + * 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 applicationTypeName The name of the application type. + * @param unprovisionApplicationTypeDescriptionInfo The relative path for the application package in the image store specified during the prior copy operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture unprovisionApplicationTypeAsync(String applicationTypeName, UnprovisionApplicationTypeDescriptionInfo unprovisionApplicationTypeDescriptionInfo, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(unprovisionApplicationTypeWithServiceResponseAsync(applicationTypeName, unprovisionApplicationTypeDescriptionInfo), serviceCallback); + } + + /** + * 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 applicationTypeName The name of the application type. + * @param unprovisionApplicationTypeDescriptionInfo The relative path for the application package in the image store specified during the prior copy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable unprovisionApplicationTypeAsync(String applicationTypeName, UnprovisionApplicationTypeDescriptionInfo unprovisionApplicationTypeDescriptionInfo) { + return unprovisionApplicationTypeWithServiceResponseAsync(applicationTypeName, unprovisionApplicationTypeDescriptionInfo).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 applicationTypeName The name of the application type. + * @param unprovisionApplicationTypeDescriptionInfo The relative path for the application package in the image store specified during the prior copy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> unprovisionApplicationTypeWithServiceResponseAsync(String applicationTypeName, UnprovisionApplicationTypeDescriptionInfo unprovisionApplicationTypeDescriptionInfo) { + if (applicationTypeName == null) { + throw new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null."); + } + if (unprovisionApplicationTypeDescriptionInfo == null) { + throw new IllegalArgumentException("Parameter unprovisionApplicationTypeDescriptionInfo is required and cannot be null."); + } + Validator.validate(unprovisionApplicationTypeDescriptionInfo); + final String apiVersion = "6.0"; + final Long timeout = null; + return service.unprovisionApplicationType(applicationTypeName, apiVersion, unprovisionApplicationTypeDescriptionInfo, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = unprovisionApplicationTypeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 applicationTypeName The name of the application type. + * @param unprovisionApplicationTypeDescriptionInfo The relative path for the application package in the image store specified during the prior copy operation. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void unprovisionApplicationType(String applicationTypeName, UnprovisionApplicationTypeDescriptionInfo unprovisionApplicationTypeDescriptionInfo, Long timeout) { + unprovisionApplicationTypeWithServiceResponseAsync(applicationTypeName, unprovisionApplicationTypeDescriptionInfo, timeout).toBlocking().single().body(); + } + + /** + * 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 applicationTypeName The name of the application type. + * @param unprovisionApplicationTypeDescriptionInfo The relative path for the application package in the image store specified during the prior copy operation. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture unprovisionApplicationTypeAsync(String applicationTypeName, UnprovisionApplicationTypeDescriptionInfo unprovisionApplicationTypeDescriptionInfo, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(unprovisionApplicationTypeWithServiceResponseAsync(applicationTypeName, unprovisionApplicationTypeDescriptionInfo, timeout), serviceCallback); + } + + /** + * 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 applicationTypeName The name of the application type. + * @param unprovisionApplicationTypeDescriptionInfo The relative path for the application package in the image store specified during the prior copy operation. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable unprovisionApplicationTypeAsync(String applicationTypeName, UnprovisionApplicationTypeDescriptionInfo unprovisionApplicationTypeDescriptionInfo, Long timeout) { + return unprovisionApplicationTypeWithServiceResponseAsync(applicationTypeName, unprovisionApplicationTypeDescriptionInfo, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 applicationTypeName The name of the application type. + * @param unprovisionApplicationTypeDescriptionInfo The relative path for the application package in the image store specified during the prior copy operation. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> unprovisionApplicationTypeWithServiceResponseAsync(String applicationTypeName, UnprovisionApplicationTypeDescriptionInfo unprovisionApplicationTypeDescriptionInfo, Long timeout) { + if (applicationTypeName == null) { + throw new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null."); + } + if (unprovisionApplicationTypeDescriptionInfo == null) { + throw new IllegalArgumentException("Parameter unprovisionApplicationTypeDescriptionInfo is required and cannot be null."); + } + Validator.validate(unprovisionApplicationTypeDescriptionInfo); + final String apiVersion = "6.0"; + return service.unprovisionApplicationType(applicationTypeName, apiVersion, unprovisionApplicationTypeDescriptionInfo, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = unprovisionApplicationTypeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse unprovisionApplicationTypeDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the list containing the information about service types that are supported by a provisioned application type in a Service Fabric cluster. + * Gets the list containing the information about service types that are supported by a provisioned application type in a Service Fabric cluster. The provided application type must exist. Otherwise, a 404 status is returned. + * + * @param applicationTypeName The name of the application type. + * @param applicationTypeVersion The version of the application type. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<ServiceTypeInfoInner> object if successful. + */ + public List getServiceTypeInfoList(String applicationTypeName, String applicationTypeVersion) { + return getServiceTypeInfoListWithServiceResponseAsync(applicationTypeName, applicationTypeVersion).toBlocking().single().body(); + } + + /** + * Gets the list containing the information about service types that are supported by a provisioned application type in a Service Fabric cluster. + * Gets the list containing the information about service types that are supported by a provisioned application type in a Service Fabric cluster. The provided application type must exist. Otherwise, a 404 status is returned. + * + * @param applicationTypeName The name of the application type. + * @param applicationTypeVersion The version of the application type. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getServiceTypeInfoListAsync(String applicationTypeName, String applicationTypeVersion, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getServiceTypeInfoListWithServiceResponseAsync(applicationTypeName, applicationTypeVersion), serviceCallback); + } + + /** + * Gets the list containing the information about service types that are supported by a provisioned application type in a Service Fabric cluster. + * Gets the list containing the information about service types that are supported by a provisioned application type in a Service Fabric cluster. The provided application type must exist. Otherwise, a 404 status is returned. + * + * @param applicationTypeName The name of the application type. + * @param applicationTypeVersion The version of the application type. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ServiceTypeInfoInner> object + */ + public Observable> getServiceTypeInfoListAsync(String applicationTypeName, String applicationTypeVersion) { + return getServiceTypeInfoListWithServiceResponseAsync(applicationTypeName, applicationTypeVersion).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the list containing the information about service types that are supported by a provisioned application type in a Service Fabric cluster. + * Gets the list containing the information about service types that are supported by a provisioned application type in a Service Fabric cluster. The provided application type must exist. Otherwise, a 404 status is returned. + * + * @param applicationTypeName The name of the application type. + * @param applicationTypeVersion The version of the application type. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ServiceTypeInfoInner> object + */ + public Observable>> getServiceTypeInfoListWithServiceResponseAsync(String applicationTypeName, String applicationTypeVersion) { + if (applicationTypeName == null) { + throw new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null."); + } + if (applicationTypeVersion == null) { + throw new IllegalArgumentException("Parameter applicationTypeVersion is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + return service.getServiceTypeInfoList(applicationTypeName, apiVersion, applicationTypeVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getServiceTypeInfoListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the list containing the information about service types that are supported by a provisioned application type in a Service Fabric cluster. + * Gets the list containing the information about service types that are supported by a provisioned application type in a Service Fabric cluster. The provided application type must exist. Otherwise, a 404 status is returned. + * + * @param applicationTypeName The name of the application type. + * @param applicationTypeVersion The version of the application type. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<ServiceTypeInfoInner> object if successful. + */ + public List getServiceTypeInfoList(String applicationTypeName, String applicationTypeVersion, Long timeout) { + return getServiceTypeInfoListWithServiceResponseAsync(applicationTypeName, applicationTypeVersion, timeout).toBlocking().single().body(); + } + + /** + * Gets the list containing the information about service types that are supported by a provisioned application type in a Service Fabric cluster. + * Gets the list containing the information about service types that are supported by a provisioned application type in a Service Fabric cluster. The provided application type must exist. Otherwise, a 404 status is returned. + * + * @param applicationTypeName The name of the application type. + * @param applicationTypeVersion The version of the application type. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getServiceTypeInfoListAsync(String applicationTypeName, String applicationTypeVersion, Long timeout, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getServiceTypeInfoListWithServiceResponseAsync(applicationTypeName, applicationTypeVersion, timeout), serviceCallback); + } + + /** + * Gets the list containing the information about service types that are supported by a provisioned application type in a Service Fabric cluster. + * Gets the list containing the information about service types that are supported by a provisioned application type in a Service Fabric cluster. The provided application type must exist. Otherwise, a 404 status is returned. + * + * @param applicationTypeName The name of the application type. + * @param applicationTypeVersion The version of the application type. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ServiceTypeInfoInner> object + */ + public Observable> getServiceTypeInfoListAsync(String applicationTypeName, String applicationTypeVersion, Long timeout) { + return getServiceTypeInfoListWithServiceResponseAsync(applicationTypeName, applicationTypeVersion, timeout).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the list containing the information about service types that are supported by a provisioned application type in a Service Fabric cluster. + * Gets the list containing the information about service types that are supported by a provisioned application type in a Service Fabric cluster. The provided application type must exist. Otherwise, a 404 status is returned. + * + * @param applicationTypeName The name of the application type. + * @param applicationTypeVersion The version of the application type. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ServiceTypeInfoInner> object + */ + public Observable>> getServiceTypeInfoListWithServiceResponseAsync(String applicationTypeName, String applicationTypeVersion, Long timeout) { + if (applicationTypeName == null) { + throw new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null."); + } + if (applicationTypeVersion == null) { + throw new IllegalArgumentException("Parameter applicationTypeVersion is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.getServiceTypeInfoList(applicationTypeName, apiVersion, applicationTypeVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getServiceTypeInfoListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getServiceTypeInfoListDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., FabricErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the information about a specific service type that is supported by a provisioned application type in a Service Fabric cluster. + * Gets the information about a specific service type that is supported by a provisioned application type in a Service Fabric cluster. The provided application type must exist. Otherwise, a 404 status is returned. A 204 response is returned if the specificed service type is not found in the cluster. + * + * @param applicationTypeName The name of the application type. + * @param serviceTypeName Specifies the name of a Service Fabric service type. + * @param applicationTypeVersion The version of the application type. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceTypeInfoInner object if successful. + */ + public ServiceTypeInfoInner getServiceTypeInfoByName(String applicationTypeName, String serviceTypeName, String applicationTypeVersion) { + return getServiceTypeInfoByNameWithServiceResponseAsync(applicationTypeName, serviceTypeName, applicationTypeVersion).toBlocking().single().body(); + } + + /** + * Gets the information about a specific service type that is supported by a provisioned application type in a Service Fabric cluster. + * Gets the information about a specific service type that is supported by a provisioned application type in a Service Fabric cluster. The provided application type must exist. Otherwise, a 404 status is returned. A 204 response is returned if the specificed service type is not found in the cluster. + * + * @param applicationTypeName The name of the application type. + * @param serviceTypeName Specifies the name of a Service Fabric service type. + * @param applicationTypeVersion The version of the application type. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getServiceTypeInfoByNameAsync(String applicationTypeName, String serviceTypeName, String applicationTypeVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getServiceTypeInfoByNameWithServiceResponseAsync(applicationTypeName, serviceTypeName, applicationTypeVersion), serviceCallback); + } + + /** + * Gets the information about a specific service type that is supported by a provisioned application type in a Service Fabric cluster. + * Gets the information about a specific service type that is supported by a provisioned application type in a Service Fabric cluster. The provided application type must exist. Otherwise, a 404 status is returned. A 204 response is returned if the specificed service type is not found in the cluster. + * + * @param applicationTypeName The name of the application type. + * @param serviceTypeName Specifies the name of a Service Fabric service type. + * @param applicationTypeVersion The version of the application type. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceTypeInfoInner object + */ + public Observable getServiceTypeInfoByNameAsync(String applicationTypeName, String serviceTypeName, String applicationTypeVersion) { + return getServiceTypeInfoByNameWithServiceResponseAsync(applicationTypeName, serviceTypeName, applicationTypeVersion).map(new Func1, ServiceTypeInfoInner>() { + @Override + public ServiceTypeInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the information about a specific service type that is supported by a provisioned application type in a Service Fabric cluster. + * Gets the information about a specific service type that is supported by a provisioned application type in a Service Fabric cluster. The provided application type must exist. Otherwise, a 404 status is returned. A 204 response is returned if the specificed service type is not found in the cluster. + * + * @param applicationTypeName The name of the application type. + * @param serviceTypeName Specifies the name of a Service Fabric service type. + * @param applicationTypeVersion The version of the application type. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceTypeInfoInner object + */ + public Observable> getServiceTypeInfoByNameWithServiceResponseAsync(String applicationTypeName, String serviceTypeName, String applicationTypeVersion) { + if (applicationTypeName == null) { + throw new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null."); + } + if (serviceTypeName == null) { + throw new IllegalArgumentException("Parameter serviceTypeName is required and cannot be null."); + } + if (applicationTypeVersion == null) { + throw new IllegalArgumentException("Parameter applicationTypeVersion is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + return service.getServiceTypeInfoByName(applicationTypeName, serviceTypeName, apiVersion, applicationTypeVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getServiceTypeInfoByNameDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the information about a specific service type that is supported by a provisioned application type in a Service Fabric cluster. + * Gets the information about a specific service type that is supported by a provisioned application type in a Service Fabric cluster. The provided application type must exist. Otherwise, a 404 status is returned. A 204 response is returned if the specificed service type is not found in the cluster. + * + * @param applicationTypeName The name of the application type. + * @param serviceTypeName Specifies the name of a Service Fabric service type. + * @param applicationTypeVersion The version of the application type. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceTypeInfoInner object if successful. + */ + public ServiceTypeInfoInner getServiceTypeInfoByName(String applicationTypeName, String serviceTypeName, String applicationTypeVersion, Long timeout) { + return getServiceTypeInfoByNameWithServiceResponseAsync(applicationTypeName, serviceTypeName, applicationTypeVersion, timeout).toBlocking().single().body(); + } + + /** + * Gets the information about a specific service type that is supported by a provisioned application type in a Service Fabric cluster. + * Gets the information about a specific service type that is supported by a provisioned application type in a Service Fabric cluster. The provided application type must exist. Otherwise, a 404 status is returned. A 204 response is returned if the specificed service type is not found in the cluster. + * + * @param applicationTypeName The name of the application type. + * @param serviceTypeName Specifies the name of a Service Fabric service type. + * @param applicationTypeVersion The version of the application type. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getServiceTypeInfoByNameAsync(String applicationTypeName, String serviceTypeName, String applicationTypeVersion, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getServiceTypeInfoByNameWithServiceResponseAsync(applicationTypeName, serviceTypeName, applicationTypeVersion, timeout), serviceCallback); + } + + /** + * Gets the information about a specific service type that is supported by a provisioned application type in a Service Fabric cluster. + * Gets the information about a specific service type that is supported by a provisioned application type in a Service Fabric cluster. The provided application type must exist. Otherwise, a 404 status is returned. A 204 response is returned if the specificed service type is not found in the cluster. + * + * @param applicationTypeName The name of the application type. + * @param serviceTypeName Specifies the name of a Service Fabric service type. + * @param applicationTypeVersion The version of the application type. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceTypeInfoInner object + */ + public Observable getServiceTypeInfoByNameAsync(String applicationTypeName, String serviceTypeName, String applicationTypeVersion, Long timeout) { + return getServiceTypeInfoByNameWithServiceResponseAsync(applicationTypeName, serviceTypeName, applicationTypeVersion, timeout).map(new Func1, ServiceTypeInfoInner>() { + @Override + public ServiceTypeInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the information about a specific service type that is supported by a provisioned application type in a Service Fabric cluster. + * Gets the information about a specific service type that is supported by a provisioned application type in a Service Fabric cluster. The provided application type must exist. Otherwise, a 404 status is returned. A 204 response is returned if the specificed service type is not found in the cluster. + * + * @param applicationTypeName The name of the application type. + * @param serviceTypeName Specifies the name of a Service Fabric service type. + * @param applicationTypeVersion The version of the application type. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceTypeInfoInner object + */ + public Observable> getServiceTypeInfoByNameWithServiceResponseAsync(String applicationTypeName, String serviceTypeName, String applicationTypeVersion, Long timeout) { + if (applicationTypeName == null) { + throw new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null."); + } + if (serviceTypeName == null) { + throw new IllegalArgumentException("Parameter serviceTypeName is required and cannot be null."); + } + if (applicationTypeVersion == null) { + throw new IllegalArgumentException("Parameter applicationTypeVersion is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.getServiceTypeInfoByName(applicationTypeName, serviceTypeName, apiVersion, applicationTypeVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getServiceTypeInfoByNameDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getServiceTypeInfoByNameDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the manifest describing a service type. + * Gets the manifest describing a service type. The response contains the service manifest XML as a string. + * + * @param applicationTypeName The name of the application type. + * @param applicationTypeVersion The version of the application type. + * @param serviceManifestName The name of a service manifest registered as part of an application type in a Service Fabric cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceTypeManifestInner object if successful. + */ + public ServiceTypeManifestInner getServiceManifest(String applicationTypeName, String applicationTypeVersion, String serviceManifestName) { + return getServiceManifestWithServiceResponseAsync(applicationTypeName, applicationTypeVersion, serviceManifestName).toBlocking().single().body(); + } + + /** + * Gets the manifest describing a service type. + * Gets the manifest describing a service type. The response contains the service manifest XML as a string. + * + * @param applicationTypeName The name of the application type. + * @param applicationTypeVersion The version of the application type. + * @param serviceManifestName The name of a service manifest registered as part of an application type in a Service Fabric cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getServiceManifestAsync(String applicationTypeName, String applicationTypeVersion, String serviceManifestName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getServiceManifestWithServiceResponseAsync(applicationTypeName, applicationTypeVersion, serviceManifestName), serviceCallback); + } + + /** + * Gets the manifest describing a service type. + * Gets the manifest describing a service type. The response contains the service manifest XML as a string. + * + * @param applicationTypeName The name of the application type. + * @param applicationTypeVersion The version of the application type. + * @param serviceManifestName The name of a service manifest registered as part of an application type in a Service Fabric cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceTypeManifestInner object + */ + public Observable getServiceManifestAsync(String applicationTypeName, String applicationTypeVersion, String serviceManifestName) { + return getServiceManifestWithServiceResponseAsync(applicationTypeName, applicationTypeVersion, serviceManifestName).map(new Func1, ServiceTypeManifestInner>() { + @Override + public ServiceTypeManifestInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the manifest describing a service type. + * Gets the manifest describing a service type. The response contains the service manifest XML as a string. + * + * @param applicationTypeName The name of the application type. + * @param applicationTypeVersion The version of the application type. + * @param serviceManifestName The name of a service manifest registered as part of an application type in a Service Fabric cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceTypeManifestInner object + */ + public Observable> getServiceManifestWithServiceResponseAsync(String applicationTypeName, String applicationTypeVersion, String serviceManifestName) { + if (applicationTypeName == null) { + throw new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null."); + } + if (applicationTypeVersion == null) { + throw new IllegalArgumentException("Parameter applicationTypeVersion is required and cannot be null."); + } + if (serviceManifestName == null) { + throw new IllegalArgumentException("Parameter serviceManifestName is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + return service.getServiceManifest(applicationTypeName, apiVersion, applicationTypeVersion, serviceManifestName, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getServiceManifestDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the manifest describing a service type. + * Gets the manifest describing a service type. The response contains the service manifest XML as a string. + * + * @param applicationTypeName The name of the application type. + * @param applicationTypeVersion The version of the application type. + * @param serviceManifestName The name of a service manifest registered as part of an application type in a Service Fabric cluster. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceTypeManifestInner object if successful. + */ + public ServiceTypeManifestInner getServiceManifest(String applicationTypeName, String applicationTypeVersion, String serviceManifestName, Long timeout) { + return getServiceManifestWithServiceResponseAsync(applicationTypeName, applicationTypeVersion, serviceManifestName, timeout).toBlocking().single().body(); + } + + /** + * Gets the manifest describing a service type. + * Gets the manifest describing a service type. The response contains the service manifest XML as a string. + * + * @param applicationTypeName The name of the application type. + * @param applicationTypeVersion The version of the application type. + * @param serviceManifestName The name of a service manifest registered as part of an application type in a Service Fabric cluster. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getServiceManifestAsync(String applicationTypeName, String applicationTypeVersion, String serviceManifestName, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getServiceManifestWithServiceResponseAsync(applicationTypeName, applicationTypeVersion, serviceManifestName, timeout), serviceCallback); + } + + /** + * Gets the manifest describing a service type. + * Gets the manifest describing a service type. The response contains the service manifest XML as a string. + * + * @param applicationTypeName The name of the application type. + * @param applicationTypeVersion The version of the application type. + * @param serviceManifestName The name of a service manifest registered as part of an application type in a Service Fabric cluster. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceTypeManifestInner object + */ + public Observable getServiceManifestAsync(String applicationTypeName, String applicationTypeVersion, String serviceManifestName, Long timeout) { + return getServiceManifestWithServiceResponseAsync(applicationTypeName, applicationTypeVersion, serviceManifestName, timeout).map(new Func1, ServiceTypeManifestInner>() { + @Override + public ServiceTypeManifestInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the manifest describing a service type. + * Gets the manifest describing a service type. The response contains the service manifest XML as a string. + * + * @param applicationTypeName The name of the application type. + * @param applicationTypeVersion The version of the application type. + * @param serviceManifestName The name of a service manifest registered as part of an application type in a Service Fabric cluster. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceTypeManifestInner object + */ + public Observable> getServiceManifestWithServiceResponseAsync(String applicationTypeName, String applicationTypeVersion, String serviceManifestName, Long timeout) { + if (applicationTypeName == null) { + throw new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null."); + } + if (applicationTypeVersion == null) { + throw new IllegalArgumentException("Parameter applicationTypeVersion is required and cannot be null."); + } + if (serviceManifestName == null) { + throw new IllegalArgumentException("Parameter serviceManifestName is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.getServiceManifest(applicationTypeName, apiVersion, applicationTypeVersion, serviceManifestName, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getServiceManifestDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getServiceManifestDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the list containing the information about service types from the applications deployed on a node in a Service Fabric cluster. + * Gets the list containing the information about service types from the applications deployed on a node in a Service Fabric cluster. The response includes the name of the service type, its registration status, the code package that registered it and activation ID of the service package. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<DeployedServiceTypeInfoInner> object if successful. + */ + public List getDeployedServiceTypeInfoList(String nodeName, String applicationId) { + return getDeployedServiceTypeInfoListWithServiceResponseAsync(nodeName, applicationId).toBlocking().single().body(); + } + + /** + * Gets the list containing the information about service types from the applications deployed on a node in a Service Fabric cluster. + * Gets the list containing the information about service types from the applications deployed on a node in a Service Fabric cluster. The response includes the name of the service type, its registration status, the code package that registered it and activation ID of the service package. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDeployedServiceTypeInfoListAsync(String nodeName, String applicationId, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getDeployedServiceTypeInfoListWithServiceResponseAsync(nodeName, applicationId), serviceCallback); + } + + /** + * Gets the list containing the information about service types from the applications deployed on a node in a Service Fabric cluster. + * Gets the list containing the information about service types from the applications deployed on a node in a Service Fabric cluster. The response includes the name of the service type, its registration status, the code package that registered it and activation ID of the service package. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DeployedServiceTypeInfoInner> object + */ + public Observable> getDeployedServiceTypeInfoListAsync(String nodeName, String applicationId) { + return getDeployedServiceTypeInfoListWithServiceResponseAsync(nodeName, applicationId).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the list containing the information about service types from the applications deployed on a node in a Service Fabric cluster. + * Gets the list containing the information about service types from the applications deployed on a node in a Service Fabric cluster. The response includes the name of the service type, its registration status, the code package that registered it and activation ID of the service package. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DeployedServiceTypeInfoInner> object + */ + public Observable>> getDeployedServiceTypeInfoListWithServiceResponseAsync(String nodeName, String applicationId) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final String serviceManifestName = null; + final Long timeout = null; + return service.getDeployedServiceTypeInfoList(nodeName, applicationId, apiVersion, serviceManifestName, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getDeployedServiceTypeInfoListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the list containing the information about service types from the applications deployed on a node in a Service Fabric cluster. + * Gets the list containing the information about service types from the applications deployed on a node in a Service Fabric cluster. The response includes the name of the service type, its registration status, the code package that registered it and activation ID of the service package. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<DeployedServiceTypeInfoInner> object if successful. + */ + public List getDeployedServiceTypeInfoList(String nodeName, String applicationId, String serviceManifestName, Long timeout) { + return getDeployedServiceTypeInfoListWithServiceResponseAsync(nodeName, applicationId, serviceManifestName, timeout).toBlocking().single().body(); + } + + /** + * Gets the list containing the information about service types from the applications deployed on a node in a Service Fabric cluster. + * Gets the list containing the information about service types from the applications deployed on a node in a Service Fabric cluster. The response includes the name of the service type, its registration status, the code package that registered it and activation ID of the service package. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDeployedServiceTypeInfoListAsync(String nodeName, String applicationId, String serviceManifestName, Long timeout, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getDeployedServiceTypeInfoListWithServiceResponseAsync(nodeName, applicationId, serviceManifestName, timeout), serviceCallback); + } + + /** + * Gets the list containing the information about service types from the applications deployed on a node in a Service Fabric cluster. + * Gets the list containing the information about service types from the applications deployed on a node in a Service Fabric cluster. The response includes the name of the service type, its registration status, the code package that registered it and activation ID of the service package. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DeployedServiceTypeInfoInner> object + */ + public Observable> getDeployedServiceTypeInfoListAsync(String nodeName, String applicationId, String serviceManifestName, Long timeout) { + return getDeployedServiceTypeInfoListWithServiceResponseAsync(nodeName, applicationId, serviceManifestName, timeout).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the list containing the information about service types from the applications deployed on a node in a Service Fabric cluster. + * Gets the list containing the information about service types from the applications deployed on a node in a Service Fabric cluster. The response includes the name of the service type, its registration status, the code package that registered it and activation ID of the service package. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DeployedServiceTypeInfoInner> object + */ + public Observable>> getDeployedServiceTypeInfoListWithServiceResponseAsync(String nodeName, String applicationId, String serviceManifestName, Long timeout) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.getDeployedServiceTypeInfoList(nodeName, applicationId, apiVersion, serviceManifestName, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getDeployedServiceTypeInfoListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getDeployedServiceTypeInfoListDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., FabricErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the information about a specified service type of the application deployed on a node in a Service Fabric cluster. + * Gets the list containing the information about a specific service type from the applications deployed on a node in a Service Fabric cluster. The response includes the name of the service type, its registration status, the code package that registered it and activation ID of the service package. Each entry represents one activation of a service type, differentiated by the activation ID. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceTypeName Specifies the name of a Service Fabric service type. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<DeployedServiceTypeInfoInner> object if successful. + */ + public List getDeployedServiceTypeInfoByName(String nodeName, String applicationId, String serviceTypeName) { + return getDeployedServiceTypeInfoByNameWithServiceResponseAsync(nodeName, applicationId, serviceTypeName).toBlocking().single().body(); + } + + /** + * Gets the information about a specified service type of the application deployed on a node in a Service Fabric cluster. + * Gets the list containing the information about a specific service type from the applications deployed on a node in a Service Fabric cluster. The response includes the name of the service type, its registration status, the code package that registered it and activation ID of the service package. Each entry represents one activation of a service type, differentiated by the activation ID. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceTypeName Specifies the name of a Service Fabric service type. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDeployedServiceTypeInfoByNameAsync(String nodeName, String applicationId, String serviceTypeName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getDeployedServiceTypeInfoByNameWithServiceResponseAsync(nodeName, applicationId, serviceTypeName), serviceCallback); + } + + /** + * Gets the information about a specified service type of the application deployed on a node in a Service Fabric cluster. + * Gets the list containing the information about a specific service type from the applications deployed on a node in a Service Fabric cluster. The response includes the name of the service type, its registration status, the code package that registered it and activation ID of the service package. Each entry represents one activation of a service type, differentiated by the activation ID. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceTypeName Specifies the name of a Service Fabric service type. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DeployedServiceTypeInfoInner> object + */ + public Observable> getDeployedServiceTypeInfoByNameAsync(String nodeName, String applicationId, String serviceTypeName) { + return getDeployedServiceTypeInfoByNameWithServiceResponseAsync(nodeName, applicationId, serviceTypeName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the information about a specified service type of the application deployed on a node in a Service Fabric cluster. + * Gets the list containing the information about a specific service type from the applications deployed on a node in a Service Fabric cluster. The response includes the name of the service type, its registration status, the code package that registered it and activation ID of the service package. Each entry represents one activation of a service type, differentiated by the activation ID. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceTypeName Specifies the name of a Service Fabric service type. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DeployedServiceTypeInfoInner> object + */ + public Observable>> getDeployedServiceTypeInfoByNameWithServiceResponseAsync(String nodeName, String applicationId, String serviceTypeName) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + if (serviceTypeName == null) { + throw new IllegalArgumentException("Parameter serviceTypeName is required and cannot be null."); + } + final String apiVersion = "6.0"; + final String serviceManifestName = null; + final Long timeout = null; + return service.getDeployedServiceTypeInfoByName(nodeName, applicationId, serviceTypeName, apiVersion, serviceManifestName, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getDeployedServiceTypeInfoByNameDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the information about a specified service type of the application deployed on a node in a Service Fabric cluster. + * Gets the list containing the information about a specific service type from the applications deployed on a node in a Service Fabric cluster. The response includes the name of the service type, its registration status, the code package that registered it and activation ID of the service package. Each entry represents one activation of a service type, differentiated by the activation ID. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceTypeName Specifies the name of a Service Fabric service type. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<DeployedServiceTypeInfoInner> object if successful. + */ + public List getDeployedServiceTypeInfoByName(String nodeName, String applicationId, String serviceTypeName, String serviceManifestName, Long timeout) { + return getDeployedServiceTypeInfoByNameWithServiceResponseAsync(nodeName, applicationId, serviceTypeName, serviceManifestName, timeout).toBlocking().single().body(); + } + + /** + * Gets the information about a specified service type of the application deployed on a node in a Service Fabric cluster. + * Gets the list containing the information about a specific service type from the applications deployed on a node in a Service Fabric cluster. The response includes the name of the service type, its registration status, the code package that registered it and activation ID of the service package. Each entry represents one activation of a service type, differentiated by the activation ID. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceTypeName Specifies the name of a Service Fabric service type. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDeployedServiceTypeInfoByNameAsync(String nodeName, String applicationId, String serviceTypeName, String serviceManifestName, Long timeout, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getDeployedServiceTypeInfoByNameWithServiceResponseAsync(nodeName, applicationId, serviceTypeName, serviceManifestName, timeout), serviceCallback); + } + + /** + * Gets the information about a specified service type of the application deployed on a node in a Service Fabric cluster. + * Gets the list containing the information about a specific service type from the applications deployed on a node in a Service Fabric cluster. The response includes the name of the service type, its registration status, the code package that registered it and activation ID of the service package. Each entry represents one activation of a service type, differentiated by the activation ID. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceTypeName Specifies the name of a Service Fabric service type. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DeployedServiceTypeInfoInner> object + */ + public Observable> getDeployedServiceTypeInfoByNameAsync(String nodeName, String applicationId, String serviceTypeName, String serviceManifestName, Long timeout) { + return getDeployedServiceTypeInfoByNameWithServiceResponseAsync(nodeName, applicationId, serviceTypeName, serviceManifestName, timeout).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the information about a specified service type of the application deployed on a node in a Service Fabric cluster. + * Gets the list containing the information about a specific service type from the applications deployed on a node in a Service Fabric cluster. The response includes the name of the service type, its registration status, the code package that registered it and activation ID of the service package. Each entry represents one activation of a service type, differentiated by the activation ID. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceTypeName Specifies the name of a Service Fabric service type. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DeployedServiceTypeInfoInner> object + */ + public Observable>> getDeployedServiceTypeInfoByNameWithServiceResponseAsync(String nodeName, String applicationId, String serviceTypeName, String serviceManifestName, Long timeout) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + if (serviceTypeName == null) { + throw new IllegalArgumentException("Parameter serviceTypeName is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.getDeployedServiceTypeInfoByName(nodeName, applicationId, serviceTypeName, apiVersion, serviceManifestName, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getDeployedServiceTypeInfoByNameDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getDeployedServiceTypeInfoByNameDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., FabricErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Creates a Service Fabric application. + * Creates a Service Fabric application using the specified description. + * + * @param applicationDescription Description for creating an application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void createApplication(ApplicationDescription applicationDescription) { + createApplicationWithServiceResponseAsync(applicationDescription).toBlocking().single().body(); + } + + /** + * Creates a Service Fabric application. + * Creates a Service Fabric application using the specified description. + * + * @param applicationDescription Description for creating an application. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createApplicationAsync(ApplicationDescription applicationDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createApplicationWithServiceResponseAsync(applicationDescription), serviceCallback); + } + + /** + * Creates a Service Fabric application. + * Creates a Service Fabric application using the specified description. + * + * @param applicationDescription Description for creating an application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable createApplicationAsync(ApplicationDescription applicationDescription) { + return createApplicationWithServiceResponseAsync(applicationDescription).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a Service Fabric application. + * Creates a Service Fabric application using the specified description. + * + * @param applicationDescription Description for creating an application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> createApplicationWithServiceResponseAsync(ApplicationDescription applicationDescription) { + if (applicationDescription == null) { + throw new IllegalArgumentException("Parameter applicationDescription is required and cannot be null."); + } + Validator.validate(applicationDescription); + final String apiVersion = "6.0"; + final Long timeout = null; + return service.createApplication(apiVersion, applicationDescription, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createApplicationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Creates a Service Fabric application. + * Creates a Service Fabric application using the specified description. + * + * @param applicationDescription Description for creating an application. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void createApplication(ApplicationDescription applicationDescription, Long timeout) { + createApplicationWithServiceResponseAsync(applicationDescription, timeout).toBlocking().single().body(); + } + + /** + * Creates a Service Fabric application. + * Creates a Service Fabric application using the specified description. + * + * @param applicationDescription Description for creating an application. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createApplicationAsync(ApplicationDescription applicationDescription, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createApplicationWithServiceResponseAsync(applicationDescription, timeout), serviceCallback); + } + + /** + * Creates a Service Fabric application. + * Creates a Service Fabric application using the specified description. + * + * @param applicationDescription Description for creating an application. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable createApplicationAsync(ApplicationDescription applicationDescription, Long timeout) { + return createApplicationWithServiceResponseAsync(applicationDescription, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a Service Fabric application. + * Creates a Service Fabric application using the specified description. + * + * @param applicationDescription Description for creating an application. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> createApplicationWithServiceResponseAsync(ApplicationDescription applicationDescription, Long timeout) { + if (applicationDescription == null) { + throw new IllegalArgumentException("Parameter applicationDescription is required and cannot be null."); + } + Validator.validate(applicationDescription); + final String apiVersion = "6.0"; + return service.createApplication(apiVersion, applicationDescription, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createApplicationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createApplicationDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Deletes an existing Service Fabric application. + * An application must be created before it can be deleted. Deleting an application will delete all services that are part of that application. By default, Service Fabric will try to close service replicas in a graceful manner and then delete the service. However, if a service is having issues closing the replica gracefully, the delete operation may take a long time or get stuck. Use the optional ForceRemove flag to skip the graceful close sequence and forcefully delete the application and all of its services. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteApplication(String applicationId) { + deleteApplicationWithServiceResponseAsync(applicationId).toBlocking().single().body(); + } + + /** + * Deletes an existing Service Fabric application. + * An application must be created before it can be deleted. Deleting an application will delete all services that are part of that application. By default, Service Fabric will try to close service replicas in a graceful manner and then delete the service. However, if a service is having issues closing the replica gracefully, the delete operation may take a long time or get stuck. Use the optional ForceRemove flag to skip the graceful close sequence and forcefully delete the application and all of its services. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteApplicationAsync(String applicationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteApplicationWithServiceResponseAsync(applicationId), serviceCallback); + } + + /** + * Deletes an existing Service Fabric application. + * An application must be created before it can be deleted. Deleting an application will delete all services that are part of that application. By default, Service Fabric will try to close service replicas in a graceful manner and then delete the service. However, if a service is having issues closing the replica gracefully, the delete operation may take a long time or get stuck. Use the optional ForceRemove flag to skip the graceful close sequence and forcefully delete the application and all of its services. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteApplicationAsync(String applicationId) { + return deleteApplicationWithServiceResponseAsync(applicationId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Service Fabric application. + * An application must be created before it can be deleted. Deleting an application will delete all services that are part of that application. By default, Service Fabric will try to close service replicas in a graceful manner and then delete the service. However, if a service is having issues closing the replica gracefully, the delete operation may take a long time or get stuck. Use the optional ForceRemove flag to skip the graceful close sequence and forcefully delete the application and all of its services. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteApplicationWithServiceResponseAsync(String applicationId) { + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Boolean forceRemove = null; + final Long timeout = null; + return service.deleteApplication(applicationId, apiVersion, forceRemove, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteApplicationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Deletes an existing Service Fabric application. + * An application must be created before it can be deleted. Deleting an application will delete all services that are part of that application. By default, Service Fabric will try to close service replicas in a graceful manner and then delete the service. However, if a service is having issues closing the replica gracefully, the delete operation may take a long time or get stuck. Use the optional ForceRemove flag to skip the graceful close sequence and forcefully delete the application and all of its services. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteApplication(String applicationId, Boolean forceRemove, Long timeout) { + deleteApplicationWithServiceResponseAsync(applicationId, forceRemove, timeout).toBlocking().single().body(); + } + + /** + * Deletes an existing Service Fabric application. + * An application must be created before it can be deleted. Deleting an application will delete all services that are part of that application. By default, Service Fabric will try to close service replicas in a graceful manner and then delete the service. However, if a service is having issues closing the replica gracefully, the delete operation may take a long time or get stuck. Use the optional ForceRemove flag to skip the graceful close sequence and forcefully delete the application and all of its services. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteApplicationAsync(String applicationId, Boolean forceRemove, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteApplicationWithServiceResponseAsync(applicationId, forceRemove, timeout), serviceCallback); + } + + /** + * Deletes an existing Service Fabric application. + * An application must be created before it can be deleted. Deleting an application will delete all services that are part of that application. By default, Service Fabric will try to close service replicas in a graceful manner and then delete the service. However, if a service is having issues closing the replica gracefully, the delete operation may take a long time or get stuck. Use the optional ForceRemove flag to skip the graceful close sequence and forcefully delete the application and all of its services. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteApplicationAsync(String applicationId, Boolean forceRemove, Long timeout) { + return deleteApplicationWithServiceResponseAsync(applicationId, forceRemove, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Service Fabric application. + * An application must be created before it can be deleted. Deleting an application will delete all services that are part of that application. By default, Service Fabric will try to close service replicas in a graceful manner and then delete the service. However, if a service is having issues closing the replica gracefully, the delete operation may take a long time or get stuck. Use the optional ForceRemove flag to skip the graceful close sequence and forcefully delete the application and all of its services. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteApplicationWithServiceResponseAsync(String applicationId, Boolean forceRemove, Long timeout) { + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.deleteApplication(applicationId, apiVersion, forceRemove, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteApplicationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteApplicationDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets load information about a Service Fabric application. + * Returns the load information about the application that was created or in the process of being created in the Service Fabric cluster and whose name matches the one specified as the parameter. The response includes the name, minimum nodes, maximum nodes, the number of nodes the application is occupying currently, and application load metric information about the application. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationLoadInfoInner object if successful. + */ + public ApplicationLoadInfoInner getApplicationLoadInfo(String applicationId) { + return getApplicationLoadInfoWithServiceResponseAsync(applicationId).toBlocking().single().body(); + } + + /** + * Gets load information about a Service Fabric application. + * Returns the load information about the application that was created or in the process of being created in the Service Fabric cluster and whose name matches the one specified as the parameter. The response includes the name, minimum nodes, maximum nodes, the number of nodes the application is occupying currently, and application load metric information about the application. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getApplicationLoadInfoAsync(String applicationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getApplicationLoadInfoWithServiceResponseAsync(applicationId), serviceCallback); + } + + /** + * Gets load information about a Service Fabric application. + * Returns the load information about the application that was created or in the process of being created in the Service Fabric cluster and whose name matches the one specified as the parameter. The response includes the name, minimum nodes, maximum nodes, the number of nodes the application is occupying currently, and application load metric information about the application. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationLoadInfoInner object + */ + public Observable getApplicationLoadInfoAsync(String applicationId) { + return getApplicationLoadInfoWithServiceResponseAsync(applicationId).map(new Func1, ApplicationLoadInfoInner>() { + @Override + public ApplicationLoadInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets load information about a Service Fabric application. + * Returns the load information about the application that was created or in the process of being created in the Service Fabric cluster and whose name matches the one specified as the parameter. The response includes the name, minimum nodes, maximum nodes, the number of nodes the application is occupying currently, and application load metric information about the application. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationLoadInfoInner object + */ + public Observable> getApplicationLoadInfoWithServiceResponseAsync(String applicationId) { + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + return service.getApplicationLoadInfo(applicationId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getApplicationLoadInfoDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets load information about a Service Fabric application. + * Returns the load information about the application that was created or in the process of being created in the Service Fabric cluster and whose name matches the one specified as the parameter. The response includes the name, minimum nodes, maximum nodes, the number of nodes the application is occupying currently, and application load metric information about the application. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationLoadInfoInner object if successful. + */ + public ApplicationLoadInfoInner getApplicationLoadInfo(String applicationId, Long timeout) { + return getApplicationLoadInfoWithServiceResponseAsync(applicationId, timeout).toBlocking().single().body(); + } + + /** + * Gets load information about a Service Fabric application. + * Returns the load information about the application that was created or in the process of being created in the Service Fabric cluster and whose name matches the one specified as the parameter. The response includes the name, minimum nodes, maximum nodes, the number of nodes the application is occupying currently, and application load metric information about the application. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getApplicationLoadInfoAsync(String applicationId, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getApplicationLoadInfoWithServiceResponseAsync(applicationId, timeout), serviceCallback); + } + + /** + * Gets load information about a Service Fabric application. + * Returns the load information about the application that was created or in the process of being created in the Service Fabric cluster and whose name matches the one specified as the parameter. The response includes the name, minimum nodes, maximum nodes, the number of nodes the application is occupying currently, and application load metric information about the application. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationLoadInfoInner object + */ + public Observable getApplicationLoadInfoAsync(String applicationId, Long timeout) { + return getApplicationLoadInfoWithServiceResponseAsync(applicationId, timeout).map(new Func1, ApplicationLoadInfoInner>() { + @Override + public ApplicationLoadInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets load information about a Service Fabric application. + * Returns the load information about the application that was created or in the process of being created in the Service Fabric cluster and whose name matches the one specified as the parameter. The response includes the name, minimum nodes, maximum nodes, the number of nodes the application is occupying currently, and application load metric information about the application. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationLoadInfoInner object + */ + public Observable> getApplicationLoadInfoWithServiceResponseAsync(String applicationId, Long timeout) { + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.getApplicationLoadInfo(applicationId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getApplicationLoadInfoDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getApplicationLoadInfoDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedApplicationInfoListInner object if successful. + */ + public PagedApplicationInfoListInner getApplicationInfoList() { + return getApplicationInfoListWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getApplicationInfoListAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getApplicationInfoListWithServiceResponseAsync(), serviceCallback); + } + + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedApplicationInfoListInner object + */ + public Observable getApplicationInfoListAsync() { + return getApplicationInfoListWithServiceResponseAsync().map(new Func1, PagedApplicationInfoListInner>() { + @Override + public PagedApplicationInfoListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedApplicationInfoListInner object + */ + public Observable> getApplicationInfoListWithServiceResponseAsync() { + final String apiVersion = "6.1"; + final Integer applicationDefinitionKindFilter = null; + final String applicationTypeName = null; + final Boolean excludeApplicationParameters = null; + final String continuationToken = null; + final Long maxResults = null; + final Long timeout = null; + return service.getApplicationInfoList(apiVersion, applicationDefinitionKindFilter, applicationTypeName, excludeApplicationParameters, continuationToken, maxResults, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getApplicationInfoListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 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 applicationTypeName The application type name used to filter the applications to query for. This value should not contain the application type version. + * @param excludeApplicationParameters The flag that specifies whether application parameters will be excluded from the result. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedApplicationInfoListInner object if successful. + */ + public PagedApplicationInfoListInner getApplicationInfoList(Integer applicationDefinitionKindFilter, String applicationTypeName, Boolean excludeApplicationParameters, String continuationToken, Long maxResults, Long timeout) { + return getApplicationInfoListWithServiceResponseAsync(applicationDefinitionKindFilter, applicationTypeName, excludeApplicationParameters, continuationToken, maxResults, timeout).toBlocking().single().body(); + } + + /** + * 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 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 applicationTypeName The application type name used to filter the applications to query for. This value should not contain the application type version. + * @param excludeApplicationParameters The flag that specifies whether application parameters will be excluded from the result. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getApplicationInfoListAsync(Integer applicationDefinitionKindFilter, String applicationTypeName, Boolean excludeApplicationParameters, String continuationToken, Long maxResults, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getApplicationInfoListWithServiceResponseAsync(applicationDefinitionKindFilter, applicationTypeName, excludeApplicationParameters, continuationToken, maxResults, timeout), serviceCallback); + } + + /** + * 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 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 applicationTypeName The application type name used to filter the applications to query for. This value should not contain the application type version. + * @param excludeApplicationParameters The flag that specifies whether application parameters will be excluded from the result. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedApplicationInfoListInner object + */ + public Observable getApplicationInfoListAsync(Integer applicationDefinitionKindFilter, String applicationTypeName, Boolean excludeApplicationParameters, String continuationToken, Long maxResults, Long timeout) { + return getApplicationInfoListWithServiceResponseAsync(applicationDefinitionKindFilter, applicationTypeName, excludeApplicationParameters, continuationToken, maxResults, timeout).map(new Func1, PagedApplicationInfoListInner>() { + @Override + public PagedApplicationInfoListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 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 applicationTypeName The application type name used to filter the applications to query for. This value should not contain the application type version. + * @param excludeApplicationParameters The flag that specifies whether application parameters will be excluded from the result. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedApplicationInfoListInner object + */ + public Observable> getApplicationInfoListWithServiceResponseAsync(Integer applicationDefinitionKindFilter, String applicationTypeName, Boolean excludeApplicationParameters, String continuationToken, Long maxResults, Long timeout) { + final String apiVersion = "6.1"; + return service.getApplicationInfoList(apiVersion, applicationDefinitionKindFilter, applicationTypeName, excludeApplicationParameters, continuationToken, maxResults, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getApplicationInfoListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getApplicationInfoListDelegate(Response response) throws FabricErrorException, IOException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets information about a Service Fabric application. + * Returns the information about the application that was created or in the process of being created in the Service Fabric cluster and whose name matches the one specified as the parameter. The response includes the name, type, status, parameters, and other details about the application. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationInfoInner object if successful. + */ + public ApplicationInfoInner getApplicationInfo(String applicationId) { + return getApplicationInfoWithServiceResponseAsync(applicationId).toBlocking().single().body(); + } + + /** + * Gets information about a Service Fabric application. + * Returns the information about the application that was created or in the process of being created in the Service Fabric cluster and whose name matches the one specified as the parameter. The response includes the name, type, status, parameters, and other details about the application. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getApplicationInfoAsync(String applicationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getApplicationInfoWithServiceResponseAsync(applicationId), serviceCallback); + } + + /** + * Gets information about a Service Fabric application. + * Returns the information about the application that was created or in the process of being created in the Service Fabric cluster and whose name matches the one specified as the parameter. The response includes the name, type, status, parameters, and other details about the application. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInfoInner object + */ + public Observable getApplicationInfoAsync(String applicationId) { + return getApplicationInfoWithServiceResponseAsync(applicationId).map(new Func1, ApplicationInfoInner>() { + @Override + public ApplicationInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets information about a Service Fabric application. + * Returns the information about the application that was created or in the process of being created in the Service Fabric cluster and whose name matches the one specified as the parameter. The response includes the name, type, status, parameters, and other details about the application. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInfoInner object + */ + public Observable> getApplicationInfoWithServiceResponseAsync(String applicationId) { + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Boolean excludeApplicationParameters = null; + final Long timeout = null; + return service.getApplicationInfo(applicationId, apiVersion, excludeApplicationParameters, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getApplicationInfoDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets information about a Service Fabric application. + * Returns the information about the application that was created or in the process of being created in the Service Fabric cluster and whose name matches the one specified as the parameter. The response includes the name, type, status, parameters, and other details about the application. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param excludeApplicationParameters The flag that specifies whether application parameters will be excluded from the result. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationInfoInner object if successful. + */ + public ApplicationInfoInner getApplicationInfo(String applicationId, Boolean excludeApplicationParameters, Long timeout) { + return getApplicationInfoWithServiceResponseAsync(applicationId, excludeApplicationParameters, timeout).toBlocking().single().body(); + } + + /** + * Gets information about a Service Fabric application. + * Returns the information about the application that was created or in the process of being created in the Service Fabric cluster and whose name matches the one specified as the parameter. The response includes the name, type, status, parameters, and other details about the application. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param excludeApplicationParameters The flag that specifies whether application parameters will be excluded from the result. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getApplicationInfoAsync(String applicationId, Boolean excludeApplicationParameters, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getApplicationInfoWithServiceResponseAsync(applicationId, excludeApplicationParameters, timeout), serviceCallback); + } + + /** + * Gets information about a Service Fabric application. + * Returns the information about the application that was created or in the process of being created in the Service Fabric cluster and whose name matches the one specified as the parameter. The response includes the name, type, status, parameters, and other details about the application. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param excludeApplicationParameters The flag that specifies whether application parameters will be excluded from the result. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInfoInner object + */ + public Observable getApplicationInfoAsync(String applicationId, Boolean excludeApplicationParameters, Long timeout) { + return getApplicationInfoWithServiceResponseAsync(applicationId, excludeApplicationParameters, timeout).map(new Func1, ApplicationInfoInner>() { + @Override + public ApplicationInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets information about a Service Fabric application. + * Returns the information about the application that was created or in the process of being created in the Service Fabric cluster and whose name matches the one specified as the parameter. The response includes the name, type, status, parameters, and other details about the application. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param excludeApplicationParameters The flag that specifies whether application parameters will be excluded from the result. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInfoInner object + */ + public Observable> getApplicationInfoWithServiceResponseAsync(String applicationId, Boolean excludeApplicationParameters, Long timeout) { + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.getApplicationInfo(applicationId, apiVersion, excludeApplicationParameters, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getApplicationInfoDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getApplicationInfoDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the health of the service fabric application. + * Returns the heath state of the service fabric application. The response reports either Ok, Error or Warning health state. If the entity is not found in the health store, it will return Error. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationHealthInner object if successful. + */ + public ApplicationHealthInner getApplicationHealth(String applicationId) { + return getApplicationHealthWithServiceResponseAsync(applicationId).toBlocking().single().body(); + } + + /** + * Gets the health of the service fabric application. + * Returns the heath state of the service fabric application. The response reports either Ok, Error or Warning health state. If the entity is not found in the health store, it will return Error. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getApplicationHealthAsync(String applicationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getApplicationHealthWithServiceResponseAsync(applicationId), serviceCallback); + } + + /** + * Gets the health of the service fabric application. + * Returns the heath state of the service fabric application. The response reports either Ok, Error or Warning health state. If the entity is not found in the health store, it will return Error. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationHealthInner object + */ + public Observable getApplicationHealthAsync(String applicationId) { + return getApplicationHealthWithServiceResponseAsync(applicationId).map(new Func1, ApplicationHealthInner>() { + @Override + public ApplicationHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the health of the service fabric application. + * Returns the heath state of the service fabric application. The response reports either Ok, Error or Warning health state. If the entity is not found in the health store, it will return Error. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationHealthInner object + */ + public Observable> getApplicationHealthWithServiceResponseAsync(String applicationId) { + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Integer eventsHealthStateFilter = null; + final Integer deployedApplicationsHealthStateFilter = null; + final Integer servicesHealthStateFilter = null; + final Boolean excludeHealthStatistics = null; + final Long timeout = null; + return service.getApplicationHealth(applicationId, apiVersion, eventsHealthStateFilter, deployedApplicationsHealthStateFilter, servicesHealthStateFilter, excludeHealthStatistics, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getApplicationHealthDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the health of the service fabric application. + * Returns the heath state of the service fabric application. The response reports either Ok, Error or Warning health state. If the entity is not found in the health store, it will return Error. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationHealthInner object if successful. + */ + public ApplicationHealthInner getApplicationHealth(String applicationId, Integer eventsHealthStateFilter, Integer deployedApplicationsHealthStateFilter, Integer servicesHealthStateFilter, Boolean excludeHealthStatistics, Long timeout) { + return getApplicationHealthWithServiceResponseAsync(applicationId, eventsHealthStateFilter, deployedApplicationsHealthStateFilter, servicesHealthStateFilter, excludeHealthStatistics, timeout).toBlocking().single().body(); + } + + /** + * Gets the health of the service fabric application. + * Returns the heath state of the service fabric application. The response reports either Ok, Error or Warning health state. If the entity is not found in the health store, it will return Error. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getApplicationHealthAsync(String applicationId, Integer eventsHealthStateFilter, Integer deployedApplicationsHealthStateFilter, Integer servicesHealthStateFilter, Boolean excludeHealthStatistics, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getApplicationHealthWithServiceResponseAsync(applicationId, eventsHealthStateFilter, deployedApplicationsHealthStateFilter, servicesHealthStateFilter, excludeHealthStatistics, timeout), serviceCallback); + } + + /** + * Gets the health of the service fabric application. + * Returns the heath state of the service fabric application. The response reports either Ok, Error or Warning health state. If the entity is not found in the health store, it will return Error. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationHealthInner object + */ + public Observable getApplicationHealthAsync(String applicationId, Integer eventsHealthStateFilter, Integer deployedApplicationsHealthStateFilter, Integer servicesHealthStateFilter, Boolean excludeHealthStatistics, Long timeout) { + return getApplicationHealthWithServiceResponseAsync(applicationId, eventsHealthStateFilter, deployedApplicationsHealthStateFilter, servicesHealthStateFilter, excludeHealthStatistics, timeout).map(new Func1, ApplicationHealthInner>() { + @Override + public ApplicationHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the health of the service fabric application. + * Returns the heath state of the service fabric application. The response reports either Ok, Error or Warning health state. If the entity is not found in the health store, it will return Error. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationHealthInner object + */ + public Observable> getApplicationHealthWithServiceResponseAsync(String applicationId, Integer eventsHealthStateFilter, Integer deployedApplicationsHealthStateFilter, Integer servicesHealthStateFilter, Boolean excludeHealthStatistics, Long timeout) { + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.getApplicationHealth(applicationId, apiVersion, eventsHealthStateFilter, deployedApplicationsHealthStateFilter, servicesHealthStateFilter, excludeHealthStatistics, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getApplicationHealthDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getApplicationHealthDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the health of a Service Fabric application using the specified policy. + * Gets the health of a Service Fabric application. Use EventsHealthStateFilter to filter the collection of health events reported on the node based on the health state. Use ClusterHealthPolicies to override the health policies used to evaluate the health. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationHealthInner object if successful. + */ + public ApplicationHealthInner getApplicationHealthUsingPolicy(String applicationId) { + return getApplicationHealthUsingPolicyWithServiceResponseAsync(applicationId).toBlocking().single().body(); + } + + /** + * Gets the health of a Service Fabric application using the specified policy. + * Gets the health of a Service Fabric application. Use EventsHealthStateFilter to filter the collection of health events reported on the node based on the health state. Use ClusterHealthPolicies to override the health policies used to evaluate the health. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getApplicationHealthUsingPolicyAsync(String applicationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getApplicationHealthUsingPolicyWithServiceResponseAsync(applicationId), serviceCallback); + } + + /** + * Gets the health of a Service Fabric application using the specified policy. + * Gets the health of a Service Fabric application. Use EventsHealthStateFilter to filter the collection of health events reported on the node based on the health state. Use ClusterHealthPolicies to override the health policies used to evaluate the health. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationHealthInner object + */ + public Observable getApplicationHealthUsingPolicyAsync(String applicationId) { + return getApplicationHealthUsingPolicyWithServiceResponseAsync(applicationId).map(new Func1, ApplicationHealthInner>() { + @Override + public ApplicationHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the health of a Service Fabric application using the specified policy. + * Gets the health of a Service Fabric application. Use EventsHealthStateFilter to filter the collection of health events reported on the node based on the health state. Use ClusterHealthPolicies to override the health policies used to evaluate the health. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationHealthInner object + */ + public Observable> getApplicationHealthUsingPolicyWithServiceResponseAsync(String applicationId) { + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Integer eventsHealthStateFilter = null; + final Integer deployedApplicationsHealthStateFilter = null; + final Integer servicesHealthStateFilter = null; + final Boolean excludeHealthStatistics = null; + final ApplicationHealthPolicy applicationHealthPolicy = null; + final Long timeout = null; + return service.getApplicationHealthUsingPolicy(applicationId, apiVersion, eventsHealthStateFilter, deployedApplicationsHealthStateFilter, servicesHealthStateFilter, excludeHealthStatistics, applicationHealthPolicy, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getApplicationHealthUsingPolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the health of a Service Fabric application using the specified policy. + * Gets the health of a Service Fabric application. Use EventsHealthStateFilter to filter the collection of health events reported on the node based on the health state. Use ClusterHealthPolicies to override the health policies used to evaluate the health. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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 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 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationHealthInner object if successful. + */ + public ApplicationHealthInner getApplicationHealthUsingPolicy(String applicationId, Integer eventsHealthStateFilter, Integer deployedApplicationsHealthStateFilter, Integer servicesHealthStateFilter, Boolean excludeHealthStatistics, ApplicationHealthPolicy applicationHealthPolicy, Long timeout) { + return getApplicationHealthUsingPolicyWithServiceResponseAsync(applicationId, eventsHealthStateFilter, deployedApplicationsHealthStateFilter, servicesHealthStateFilter, excludeHealthStatistics, applicationHealthPolicy, timeout).toBlocking().single().body(); + } + + /** + * Gets the health of a Service Fabric application using the specified policy. + * Gets the health of a Service Fabric application. Use EventsHealthStateFilter to filter the collection of health events reported on the node based on the health state. Use ClusterHealthPolicies to override the health policies used to evaluate the health. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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 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 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getApplicationHealthUsingPolicyAsync(String applicationId, Integer eventsHealthStateFilter, Integer deployedApplicationsHealthStateFilter, Integer servicesHealthStateFilter, Boolean excludeHealthStatistics, ApplicationHealthPolicy applicationHealthPolicy, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getApplicationHealthUsingPolicyWithServiceResponseAsync(applicationId, eventsHealthStateFilter, deployedApplicationsHealthStateFilter, servicesHealthStateFilter, excludeHealthStatistics, applicationHealthPolicy, timeout), serviceCallback); + } + + /** + * Gets the health of a Service Fabric application using the specified policy. + * Gets the health of a Service Fabric application. Use EventsHealthStateFilter to filter the collection of health events reported on the node based on the health state. Use ClusterHealthPolicies to override the health policies used to evaluate the health. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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 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 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationHealthInner object + */ + public Observable getApplicationHealthUsingPolicyAsync(String applicationId, Integer eventsHealthStateFilter, Integer deployedApplicationsHealthStateFilter, Integer servicesHealthStateFilter, Boolean excludeHealthStatistics, ApplicationHealthPolicy applicationHealthPolicy, Long timeout) { + return getApplicationHealthUsingPolicyWithServiceResponseAsync(applicationId, eventsHealthStateFilter, deployedApplicationsHealthStateFilter, servicesHealthStateFilter, excludeHealthStatistics, applicationHealthPolicy, timeout).map(new Func1, ApplicationHealthInner>() { + @Override + public ApplicationHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the health of a Service Fabric application using the specified policy. + * Gets the health of a Service Fabric application. Use EventsHealthStateFilter to filter the collection of health events reported on the node based on the health state. Use ClusterHealthPolicies to override the health policies used to evaluate the health. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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 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 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationHealthInner object + */ + public Observable> getApplicationHealthUsingPolicyWithServiceResponseAsync(String applicationId, Integer eventsHealthStateFilter, Integer deployedApplicationsHealthStateFilter, Integer servicesHealthStateFilter, Boolean excludeHealthStatistics, ApplicationHealthPolicy applicationHealthPolicy, Long timeout) { + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + Validator.validate(applicationHealthPolicy); + final String apiVersion = "6.0"; + return service.getApplicationHealthUsingPolicy(applicationId, apiVersion, eventsHealthStateFilter, deployedApplicationsHealthStateFilter, servicesHealthStateFilter, excludeHealthStatistics, applicationHealthPolicy, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getApplicationHealthUsingPolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getApplicationHealthUsingPolicyDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void reportApplicationHealth(String applicationId, HealthInformation healthInformation) { + reportApplicationHealthWithServiceResponseAsync(applicationId, healthInformation).toBlocking().single().body(); + } + + /** + * 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 applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture reportApplicationHealthAsync(String applicationId, HealthInformation healthInformation, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(reportApplicationHealthWithServiceResponseAsync(applicationId, healthInformation), serviceCallback); + } + + /** + * 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 applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable reportApplicationHealthAsync(String applicationId, HealthInformation healthInformation) { + return reportApplicationHealthWithServiceResponseAsync(applicationId, healthInformation).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> reportApplicationHealthWithServiceResponseAsync(String applicationId, HealthInformation healthInformation) { + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + if (healthInformation == null) { + throw new IllegalArgumentException("Parameter healthInformation is required and cannot be null."); + } + Validator.validate(healthInformation); + final String apiVersion = "6.0"; + final Boolean immediate = null; + final Long timeout = null; + return service.reportApplicationHealth(applicationId, apiVersion, healthInformation, immediate, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = reportApplicationHealthDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void reportApplicationHealth(String applicationId, HealthInformation healthInformation, Boolean immediate, Long timeout) { + reportApplicationHealthWithServiceResponseAsync(applicationId, healthInformation, immediate, timeout).toBlocking().single().body(); + } + + /** + * 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 applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture reportApplicationHealthAsync(String applicationId, HealthInformation healthInformation, Boolean immediate, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(reportApplicationHealthWithServiceResponseAsync(applicationId, healthInformation, immediate, timeout), serviceCallback); + } + + /** + * 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 applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable reportApplicationHealthAsync(String applicationId, HealthInformation healthInformation, Boolean immediate, Long timeout) { + return reportApplicationHealthWithServiceResponseAsync(applicationId, healthInformation, immediate, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> reportApplicationHealthWithServiceResponseAsync(String applicationId, HealthInformation healthInformation, Boolean immediate, Long timeout) { + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + if (healthInformation == null) { + throw new IllegalArgumentException("Parameter healthInformation is required and cannot be null."); + } + Validator.validate(healthInformation); + final String apiVersion = "6.0"; + return service.reportApplicationHealth(applicationId, apiVersion, healthInformation, immediate, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = reportApplicationHealthDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse reportApplicationHealthDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param applicationUpgradeDescription Parameters for an application upgrade. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void startApplicationUpgrade(String applicationId, ApplicationUpgradeDescription applicationUpgradeDescription) { + startApplicationUpgradeWithServiceResponseAsync(applicationId, applicationUpgradeDescription).toBlocking().single().body(); + } + + /** + * 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 applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param applicationUpgradeDescription Parameters for an application upgrade. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture startApplicationUpgradeAsync(String applicationId, ApplicationUpgradeDescription applicationUpgradeDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startApplicationUpgradeWithServiceResponseAsync(applicationId, applicationUpgradeDescription), serviceCallback); + } + + /** + * 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 applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param applicationUpgradeDescription Parameters for an application upgrade. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable startApplicationUpgradeAsync(String applicationId, ApplicationUpgradeDescription applicationUpgradeDescription) { + return startApplicationUpgradeWithServiceResponseAsync(applicationId, applicationUpgradeDescription).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param applicationUpgradeDescription Parameters for an application upgrade. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> startApplicationUpgradeWithServiceResponseAsync(String applicationId, ApplicationUpgradeDescription applicationUpgradeDescription) { + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + if (applicationUpgradeDescription == null) { + throw new IllegalArgumentException("Parameter applicationUpgradeDescription is required and cannot be null."); + } + Validator.validate(applicationUpgradeDescription); + final String apiVersion = "6.0"; + final Long timeout = null; + return service.startApplicationUpgrade(applicationId, apiVersion, applicationUpgradeDescription, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = startApplicationUpgradeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param applicationUpgradeDescription Parameters for an application upgrade. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void startApplicationUpgrade(String applicationId, ApplicationUpgradeDescription applicationUpgradeDescription, Long timeout) { + startApplicationUpgradeWithServiceResponseAsync(applicationId, applicationUpgradeDescription, timeout).toBlocking().single().body(); + } + + /** + * 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 applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param applicationUpgradeDescription Parameters for an application upgrade. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture startApplicationUpgradeAsync(String applicationId, ApplicationUpgradeDescription applicationUpgradeDescription, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startApplicationUpgradeWithServiceResponseAsync(applicationId, applicationUpgradeDescription, timeout), serviceCallback); + } + + /** + * 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 applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param applicationUpgradeDescription Parameters for an application upgrade. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable startApplicationUpgradeAsync(String applicationId, ApplicationUpgradeDescription applicationUpgradeDescription, Long timeout) { + return startApplicationUpgradeWithServiceResponseAsync(applicationId, applicationUpgradeDescription, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param applicationUpgradeDescription Parameters for an application upgrade. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> startApplicationUpgradeWithServiceResponseAsync(String applicationId, ApplicationUpgradeDescription applicationUpgradeDescription, Long timeout) { + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + if (applicationUpgradeDescription == null) { + throw new IllegalArgumentException("Parameter applicationUpgradeDescription is required and cannot be null."); + } + Validator.validate(applicationUpgradeDescription); + final String apiVersion = "6.0"; + return service.startApplicationUpgrade(applicationId, apiVersion, applicationUpgradeDescription, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = startApplicationUpgradeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse startApplicationUpgradeDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets details for the latest upgrade performed on this application. + * Returns information about the state of the latest application upgrade along with details to aid debugging application health issues. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationUpgradeProgressInfoInner object if successful. + */ + public ApplicationUpgradeProgressInfoInner getApplicationUpgrade(String applicationId) { + return getApplicationUpgradeWithServiceResponseAsync(applicationId).toBlocking().single().body(); + } + + /** + * Gets details for the latest upgrade performed on this application. + * Returns information about the state of the latest application upgrade along with details to aid debugging application health issues. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getApplicationUpgradeAsync(String applicationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getApplicationUpgradeWithServiceResponseAsync(applicationId), serviceCallback); + } + + /** + * Gets details for the latest upgrade performed on this application. + * Returns information about the state of the latest application upgrade along with details to aid debugging application health issues. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationUpgradeProgressInfoInner object + */ + public Observable getApplicationUpgradeAsync(String applicationId) { + return getApplicationUpgradeWithServiceResponseAsync(applicationId).map(new Func1, ApplicationUpgradeProgressInfoInner>() { + @Override + public ApplicationUpgradeProgressInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets details for the latest upgrade performed on this application. + * Returns information about the state of the latest application upgrade along with details to aid debugging application health issues. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationUpgradeProgressInfoInner object + */ + public Observable> getApplicationUpgradeWithServiceResponseAsync(String applicationId) { + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + return service.getApplicationUpgrade(applicationId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getApplicationUpgradeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets details for the latest upgrade performed on this application. + * Returns information about the state of the latest application upgrade along with details to aid debugging application health issues. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationUpgradeProgressInfoInner object if successful. + */ + public ApplicationUpgradeProgressInfoInner getApplicationUpgrade(String applicationId, Long timeout) { + return getApplicationUpgradeWithServiceResponseAsync(applicationId, timeout).toBlocking().single().body(); + } + + /** + * Gets details for the latest upgrade performed on this application. + * Returns information about the state of the latest application upgrade along with details to aid debugging application health issues. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getApplicationUpgradeAsync(String applicationId, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getApplicationUpgradeWithServiceResponseAsync(applicationId, timeout), serviceCallback); + } + + /** + * Gets details for the latest upgrade performed on this application. + * Returns information about the state of the latest application upgrade along with details to aid debugging application health issues. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationUpgradeProgressInfoInner object + */ + public Observable getApplicationUpgradeAsync(String applicationId, Long timeout) { + return getApplicationUpgradeWithServiceResponseAsync(applicationId, timeout).map(new Func1, ApplicationUpgradeProgressInfoInner>() { + @Override + public ApplicationUpgradeProgressInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets details for the latest upgrade performed on this application. + * Returns information about the state of the latest application upgrade along with details to aid debugging application health issues. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationUpgradeProgressInfoInner object + */ + public Observable> getApplicationUpgradeWithServiceResponseAsync(String applicationId, Long timeout) { + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.getApplicationUpgrade(applicationId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getApplicationUpgradeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getApplicationUpgradeDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Updates an ongoing application upgrade in the Service Fabric cluster. + * Updates the parameters of an ongoing application upgrade from the ones specified at the time of starting the application upgrade. This may be required to mitigate stuck application upgrades due to incorrect parameters or issues in the application to make progress. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param applicationUpgradeUpdateDescription Parameters for updating an existing application upgrade. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void updateApplicationUpgrade(String applicationId, ApplicationUpgradeUpdateDescription applicationUpgradeUpdateDescription) { + updateApplicationUpgradeWithServiceResponseAsync(applicationId, applicationUpgradeUpdateDescription).toBlocking().single().body(); + } + + /** + * Updates an ongoing application upgrade in the Service Fabric cluster. + * Updates the parameters of an ongoing application upgrade from the ones specified at the time of starting the application upgrade. This may be required to mitigate stuck application upgrades due to incorrect parameters or issues in the application to make progress. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param applicationUpgradeUpdateDescription Parameters for updating an existing application upgrade. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateApplicationUpgradeAsync(String applicationId, ApplicationUpgradeUpdateDescription applicationUpgradeUpdateDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateApplicationUpgradeWithServiceResponseAsync(applicationId, applicationUpgradeUpdateDescription), serviceCallback); + } + + /** + * Updates an ongoing application upgrade in the Service Fabric cluster. + * Updates the parameters of an ongoing application upgrade from the ones specified at the time of starting the application upgrade. This may be required to mitigate stuck application upgrades due to incorrect parameters or issues in the application to make progress. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param applicationUpgradeUpdateDescription Parameters for updating an existing application upgrade. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable updateApplicationUpgradeAsync(String applicationId, ApplicationUpgradeUpdateDescription applicationUpgradeUpdateDescription) { + return updateApplicationUpgradeWithServiceResponseAsync(applicationId, applicationUpgradeUpdateDescription).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an ongoing application upgrade in the Service Fabric cluster. + * Updates the parameters of an ongoing application upgrade from the ones specified at the time of starting the application upgrade. This may be required to mitigate stuck application upgrades due to incorrect parameters or issues in the application to make progress. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param applicationUpgradeUpdateDescription Parameters for updating an existing application upgrade. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> updateApplicationUpgradeWithServiceResponseAsync(String applicationId, ApplicationUpgradeUpdateDescription applicationUpgradeUpdateDescription) { + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + if (applicationUpgradeUpdateDescription == null) { + throw new IllegalArgumentException("Parameter applicationUpgradeUpdateDescription is required and cannot be null."); + } + Validator.validate(applicationUpgradeUpdateDescription); + final String apiVersion = "6.0"; + final Long timeout = null; + return service.updateApplicationUpgrade(applicationId, apiVersion, applicationUpgradeUpdateDescription, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateApplicationUpgradeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates an ongoing application upgrade in the Service Fabric cluster. + * Updates the parameters of an ongoing application upgrade from the ones specified at the time of starting the application upgrade. This may be required to mitigate stuck application upgrades due to incorrect parameters or issues in the application to make progress. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param applicationUpgradeUpdateDescription Parameters for updating an existing application upgrade. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void updateApplicationUpgrade(String applicationId, ApplicationUpgradeUpdateDescription applicationUpgradeUpdateDescription, Long timeout) { + updateApplicationUpgradeWithServiceResponseAsync(applicationId, applicationUpgradeUpdateDescription, timeout).toBlocking().single().body(); + } + + /** + * Updates an ongoing application upgrade in the Service Fabric cluster. + * Updates the parameters of an ongoing application upgrade from the ones specified at the time of starting the application upgrade. This may be required to mitigate stuck application upgrades due to incorrect parameters or issues in the application to make progress. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param applicationUpgradeUpdateDescription Parameters for updating an existing application upgrade. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateApplicationUpgradeAsync(String applicationId, ApplicationUpgradeUpdateDescription applicationUpgradeUpdateDescription, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateApplicationUpgradeWithServiceResponseAsync(applicationId, applicationUpgradeUpdateDescription, timeout), serviceCallback); + } + + /** + * Updates an ongoing application upgrade in the Service Fabric cluster. + * Updates the parameters of an ongoing application upgrade from the ones specified at the time of starting the application upgrade. This may be required to mitigate stuck application upgrades due to incorrect parameters or issues in the application to make progress. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param applicationUpgradeUpdateDescription Parameters for updating an existing application upgrade. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable updateApplicationUpgradeAsync(String applicationId, ApplicationUpgradeUpdateDescription applicationUpgradeUpdateDescription, Long timeout) { + return updateApplicationUpgradeWithServiceResponseAsync(applicationId, applicationUpgradeUpdateDescription, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an ongoing application upgrade in the Service Fabric cluster. + * Updates the parameters of an ongoing application upgrade from the ones specified at the time of starting the application upgrade. This may be required to mitigate stuck application upgrades due to incorrect parameters or issues in the application to make progress. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param applicationUpgradeUpdateDescription Parameters for updating an existing application upgrade. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> updateApplicationUpgradeWithServiceResponseAsync(String applicationId, ApplicationUpgradeUpdateDescription applicationUpgradeUpdateDescription, Long timeout) { + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + if (applicationUpgradeUpdateDescription == null) { + throw new IllegalArgumentException("Parameter applicationUpgradeUpdateDescription is required and cannot be null."); + } + Validator.validate(applicationUpgradeUpdateDescription); + final String apiVersion = "6.0"; + return service.updateApplicationUpgrade(applicationId, apiVersion, applicationUpgradeUpdateDescription, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateApplicationUpgradeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateApplicationUpgradeDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Resumes upgrading an application in the Service Fabric cluster. + * Resumes an unmonitored manual Service Fabric application upgrade. Service Fabric upgrades one upgrade domain at a time. For unmonitored manual upgrades, after Service Fabric finishes an upgrade domain, it waits for you to call this API before proceeding to the next upgrade domain. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param upgradeDomainName The name of the upgrade domain in which to resume the upgrade. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void resumeApplicationUpgrade(String applicationId, String upgradeDomainName) { + resumeApplicationUpgradeWithServiceResponseAsync(applicationId, upgradeDomainName).toBlocking().single().body(); + } + + /** + * Resumes upgrading an application in the Service Fabric cluster. + * Resumes an unmonitored manual Service Fabric application upgrade. Service Fabric upgrades one upgrade domain at a time. For unmonitored manual upgrades, after Service Fabric finishes an upgrade domain, it waits for you to call this API before proceeding to the next upgrade domain. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param upgradeDomainName The name of the upgrade domain in which to resume the upgrade. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture resumeApplicationUpgradeAsync(String applicationId, String upgradeDomainName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resumeApplicationUpgradeWithServiceResponseAsync(applicationId, upgradeDomainName), serviceCallback); + } + + /** + * Resumes upgrading an application in the Service Fabric cluster. + * Resumes an unmonitored manual Service Fabric application upgrade. Service Fabric upgrades one upgrade domain at a time. For unmonitored manual upgrades, after Service Fabric finishes an upgrade domain, it waits for you to call this API before proceeding to the next upgrade domain. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param upgradeDomainName The name of the upgrade domain in which to resume the upgrade. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable resumeApplicationUpgradeAsync(String applicationId, String upgradeDomainName) { + return resumeApplicationUpgradeWithServiceResponseAsync(applicationId, upgradeDomainName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resumes upgrading an application in the Service Fabric cluster. + * Resumes an unmonitored manual Service Fabric application upgrade. Service Fabric upgrades one upgrade domain at a time. For unmonitored manual upgrades, after Service Fabric finishes an upgrade domain, it waits for you to call this API before proceeding to the next upgrade domain. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param upgradeDomainName The name of the upgrade domain in which to resume the upgrade. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> resumeApplicationUpgradeWithServiceResponseAsync(String applicationId, String upgradeDomainName) { + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + if (upgradeDomainName == null) { + throw new IllegalArgumentException("Parameter upgradeDomainName is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + ResumeApplicationUpgradeDescription resumeApplicationUpgradeDescription = new ResumeApplicationUpgradeDescription(); + resumeApplicationUpgradeDescription.withUpgradeDomainName(upgradeDomainName); + return service.resumeApplicationUpgrade(applicationId, apiVersion, timeout, this.acceptLanguage(), resumeApplicationUpgradeDescription, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = resumeApplicationUpgradeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Resumes upgrading an application in the Service Fabric cluster. + * Resumes an unmonitored manual Service Fabric application upgrade. Service Fabric upgrades one upgrade domain at a time. For unmonitored manual upgrades, after Service Fabric finishes an upgrade domain, it waits for you to call this API before proceeding to the next upgrade domain. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param upgradeDomainName The name of the upgrade domain in which to resume the upgrade. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void resumeApplicationUpgrade(String applicationId, String upgradeDomainName, Long timeout) { + resumeApplicationUpgradeWithServiceResponseAsync(applicationId, upgradeDomainName, timeout).toBlocking().single().body(); + } + + /** + * Resumes upgrading an application in the Service Fabric cluster. + * Resumes an unmonitored manual Service Fabric application upgrade. Service Fabric upgrades one upgrade domain at a time. For unmonitored manual upgrades, after Service Fabric finishes an upgrade domain, it waits for you to call this API before proceeding to the next upgrade domain. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param upgradeDomainName The name of the upgrade domain in which to resume the upgrade. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture resumeApplicationUpgradeAsync(String applicationId, String upgradeDomainName, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resumeApplicationUpgradeWithServiceResponseAsync(applicationId, upgradeDomainName, timeout), serviceCallback); + } + + /** + * Resumes upgrading an application in the Service Fabric cluster. + * Resumes an unmonitored manual Service Fabric application upgrade. Service Fabric upgrades one upgrade domain at a time. For unmonitored manual upgrades, after Service Fabric finishes an upgrade domain, it waits for you to call this API before proceeding to the next upgrade domain. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param upgradeDomainName The name of the upgrade domain in which to resume the upgrade. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable resumeApplicationUpgradeAsync(String applicationId, String upgradeDomainName, Long timeout) { + return resumeApplicationUpgradeWithServiceResponseAsync(applicationId, upgradeDomainName, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resumes upgrading an application in the Service Fabric cluster. + * Resumes an unmonitored manual Service Fabric application upgrade. Service Fabric upgrades one upgrade domain at a time. For unmonitored manual upgrades, after Service Fabric finishes an upgrade domain, it waits for you to call this API before proceeding to the next upgrade domain. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param upgradeDomainName The name of the upgrade domain in which to resume the upgrade. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> resumeApplicationUpgradeWithServiceResponseAsync(String applicationId, String upgradeDomainName, Long timeout) { + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + if (upgradeDomainName == null) { + throw new IllegalArgumentException("Parameter upgradeDomainName is required and cannot be null."); + } + final String apiVersion = "6.0"; + ResumeApplicationUpgradeDescription resumeApplicationUpgradeDescription = new ResumeApplicationUpgradeDescription(); + resumeApplicationUpgradeDescription.withUpgradeDomainName(upgradeDomainName); + return service.resumeApplicationUpgrade(applicationId, apiVersion, timeout, this.acceptLanguage(), resumeApplicationUpgradeDescription, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = resumeApplicationUpgradeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse resumeApplicationUpgradeDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void rollbackApplicationUpgrade(String applicationId) { + rollbackApplicationUpgradeWithServiceResponseAsync(applicationId).toBlocking().single().body(); + } + + /** + * 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 applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture rollbackApplicationUpgradeAsync(String applicationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(rollbackApplicationUpgradeWithServiceResponseAsync(applicationId), serviceCallback); + } + + /** + * 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 applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable rollbackApplicationUpgradeAsync(String applicationId) { + return rollbackApplicationUpgradeWithServiceResponseAsync(applicationId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> rollbackApplicationUpgradeWithServiceResponseAsync(String applicationId) { + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + return service.rollbackApplicationUpgrade(applicationId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = rollbackApplicationUpgradeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void rollbackApplicationUpgrade(String applicationId, Long timeout) { + rollbackApplicationUpgradeWithServiceResponseAsync(applicationId, timeout).toBlocking().single().body(); + } + + /** + * 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 applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture rollbackApplicationUpgradeAsync(String applicationId, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(rollbackApplicationUpgradeWithServiceResponseAsync(applicationId, timeout), serviceCallback); + } + + /** + * 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 applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable rollbackApplicationUpgradeAsync(String applicationId, Long timeout) { + return rollbackApplicationUpgradeWithServiceResponseAsync(applicationId, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> rollbackApplicationUpgradeWithServiceResponseAsync(String applicationId, Long timeout) { + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.rollbackApplicationUpgrade(applicationId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = rollbackApplicationUpgradeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse rollbackApplicationUpgradeDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 nodeName The name of the node. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedDeployedApplicationInfoListInner object if successful. + */ + public PagedDeployedApplicationInfoListInner getDeployedApplicationInfoList(String nodeName) { + return getDeployedApplicationInfoListWithServiceResponseAsync(nodeName).toBlocking().single().body(); + } + + /** + * 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 nodeName The name of the node. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getDeployedApplicationInfoListAsync(String nodeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDeployedApplicationInfoListWithServiceResponseAsync(nodeName), serviceCallback); + } + + /** + * 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 nodeName The name of the node. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedDeployedApplicationInfoListInner object + */ + public Observable getDeployedApplicationInfoListAsync(String nodeName) { + return getDeployedApplicationInfoListWithServiceResponseAsync(nodeName).map(new Func1, PagedDeployedApplicationInfoListInner>() { + @Override + public PagedDeployedApplicationInfoListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 nodeName The name of the node. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedDeployedApplicationInfoListInner object + */ + public Observable> getDeployedApplicationInfoListWithServiceResponseAsync(String nodeName) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + final String apiVersion = "6.1"; + final Long timeout = null; + final Boolean includeHealthState = null; + final String continuationToken = null; + final Long maxResults = null; + return service.getDeployedApplicationInfoList(nodeName, apiVersion, timeout, includeHealthState, continuationToken, maxResults, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDeployedApplicationInfoListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 nodeName The name of the node. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param 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 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedDeployedApplicationInfoListInner object if successful. + */ + public PagedDeployedApplicationInfoListInner getDeployedApplicationInfoList(String nodeName, Long timeout, Boolean includeHealthState, String continuationToken, Long maxResults) { + return getDeployedApplicationInfoListWithServiceResponseAsync(nodeName, timeout, includeHealthState, continuationToken, maxResults).toBlocking().single().body(); + } + + /** + * 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 nodeName The name of the node. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param 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 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 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getDeployedApplicationInfoListAsync(String nodeName, Long timeout, Boolean includeHealthState, String continuationToken, Long maxResults, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDeployedApplicationInfoListWithServiceResponseAsync(nodeName, timeout, includeHealthState, continuationToken, maxResults), serviceCallback); + } + + /** + * 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 nodeName The name of the node. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param 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 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedDeployedApplicationInfoListInner object + */ + public Observable getDeployedApplicationInfoListAsync(String nodeName, Long timeout, Boolean includeHealthState, String continuationToken, Long maxResults) { + return getDeployedApplicationInfoListWithServiceResponseAsync(nodeName, timeout, includeHealthState, continuationToken, maxResults).map(new Func1, PagedDeployedApplicationInfoListInner>() { + @Override + public PagedDeployedApplicationInfoListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 nodeName The name of the node. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param 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 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedDeployedApplicationInfoListInner object + */ + public Observable> getDeployedApplicationInfoListWithServiceResponseAsync(String nodeName, Long timeout, Boolean includeHealthState, String continuationToken, Long maxResults) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + final String apiVersion = "6.1"; + return service.getDeployedApplicationInfoList(nodeName, apiVersion, timeout, includeHealthState, continuationToken, maxResults, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDeployedApplicationInfoListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDeployedApplicationInfoListDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the information about an application deployed on a Service Fabric node. + * This query returns system application information if the application ID provided is for system application. Results encompass deployed applications in active, activating, and downloading states. This query requires that the node name corresponds to a node on the cluster. The query fails if the provided node name does not point to any active Service Fabric nodes on the cluster. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DeployedApplicationInfoInner object if successful. + */ + public DeployedApplicationInfoInner getDeployedApplicationInfo(String nodeName, String applicationId) { + return getDeployedApplicationInfoWithServiceResponseAsync(nodeName, applicationId).toBlocking().single().body(); + } + + /** + * Gets the information about an application deployed on a Service Fabric node. + * This query returns system application information if the application ID provided is for system application. Results encompass deployed applications in active, activating, and downloading states. This query requires that the node name corresponds to a node on the cluster. The query fails if the provided node name does not point to any active Service Fabric nodes on the cluster. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getDeployedApplicationInfoAsync(String nodeName, String applicationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDeployedApplicationInfoWithServiceResponseAsync(nodeName, applicationId), serviceCallback); + } + + /** + * Gets the information about an application deployed on a Service Fabric node. + * This query returns system application information if the application ID provided is for system application. Results encompass deployed applications in active, activating, and downloading states. This query requires that the node name corresponds to a node on the cluster. The query fails if the provided node name does not point to any active Service Fabric nodes on the cluster. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeployedApplicationInfoInner object + */ + public Observable getDeployedApplicationInfoAsync(String nodeName, String applicationId) { + return getDeployedApplicationInfoWithServiceResponseAsync(nodeName, applicationId).map(new Func1, DeployedApplicationInfoInner>() { + @Override + public DeployedApplicationInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the information about an application deployed on a Service Fabric node. + * This query returns system application information if the application ID provided is for system application. Results encompass deployed applications in active, activating, and downloading states. This query requires that the node name corresponds to a node on the cluster. The query fails if the provided node name does not point to any active Service Fabric nodes on the cluster. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeployedApplicationInfoInner object + */ + public Observable> getDeployedApplicationInfoWithServiceResponseAsync(String nodeName, String applicationId) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + final String apiVersion = "6.1"; + final Long timeout = null; + final Boolean includeHealthState = null; + return service.getDeployedApplicationInfo(nodeName, applicationId, apiVersion, timeout, includeHealthState, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDeployedApplicationInfoDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the information about an application deployed on a Service Fabric node. + * This query returns system application information if the application ID provided is for system application. Results encompass deployed applications in active, activating, and downloading states. This query requires that the node name corresponds to a node on the cluster. The query fails if the provided node name does not point to any active Service Fabric nodes on the cluster. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DeployedApplicationInfoInner object if successful. + */ + public DeployedApplicationInfoInner getDeployedApplicationInfo(String nodeName, String applicationId, Long timeout, Boolean includeHealthState) { + return getDeployedApplicationInfoWithServiceResponseAsync(nodeName, applicationId, timeout, includeHealthState).toBlocking().single().body(); + } + + /** + * Gets the information about an application deployed on a Service Fabric node. + * This query returns system application information if the application ID provided is for system application. Results encompass deployed applications in active, activating, and downloading states. This query requires that the node name corresponds to a node on the cluster. The query fails if the provided node name does not point to any active Service Fabric nodes on the cluster. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getDeployedApplicationInfoAsync(String nodeName, String applicationId, Long timeout, Boolean includeHealthState, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDeployedApplicationInfoWithServiceResponseAsync(nodeName, applicationId, timeout, includeHealthState), serviceCallback); + } + + /** + * Gets the information about an application deployed on a Service Fabric node. + * This query returns system application information if the application ID provided is for system application. Results encompass deployed applications in active, activating, and downloading states. This query requires that the node name corresponds to a node on the cluster. The query fails if the provided node name does not point to any active Service Fabric nodes on the cluster. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeployedApplicationInfoInner object + */ + public Observable getDeployedApplicationInfoAsync(String nodeName, String applicationId, Long timeout, Boolean includeHealthState) { + return getDeployedApplicationInfoWithServiceResponseAsync(nodeName, applicationId, timeout, includeHealthState).map(new Func1, DeployedApplicationInfoInner>() { + @Override + public DeployedApplicationInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the information about an application deployed on a Service Fabric node. + * This query returns system application information if the application ID provided is for system application. Results encompass deployed applications in active, activating, and downloading states. This query requires that the node name corresponds to a node on the cluster. The query fails if the provided node name does not point to any active Service Fabric nodes on the cluster. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeployedApplicationInfoInner object + */ + public Observable> getDeployedApplicationInfoWithServiceResponseAsync(String nodeName, String applicationId, Long timeout, Boolean includeHealthState) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + final String apiVersion = "6.1"; + return service.getDeployedApplicationInfo(nodeName, applicationId, apiVersion, timeout, includeHealthState, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDeployedApplicationInfoDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDeployedApplicationInfoDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the information about health of an application deployed on a Service Fabric node. + * Gets the information about health of an application deployed on a Service Fabric node. Use EventsHealthStateFilter to optionally filter for the collection of HealthEvent objects reported on the deployed application based on health state. Use DeployedServicePackagesHealthStateFilter to optionally filter for DeployedServicePackageHealth children based on health state. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DeployedApplicationHealthInner object if successful. + */ + public DeployedApplicationHealthInner getDeployedApplicationHealth(String nodeName, String applicationId) { + return getDeployedApplicationHealthWithServiceResponseAsync(nodeName, applicationId).toBlocking().single().body(); + } + + /** + * Gets the information about health of an application deployed on a Service Fabric node. + * Gets the information about health of an application deployed on a Service Fabric node. Use EventsHealthStateFilter to optionally filter for the collection of HealthEvent objects reported on the deployed application based on health state. Use DeployedServicePackagesHealthStateFilter to optionally filter for DeployedServicePackageHealth children based on health state. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getDeployedApplicationHealthAsync(String nodeName, String applicationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDeployedApplicationHealthWithServiceResponseAsync(nodeName, applicationId), serviceCallback); + } + + /** + * Gets the information about health of an application deployed on a Service Fabric node. + * Gets the information about health of an application deployed on a Service Fabric node. Use EventsHealthStateFilter to optionally filter for the collection of HealthEvent objects reported on the deployed application based on health state. Use DeployedServicePackagesHealthStateFilter to optionally filter for DeployedServicePackageHealth children based on health state. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeployedApplicationHealthInner object + */ + public Observable getDeployedApplicationHealthAsync(String nodeName, String applicationId) { + return getDeployedApplicationHealthWithServiceResponseAsync(nodeName, applicationId).map(new Func1, DeployedApplicationHealthInner>() { + @Override + public DeployedApplicationHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the information about health of an application deployed on a Service Fabric node. + * Gets the information about health of an application deployed on a Service Fabric node. Use EventsHealthStateFilter to optionally filter for the collection of HealthEvent objects reported on the deployed application based on health state. Use DeployedServicePackagesHealthStateFilter to optionally filter for DeployedServicePackageHealth children based on health state. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeployedApplicationHealthInner object + */ + public Observable> getDeployedApplicationHealthWithServiceResponseAsync(String nodeName, String applicationId) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Integer eventsHealthStateFilter = null; + final Integer deployedServicePackagesHealthStateFilter = null; + final Boolean excludeHealthStatistics = null; + final Long timeout = null; + return service.getDeployedApplicationHealth(nodeName, applicationId, apiVersion, eventsHealthStateFilter, deployedServicePackagesHealthStateFilter, excludeHealthStatistics, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDeployedApplicationHealthDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the information about health of an application deployed on a Service Fabric node. + * Gets the information about health of an application deployed on a Service Fabric node. Use EventsHealthStateFilter to optionally filter for the collection of HealthEvent objects reported on the deployed application based on health state. Use DeployedServicePackagesHealthStateFilter to optionally filter for DeployedServicePackageHealth children based on health state. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DeployedApplicationHealthInner object if successful. + */ + public DeployedApplicationHealthInner getDeployedApplicationHealth(String nodeName, String applicationId, Integer eventsHealthStateFilter, Integer deployedServicePackagesHealthStateFilter, Boolean excludeHealthStatistics, Long timeout) { + return getDeployedApplicationHealthWithServiceResponseAsync(nodeName, applicationId, eventsHealthStateFilter, deployedServicePackagesHealthStateFilter, excludeHealthStatistics, timeout).toBlocking().single().body(); + } + + /** + * Gets the information about health of an application deployed on a Service Fabric node. + * Gets the information about health of an application deployed on a Service Fabric node. Use EventsHealthStateFilter to optionally filter for the collection of HealthEvent objects reported on the deployed application based on health state. Use DeployedServicePackagesHealthStateFilter to optionally filter for DeployedServicePackageHealth children based on health state. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getDeployedApplicationHealthAsync(String nodeName, String applicationId, Integer eventsHealthStateFilter, Integer deployedServicePackagesHealthStateFilter, Boolean excludeHealthStatistics, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDeployedApplicationHealthWithServiceResponseAsync(nodeName, applicationId, eventsHealthStateFilter, deployedServicePackagesHealthStateFilter, excludeHealthStatistics, timeout), serviceCallback); + } + + /** + * Gets the information about health of an application deployed on a Service Fabric node. + * Gets the information about health of an application deployed on a Service Fabric node. Use EventsHealthStateFilter to optionally filter for the collection of HealthEvent objects reported on the deployed application based on health state. Use DeployedServicePackagesHealthStateFilter to optionally filter for DeployedServicePackageHealth children based on health state. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeployedApplicationHealthInner object + */ + public Observable getDeployedApplicationHealthAsync(String nodeName, String applicationId, Integer eventsHealthStateFilter, Integer deployedServicePackagesHealthStateFilter, Boolean excludeHealthStatistics, Long timeout) { + return getDeployedApplicationHealthWithServiceResponseAsync(nodeName, applicationId, eventsHealthStateFilter, deployedServicePackagesHealthStateFilter, excludeHealthStatistics, timeout).map(new Func1, DeployedApplicationHealthInner>() { + @Override + public DeployedApplicationHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the information about health of an application deployed on a Service Fabric node. + * Gets the information about health of an application deployed on a Service Fabric node. Use EventsHealthStateFilter to optionally filter for the collection of HealthEvent objects reported on the deployed application based on health state. Use DeployedServicePackagesHealthStateFilter to optionally filter for DeployedServicePackageHealth children based on health state. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeployedApplicationHealthInner object + */ + public Observable> getDeployedApplicationHealthWithServiceResponseAsync(String nodeName, String applicationId, Integer eventsHealthStateFilter, Integer deployedServicePackagesHealthStateFilter, Boolean excludeHealthStatistics, Long timeout) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.getDeployedApplicationHealth(nodeName, applicationId, apiVersion, eventsHealthStateFilter, deployedServicePackagesHealthStateFilter, excludeHealthStatistics, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDeployedApplicationHealthDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDeployedApplicationHealthDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the information about health of an application deployed on a Service Fabric node. using the specified policy. + * Gets the information about health of an application deployed on a Service Fabric node using the specified policy. Use EventsHealthStateFilter to optionally filter for the collection of HealthEvent objects reported on the deployed application based on health state. Use DeployedServicePackagesHealthStateFilter to optionally filter for DeployedServicePackageHealth children based on health state. Use ApplicationHealthPolicy to optionally override the health policies used to evaluate the health. This API only uses 'ConsiderWarningAsError' field of the ApplicationHealthPolicy. The rest of the fields are ignored while evaluating the health of the deployed application. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DeployedApplicationHealthInner object if successful. + */ + public DeployedApplicationHealthInner getDeployedApplicationHealthUsingPolicy(String nodeName, String applicationId) { + return getDeployedApplicationHealthUsingPolicyWithServiceResponseAsync(nodeName, applicationId).toBlocking().single().body(); + } + + /** + * Gets the information about health of an application deployed on a Service Fabric node. using the specified policy. + * Gets the information about health of an application deployed on a Service Fabric node using the specified policy. Use EventsHealthStateFilter to optionally filter for the collection of HealthEvent objects reported on the deployed application based on health state. Use DeployedServicePackagesHealthStateFilter to optionally filter for DeployedServicePackageHealth children based on health state. Use ApplicationHealthPolicy to optionally override the health policies used to evaluate the health. This API only uses 'ConsiderWarningAsError' field of the ApplicationHealthPolicy. The rest of the fields are ignored while evaluating the health of the deployed application. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getDeployedApplicationHealthUsingPolicyAsync(String nodeName, String applicationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDeployedApplicationHealthUsingPolicyWithServiceResponseAsync(nodeName, applicationId), serviceCallback); + } + + /** + * Gets the information about health of an application deployed on a Service Fabric node. using the specified policy. + * Gets the information about health of an application deployed on a Service Fabric node using the specified policy. Use EventsHealthStateFilter to optionally filter for the collection of HealthEvent objects reported on the deployed application based on health state. Use DeployedServicePackagesHealthStateFilter to optionally filter for DeployedServicePackageHealth children based on health state. Use ApplicationHealthPolicy to optionally override the health policies used to evaluate the health. This API only uses 'ConsiderWarningAsError' field of the ApplicationHealthPolicy. The rest of the fields are ignored while evaluating the health of the deployed application. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeployedApplicationHealthInner object + */ + public Observable getDeployedApplicationHealthUsingPolicyAsync(String nodeName, String applicationId) { + return getDeployedApplicationHealthUsingPolicyWithServiceResponseAsync(nodeName, applicationId).map(new Func1, DeployedApplicationHealthInner>() { + @Override + public DeployedApplicationHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the information about health of an application deployed on a Service Fabric node. using the specified policy. + * Gets the information about health of an application deployed on a Service Fabric node using the specified policy. Use EventsHealthStateFilter to optionally filter for the collection of HealthEvent objects reported on the deployed application based on health state. Use DeployedServicePackagesHealthStateFilter to optionally filter for DeployedServicePackageHealth children based on health state. Use ApplicationHealthPolicy to optionally override the health policies used to evaluate the health. This API only uses 'ConsiderWarningAsError' field of the ApplicationHealthPolicy. The rest of the fields are ignored while evaluating the health of the deployed application. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeployedApplicationHealthInner object + */ + public Observable> getDeployedApplicationHealthUsingPolicyWithServiceResponseAsync(String nodeName, String applicationId) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Integer eventsHealthStateFilter = null; + final Integer deployedServicePackagesHealthStateFilter = null; + final ApplicationHealthPolicy applicationHealthPolicy = null; + final Boolean excludeHealthStatistics = null; + final Long timeout = null; + return service.getDeployedApplicationHealthUsingPolicy(nodeName, applicationId, apiVersion, eventsHealthStateFilter, deployedServicePackagesHealthStateFilter, applicationHealthPolicy, excludeHealthStatistics, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDeployedApplicationHealthUsingPolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the information about health of an application deployed on a Service Fabric node. using the specified policy. + * Gets the information about health of an application deployed on a Service Fabric node using the specified policy. Use EventsHealthStateFilter to optionally filter for the collection of HealthEvent objects reported on the deployed application based on health state. Use DeployedServicePackagesHealthStateFilter to optionally filter for DeployedServicePackageHealth children based on health state. Use ApplicationHealthPolicy to optionally override the health policies used to evaluate the health. This API only uses 'ConsiderWarningAsError' field of the ApplicationHealthPolicy. The rest of the fields are ignored while evaluating the health of the deployed application. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DeployedApplicationHealthInner object if successful. + */ + public DeployedApplicationHealthInner getDeployedApplicationHealthUsingPolicy(String nodeName, String applicationId, Integer eventsHealthStateFilter, Integer deployedServicePackagesHealthStateFilter, ApplicationHealthPolicy applicationHealthPolicy, Boolean excludeHealthStatistics, Long timeout) { + return getDeployedApplicationHealthUsingPolicyWithServiceResponseAsync(nodeName, applicationId, eventsHealthStateFilter, deployedServicePackagesHealthStateFilter, applicationHealthPolicy, excludeHealthStatistics, timeout).toBlocking().single().body(); + } + + /** + * Gets the information about health of an application deployed on a Service Fabric node. using the specified policy. + * Gets the information about health of an application deployed on a Service Fabric node using the specified policy. Use EventsHealthStateFilter to optionally filter for the collection of HealthEvent objects reported on the deployed application based on health state. Use DeployedServicePackagesHealthStateFilter to optionally filter for DeployedServicePackageHealth children based on health state. Use ApplicationHealthPolicy to optionally override the health policies used to evaluate the health. This API only uses 'ConsiderWarningAsError' field of the ApplicationHealthPolicy. The rest of the fields are ignored while evaluating the health of the deployed application. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getDeployedApplicationHealthUsingPolicyAsync(String nodeName, String applicationId, Integer eventsHealthStateFilter, Integer deployedServicePackagesHealthStateFilter, ApplicationHealthPolicy applicationHealthPolicy, Boolean excludeHealthStatistics, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDeployedApplicationHealthUsingPolicyWithServiceResponseAsync(nodeName, applicationId, eventsHealthStateFilter, deployedServicePackagesHealthStateFilter, applicationHealthPolicy, excludeHealthStatistics, timeout), serviceCallback); + } + + /** + * Gets the information about health of an application deployed on a Service Fabric node. using the specified policy. + * Gets the information about health of an application deployed on a Service Fabric node using the specified policy. Use EventsHealthStateFilter to optionally filter for the collection of HealthEvent objects reported on the deployed application based on health state. Use DeployedServicePackagesHealthStateFilter to optionally filter for DeployedServicePackageHealth children based on health state. Use ApplicationHealthPolicy to optionally override the health policies used to evaluate the health. This API only uses 'ConsiderWarningAsError' field of the ApplicationHealthPolicy. The rest of the fields are ignored while evaluating the health of the deployed application. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeployedApplicationHealthInner object + */ + public Observable getDeployedApplicationHealthUsingPolicyAsync(String nodeName, String applicationId, Integer eventsHealthStateFilter, Integer deployedServicePackagesHealthStateFilter, ApplicationHealthPolicy applicationHealthPolicy, Boolean excludeHealthStatistics, Long timeout) { + return getDeployedApplicationHealthUsingPolicyWithServiceResponseAsync(nodeName, applicationId, eventsHealthStateFilter, deployedServicePackagesHealthStateFilter, applicationHealthPolicy, excludeHealthStatistics, timeout).map(new Func1, DeployedApplicationHealthInner>() { + @Override + public DeployedApplicationHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the information about health of an application deployed on a Service Fabric node. using the specified policy. + * Gets the information about health of an application deployed on a Service Fabric node using the specified policy. Use EventsHealthStateFilter to optionally filter for the collection of HealthEvent objects reported on the deployed application based on health state. Use DeployedServicePackagesHealthStateFilter to optionally filter for DeployedServicePackageHealth children based on health state. Use ApplicationHealthPolicy to optionally override the health policies used to evaluate the health. This API only uses 'ConsiderWarningAsError' field of the ApplicationHealthPolicy. The rest of the fields are ignored while evaluating the health of the deployed application. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeployedApplicationHealthInner object + */ + public Observable> getDeployedApplicationHealthUsingPolicyWithServiceResponseAsync(String nodeName, String applicationId, Integer eventsHealthStateFilter, Integer deployedServicePackagesHealthStateFilter, ApplicationHealthPolicy applicationHealthPolicy, Boolean excludeHealthStatistics, Long timeout) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + Validator.validate(applicationHealthPolicy); + final String apiVersion = "6.0"; + return service.getDeployedApplicationHealthUsingPolicy(nodeName, applicationId, apiVersion, eventsHealthStateFilter, deployedServicePackagesHealthStateFilter, applicationHealthPolicy, excludeHealthStatistics, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDeployedApplicationHealthUsingPolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDeployedApplicationHealthUsingPolicyDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Sends a health report on the Service Fabric application deployed on a Service Fabric node. + * Reports health state of the application deployed on a Service Fabric node. The report must contain the information about the source of the health report and property on which it is reported. + The report is sent to a Service Fabric gateway Service, which forwards to the health store. + The report may be accepted by the gateway, but rejected by the health store after extra validation. + For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. + To see whether the report was applied in the health store, get deployed application health and check that the report appears in the HealthEvents section. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void reportDeployedApplicationHealth(String nodeName, String applicationId, HealthInformation healthInformation) { + reportDeployedApplicationHealthWithServiceResponseAsync(nodeName, applicationId, healthInformation).toBlocking().single().body(); + } + + /** + * Sends a health report on the Service Fabric application deployed on a Service Fabric node. + * Reports health state of the application deployed on a Service Fabric node. The report must contain the information about the source of the health report and property on which it is reported. + The report is sent to a Service Fabric gateway Service, which forwards to the health store. + The report may be accepted by the gateway, but rejected by the health store after extra validation. + For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. + To see whether the report was applied in the health store, get deployed application health and check that the report appears in the HealthEvents section. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture reportDeployedApplicationHealthAsync(String nodeName, String applicationId, HealthInformation healthInformation, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(reportDeployedApplicationHealthWithServiceResponseAsync(nodeName, applicationId, healthInformation), serviceCallback); + } + + /** + * Sends a health report on the Service Fabric application deployed on a Service Fabric node. + * Reports health state of the application deployed on a Service Fabric node. The report must contain the information about the source of the health report and property on which it is reported. + The report is sent to a Service Fabric gateway Service, which forwards to the health store. + The report may be accepted by the gateway, but rejected by the health store after extra validation. + For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. + To see whether the report was applied in the health store, get deployed application health and check that the report appears in the HealthEvents section. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable reportDeployedApplicationHealthAsync(String nodeName, String applicationId, HealthInformation healthInformation) { + return reportDeployedApplicationHealthWithServiceResponseAsync(nodeName, applicationId, healthInformation).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Sends a health report on the Service Fabric application deployed on a Service Fabric node. + * Reports health state of the application deployed on a Service Fabric node. The report must contain the information about the source of the health report and property on which it is reported. + The report is sent to a Service Fabric gateway Service, which forwards to the health store. + The report may be accepted by the gateway, but rejected by the health store after extra validation. + For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. + To see whether the report was applied in the health store, get deployed application health and check that the report appears in the HealthEvents section. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> reportDeployedApplicationHealthWithServiceResponseAsync(String nodeName, String applicationId, HealthInformation healthInformation) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + if (healthInformation == null) { + throw new IllegalArgumentException("Parameter healthInformation is required and cannot be null."); + } + Validator.validate(healthInformation); + final String apiVersion = "6.0"; + final Boolean immediate = null; + final Long timeout = null; + return service.reportDeployedApplicationHealth(nodeName, applicationId, apiVersion, healthInformation, immediate, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = reportDeployedApplicationHealthDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Sends a health report on the Service Fabric application deployed on a Service Fabric node. + * Reports health state of the application deployed on a Service Fabric node. The report must contain the information about the source of the health report and property on which it is reported. + The report is sent to a Service Fabric gateway Service, which forwards to the health store. + The report may be accepted by the gateway, but rejected by the health store after extra validation. + For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. + To see whether the report was applied in the health store, get deployed application health and check that the report appears in the HealthEvents section. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void reportDeployedApplicationHealth(String nodeName, String applicationId, HealthInformation healthInformation, Boolean immediate, Long timeout) { + reportDeployedApplicationHealthWithServiceResponseAsync(nodeName, applicationId, healthInformation, immediate, timeout).toBlocking().single().body(); + } + + /** + * Sends a health report on the Service Fabric application deployed on a Service Fabric node. + * Reports health state of the application deployed on a Service Fabric node. The report must contain the information about the source of the health report and property on which it is reported. + The report is sent to a Service Fabric gateway Service, which forwards to the health store. + The report may be accepted by the gateway, but rejected by the health store after extra validation. + For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. + To see whether the report was applied in the health store, get deployed application health and check that the report appears in the HealthEvents section. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture reportDeployedApplicationHealthAsync(String nodeName, String applicationId, HealthInformation healthInformation, Boolean immediate, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(reportDeployedApplicationHealthWithServiceResponseAsync(nodeName, applicationId, healthInformation, immediate, timeout), serviceCallback); + } + + /** + * Sends a health report on the Service Fabric application deployed on a Service Fabric node. + * Reports health state of the application deployed on a Service Fabric node. The report must contain the information about the source of the health report and property on which it is reported. + The report is sent to a Service Fabric gateway Service, which forwards to the health store. + The report may be accepted by the gateway, but rejected by the health store after extra validation. + For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. + To see whether the report was applied in the health store, get deployed application health and check that the report appears in the HealthEvents section. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable reportDeployedApplicationHealthAsync(String nodeName, String applicationId, HealthInformation healthInformation, Boolean immediate, Long timeout) { + return reportDeployedApplicationHealthWithServiceResponseAsync(nodeName, applicationId, healthInformation, immediate, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Sends a health report on the Service Fabric application deployed on a Service Fabric node. + * Reports health state of the application deployed on a Service Fabric node. The report must contain the information about the source of the health report and property on which it is reported. + The report is sent to a Service Fabric gateway Service, which forwards to the health store. + The report may be accepted by the gateway, but rejected by the health store after extra validation. + For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. + To see whether the report was applied in the health store, get deployed application health and check that the report appears in the HealthEvents section. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> reportDeployedApplicationHealthWithServiceResponseAsync(String nodeName, String applicationId, HealthInformation healthInformation, Boolean immediate, Long timeout) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + if (healthInformation == null) { + throw new IllegalArgumentException("Parameter healthInformation is required and cannot be null."); + } + Validator.validate(healthInformation); + final String apiVersion = "6.0"; + return service.reportDeployedApplicationHealth(nodeName, applicationId, apiVersion, healthInformation, immediate, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = reportDeployedApplicationHealthDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse reportDeployedApplicationHealthDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the manifest describing an application type. + * The response contains the application manifest XML as a string. + * + * @param applicationTypeName The name of the application type. + * @param applicationTypeVersion The version of the application type. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationTypeManifestInner object if successful. + */ + public ApplicationTypeManifestInner getApplicationManifest(String applicationTypeName, String applicationTypeVersion) { + return getApplicationManifestWithServiceResponseAsync(applicationTypeName, applicationTypeVersion).toBlocking().single().body(); + } + + /** + * Gets the manifest describing an application type. + * The response contains the application manifest XML as a string. + * + * @param applicationTypeName The name of the application type. + * @param applicationTypeVersion The version of the application type. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getApplicationManifestAsync(String applicationTypeName, String applicationTypeVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getApplicationManifestWithServiceResponseAsync(applicationTypeName, applicationTypeVersion), serviceCallback); + } + + /** + * Gets the manifest describing an application type. + * The response contains the application manifest XML as a string. + * + * @param applicationTypeName The name of the application type. + * @param applicationTypeVersion The version of the application type. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationTypeManifestInner object + */ + public Observable getApplicationManifestAsync(String applicationTypeName, String applicationTypeVersion) { + return getApplicationManifestWithServiceResponseAsync(applicationTypeName, applicationTypeVersion).map(new Func1, ApplicationTypeManifestInner>() { + @Override + public ApplicationTypeManifestInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the manifest describing an application type. + * The response contains the application manifest XML as a string. + * + * @param applicationTypeName The name of the application type. + * @param applicationTypeVersion The version of the application type. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationTypeManifestInner object + */ + public Observable> getApplicationManifestWithServiceResponseAsync(String applicationTypeName, String applicationTypeVersion) { + if (applicationTypeName == null) { + throw new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null."); + } + if (applicationTypeVersion == null) { + throw new IllegalArgumentException("Parameter applicationTypeVersion is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + return service.getApplicationManifest(applicationTypeName, apiVersion, applicationTypeVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getApplicationManifestDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the manifest describing an application type. + * The response contains the application manifest XML as a string. + * + * @param applicationTypeName The name of the application type. + * @param applicationTypeVersion The version of the application type. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationTypeManifestInner object if successful. + */ + public ApplicationTypeManifestInner getApplicationManifest(String applicationTypeName, String applicationTypeVersion, Long timeout) { + return getApplicationManifestWithServiceResponseAsync(applicationTypeName, applicationTypeVersion, timeout).toBlocking().single().body(); + } + + /** + * Gets the manifest describing an application type. + * The response contains the application manifest XML as a string. + * + * @param applicationTypeName The name of the application type. + * @param applicationTypeVersion The version of the application type. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getApplicationManifestAsync(String applicationTypeName, String applicationTypeVersion, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getApplicationManifestWithServiceResponseAsync(applicationTypeName, applicationTypeVersion, timeout), serviceCallback); + } + + /** + * Gets the manifest describing an application type. + * The response contains the application manifest XML as a string. + * + * @param applicationTypeName The name of the application type. + * @param applicationTypeVersion The version of the application type. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationTypeManifestInner object + */ + public Observable getApplicationManifestAsync(String applicationTypeName, String applicationTypeVersion, Long timeout) { + return getApplicationManifestWithServiceResponseAsync(applicationTypeName, applicationTypeVersion, timeout).map(new Func1, ApplicationTypeManifestInner>() { + @Override + public ApplicationTypeManifestInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the manifest describing an application type. + * The response contains the application manifest XML as a string. + * + * @param applicationTypeName The name of the application type. + * @param applicationTypeVersion The version of the application type. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationTypeManifestInner object + */ + public Observable> getApplicationManifestWithServiceResponseAsync(String applicationTypeName, String applicationTypeVersion, Long timeout) { + if (applicationTypeName == null) { + throw new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null."); + } + if (applicationTypeVersion == null) { + throw new IllegalArgumentException("Parameter applicationTypeVersion is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.getApplicationManifest(applicationTypeName, apiVersion, applicationTypeVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getApplicationManifestDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getApplicationManifestDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the information about all services belonging to the application specified by the application ID. + * Returns the information about all services belonging to the application specified by the application ID. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedServiceInfoListInner object if successful. + */ + public PagedServiceInfoListInner getServiceInfoList(String applicationId) { + return getServiceInfoListWithServiceResponseAsync(applicationId).toBlocking().single().body(); + } + + /** + * Gets the information about all services belonging to the application specified by the application ID. + * Returns the information about all services belonging to the application specified by the application ID. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getServiceInfoListAsync(String applicationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getServiceInfoListWithServiceResponseAsync(applicationId), serviceCallback); + } + + /** + * Gets the information about all services belonging to the application specified by the application ID. + * Returns the information about all services belonging to the application specified by the application ID. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedServiceInfoListInner object + */ + public Observable getServiceInfoListAsync(String applicationId) { + return getServiceInfoListWithServiceResponseAsync(applicationId).map(new Func1, PagedServiceInfoListInner>() { + @Override + public PagedServiceInfoListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the information about all services belonging to the application specified by the application ID. + * Returns the information about all services belonging to the application specified by the application ID. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedServiceInfoListInner object + */ + public Observable> getServiceInfoListWithServiceResponseAsync(String applicationId) { + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final String serviceTypeName = null; + final String continuationToken = null; + final Long timeout = null; + return service.getServiceInfoList(applicationId, serviceTypeName, apiVersion, continuationToken, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getServiceInfoListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the information about all services belonging to the application specified by the application ID. + * Returns the information about all services belonging to the application specified by the application ID. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceTypeName The service type name used to filter the services to query for. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedServiceInfoListInner object if successful. + */ + public PagedServiceInfoListInner getServiceInfoList(String applicationId, String serviceTypeName, String continuationToken, Long timeout) { + return getServiceInfoListWithServiceResponseAsync(applicationId, serviceTypeName, continuationToken, timeout).toBlocking().single().body(); + } + + /** + * Gets the information about all services belonging to the application specified by the application ID. + * Returns the information about all services belonging to the application specified by the application ID. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceTypeName The service type name used to filter the services to query for. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getServiceInfoListAsync(String applicationId, String serviceTypeName, String continuationToken, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getServiceInfoListWithServiceResponseAsync(applicationId, serviceTypeName, continuationToken, timeout), serviceCallback); + } + + /** + * Gets the information about all services belonging to the application specified by the application ID. + * Returns the information about all services belonging to the application specified by the application ID. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceTypeName The service type name used to filter the services to query for. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedServiceInfoListInner object + */ + public Observable getServiceInfoListAsync(String applicationId, String serviceTypeName, String continuationToken, Long timeout) { + return getServiceInfoListWithServiceResponseAsync(applicationId, serviceTypeName, continuationToken, timeout).map(new Func1, PagedServiceInfoListInner>() { + @Override + public PagedServiceInfoListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the information about all services belonging to the application specified by the application ID. + * Returns the information about all services belonging to the application specified by the application ID. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceTypeName The service type name used to filter the services to query for. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedServiceInfoListInner object + */ + public Observable> getServiceInfoListWithServiceResponseAsync(String applicationId, String serviceTypeName, String continuationToken, Long timeout) { + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.getServiceInfoList(applicationId, serviceTypeName, apiVersion, continuationToken, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getServiceInfoListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getServiceInfoListDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the information about the specific service belonging to the Service Fabric application. + * Returns the information about the specified service belonging to the specified Service Fabric application. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceInfoInner object if successful. + */ + public ServiceInfoInner getServiceInfo(String applicationId, String serviceId) { + return getServiceInfoWithServiceResponseAsync(applicationId, serviceId).toBlocking().single().body(); + } + + /** + * Gets the information about the specific service belonging to the Service Fabric application. + * Returns the information about the specified service belonging to the specified Service Fabric application. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getServiceInfoAsync(String applicationId, String serviceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getServiceInfoWithServiceResponseAsync(applicationId, serviceId), serviceCallback); + } + + /** + * Gets the information about the specific service belonging to the Service Fabric application. + * Returns the information about the specified service belonging to the specified Service Fabric application. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceInfoInner object + */ + public Observable getServiceInfoAsync(String applicationId, String serviceId) { + return getServiceInfoWithServiceResponseAsync(applicationId, serviceId).map(new Func1, ServiceInfoInner>() { + @Override + public ServiceInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the information about the specific service belonging to the Service Fabric application. + * Returns the information about the specified service belonging to the specified Service Fabric application. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceInfoInner object + */ + public Observable> getServiceInfoWithServiceResponseAsync(String applicationId, String serviceId) { + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + return service.getServiceInfo(applicationId, serviceId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getServiceInfoDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the information about the specific service belonging to the Service Fabric application. + * Returns the information about the specified service belonging to the specified Service Fabric application. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceInfoInner object if successful. + */ + public ServiceInfoInner getServiceInfo(String applicationId, String serviceId, Long timeout) { + return getServiceInfoWithServiceResponseAsync(applicationId, serviceId, timeout).toBlocking().single().body(); + } + + /** + * Gets the information about the specific service belonging to the Service Fabric application. + * Returns the information about the specified service belonging to the specified Service Fabric application. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getServiceInfoAsync(String applicationId, String serviceId, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getServiceInfoWithServiceResponseAsync(applicationId, serviceId, timeout), serviceCallback); + } + + /** + * Gets the information about the specific service belonging to the Service Fabric application. + * Returns the information about the specified service belonging to the specified Service Fabric application. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceInfoInner object + */ + public Observable getServiceInfoAsync(String applicationId, String serviceId, Long timeout) { + return getServiceInfoWithServiceResponseAsync(applicationId, serviceId, timeout).map(new Func1, ServiceInfoInner>() { + @Override + public ServiceInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the information about the specific service belonging to the Service Fabric application. + * Returns the information about the specified service belonging to the specified Service Fabric application. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceInfoInner object + */ + public Observable> getServiceInfoWithServiceResponseAsync(String applicationId, String serviceId, Long timeout) { + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.getServiceInfo(applicationId, serviceId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getServiceInfoDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getServiceInfoDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the name of the Service Fabric application for a service. + * Gets the name of the application for the specified service. A 404 FABRIC_E_SERVICE_DOES_NOT_EXIST error is returned if a service with the provided service ID does not exist. + * + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationNameInfoInner object if successful. + */ + public ApplicationNameInfoInner getApplicationNameInfo(String serviceId) { + return getApplicationNameInfoWithServiceResponseAsync(serviceId).toBlocking().single().body(); + } + + /** + * Gets the name of the Service Fabric application for a service. + * Gets the name of the application for the specified service. A 404 FABRIC_E_SERVICE_DOES_NOT_EXIST error is returned if a service with the provided service ID does not exist. + * + * @param 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getApplicationNameInfoAsync(String serviceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getApplicationNameInfoWithServiceResponseAsync(serviceId), serviceCallback); + } + + /** + * Gets the name of the Service Fabric application for a service. + * Gets the name of the application for the specified service. A 404 FABRIC_E_SERVICE_DOES_NOT_EXIST error is returned if a service with the provided service ID does not exist. + * + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationNameInfoInner object + */ + public Observable getApplicationNameInfoAsync(String serviceId) { + return getApplicationNameInfoWithServiceResponseAsync(serviceId).map(new Func1, ApplicationNameInfoInner>() { + @Override + public ApplicationNameInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the name of the Service Fabric application for a service. + * Gets the name of the application for the specified service. A 404 FABRIC_E_SERVICE_DOES_NOT_EXIST error is returned if a service with the provided service ID does not exist. + * + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationNameInfoInner object + */ + public Observable> getApplicationNameInfoWithServiceResponseAsync(String serviceId) { + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + return service.getApplicationNameInfo(serviceId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getApplicationNameInfoDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the name of the Service Fabric application for a service. + * Gets the name of the application for the specified service. A 404 FABRIC_E_SERVICE_DOES_NOT_EXIST error is returned if a service with the provided service ID does not exist. + * + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationNameInfoInner object if successful. + */ + public ApplicationNameInfoInner getApplicationNameInfo(String serviceId, Long timeout) { + return getApplicationNameInfoWithServiceResponseAsync(serviceId, timeout).toBlocking().single().body(); + } + + /** + * Gets the name of the Service Fabric application for a service. + * Gets the name of the application for the specified service. A 404 FABRIC_E_SERVICE_DOES_NOT_EXIST error is returned if a service with the provided service ID does not exist. + * + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getApplicationNameInfoAsync(String serviceId, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getApplicationNameInfoWithServiceResponseAsync(serviceId, timeout), serviceCallback); + } + + /** + * Gets the name of the Service Fabric application for a service. + * Gets the name of the application for the specified service. A 404 FABRIC_E_SERVICE_DOES_NOT_EXIST error is returned if a service with the provided service ID does not exist. + * + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationNameInfoInner object + */ + public Observable getApplicationNameInfoAsync(String serviceId, Long timeout) { + return getApplicationNameInfoWithServiceResponseAsync(serviceId, timeout).map(new Func1, ApplicationNameInfoInner>() { + @Override + public ApplicationNameInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the name of the Service Fabric application for a service. + * Gets the name of the application for the specified service. A 404 FABRIC_E_SERVICE_DOES_NOT_EXIST error is returned if a service with the provided service ID does not exist. + * + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationNameInfoInner object + */ + public Observable> getApplicationNameInfoWithServiceResponseAsync(String serviceId, Long timeout) { + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.getApplicationNameInfo(serviceId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getApplicationNameInfoDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getApplicationNameInfoDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Creates the specified Service Fabric service. + * This api allows creating a new Service Fabric stateless or stateful service under a specified Service Fabric application. The description for creating the service includes partitioning information and optional properties for placement and load balancing. Some of the properties can later be modified using `UpdateService` API. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceDescription The information necessary to create a service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void createService(String applicationId, ServiceDescriptionInner serviceDescription) { + createServiceWithServiceResponseAsync(applicationId, serviceDescription).toBlocking().single().body(); + } + + /** + * Creates the specified Service Fabric service. + * This api allows creating a new Service Fabric stateless or stateful service under a specified Service Fabric application. The description for creating the service includes partitioning information and optional properties for placement and load balancing. Some of the properties can later be modified using `UpdateService` API. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceDescription The information necessary to create a service. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createServiceAsync(String applicationId, ServiceDescriptionInner serviceDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createServiceWithServiceResponseAsync(applicationId, serviceDescription), serviceCallback); + } + + /** + * Creates the specified Service Fabric service. + * This api allows creating a new Service Fabric stateless or stateful service under a specified Service Fabric application. The description for creating the service includes partitioning information and optional properties for placement and load balancing. Some of the properties can later be modified using `UpdateService` API. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceDescription The information necessary to create a service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable createServiceAsync(String applicationId, ServiceDescriptionInner serviceDescription) { + return createServiceWithServiceResponseAsync(applicationId, serviceDescription).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates the specified Service Fabric service. + * This api allows creating a new Service Fabric stateless or stateful service under a specified Service Fabric application. The description for creating the service includes partitioning information and optional properties for placement and load balancing. Some of the properties can later be modified using `UpdateService` API. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceDescription The information necessary to create a service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> createServiceWithServiceResponseAsync(String applicationId, ServiceDescriptionInner serviceDescription) { + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + if (serviceDescription == null) { + throw new IllegalArgumentException("Parameter serviceDescription is required and cannot be null."); + } + Validator.validate(serviceDescription); + final String apiVersion = "6.0"; + final Long timeout = null; + return service.createService(applicationId, apiVersion, serviceDescription, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createServiceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Creates the specified Service Fabric service. + * This api allows creating a new Service Fabric stateless or stateful service under a specified Service Fabric application. The description for creating the service includes partitioning information and optional properties for placement and load balancing. Some of the properties can later be modified using `UpdateService` API. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceDescription The information necessary to create a service. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void createService(String applicationId, ServiceDescriptionInner serviceDescription, Long timeout) { + createServiceWithServiceResponseAsync(applicationId, serviceDescription, timeout).toBlocking().single().body(); + } + + /** + * Creates the specified Service Fabric service. + * This api allows creating a new Service Fabric stateless or stateful service under a specified Service Fabric application. The description for creating the service includes partitioning information and optional properties for placement and load balancing. Some of the properties can later be modified using `UpdateService` API. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceDescription The information necessary to create a service. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createServiceAsync(String applicationId, ServiceDescriptionInner serviceDescription, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createServiceWithServiceResponseAsync(applicationId, serviceDescription, timeout), serviceCallback); + } + + /** + * Creates the specified Service Fabric service. + * This api allows creating a new Service Fabric stateless or stateful service under a specified Service Fabric application. The description for creating the service includes partitioning information and optional properties for placement and load balancing. Some of the properties can later be modified using `UpdateService` API. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceDescription The information necessary to create a service. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable createServiceAsync(String applicationId, ServiceDescriptionInner serviceDescription, Long timeout) { + return createServiceWithServiceResponseAsync(applicationId, serviceDescription, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates the specified Service Fabric service. + * This api allows creating a new Service Fabric stateless or stateful service under a specified Service Fabric application. The description for creating the service includes partitioning information and optional properties for placement and load balancing. Some of the properties can later be modified using `UpdateService` API. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceDescription The information necessary to create a service. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> createServiceWithServiceResponseAsync(String applicationId, ServiceDescriptionInner serviceDescription, Long timeout) { + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + if (serviceDescription == null) { + throw new IllegalArgumentException("Parameter serviceDescription is required and cannot be null."); + } + Validator.validate(serviceDescription); + final String apiVersion = "6.0"; + return service.createService(applicationId, apiVersion, serviceDescription, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createServiceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createServiceDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Creates a Service Fabric service from the service template. + * Creates a Service Fabric service from the service template defined in the application manifest. A service template contains the properties that will be same for the service instance of the same type. The API allows overriding the properties that are usually different for different services of the same service type. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceFromTemplateDescription Describes the service that needs to be created from the template defined in the application manifest. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void createServiceFromTemplate(String applicationId, ServiceFromTemplateDescription serviceFromTemplateDescription) { + createServiceFromTemplateWithServiceResponseAsync(applicationId, serviceFromTemplateDescription).toBlocking().single().body(); + } + + /** + * Creates a Service Fabric service from the service template. + * Creates a Service Fabric service from the service template defined in the application manifest. A service template contains the properties that will be same for the service instance of the same type. The API allows overriding the properties that are usually different for different services of the same service type. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceFromTemplateDescription Describes the service that needs to be created from the template defined in the application manifest. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createServiceFromTemplateAsync(String applicationId, ServiceFromTemplateDescription serviceFromTemplateDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createServiceFromTemplateWithServiceResponseAsync(applicationId, serviceFromTemplateDescription), serviceCallback); + } + + /** + * Creates a Service Fabric service from the service template. + * Creates a Service Fabric service from the service template defined in the application manifest. A service template contains the properties that will be same for the service instance of the same type. The API allows overriding the properties that are usually different for different services of the same service type. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceFromTemplateDescription Describes the service that needs to be created from the template defined in the application manifest. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable createServiceFromTemplateAsync(String applicationId, ServiceFromTemplateDescription serviceFromTemplateDescription) { + return createServiceFromTemplateWithServiceResponseAsync(applicationId, serviceFromTemplateDescription).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a Service Fabric service from the service template. + * Creates a Service Fabric service from the service template defined in the application manifest. A service template contains the properties that will be same for the service instance of the same type. The API allows overriding the properties that are usually different for different services of the same service type. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceFromTemplateDescription Describes the service that needs to be created from the template defined in the application manifest. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> createServiceFromTemplateWithServiceResponseAsync(String applicationId, ServiceFromTemplateDescription serviceFromTemplateDescription) { + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + if (serviceFromTemplateDescription == null) { + throw new IllegalArgumentException("Parameter serviceFromTemplateDescription is required and cannot be null."); + } + Validator.validate(serviceFromTemplateDescription); + final String apiVersion = "6.0"; + final Long timeout = null; + return service.createServiceFromTemplate(applicationId, apiVersion, serviceFromTemplateDescription, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createServiceFromTemplateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Creates a Service Fabric service from the service template. + * Creates a Service Fabric service from the service template defined in the application manifest. A service template contains the properties that will be same for the service instance of the same type. The API allows overriding the properties that are usually different for different services of the same service type. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceFromTemplateDescription Describes the service that needs to be created from the template defined in the application manifest. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void createServiceFromTemplate(String applicationId, ServiceFromTemplateDescription serviceFromTemplateDescription, Long timeout) { + createServiceFromTemplateWithServiceResponseAsync(applicationId, serviceFromTemplateDescription, timeout).toBlocking().single().body(); + } + + /** + * Creates a Service Fabric service from the service template. + * Creates a Service Fabric service from the service template defined in the application manifest. A service template contains the properties that will be same for the service instance of the same type. The API allows overriding the properties that are usually different for different services of the same service type. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceFromTemplateDescription Describes the service that needs to be created from the template defined in the application manifest. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createServiceFromTemplateAsync(String applicationId, ServiceFromTemplateDescription serviceFromTemplateDescription, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createServiceFromTemplateWithServiceResponseAsync(applicationId, serviceFromTemplateDescription, timeout), serviceCallback); + } + + /** + * Creates a Service Fabric service from the service template. + * Creates a Service Fabric service from the service template defined in the application manifest. A service template contains the properties that will be same for the service instance of the same type. The API allows overriding the properties that are usually different for different services of the same service type. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceFromTemplateDescription Describes the service that needs to be created from the template defined in the application manifest. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable createServiceFromTemplateAsync(String applicationId, ServiceFromTemplateDescription serviceFromTemplateDescription, Long timeout) { + return createServiceFromTemplateWithServiceResponseAsync(applicationId, serviceFromTemplateDescription, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a Service Fabric service from the service template. + * Creates a Service Fabric service from the service template defined in the application manifest. A service template contains the properties that will be same for the service instance of the same type. The API allows overriding the properties that are usually different for different services of the same service type. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceFromTemplateDescription Describes the service that needs to be created from the template defined in the application manifest. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> createServiceFromTemplateWithServiceResponseAsync(String applicationId, ServiceFromTemplateDescription serviceFromTemplateDescription, Long timeout) { + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + if (serviceFromTemplateDescription == null) { + throw new IllegalArgumentException("Parameter serviceFromTemplateDescription is required and cannot be null."); + } + Validator.validate(serviceFromTemplateDescription); + final String apiVersion = "6.0"; + return service.createServiceFromTemplate(applicationId, apiVersion, serviceFromTemplateDescription, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createServiceFromTemplateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createServiceFromTemplateDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteService(String serviceId) { + deleteServiceWithServiceResponseAsync(serviceId).toBlocking().single().body(); + } + + /** + * 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 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteServiceAsync(String serviceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteServiceWithServiceResponseAsync(serviceId), serviceCallback); + } + + /** + * 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteServiceAsync(String serviceId) { + return deleteServiceWithServiceResponseAsync(serviceId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteServiceWithServiceResponseAsync(String serviceId) { + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Boolean forceRemove = null; + final Long timeout = null; + return service.deleteService(serviceId, apiVersion, forceRemove, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteServiceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteService(String serviceId, Boolean forceRemove, Long timeout) { + deleteServiceWithServiceResponseAsync(serviceId, forceRemove, timeout).toBlocking().single().body(); + } + + /** + * 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteServiceAsync(String serviceId, Boolean forceRemove, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteServiceWithServiceResponseAsync(serviceId, forceRemove, timeout), serviceCallback); + } + + /** + * 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteServiceAsync(String serviceId, Boolean forceRemove, Long timeout) { + return deleteServiceWithServiceResponseAsync(serviceId, forceRemove, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteServiceWithServiceResponseAsync(String serviceId, Boolean forceRemove, Long timeout) { + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.deleteService(serviceId, apiVersion, forceRemove, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteServiceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteServiceDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 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 serviceUpdateDescription The information necessary to update a service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void updateService(String serviceId, ServiceUpdateDescription serviceUpdateDescription) { + updateServiceWithServiceResponseAsync(serviceId, serviceUpdateDescription).toBlocking().single().body(); + } + + /** + * 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 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 serviceUpdateDescription The information necessary to update a service. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateServiceAsync(String serviceId, ServiceUpdateDescription serviceUpdateDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateServiceWithServiceResponseAsync(serviceId, serviceUpdateDescription), serviceCallback); + } + + /** + * 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 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 serviceUpdateDescription The information necessary to update a service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable updateServiceAsync(String serviceId, ServiceUpdateDescription serviceUpdateDescription) { + return updateServiceWithServiceResponseAsync(serviceId, serviceUpdateDescription).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 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 serviceUpdateDescription The information necessary to update a service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> updateServiceWithServiceResponseAsync(String serviceId, ServiceUpdateDescription serviceUpdateDescription) { + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + if (serviceUpdateDescription == null) { + throw new IllegalArgumentException("Parameter serviceUpdateDescription is required and cannot be null."); + } + Validator.validate(serviceUpdateDescription); + final String apiVersion = "6.0"; + final Long timeout = null; + return service.updateService(serviceId, apiVersion, serviceUpdateDescription, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateServiceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 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 serviceUpdateDescription The information necessary to update a service. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void updateService(String serviceId, ServiceUpdateDescription serviceUpdateDescription, Long timeout) { + updateServiceWithServiceResponseAsync(serviceId, serviceUpdateDescription, timeout).toBlocking().single().body(); + } + + /** + * 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 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 serviceUpdateDescription The information necessary to update a service. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateServiceAsync(String serviceId, ServiceUpdateDescription serviceUpdateDescription, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateServiceWithServiceResponseAsync(serviceId, serviceUpdateDescription, timeout), serviceCallback); + } + + /** + * 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 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 serviceUpdateDescription The information necessary to update a service. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable updateServiceAsync(String serviceId, ServiceUpdateDescription serviceUpdateDescription, Long timeout) { + return updateServiceWithServiceResponseAsync(serviceId, serviceUpdateDescription, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 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 serviceUpdateDescription The information necessary to update a service. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> updateServiceWithServiceResponseAsync(String serviceId, ServiceUpdateDescription serviceUpdateDescription, Long timeout) { + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + if (serviceUpdateDescription == null) { + throw new IllegalArgumentException("Parameter serviceUpdateDescription is required and cannot be null."); + } + Validator.validate(serviceUpdateDescription); + final String apiVersion = "6.0"; + return service.updateService(serviceId, apiVersion, serviceUpdateDescription, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateServiceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateServiceDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the description of an existing Service Fabric service. + * Gets the description of an existing Service Fabric service. A service must be created before its description can be obtained. + * + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceDescriptionInner object if successful. + */ + public ServiceDescriptionInner getServiceDescription(String serviceId) { + return getServiceDescriptionWithServiceResponseAsync(serviceId).toBlocking().single().body(); + } + + /** + * Gets the description of an existing Service Fabric service. + * Gets the description of an existing Service Fabric service. A service must be created before its description can be obtained. + * + * @param 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getServiceDescriptionAsync(String serviceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getServiceDescriptionWithServiceResponseAsync(serviceId), serviceCallback); + } + + /** + * Gets the description of an existing Service Fabric service. + * Gets the description of an existing Service Fabric service. A service must be created before its description can be obtained. + * + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceDescriptionInner object + */ + public Observable getServiceDescriptionAsync(String serviceId) { + return getServiceDescriptionWithServiceResponseAsync(serviceId).map(new Func1, ServiceDescriptionInner>() { + @Override + public ServiceDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the description of an existing Service Fabric service. + * Gets the description of an existing Service Fabric service. A service must be created before its description can be obtained. + * + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceDescriptionInner object + */ + public Observable> getServiceDescriptionWithServiceResponseAsync(String serviceId) { + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + return service.getServiceDescription(serviceId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getServiceDescriptionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the description of an existing Service Fabric service. + * Gets the description of an existing Service Fabric service. A service must be created before its description can be obtained. + * + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceDescriptionInner object if successful. + */ + public ServiceDescriptionInner getServiceDescription(String serviceId, Long timeout) { + return getServiceDescriptionWithServiceResponseAsync(serviceId, timeout).toBlocking().single().body(); + } + + /** + * Gets the description of an existing Service Fabric service. + * Gets the description of an existing Service Fabric service. A service must be created before its description can be obtained. + * + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getServiceDescriptionAsync(String serviceId, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getServiceDescriptionWithServiceResponseAsync(serviceId, timeout), serviceCallback); + } + + /** + * Gets the description of an existing Service Fabric service. + * Gets the description of an existing Service Fabric service. A service must be created before its description can be obtained. + * + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceDescriptionInner object + */ + public Observable getServiceDescriptionAsync(String serviceId, Long timeout) { + return getServiceDescriptionWithServiceResponseAsync(serviceId, timeout).map(new Func1, ServiceDescriptionInner>() { + @Override + public ServiceDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the description of an existing Service Fabric service. + * Gets the description of an existing Service Fabric service. A service must be created before its description can be obtained. + * + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceDescriptionInner object + */ + public Observable> getServiceDescriptionWithServiceResponseAsync(String serviceId, Long timeout) { + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.getServiceDescription(serviceId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getServiceDescriptionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getServiceDescriptionDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the health of the specified Service Fabric service. + * Gets the health information of the specified service. + Use EventsHealthStateFilter to filter the collection of health events reported on the service based on the health state. + Use PartitionsHealthStateFilter to filter the collection of partitions returned. + If you specify a service that does not exist in the health store, this request returns an error. + * + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceHealthInner object if successful. + */ + public ServiceHealthInner getServiceHealth(String serviceId) { + return getServiceHealthWithServiceResponseAsync(serviceId).toBlocking().single().body(); + } + + /** + * Gets the health of the specified Service Fabric service. + * Gets the health information of the specified service. + Use EventsHealthStateFilter to filter the collection of health events reported on the service based on the health state. + Use PartitionsHealthStateFilter to filter the collection of partitions returned. + If you specify a service that does not exist in the health store, this request returns an error. + * + * @param 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getServiceHealthAsync(String serviceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getServiceHealthWithServiceResponseAsync(serviceId), serviceCallback); + } + + /** + * Gets the health of the specified Service Fabric service. + * Gets the health information of the specified service. + Use EventsHealthStateFilter to filter the collection of health events reported on the service based on the health state. + Use PartitionsHealthStateFilter to filter the collection of partitions returned. + If you specify a service that does not exist in the health store, this request returns an error. + * + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceHealthInner object + */ + public Observable getServiceHealthAsync(String serviceId) { + return getServiceHealthWithServiceResponseAsync(serviceId).map(new Func1, ServiceHealthInner>() { + @Override + public ServiceHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the health of the specified Service Fabric service. + * Gets the health information of the specified service. + Use EventsHealthStateFilter to filter the collection of health events reported on the service based on the health state. + Use PartitionsHealthStateFilter to filter the collection of partitions returned. + If you specify a service that does not exist in the health store, this request returns an error. + * + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceHealthInner object + */ + public Observable> getServiceHealthWithServiceResponseAsync(String serviceId) { + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Integer eventsHealthStateFilter = null; + final Integer partitionsHealthStateFilter = null; + final Boolean excludeHealthStatistics = null; + final Long timeout = null; + return service.getServiceHealth(serviceId, apiVersion, eventsHealthStateFilter, partitionsHealthStateFilter, excludeHealthStatistics, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getServiceHealthDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the health of the specified Service Fabric service. + * Gets the health information of the specified service. + Use EventsHealthStateFilter to filter the collection of health events reported on the service based on the health state. + Use PartitionsHealthStateFilter to filter the collection of partitions returned. + If you specify a service that does not exist in the health store, this request returns an error. + * + * @param 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 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceHealthInner object if successful. + */ + public ServiceHealthInner getServiceHealth(String serviceId, Integer eventsHealthStateFilter, Integer partitionsHealthStateFilter, Boolean excludeHealthStatistics, Long timeout) { + return getServiceHealthWithServiceResponseAsync(serviceId, eventsHealthStateFilter, partitionsHealthStateFilter, excludeHealthStatistics, timeout).toBlocking().single().body(); + } + + /** + * Gets the health of the specified Service Fabric service. + * Gets the health information of the specified service. + Use EventsHealthStateFilter to filter the collection of health events reported on the service based on the health state. + Use PartitionsHealthStateFilter to filter the collection of partitions returned. + If you specify a service that does not exist in the health store, this request returns an error. + * + * @param 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 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getServiceHealthAsync(String serviceId, Integer eventsHealthStateFilter, Integer partitionsHealthStateFilter, Boolean excludeHealthStatistics, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getServiceHealthWithServiceResponseAsync(serviceId, eventsHealthStateFilter, partitionsHealthStateFilter, excludeHealthStatistics, timeout), serviceCallback); + } + + /** + * Gets the health of the specified Service Fabric service. + * Gets the health information of the specified service. + Use EventsHealthStateFilter to filter the collection of health events reported on the service based on the health state. + Use PartitionsHealthStateFilter to filter the collection of partitions returned. + If you specify a service that does not exist in the health store, this request returns an error. + * + * @param 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 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceHealthInner object + */ + public Observable getServiceHealthAsync(String serviceId, Integer eventsHealthStateFilter, Integer partitionsHealthStateFilter, Boolean excludeHealthStatistics, Long timeout) { + return getServiceHealthWithServiceResponseAsync(serviceId, eventsHealthStateFilter, partitionsHealthStateFilter, excludeHealthStatistics, timeout).map(new Func1, ServiceHealthInner>() { + @Override + public ServiceHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the health of the specified Service Fabric service. + * Gets the health information of the specified service. + Use EventsHealthStateFilter to filter the collection of health events reported on the service based on the health state. + Use PartitionsHealthStateFilter to filter the collection of partitions returned. + If you specify a service that does not exist in the health store, this request returns an error. + * + * @param 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 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceHealthInner object + */ + public Observable> getServiceHealthWithServiceResponseAsync(String serviceId, Integer eventsHealthStateFilter, Integer partitionsHealthStateFilter, Boolean excludeHealthStatistics, Long timeout) { + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.getServiceHealth(serviceId, apiVersion, eventsHealthStateFilter, partitionsHealthStateFilter, excludeHealthStatistics, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getServiceHealthDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getServiceHealthDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceHealthInner object if successful. + */ + public ServiceHealthInner getServiceHealthUsingPolicy(String serviceId) { + return getServiceHealthUsingPolicyWithServiceResponseAsync(serviceId).toBlocking().single().body(); + } + + /** + * 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 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getServiceHealthUsingPolicyAsync(String serviceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getServiceHealthUsingPolicyWithServiceResponseAsync(serviceId), serviceCallback); + } + + /** + * 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceHealthInner object + */ + public Observable getServiceHealthUsingPolicyAsync(String serviceId) { + return getServiceHealthUsingPolicyWithServiceResponseAsync(serviceId).map(new Func1, ServiceHealthInner>() { + @Override + public ServiceHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceHealthInner object + */ + public Observable> getServiceHealthUsingPolicyWithServiceResponseAsync(String serviceId) { + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Integer eventsHealthStateFilter = null; + final Integer partitionsHealthStateFilter = null; + final ApplicationHealthPolicy applicationHealthPolicy = null; + final Boolean excludeHealthStatistics = null; + final Long timeout = null; + return service.getServiceHealthUsingPolicy(serviceId, apiVersion, eventsHealthStateFilter, partitionsHealthStateFilter, applicationHealthPolicy, excludeHealthStatistics, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getServiceHealthUsingPolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 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 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 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceHealthInner object if successful. + */ + public ServiceHealthInner getServiceHealthUsingPolicy(String serviceId, Integer eventsHealthStateFilter, Integer partitionsHealthStateFilter, ApplicationHealthPolicy applicationHealthPolicy, Boolean excludeHealthStatistics, Long timeout) { + return getServiceHealthUsingPolicyWithServiceResponseAsync(serviceId, eventsHealthStateFilter, partitionsHealthStateFilter, applicationHealthPolicy, excludeHealthStatistics, timeout).toBlocking().single().body(); + } + + /** + * 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 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 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 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getServiceHealthUsingPolicyAsync(String serviceId, Integer eventsHealthStateFilter, Integer partitionsHealthStateFilter, ApplicationHealthPolicy applicationHealthPolicy, Boolean excludeHealthStatistics, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getServiceHealthUsingPolicyWithServiceResponseAsync(serviceId, eventsHealthStateFilter, partitionsHealthStateFilter, applicationHealthPolicy, excludeHealthStatistics, timeout), serviceCallback); + } + + /** + * 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 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 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 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceHealthInner object + */ + public Observable getServiceHealthUsingPolicyAsync(String serviceId, Integer eventsHealthStateFilter, Integer partitionsHealthStateFilter, ApplicationHealthPolicy applicationHealthPolicy, Boolean excludeHealthStatistics, Long timeout) { + return getServiceHealthUsingPolicyWithServiceResponseAsync(serviceId, eventsHealthStateFilter, partitionsHealthStateFilter, applicationHealthPolicy, excludeHealthStatistics, timeout).map(new Func1, ServiceHealthInner>() { + @Override + public ServiceHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 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 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 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceHealthInner object + */ + public Observable> getServiceHealthUsingPolicyWithServiceResponseAsync(String serviceId, Integer eventsHealthStateFilter, Integer partitionsHealthStateFilter, ApplicationHealthPolicy applicationHealthPolicy, Boolean excludeHealthStatistics, Long timeout) { + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + Validator.validate(applicationHealthPolicy); + final String apiVersion = "6.0"; + return service.getServiceHealthUsingPolicy(serviceId, apiVersion, eventsHealthStateFilter, partitionsHealthStateFilter, applicationHealthPolicy, excludeHealthStatistics, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getServiceHealthUsingPolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getServiceHealthUsingPolicyDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void reportServiceHealth(String serviceId, HealthInformation healthInformation) { + reportServiceHealthWithServiceResponseAsync(serviceId, healthInformation).toBlocking().single().body(); + } + + /** + * 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 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 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture reportServiceHealthAsync(String serviceId, HealthInformation healthInformation, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(reportServiceHealthWithServiceResponseAsync(serviceId, healthInformation), serviceCallback); + } + + /** + * 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 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable reportServiceHealthAsync(String serviceId, HealthInformation healthInformation) { + return reportServiceHealthWithServiceResponseAsync(serviceId, healthInformation).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> reportServiceHealthWithServiceResponseAsync(String serviceId, HealthInformation healthInformation) { + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + if (healthInformation == null) { + throw new IllegalArgumentException("Parameter healthInformation is required and cannot be null."); + } + Validator.validate(healthInformation); + final String apiVersion = "6.0"; + final Boolean immediate = null; + final Long timeout = null; + return service.reportServiceHealth(serviceId, apiVersion, healthInformation, immediate, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = reportServiceHealthDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void reportServiceHealth(String serviceId, HealthInformation healthInformation, Boolean immediate, Long timeout) { + reportServiceHealthWithServiceResponseAsync(serviceId, healthInformation, immediate, timeout).toBlocking().single().body(); + } + + /** + * 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 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture reportServiceHealthAsync(String serviceId, HealthInformation healthInformation, Boolean immediate, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(reportServiceHealthWithServiceResponseAsync(serviceId, healthInformation, immediate, timeout), serviceCallback); + } + + /** + * 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 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable reportServiceHealthAsync(String serviceId, HealthInformation healthInformation, Boolean immediate, Long timeout) { + return reportServiceHealthWithServiceResponseAsync(serviceId, healthInformation, immediate, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> reportServiceHealthWithServiceResponseAsync(String serviceId, HealthInformation healthInformation, Boolean immediate, Long timeout) { + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + if (healthInformation == null) { + throw new IllegalArgumentException("Parameter healthInformation is required and cannot be null."); + } + Validator.validate(healthInformation); + final String apiVersion = "6.0"; + return service.reportServiceHealth(serviceId, apiVersion, healthInformation, immediate, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = reportServiceHealthDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse reportServiceHealthDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Resolve a Service Fabric partition. + * Resolve a Service Fabric service partition to get the endpoints of the service replicas. + * + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ResolvedServicePartitionInner object if successful. + */ + public ResolvedServicePartitionInner resolveService(String serviceId) { + return resolveServiceWithServiceResponseAsync(serviceId).toBlocking().single().body(); + } + + /** + * Resolve a Service Fabric partition. + * Resolve a Service Fabric service partition to get the endpoints of the service replicas. + * + * @param 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture resolveServiceAsync(String serviceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resolveServiceWithServiceResponseAsync(serviceId), serviceCallback); + } + + /** + * Resolve a Service Fabric partition. + * Resolve a Service Fabric service partition to get the endpoints of the service replicas. + * + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResolvedServicePartitionInner object + */ + public Observable resolveServiceAsync(String serviceId) { + return resolveServiceWithServiceResponseAsync(serviceId).map(new Func1, ResolvedServicePartitionInner>() { + @Override + public ResolvedServicePartitionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resolve a Service Fabric partition. + * Resolve a Service Fabric service partition to get the endpoints of the service replicas. + * + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResolvedServicePartitionInner object + */ + public Observable> resolveServiceWithServiceResponseAsync(String serviceId) { + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Integer partitionKeyType = null; + final String partitionKeyValue = null; + final String previousRspVersion = null; + final Long timeout = null; + return service.resolveService(serviceId, apiVersion, partitionKeyType, partitionKeyValue, previousRspVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = resolveServiceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Resolve a Service Fabric partition. + * Resolve a Service Fabric service partition to get the endpoints of the service replicas. + * + * @param 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 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 partitionKeyValue Partition key. This is required if the partition scheme for the service is Int64Range or Named. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ResolvedServicePartitionInner object if successful. + */ + public ResolvedServicePartitionInner resolveService(String serviceId, Integer partitionKeyType, String partitionKeyValue, String previousRspVersion, Long timeout) { + return resolveServiceWithServiceResponseAsync(serviceId, partitionKeyType, partitionKeyValue, previousRspVersion, timeout).toBlocking().single().body(); + } + + /** + * Resolve a Service Fabric partition. + * Resolve a Service Fabric service partition to get the endpoints of the service replicas. + * + * @param 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 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 partitionKeyValue Partition key. This is required if the partition scheme for the service is Int64Range or Named. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture resolveServiceAsync(String serviceId, Integer partitionKeyType, String partitionKeyValue, String previousRspVersion, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resolveServiceWithServiceResponseAsync(serviceId, partitionKeyType, partitionKeyValue, previousRspVersion, timeout), serviceCallback); + } + + /** + * Resolve a Service Fabric partition. + * Resolve a Service Fabric service partition to get the endpoints of the service replicas. + * + * @param 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 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 partitionKeyValue Partition key. This is required if the partition scheme for the service is Int64Range or Named. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResolvedServicePartitionInner object + */ + public Observable resolveServiceAsync(String serviceId, Integer partitionKeyType, String partitionKeyValue, String previousRspVersion, Long timeout) { + return resolveServiceWithServiceResponseAsync(serviceId, partitionKeyType, partitionKeyValue, previousRspVersion, timeout).map(new Func1, ResolvedServicePartitionInner>() { + @Override + public ResolvedServicePartitionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resolve a Service Fabric partition. + * Resolve a Service Fabric service partition to get the endpoints of the service replicas. + * + * @param 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 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 partitionKeyValue Partition key. This is required if the partition scheme for the service is Int64Range or Named. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResolvedServicePartitionInner object + */ + public Observable> resolveServiceWithServiceResponseAsync(String serviceId, Integer partitionKeyType, String partitionKeyValue, String previousRspVersion, Long timeout) { + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.resolveService(serviceId, apiVersion, partitionKeyType, partitionKeyValue, previousRspVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = resolveServiceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse resolveServiceDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedServicePartitionInfoListInner object if successful. + */ + public PagedServicePartitionInfoListInner getPartitionInfoList(String serviceId) { + return getPartitionInfoListWithServiceResponseAsync(serviceId).toBlocking().single().body(); + } + + /** + * 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 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getPartitionInfoListAsync(String serviceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPartitionInfoListWithServiceResponseAsync(serviceId), serviceCallback); + } + + /** + * 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedServicePartitionInfoListInner object + */ + public Observable getPartitionInfoListAsync(String serviceId) { + return getPartitionInfoListWithServiceResponseAsync(serviceId).map(new Func1, PagedServicePartitionInfoListInner>() { + @Override + public PagedServicePartitionInfoListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedServicePartitionInfoListInner object + */ + public Observable> getPartitionInfoListWithServiceResponseAsync(String serviceId) { + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final String continuationToken = null; + final Long timeout = null; + return service.getPartitionInfoList(serviceId, apiVersion, continuationToken, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPartitionInfoListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedServicePartitionInfoListInner object if successful. + */ + public PagedServicePartitionInfoListInner getPartitionInfoList(String serviceId, String continuationToken, Long timeout) { + return getPartitionInfoListWithServiceResponseAsync(serviceId, continuationToken, timeout).toBlocking().single().body(); + } + + /** + * 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getPartitionInfoListAsync(String serviceId, String continuationToken, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPartitionInfoListWithServiceResponseAsync(serviceId, continuationToken, timeout), serviceCallback); + } + + /** + * 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedServicePartitionInfoListInner object + */ + public Observable getPartitionInfoListAsync(String serviceId, String continuationToken, Long timeout) { + return getPartitionInfoListWithServiceResponseAsync(serviceId, continuationToken, timeout).map(new Func1, PagedServicePartitionInfoListInner>() { + @Override + public PagedServicePartitionInfoListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedServicePartitionInfoListInner object + */ + public Observable> getPartitionInfoListWithServiceResponseAsync(String serviceId, String continuationToken, Long timeout) { + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.getPartitionInfoList(serviceId, apiVersion, continuationToken, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPartitionInfoListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getPartitionInfoListDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the information about a Service Fabric partition. + * Gets the information about the specified partition. The response includes the partition ID, partitioning scheme information, keys supported by the partition, status, health, and other details about the partition. + * + * @param partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServicePartitionInfoInner object if successful. + */ + public ServicePartitionInfoInner getPartitionInfo(UUID partitionId) { + return getPartitionInfoWithServiceResponseAsync(partitionId).toBlocking().single().body(); + } + + /** + * Gets the information about a Service Fabric partition. + * Gets the information about the specified partition. The response includes the partition ID, partitioning scheme information, keys supported by the partition, status, health, and other details about the partition. + * + * @param partitionId The identity of the partition. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getPartitionInfoAsync(UUID partitionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPartitionInfoWithServiceResponseAsync(partitionId), serviceCallback); + } + + /** + * Gets the information about a Service Fabric partition. + * Gets the information about the specified partition. The response includes the partition ID, partitioning scheme information, keys supported by the partition, status, health, and other details about the partition. + * + * @param partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServicePartitionInfoInner object + */ + public Observable getPartitionInfoAsync(UUID partitionId) { + return getPartitionInfoWithServiceResponseAsync(partitionId).map(new Func1, ServicePartitionInfoInner>() { + @Override + public ServicePartitionInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the information about a Service Fabric partition. + * Gets the information about the specified partition. The response includes the partition ID, partitioning scheme information, keys supported by the partition, status, health, and other details about the partition. + * + * @param partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServicePartitionInfoInner object + */ + public Observable> getPartitionInfoWithServiceResponseAsync(UUID partitionId) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + return service.getPartitionInfo(partitionId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPartitionInfoDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the information about a Service Fabric partition. + * Gets the information about the specified partition. The response includes the partition ID, partitioning scheme information, keys supported by the partition, status, health, and other details about the partition. + * + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServicePartitionInfoInner object if successful. + */ + public ServicePartitionInfoInner getPartitionInfo(UUID partitionId, Long timeout) { + return getPartitionInfoWithServiceResponseAsync(partitionId, timeout).toBlocking().single().body(); + } + + /** + * Gets the information about a Service Fabric partition. + * Gets the information about the specified partition. The response includes the partition ID, partitioning scheme information, keys supported by the partition, status, health, and other details about the partition. + * + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getPartitionInfoAsync(UUID partitionId, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPartitionInfoWithServiceResponseAsync(partitionId, timeout), serviceCallback); + } + + /** + * Gets the information about a Service Fabric partition. + * Gets the information about the specified partition. The response includes the partition ID, partitioning scheme information, keys supported by the partition, status, health, and other details about the partition. + * + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServicePartitionInfoInner object + */ + public Observable getPartitionInfoAsync(UUID partitionId, Long timeout) { + return getPartitionInfoWithServiceResponseAsync(partitionId, timeout).map(new Func1, ServicePartitionInfoInner>() { + @Override + public ServicePartitionInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the information about a Service Fabric partition. + * Gets the information about the specified partition. The response includes the partition ID, partitioning scheme information, keys supported by the partition, status, health, and other details about the partition. + * + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServicePartitionInfoInner object + */ + public Observable> getPartitionInfoWithServiceResponseAsync(UUID partitionId, Long timeout) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.getPartitionInfo(partitionId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPartitionInfoDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getPartitionInfoDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the name of the Service Fabric service for a partition. + * Gets name of the service for the specified partition. A 404 error is returned if the partition ID does not exist in the cluster. + * + * @param partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceNameInfoInner object if successful. + */ + public ServiceNameInfoInner getServiceNameInfo(UUID partitionId) { + return getServiceNameInfoWithServiceResponseAsync(partitionId).toBlocking().single().body(); + } + + /** + * Gets the name of the Service Fabric service for a partition. + * Gets name of the service for the specified partition. A 404 error is returned if the partition ID does not exist in the cluster. + * + * @param partitionId The identity of the partition. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getServiceNameInfoAsync(UUID partitionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getServiceNameInfoWithServiceResponseAsync(partitionId), serviceCallback); + } + + /** + * Gets the name of the Service Fabric service for a partition. + * Gets name of the service for the specified partition. A 404 error is returned if the partition ID does not exist in the cluster. + * + * @param partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceNameInfoInner object + */ + public Observable getServiceNameInfoAsync(UUID partitionId) { + return getServiceNameInfoWithServiceResponseAsync(partitionId).map(new Func1, ServiceNameInfoInner>() { + @Override + public ServiceNameInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the name of the Service Fabric service for a partition. + * Gets name of the service for the specified partition. A 404 error is returned if the partition ID does not exist in the cluster. + * + * @param partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceNameInfoInner object + */ + public Observable> getServiceNameInfoWithServiceResponseAsync(UUID partitionId) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + return service.getServiceNameInfo(partitionId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getServiceNameInfoDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the name of the Service Fabric service for a partition. + * Gets name of the service for the specified partition. A 404 error is returned if the partition ID does not exist in the cluster. + * + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceNameInfoInner object if successful. + */ + public ServiceNameInfoInner getServiceNameInfo(UUID partitionId, Long timeout) { + return getServiceNameInfoWithServiceResponseAsync(partitionId, timeout).toBlocking().single().body(); + } + + /** + * Gets the name of the Service Fabric service for a partition. + * Gets name of the service for the specified partition. A 404 error is returned if the partition ID does not exist in the cluster. + * + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getServiceNameInfoAsync(UUID partitionId, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getServiceNameInfoWithServiceResponseAsync(partitionId, timeout), serviceCallback); + } + + /** + * Gets the name of the Service Fabric service for a partition. + * Gets name of the service for the specified partition. A 404 error is returned if the partition ID does not exist in the cluster. + * + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceNameInfoInner object + */ + public Observable getServiceNameInfoAsync(UUID partitionId, Long timeout) { + return getServiceNameInfoWithServiceResponseAsync(partitionId, timeout).map(new Func1, ServiceNameInfoInner>() { + @Override + public ServiceNameInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the name of the Service Fabric service for a partition. + * Gets name of the service for the specified partition. A 404 error is returned if the partition ID does not exist in the cluster. + * + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceNameInfoInner object + */ + public Observable> getServiceNameInfoWithServiceResponseAsync(UUID partitionId, Long timeout) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.getServiceNameInfo(partitionId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getServiceNameInfoDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getServiceNameInfoDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the health of the specified Service Fabric partition. + * Use EventsHealthStateFilter to filter the collection of health events reported on the service based on the health state. + Use ReplicasHealthStateFilter to filter the collection of ReplicaHealthState objects on the partition. + If you specify a partition that does not exist in the health store, this request returns an error. + * + * @param partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PartitionHealthInner object if successful. + */ + public PartitionHealthInner getPartitionHealth(UUID partitionId) { + return getPartitionHealthWithServiceResponseAsync(partitionId).toBlocking().single().body(); + } + + /** + * Gets the health of the specified Service Fabric partition. + * Use EventsHealthStateFilter to filter the collection of health events reported on the service based on the health state. + Use ReplicasHealthStateFilter to filter the collection of ReplicaHealthState objects on the partition. + If you specify a partition that does not exist in the health store, this request returns an error. + * + * @param partitionId The identity of the partition. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getPartitionHealthAsync(UUID partitionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPartitionHealthWithServiceResponseAsync(partitionId), serviceCallback); + } + + /** + * Gets the health of the specified Service Fabric partition. + * Use EventsHealthStateFilter to filter the collection of health events reported on the service based on the health state. + Use ReplicasHealthStateFilter to filter the collection of ReplicaHealthState objects on the partition. + If you specify a partition that does not exist in the health store, this request returns an error. + * + * @param partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PartitionHealthInner object + */ + public Observable getPartitionHealthAsync(UUID partitionId) { + return getPartitionHealthWithServiceResponseAsync(partitionId).map(new Func1, PartitionHealthInner>() { + @Override + public PartitionHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the health of the specified Service Fabric partition. + * Use EventsHealthStateFilter to filter the collection of health events reported on the service based on the health state. + Use ReplicasHealthStateFilter to filter the collection of ReplicaHealthState objects on the partition. + If you specify a partition that does not exist in the health store, this request returns an error. + * + * @param partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PartitionHealthInner object + */ + public Observable> getPartitionHealthWithServiceResponseAsync(UUID partitionId) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Integer eventsHealthStateFilter = null; + final Integer replicasHealthStateFilter = null; + final Boolean excludeHealthStatistics = null; + final Long timeout = null; + return service.getPartitionHealth(partitionId, apiVersion, eventsHealthStateFilter, replicasHealthStateFilter, excludeHealthStatistics, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPartitionHealthDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the health of the specified Service Fabric partition. + * Use EventsHealthStateFilter to filter the collection of health events reported on the service based on the health state. + Use ReplicasHealthStateFilter to filter the collection of ReplicaHealthState objects on the partition. + If you specify a partition that does not exist in the health store, this request returns an error. + * + * @param partitionId The identity of the partition. + * @param 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PartitionHealthInner object if successful. + */ + public PartitionHealthInner getPartitionHealth(UUID partitionId, Integer eventsHealthStateFilter, Integer replicasHealthStateFilter, Boolean excludeHealthStatistics, Long timeout) { + return getPartitionHealthWithServiceResponseAsync(partitionId, eventsHealthStateFilter, replicasHealthStateFilter, excludeHealthStatistics, timeout).toBlocking().single().body(); + } + + /** + * Gets the health of the specified Service Fabric partition. + * Use EventsHealthStateFilter to filter the collection of health events reported on the service based on the health state. + Use ReplicasHealthStateFilter to filter the collection of ReplicaHealthState objects on the partition. + If you specify a partition that does not exist in the health store, this request returns an error. + * + * @param partitionId The identity of the partition. + * @param 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getPartitionHealthAsync(UUID partitionId, Integer eventsHealthStateFilter, Integer replicasHealthStateFilter, Boolean excludeHealthStatistics, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPartitionHealthWithServiceResponseAsync(partitionId, eventsHealthStateFilter, replicasHealthStateFilter, excludeHealthStatistics, timeout), serviceCallback); + } + + /** + * Gets the health of the specified Service Fabric partition. + * Use EventsHealthStateFilter to filter the collection of health events reported on the service based on the health state. + Use ReplicasHealthStateFilter to filter the collection of ReplicaHealthState objects on the partition. + If you specify a partition that does not exist in the health store, this request returns an error. + * + * @param partitionId The identity of the partition. + * @param 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PartitionHealthInner object + */ + public Observable getPartitionHealthAsync(UUID partitionId, Integer eventsHealthStateFilter, Integer replicasHealthStateFilter, Boolean excludeHealthStatistics, Long timeout) { + return getPartitionHealthWithServiceResponseAsync(partitionId, eventsHealthStateFilter, replicasHealthStateFilter, excludeHealthStatistics, timeout).map(new Func1, PartitionHealthInner>() { + @Override + public PartitionHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the health of the specified Service Fabric partition. + * Use EventsHealthStateFilter to filter the collection of health events reported on the service based on the health state. + Use ReplicasHealthStateFilter to filter the collection of ReplicaHealthState objects on the partition. + If you specify a partition that does not exist in the health store, this request returns an error. + * + * @param partitionId The identity of the partition. + * @param 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PartitionHealthInner object + */ + public Observable> getPartitionHealthWithServiceResponseAsync(UUID partitionId, Integer eventsHealthStateFilter, Integer replicasHealthStateFilter, Boolean excludeHealthStatistics, Long timeout) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.getPartitionHealth(partitionId, apiVersion, eventsHealthStateFilter, replicasHealthStateFilter, excludeHealthStatistics, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPartitionHealthDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getPartitionHealthDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PartitionHealthInner object if successful. + */ + public PartitionHealthInner getPartitionHealthUsingPolicy(UUID partitionId) { + return getPartitionHealthUsingPolicyWithServiceResponseAsync(partitionId).toBlocking().single().body(); + } + + /** + * 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 partitionId The identity of the partition. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getPartitionHealthUsingPolicyAsync(UUID partitionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPartitionHealthUsingPolicyWithServiceResponseAsync(partitionId), serviceCallback); + } + + /** + * 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 partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PartitionHealthInner object + */ + public Observable getPartitionHealthUsingPolicyAsync(UUID partitionId) { + return getPartitionHealthUsingPolicyWithServiceResponseAsync(partitionId).map(new Func1, PartitionHealthInner>() { + @Override + public PartitionHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PartitionHealthInner object + */ + public Observable> getPartitionHealthUsingPolicyWithServiceResponseAsync(UUID partitionId) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Integer eventsHealthStateFilter = null; + final Integer replicasHealthStateFilter = null; + final ApplicationHealthPolicy applicationHealthPolicy = null; + final Boolean excludeHealthStatistics = null; + final Long timeout = null; + return service.getPartitionHealthUsingPolicy(partitionId, apiVersion, eventsHealthStateFilter, replicasHealthStateFilter, applicationHealthPolicy, excludeHealthStatistics, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPartitionHealthUsingPolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 partitionId The identity of the partition. + * @param 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 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PartitionHealthInner object if successful. + */ + public PartitionHealthInner getPartitionHealthUsingPolicy(UUID partitionId, Integer eventsHealthStateFilter, Integer replicasHealthStateFilter, ApplicationHealthPolicy applicationHealthPolicy, Boolean excludeHealthStatistics, Long timeout) { + return getPartitionHealthUsingPolicyWithServiceResponseAsync(partitionId, eventsHealthStateFilter, replicasHealthStateFilter, applicationHealthPolicy, excludeHealthStatistics, timeout).toBlocking().single().body(); + } + + /** + * 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 partitionId The identity of the partition. + * @param 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 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getPartitionHealthUsingPolicyAsync(UUID partitionId, Integer eventsHealthStateFilter, Integer replicasHealthStateFilter, ApplicationHealthPolicy applicationHealthPolicy, Boolean excludeHealthStatistics, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPartitionHealthUsingPolicyWithServiceResponseAsync(partitionId, eventsHealthStateFilter, replicasHealthStateFilter, applicationHealthPolicy, excludeHealthStatistics, timeout), serviceCallback); + } + + /** + * 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 partitionId The identity of the partition. + * @param 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 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PartitionHealthInner object + */ + public Observable getPartitionHealthUsingPolicyAsync(UUID partitionId, Integer eventsHealthStateFilter, Integer replicasHealthStateFilter, ApplicationHealthPolicy applicationHealthPolicy, Boolean excludeHealthStatistics, Long timeout) { + return getPartitionHealthUsingPolicyWithServiceResponseAsync(partitionId, eventsHealthStateFilter, replicasHealthStateFilter, applicationHealthPolicy, excludeHealthStatistics, timeout).map(new Func1, PartitionHealthInner>() { + @Override + public PartitionHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 partitionId The identity of the partition. + * @param 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 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PartitionHealthInner object + */ + public Observable> getPartitionHealthUsingPolicyWithServiceResponseAsync(UUID partitionId, Integer eventsHealthStateFilter, Integer replicasHealthStateFilter, ApplicationHealthPolicy applicationHealthPolicy, Boolean excludeHealthStatistics, Long timeout) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + Validator.validate(applicationHealthPolicy); + final String apiVersion = "6.0"; + return service.getPartitionHealthUsingPolicy(partitionId, apiVersion, eventsHealthStateFilter, replicasHealthStateFilter, applicationHealthPolicy, excludeHealthStatistics, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPartitionHealthUsingPolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getPartitionHealthUsingPolicyDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 partitionId The identity of the partition. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void reportPartitionHealth(UUID partitionId, HealthInformation healthInformation) { + reportPartitionHealthWithServiceResponseAsync(partitionId, healthInformation).toBlocking().single().body(); + } + + /** + * 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 partitionId The identity of the partition. + * @param 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture reportPartitionHealthAsync(UUID partitionId, HealthInformation healthInformation, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(reportPartitionHealthWithServiceResponseAsync(partitionId, healthInformation), serviceCallback); + } + + /** + * 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 partitionId The identity of the partition. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable reportPartitionHealthAsync(UUID partitionId, HealthInformation healthInformation) { + return reportPartitionHealthWithServiceResponseAsync(partitionId, healthInformation).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 partitionId The identity of the partition. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> reportPartitionHealthWithServiceResponseAsync(UUID partitionId, HealthInformation healthInformation) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + if (healthInformation == null) { + throw new IllegalArgumentException("Parameter healthInformation is required and cannot be null."); + } + Validator.validate(healthInformation); + final String apiVersion = "6.0"; + final Boolean immediate = null; + final Long timeout = null; + return service.reportPartitionHealth(partitionId, apiVersion, healthInformation, immediate, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = reportPartitionHealthDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 partitionId The identity of the partition. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void reportPartitionHealth(UUID partitionId, HealthInformation healthInformation, Boolean immediate, Long timeout) { + reportPartitionHealthWithServiceResponseAsync(partitionId, healthInformation, immediate, timeout).toBlocking().single().body(); + } + + /** + * 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 partitionId The identity of the partition. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture reportPartitionHealthAsync(UUID partitionId, HealthInformation healthInformation, Boolean immediate, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(reportPartitionHealthWithServiceResponseAsync(partitionId, healthInformation, immediate, timeout), serviceCallback); + } + + /** + * 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 partitionId The identity of the partition. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable reportPartitionHealthAsync(UUID partitionId, HealthInformation healthInformation, Boolean immediate, Long timeout) { + return reportPartitionHealthWithServiceResponseAsync(partitionId, healthInformation, immediate, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 partitionId The identity of the partition. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> reportPartitionHealthWithServiceResponseAsync(UUID partitionId, HealthInformation healthInformation, Boolean immediate, Long timeout) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + if (healthInformation == null) { + throw new IllegalArgumentException("Parameter healthInformation is required and cannot be null."); + } + Validator.validate(healthInformation); + final String apiVersion = "6.0"; + return service.reportPartitionHealth(partitionId, apiVersion, healthInformation, immediate, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = reportPartitionHealthDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse reportPartitionHealthDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the load information of the specified Service Fabric partition. + * Returns information about the load of a specified partition. + The response includes a list of load reports for a Service Fabric partition. + Each report includes the load metric name, value, and last reported time in UTC. + * + * @param partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PartitionLoadInformationInner object if successful. + */ + public PartitionLoadInformationInner getPartitionLoadInformation(UUID partitionId) { + return getPartitionLoadInformationWithServiceResponseAsync(partitionId).toBlocking().single().body(); + } + + /** + * Gets the load information of the specified Service Fabric partition. + * Returns information about the load of a specified partition. + The response includes a list of load reports for a Service Fabric partition. + Each report includes the load metric name, value, and last reported time in UTC. + * + * @param partitionId The identity of the partition. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getPartitionLoadInformationAsync(UUID partitionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPartitionLoadInformationWithServiceResponseAsync(partitionId), serviceCallback); + } + + /** + * Gets the load information of the specified Service Fabric partition. + * Returns information about the load of a specified partition. + The response includes a list of load reports for a Service Fabric partition. + Each report includes the load metric name, value, and last reported time in UTC. + * + * @param partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PartitionLoadInformationInner object + */ + public Observable getPartitionLoadInformationAsync(UUID partitionId) { + return getPartitionLoadInformationWithServiceResponseAsync(partitionId).map(new Func1, PartitionLoadInformationInner>() { + @Override + public PartitionLoadInformationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the load information of the specified Service Fabric partition. + * Returns information about the load of a specified partition. + The response includes a list of load reports for a Service Fabric partition. + Each report includes the load metric name, value, and last reported time in UTC. + * + * @param partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PartitionLoadInformationInner object + */ + public Observable> getPartitionLoadInformationWithServiceResponseAsync(UUID partitionId) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + return service.getPartitionLoadInformation(partitionId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPartitionLoadInformationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the load information of the specified Service Fabric partition. + * Returns information about the load of a specified partition. + The response includes a list of load reports for a Service Fabric partition. + Each report includes the load metric name, value, and last reported time in UTC. + * + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PartitionLoadInformationInner object if successful. + */ + public PartitionLoadInformationInner getPartitionLoadInformation(UUID partitionId, Long timeout) { + return getPartitionLoadInformationWithServiceResponseAsync(partitionId, timeout).toBlocking().single().body(); + } + + /** + * Gets the load information of the specified Service Fabric partition. + * Returns information about the load of a specified partition. + The response includes a list of load reports for a Service Fabric partition. + Each report includes the load metric name, value, and last reported time in UTC. + * + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getPartitionLoadInformationAsync(UUID partitionId, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPartitionLoadInformationWithServiceResponseAsync(partitionId, timeout), serviceCallback); + } + + /** + * Gets the load information of the specified Service Fabric partition. + * Returns information about the load of a specified partition. + The response includes a list of load reports for a Service Fabric partition. + Each report includes the load metric name, value, and last reported time in UTC. + * + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PartitionLoadInformationInner object + */ + public Observable getPartitionLoadInformationAsync(UUID partitionId, Long timeout) { + return getPartitionLoadInformationWithServiceResponseAsync(partitionId, timeout).map(new Func1, PartitionLoadInformationInner>() { + @Override + public PartitionLoadInformationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the load information of the specified Service Fabric partition. + * Returns information about the load of a specified partition. + The response includes a list of load reports for a Service Fabric partition. + Each report includes the load metric name, value, and last reported time in UTC. + * + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PartitionLoadInformationInner object + */ + public Observable> getPartitionLoadInformationWithServiceResponseAsync(UUID partitionId, Long timeout) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.getPartitionLoadInformation(partitionId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPartitionLoadInformationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getPartitionLoadInformationDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Resets the current load of a Service Fabric partition. + * Resets the current load of a Service Fabric partition to the default load for the service. + * + * @param partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void resetPartitionLoad(UUID partitionId) { + resetPartitionLoadWithServiceResponseAsync(partitionId).toBlocking().single().body(); + } + + /** + * Resets the current load of a Service Fabric partition. + * Resets the current load of a Service Fabric partition to the default load for the service. + * + * @param partitionId The identity of the partition. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture resetPartitionLoadAsync(UUID partitionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resetPartitionLoadWithServiceResponseAsync(partitionId), serviceCallback); + } + + /** + * Resets the current load of a Service Fabric partition. + * Resets the current load of a Service Fabric partition to the default load for the service. + * + * @param partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable resetPartitionLoadAsync(UUID partitionId) { + return resetPartitionLoadWithServiceResponseAsync(partitionId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resets the current load of a Service Fabric partition. + * Resets the current load of a Service Fabric partition to the default load for the service. + * + * @param partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> resetPartitionLoadWithServiceResponseAsync(UUID partitionId) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + return service.resetPartitionLoad(partitionId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = resetPartitionLoadDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Resets the current load of a Service Fabric partition. + * Resets the current load of a Service Fabric partition to the default load for the service. + * + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void resetPartitionLoad(UUID partitionId, Long timeout) { + resetPartitionLoadWithServiceResponseAsync(partitionId, timeout).toBlocking().single().body(); + } + + /** + * Resets the current load of a Service Fabric partition. + * Resets the current load of a Service Fabric partition to the default load for the service. + * + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture resetPartitionLoadAsync(UUID partitionId, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resetPartitionLoadWithServiceResponseAsync(partitionId, timeout), serviceCallback); + } + + /** + * Resets the current load of a Service Fabric partition. + * Resets the current load of a Service Fabric partition to the default load for the service. + * + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable resetPartitionLoadAsync(UUID partitionId, Long timeout) { + return resetPartitionLoadWithServiceResponseAsync(partitionId, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resets the current load of a Service Fabric partition. + * Resets the current load of a Service Fabric partition to the default load for the service. + * + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> resetPartitionLoadWithServiceResponseAsync(UUID partitionId, Long timeout) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.resetPartitionLoad(partitionId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = resetPartitionLoadDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse resetPartitionLoadDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Indicates to the Service Fabric cluster that it should attempt to recover a specific partition 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 partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void recoverPartition(UUID partitionId) { + recoverPartitionWithServiceResponseAsync(partitionId).toBlocking().single().body(); + } + + /** + * Indicates to the Service Fabric cluster that it should attempt to recover a specific partition 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 partitionId The identity of the partition. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture recoverPartitionAsync(UUID partitionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(recoverPartitionWithServiceResponseAsync(partitionId), serviceCallback); + } + + /** + * Indicates to the Service Fabric cluster that it should attempt to recover a specific partition 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 partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable recoverPartitionAsync(UUID partitionId) { + return recoverPartitionWithServiceResponseAsync(partitionId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Indicates to the Service Fabric cluster that it should attempt to recover a specific partition 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 partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> recoverPartitionWithServiceResponseAsync(UUID partitionId) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + return service.recoverPartition(partitionId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = recoverPartitionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Indicates to the Service Fabric cluster that it should attempt to recover a specific partition 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 partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void recoverPartition(UUID partitionId, Long timeout) { + recoverPartitionWithServiceResponseAsync(partitionId, timeout).toBlocking().single().body(); + } + + /** + * Indicates to the Service Fabric cluster that it should attempt to recover a specific partition 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 partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture recoverPartitionAsync(UUID partitionId, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(recoverPartitionWithServiceResponseAsync(partitionId, timeout), serviceCallback); + } + + /** + * Indicates to the Service Fabric cluster that it should attempt to recover a specific partition 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 partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable recoverPartitionAsync(UUID partitionId, Long timeout) { + return recoverPartitionWithServiceResponseAsync(partitionId, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Indicates to the Service Fabric cluster that it should attempt to recover a specific partition 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 partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> recoverPartitionWithServiceResponseAsync(UUID partitionId, Long timeout) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.recoverPartition(partitionId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = recoverPartitionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse recoverPartitionDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Indicates to the Service Fabric cluster that it should attempt to recover the specified service that is currently stuck in quorum loss. + * Indicates to the Service Fabric cluster that it should attempt to recover the specified service 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void recoverServicePartitions(String serviceId) { + recoverServicePartitionsWithServiceResponseAsync(serviceId).toBlocking().single().body(); + } + + /** + * Indicates to the Service Fabric cluster that it should attempt to recover the specified service that is currently stuck in quorum loss. + * Indicates to the Service Fabric cluster that it should attempt to recover the specified service 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 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture recoverServicePartitionsAsync(String serviceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(recoverServicePartitionsWithServiceResponseAsync(serviceId), serviceCallback); + } + + /** + * Indicates to the Service Fabric cluster that it should attempt to recover the specified service that is currently stuck in quorum loss. + * Indicates to the Service Fabric cluster that it should attempt to recover the specified service 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable recoverServicePartitionsAsync(String serviceId) { + return recoverServicePartitionsWithServiceResponseAsync(serviceId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Indicates to the Service Fabric cluster that it should attempt to recover the specified service that is currently stuck in quorum loss. + * Indicates to the Service Fabric cluster that it should attempt to recover the specified service 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> recoverServicePartitionsWithServiceResponseAsync(String serviceId) { + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + return service.recoverServicePartitions(serviceId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = recoverServicePartitionsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Indicates to the Service Fabric cluster that it should attempt to recover the specified service that is currently stuck in quorum loss. + * Indicates to the Service Fabric cluster that it should attempt to recover the specified service 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void recoverServicePartitions(String serviceId, Long timeout) { + recoverServicePartitionsWithServiceResponseAsync(serviceId, timeout).toBlocking().single().body(); + } + + /** + * Indicates to the Service Fabric cluster that it should attempt to recover the specified service that is currently stuck in quorum loss. + * Indicates to the Service Fabric cluster that it should attempt to recover the specified service 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture recoverServicePartitionsAsync(String serviceId, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(recoverServicePartitionsWithServiceResponseAsync(serviceId, timeout), serviceCallback); + } + + /** + * Indicates to the Service Fabric cluster that it should attempt to recover the specified service that is currently stuck in quorum loss. + * Indicates to the Service Fabric cluster that it should attempt to recover the specified service 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable recoverServicePartitionsAsync(String serviceId, Long timeout) { + return recoverServicePartitionsWithServiceResponseAsync(serviceId, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Indicates to the Service Fabric cluster that it should attempt to recover the specified service that is currently stuck in quorum loss. + * Indicates to the Service Fabric cluster that it should attempt to recover the specified service 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> recoverServicePartitionsWithServiceResponseAsync(String serviceId, Long timeout) { + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.recoverServicePartitions(serviceId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = recoverServicePartitionsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse recoverServicePartitionsDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Indicates to the Service Fabric cluster that it should attempt to recover the system services that are currently stuck in quorum loss. + * Indicates to the Service Fabric cluster that it should attempt to recover the system services 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void recoverSystemPartitions() { + recoverSystemPartitionsWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Indicates to the Service Fabric cluster that it should attempt to recover the system services that are currently stuck in quorum loss. + * Indicates to the Service Fabric cluster that it should attempt to recover the system services 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture recoverSystemPartitionsAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(recoverSystemPartitionsWithServiceResponseAsync(), serviceCallback); + } + + /** + * Indicates to the Service Fabric cluster that it should attempt to recover the system services that are currently stuck in quorum loss. + * Indicates to the Service Fabric cluster that it should attempt to recover the system services 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable recoverSystemPartitionsAsync() { + return recoverSystemPartitionsWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Indicates to the Service Fabric cluster that it should attempt to recover the system services that are currently stuck in quorum loss. + * Indicates to the Service Fabric cluster that it should attempt to recover the system services 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> recoverSystemPartitionsWithServiceResponseAsync() { + final String apiVersion = "6.0"; + final Long timeout = null; + return service.recoverSystemPartitions(apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = recoverSystemPartitionsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Indicates to the Service Fabric cluster that it should attempt to recover the system services that are currently stuck in quorum loss. + * Indicates to the Service Fabric cluster that it should attempt to recover the system services 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void recoverSystemPartitions(Long timeout) { + recoverSystemPartitionsWithServiceResponseAsync(timeout).toBlocking().single().body(); + } + + /** + * Indicates to the Service Fabric cluster that it should attempt to recover the system services that are currently stuck in quorum loss. + * Indicates to the Service Fabric cluster that it should attempt to recover the system services 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture recoverSystemPartitionsAsync(Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(recoverSystemPartitionsWithServiceResponseAsync(timeout), serviceCallback); + } + + /** + * Indicates to the Service Fabric cluster that it should attempt to recover the system services that are currently stuck in quorum loss. + * Indicates to the Service Fabric cluster that it should attempt to recover the system services 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable recoverSystemPartitionsAsync(Long timeout) { + return recoverSystemPartitionsWithServiceResponseAsync(timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Indicates to the Service Fabric cluster that it should attempt to recover the system services that are currently stuck in quorum loss. + * Indicates to the Service Fabric cluster that it should attempt to recover the system services 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> recoverSystemPartitionsWithServiceResponseAsync(Long timeout) { + final String apiVersion = "6.0"; + return service.recoverSystemPartitions(apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = recoverSystemPartitionsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse recoverSystemPartitionsDelegate(Response response) throws FabricErrorException, IOException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Indicates to the Service Fabric cluster that it should attempt to recover any services (including system services) which are currently stuck in quorum loss. + * This operation should only be performed if it is known that the replicas that are down cannot be recovered. Incorrect use of this API can cause potential data loss. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void recoverAllPartitions() { + recoverAllPartitionsWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Indicates to the Service Fabric cluster that it should attempt to recover any services (including system services) which are currently stuck in quorum loss. + * This operation should only be performed if it is known that the replicas that are down cannot be recovered. Incorrect use of this API can cause potential data loss. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture recoverAllPartitionsAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(recoverAllPartitionsWithServiceResponseAsync(), serviceCallback); + } + + /** + * Indicates to the Service Fabric cluster that it should attempt to recover any services (including system services) which are currently stuck in quorum loss. + * This operation should only be performed if it is known that the replicas that are down cannot be recovered. Incorrect use of this API can cause potential data loss. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable recoverAllPartitionsAsync() { + return recoverAllPartitionsWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Indicates to the Service Fabric cluster that it should attempt to recover any services (including system services) which are currently stuck in quorum loss. + * This operation should only be performed if it is known that the replicas that are down cannot be recovered. Incorrect use of this API can cause potential data loss. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> recoverAllPartitionsWithServiceResponseAsync() { + final String apiVersion = "6.0"; + final Long timeout = null; + return service.recoverAllPartitions(apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = recoverAllPartitionsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Indicates to the Service Fabric cluster that it should attempt to recover any services (including system services) which are currently stuck in quorum loss. + * This operation should only be performed if it is known that the replicas that are down cannot be recovered. Incorrect use of this API can cause potential data loss. + * + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void recoverAllPartitions(Long timeout) { + recoverAllPartitionsWithServiceResponseAsync(timeout).toBlocking().single().body(); + } + + /** + * Indicates to the Service Fabric cluster that it should attempt to recover any services (including system services) which are currently stuck in quorum loss. + * This operation should only be performed if it is known that the replicas that are down cannot be recovered. Incorrect use of this API can cause potential data loss. + * + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture recoverAllPartitionsAsync(Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(recoverAllPartitionsWithServiceResponseAsync(timeout), serviceCallback); + } + + /** + * Indicates to the Service Fabric cluster that it should attempt to recover any services (including system services) which are currently stuck in quorum loss. + * This operation should only be performed if it is known that the replicas that are down cannot be recovered. Incorrect use of this API can cause potential data loss. + * + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable recoverAllPartitionsAsync(Long timeout) { + return recoverAllPartitionsWithServiceResponseAsync(timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Indicates to the Service Fabric cluster that it should attempt to recover any services (including system services) which are currently stuck in quorum loss. + * This operation should only be performed if it is known that the replicas that are down cannot be recovered. Incorrect use of this API can cause potential data loss. + * + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> recoverAllPartitionsWithServiceResponseAsync(Long timeout) { + final String apiVersion = "6.0"; + return service.recoverAllPartitions(apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = recoverAllPartitionsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse recoverAllPartitionsDelegate(Response response) throws FabricErrorException, IOException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 repairTask Describes the repair task to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RepairTaskUpdateInfoInner object if successful. + */ + public RepairTaskUpdateInfoInner createRepairTask(RepairTaskInner repairTask) { + return createRepairTaskWithServiceResponseAsync(repairTask).toBlocking().single().body(); + } + + /** + * 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 repairTask Describes the repair task to be created or updated. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createRepairTaskAsync(RepairTaskInner repairTask, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createRepairTaskWithServiceResponseAsync(repairTask), serviceCallback); + } + + /** + * 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 repairTask Describes the repair task to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RepairTaskUpdateInfoInner object + */ + public Observable createRepairTaskAsync(RepairTaskInner repairTask) { + return createRepairTaskWithServiceResponseAsync(repairTask).map(new Func1, RepairTaskUpdateInfoInner>() { + @Override + public RepairTaskUpdateInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 repairTask Describes the repair task to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RepairTaskUpdateInfoInner object + */ + public Observable> createRepairTaskWithServiceResponseAsync(RepairTaskInner repairTask) { + if (repairTask == null) { + throw new IllegalArgumentException("Parameter repairTask is required and cannot be null."); + } + Validator.validate(repairTask); + final String apiVersion = "6.0"; + return service.createRepairTask(apiVersion, repairTask, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createRepairTaskDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createRepairTaskDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 repairTaskCancelDescription Describes the repair task to be cancelled. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RepairTaskUpdateInfoInner object if successful. + */ + public RepairTaskUpdateInfoInner cancelRepairTask(RepairTaskCancelDescription repairTaskCancelDescription) { + return cancelRepairTaskWithServiceResponseAsync(repairTaskCancelDescription).toBlocking().single().body(); + } + + /** + * 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 repairTaskCancelDescription Describes the repair task to be cancelled. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture cancelRepairTaskAsync(RepairTaskCancelDescription repairTaskCancelDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(cancelRepairTaskWithServiceResponseAsync(repairTaskCancelDescription), serviceCallback); + } + + /** + * 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 repairTaskCancelDescription Describes the repair task to be cancelled. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RepairTaskUpdateInfoInner object + */ + public Observable cancelRepairTaskAsync(RepairTaskCancelDescription repairTaskCancelDescription) { + return cancelRepairTaskWithServiceResponseAsync(repairTaskCancelDescription).map(new Func1, RepairTaskUpdateInfoInner>() { + @Override + public RepairTaskUpdateInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 repairTaskCancelDescription Describes the repair task to be cancelled. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RepairTaskUpdateInfoInner object + */ + public Observable> cancelRepairTaskWithServiceResponseAsync(RepairTaskCancelDescription repairTaskCancelDescription) { + if (repairTaskCancelDescription == null) { + throw new IllegalArgumentException("Parameter repairTaskCancelDescription is required and cannot be null."); + } + Validator.validate(repairTaskCancelDescription); + final String apiVersion = "6.0"; + return service.cancelRepairTask(apiVersion, repairTaskCancelDescription, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = cancelRepairTaskDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse cancelRepairTaskDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Deletes a completed repair task. + * This API supports the Service Fabric platform; it is not meant to be used directly from your code. + * + * @param repairTaskDeleteDescription Describes the repair task to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteRepairTask(RepairTaskDeleteDescription repairTaskDeleteDescription) { + deleteRepairTaskWithServiceResponseAsync(repairTaskDeleteDescription).toBlocking().single().body(); + } + + /** + * Deletes a completed repair task. + * This API supports the Service Fabric platform; it is not meant to be used directly from your code. + * + * @param repairTaskDeleteDescription Describes the repair task to be deleted. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteRepairTaskAsync(RepairTaskDeleteDescription repairTaskDeleteDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteRepairTaskWithServiceResponseAsync(repairTaskDeleteDescription), serviceCallback); + } + + /** + * Deletes a completed repair task. + * This API supports the Service Fabric platform; it is not meant to be used directly from your code. + * + * @param repairTaskDeleteDescription Describes the repair task to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteRepairTaskAsync(RepairTaskDeleteDescription repairTaskDeleteDescription) { + return deleteRepairTaskWithServiceResponseAsync(repairTaskDeleteDescription).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a completed repair task. + * This API supports the Service Fabric platform; it is not meant to be used directly from your code. + * + * @param repairTaskDeleteDescription Describes the repair task to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteRepairTaskWithServiceResponseAsync(RepairTaskDeleteDescription repairTaskDeleteDescription) { + if (repairTaskDeleteDescription == null) { + throw new IllegalArgumentException("Parameter repairTaskDeleteDescription is required and cannot be null."); + } + Validator.validate(repairTaskDeleteDescription); + final String apiVersion = "6.0"; + return service.deleteRepairTask(apiVersion, repairTaskDeleteDescription, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteRepairTaskDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteRepairTaskDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<RepairTaskInner> object if successful. + */ + public List getRepairTaskList() { + return getRepairTaskListWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getRepairTaskListAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getRepairTaskListWithServiceResponseAsync(), serviceCallback); + } + + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<RepairTaskInner> object + */ + public Observable> getRepairTaskListAsync() { + return getRepairTaskListWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<RepairTaskInner> object + */ + public Observable>> getRepairTaskListWithServiceResponseAsync() { + final String apiVersion = "6.0"; + final String taskIdFilter = null; + final Integer stateFilter = null; + final String executorFilter = null; + return service.getRepairTaskList(apiVersion, taskIdFilter, stateFilter, executorFilter, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getRepairTaskListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 taskIdFilter The repair task ID prefix to be matched. + * @param stateFilter A bitwise-OR of the following values, specifying which task states should be included in the result list. + - 1 - Created + - 2 - Claimed + - 4 - Preparing + - 8 - Approved + - 16 - Executing + - 32 - Restoring + - 64 - Completed + * @param executorFilter The name of the repair executor whose claimed tasks should be included in the list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<RepairTaskInner> object if successful. + */ + public List getRepairTaskList(String taskIdFilter, Integer stateFilter, String executorFilter) { + return getRepairTaskListWithServiceResponseAsync(taskIdFilter, stateFilter, executorFilter).toBlocking().single().body(); + } + + /** + * 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 taskIdFilter The repair task ID prefix to be matched. + * @param stateFilter A bitwise-OR of the following values, specifying which task states should be included in the result list. + - 1 - Created + - 2 - Claimed + - 4 - Preparing + - 8 - Approved + - 16 - Executing + - 32 - Restoring + - 64 - Completed + * @param executorFilter The name of the repair executor whose claimed tasks should be included in the list. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getRepairTaskListAsync(String taskIdFilter, Integer stateFilter, String executorFilter, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getRepairTaskListWithServiceResponseAsync(taskIdFilter, stateFilter, executorFilter), serviceCallback); + } + + /** + * 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 taskIdFilter The repair task ID prefix to be matched. + * @param stateFilter A bitwise-OR of the following values, specifying which task states should be included in the result list. + - 1 - Created + - 2 - Claimed + - 4 - Preparing + - 8 - Approved + - 16 - Executing + - 32 - Restoring + - 64 - Completed + * @param executorFilter The name of the repair executor whose claimed tasks should be included in the list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<RepairTaskInner> object + */ + public Observable> getRepairTaskListAsync(String taskIdFilter, Integer stateFilter, String executorFilter) { + return getRepairTaskListWithServiceResponseAsync(taskIdFilter, stateFilter, executorFilter).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 taskIdFilter The repair task ID prefix to be matched. + * @param stateFilter A bitwise-OR of the following values, specifying which task states should be included in the result list. + - 1 - Created + - 2 - Claimed + - 4 - Preparing + - 8 - Approved + - 16 - Executing + - 32 - Restoring + - 64 - Completed + * @param executorFilter The name of the repair executor whose claimed tasks should be included in the list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<RepairTaskInner> object + */ + public Observable>> getRepairTaskListWithServiceResponseAsync(String taskIdFilter, Integer stateFilter, String executorFilter) { + final String apiVersion = "6.0"; + return service.getRepairTaskList(apiVersion, taskIdFilter, stateFilter, executorFilter, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getRepairTaskListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getRepairTaskListDelegate(Response response) throws FabricErrorException, IOException { + return this.restClient().responseBuilderFactory()., FabricErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 repairTaskApproveDescription Describes the repair task to be approved. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RepairTaskUpdateInfoInner object if successful. + */ + public RepairTaskUpdateInfoInner forceApproveRepairTask(RepairTaskApproveDescription repairTaskApproveDescription) { + return forceApproveRepairTaskWithServiceResponseAsync(repairTaskApproveDescription).toBlocking().single().body(); + } + + /** + * 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 repairTaskApproveDescription Describes the repair task to be approved. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture forceApproveRepairTaskAsync(RepairTaskApproveDescription repairTaskApproveDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(forceApproveRepairTaskWithServiceResponseAsync(repairTaskApproveDescription), serviceCallback); + } + + /** + * 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 repairTaskApproveDescription Describes the repair task to be approved. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RepairTaskUpdateInfoInner object + */ + public Observable forceApproveRepairTaskAsync(RepairTaskApproveDescription repairTaskApproveDescription) { + return forceApproveRepairTaskWithServiceResponseAsync(repairTaskApproveDescription).map(new Func1, RepairTaskUpdateInfoInner>() { + @Override + public RepairTaskUpdateInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 repairTaskApproveDescription Describes the repair task to be approved. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RepairTaskUpdateInfoInner object + */ + public Observable> forceApproveRepairTaskWithServiceResponseAsync(RepairTaskApproveDescription repairTaskApproveDescription) { + if (repairTaskApproveDescription == null) { + throw new IllegalArgumentException("Parameter repairTaskApproveDescription is required and cannot be null."); + } + Validator.validate(repairTaskApproveDescription); + final String apiVersion = "6.0"; + return service.forceApproveRepairTask(apiVersion, repairTaskApproveDescription, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = forceApproveRepairTaskDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse forceApproveRepairTaskDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 repairTaskUpdateHealthPolicyDescription Describes the repair task healthy policy to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RepairTaskUpdateInfoInner object if successful. + */ + public RepairTaskUpdateInfoInner updateRepairTaskHealthPolicy(RepairTaskUpdateHealthPolicyDescription repairTaskUpdateHealthPolicyDescription) { + return updateRepairTaskHealthPolicyWithServiceResponseAsync(repairTaskUpdateHealthPolicyDescription).toBlocking().single().body(); + } + + /** + * 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 repairTaskUpdateHealthPolicyDescription Describes the repair task healthy policy to be updated. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateRepairTaskHealthPolicyAsync(RepairTaskUpdateHealthPolicyDescription repairTaskUpdateHealthPolicyDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateRepairTaskHealthPolicyWithServiceResponseAsync(repairTaskUpdateHealthPolicyDescription), serviceCallback); + } + + /** + * 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 repairTaskUpdateHealthPolicyDescription Describes the repair task healthy policy to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RepairTaskUpdateInfoInner object + */ + public Observable updateRepairTaskHealthPolicyAsync(RepairTaskUpdateHealthPolicyDescription repairTaskUpdateHealthPolicyDescription) { + return updateRepairTaskHealthPolicyWithServiceResponseAsync(repairTaskUpdateHealthPolicyDescription).map(new Func1, RepairTaskUpdateInfoInner>() { + @Override + public RepairTaskUpdateInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 repairTaskUpdateHealthPolicyDescription Describes the repair task healthy policy to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RepairTaskUpdateInfoInner object + */ + public Observable> updateRepairTaskHealthPolicyWithServiceResponseAsync(RepairTaskUpdateHealthPolicyDescription repairTaskUpdateHealthPolicyDescription) { + if (repairTaskUpdateHealthPolicyDescription == null) { + throw new IllegalArgumentException("Parameter repairTaskUpdateHealthPolicyDescription is required and cannot be null."); + } + Validator.validate(repairTaskUpdateHealthPolicyDescription); + final String apiVersion = "6.0"; + return service.updateRepairTaskHealthPolicy(apiVersion, repairTaskUpdateHealthPolicyDescription, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateRepairTaskHealthPolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateRepairTaskHealthPolicyDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Updates the execution state of a repair task. + * This API supports the Service Fabric platform; it is not meant to be used directly from your code. + * + * @param repairTask Describes the repair task to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RepairTaskUpdateInfoInner object if successful. + */ + public RepairTaskUpdateInfoInner updateRepairExecutionState(RepairTaskInner repairTask) { + return updateRepairExecutionStateWithServiceResponseAsync(repairTask).toBlocking().single().body(); + } + + /** + * Updates the execution state of a repair task. + * This API supports the Service Fabric platform; it is not meant to be used directly from your code. + * + * @param repairTask Describes the repair task to be created or updated. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateRepairExecutionStateAsync(RepairTaskInner repairTask, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateRepairExecutionStateWithServiceResponseAsync(repairTask), serviceCallback); + } + + /** + * Updates the execution state of a repair task. + * This API supports the Service Fabric platform; it is not meant to be used directly from your code. + * + * @param repairTask Describes the repair task to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RepairTaskUpdateInfoInner object + */ + public Observable updateRepairExecutionStateAsync(RepairTaskInner repairTask) { + return updateRepairExecutionStateWithServiceResponseAsync(repairTask).map(new Func1, RepairTaskUpdateInfoInner>() { + @Override + public RepairTaskUpdateInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the execution state of a repair task. + * This API supports the Service Fabric platform; it is not meant to be used directly from your code. + * + * @param repairTask Describes the repair task to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RepairTaskUpdateInfoInner object + */ + public Observable> updateRepairExecutionStateWithServiceResponseAsync(RepairTaskInner repairTask) { + if (repairTask == null) { + throw new IllegalArgumentException("Parameter repairTask is required and cannot be null."); + } + Validator.validate(repairTask); + final String apiVersion = "6.0"; + return service.updateRepairExecutionState(apiVersion, repairTask, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateRepairExecutionStateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateRepairExecutionStateDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedReplicaInfoListInner object if successful. + */ + public PagedReplicaInfoListInner getReplicaInfoList(UUID partitionId) { + return getReplicaInfoListWithServiceResponseAsync(partitionId).toBlocking().single().body(); + } + + /** + * 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 partitionId The identity of the partition. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getReplicaInfoListAsync(UUID partitionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getReplicaInfoListWithServiceResponseAsync(partitionId), serviceCallback); + } + + /** + * 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 partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedReplicaInfoListInner object + */ + public Observable getReplicaInfoListAsync(UUID partitionId) { + return getReplicaInfoListWithServiceResponseAsync(partitionId).map(new Func1, PagedReplicaInfoListInner>() { + @Override + public PagedReplicaInfoListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedReplicaInfoListInner object + */ + public Observable> getReplicaInfoListWithServiceResponseAsync(UUID partitionId) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final String continuationToken = null; + final Long timeout = null; + return service.getReplicaInfoList(partitionId, apiVersion, continuationToken, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getReplicaInfoListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 partitionId The identity of the partition. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedReplicaInfoListInner object if successful. + */ + public PagedReplicaInfoListInner getReplicaInfoList(UUID partitionId, String continuationToken, Long timeout) { + return getReplicaInfoListWithServiceResponseAsync(partitionId, continuationToken, timeout).toBlocking().single().body(); + } + + /** + * 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 partitionId The identity of the partition. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getReplicaInfoListAsync(UUID partitionId, String continuationToken, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getReplicaInfoListWithServiceResponseAsync(partitionId, continuationToken, timeout), serviceCallback); + } + + /** + * 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 partitionId The identity of the partition. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedReplicaInfoListInner object + */ + public Observable getReplicaInfoListAsync(UUID partitionId, String continuationToken, Long timeout) { + return getReplicaInfoListWithServiceResponseAsync(partitionId, continuationToken, timeout).map(new Func1, PagedReplicaInfoListInner>() { + @Override + public PagedReplicaInfoListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 partitionId The identity of the partition. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedReplicaInfoListInner object + */ + public Observable> getReplicaInfoListWithServiceResponseAsync(UUID partitionId, String continuationToken, Long timeout) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.getReplicaInfoList(partitionId, apiVersion, continuationToken, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getReplicaInfoListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getReplicaInfoListDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the information about a replica of a Service Fabric partition. + * The response includes the ID, role, status, health, node name, uptime, and other details about the replica. + * + * @param partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ReplicaInfoInner object if successful. + */ + public ReplicaInfoInner getReplicaInfo(UUID partitionId, String replicaId) { + return getReplicaInfoWithServiceResponseAsync(partitionId, replicaId).toBlocking().single().body(); + } + + /** + * Gets the information about a replica of a Service Fabric partition. + * The response includes the ID, role, status, health, node name, uptime, and other details about the replica. + * + * @param partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getReplicaInfoAsync(UUID partitionId, String replicaId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getReplicaInfoWithServiceResponseAsync(partitionId, replicaId), serviceCallback); + } + + /** + * Gets the information about a replica of a Service Fabric partition. + * The response includes the ID, role, status, health, node name, uptime, and other details about the replica. + * + * @param partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicaInfoInner object + */ + public Observable getReplicaInfoAsync(UUID partitionId, String replicaId) { + return getReplicaInfoWithServiceResponseAsync(partitionId, replicaId).map(new Func1, ReplicaInfoInner>() { + @Override + public ReplicaInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the information about a replica of a Service Fabric partition. + * The response includes the ID, role, status, health, node name, uptime, and other details about the replica. + * + * @param partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicaInfoInner object + */ + public Observable> getReplicaInfoWithServiceResponseAsync(UUID partitionId, String replicaId) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + if (replicaId == null) { + throw new IllegalArgumentException("Parameter replicaId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + return service.getReplicaInfo(partitionId, replicaId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getReplicaInfoDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the information about a replica of a Service Fabric partition. + * The response includes the ID, role, status, health, node name, uptime, and other details about the replica. + * + * @param partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ReplicaInfoInner object if successful. + */ + public ReplicaInfoInner getReplicaInfo(UUID partitionId, String replicaId, Long timeout) { + return getReplicaInfoWithServiceResponseAsync(partitionId, replicaId, timeout).toBlocking().single().body(); + } + + /** + * Gets the information about a replica of a Service Fabric partition. + * The response includes the ID, role, status, health, node name, uptime, and other details about the replica. + * + * @param partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getReplicaInfoAsync(UUID partitionId, String replicaId, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getReplicaInfoWithServiceResponseAsync(partitionId, replicaId, timeout), serviceCallback); + } + + /** + * Gets the information about a replica of a Service Fabric partition. + * The response includes the ID, role, status, health, node name, uptime, and other details about the replica. + * + * @param partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicaInfoInner object + */ + public Observable getReplicaInfoAsync(UUID partitionId, String replicaId, Long timeout) { + return getReplicaInfoWithServiceResponseAsync(partitionId, replicaId, timeout).map(new Func1, ReplicaInfoInner>() { + @Override + public ReplicaInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the information about a replica of a Service Fabric partition. + * The response includes the ID, role, status, health, node name, uptime, and other details about the replica. + * + * @param partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicaInfoInner object + */ + public Observable> getReplicaInfoWithServiceResponseAsync(UUID partitionId, String replicaId, Long timeout) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + if (replicaId == null) { + throw new IllegalArgumentException("Parameter replicaId is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.getReplicaInfo(partitionId, replicaId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getReplicaInfoDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getReplicaInfoDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ReplicaHealthInner object if successful. + */ + public ReplicaHealthInner getReplicaHealth(UUID partitionId, String replicaId) { + return getReplicaHealthWithServiceResponseAsync(partitionId, replicaId).toBlocking().single().body(); + } + + /** + * 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 partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getReplicaHealthAsync(UUID partitionId, String replicaId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getReplicaHealthWithServiceResponseAsync(partitionId, replicaId), serviceCallback); + } + + /** + * 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 partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicaHealthInner object + */ + public Observable getReplicaHealthAsync(UUID partitionId, String replicaId) { + return getReplicaHealthWithServiceResponseAsync(partitionId, replicaId).map(new Func1, ReplicaHealthInner>() { + @Override + public ReplicaHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicaHealthInner object + */ + public Observable> getReplicaHealthWithServiceResponseAsync(UUID partitionId, String replicaId) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + if (replicaId == null) { + throw new IllegalArgumentException("Parameter replicaId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Integer eventsHealthStateFilter = null; + final Long timeout = null; + return service.getReplicaHealth(partitionId, replicaId, apiVersion, eventsHealthStateFilter, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getReplicaHealthDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ReplicaHealthInner object if successful. + */ + public ReplicaHealthInner getReplicaHealth(UUID partitionId, String replicaId, Integer eventsHealthStateFilter, Long timeout) { + return getReplicaHealthWithServiceResponseAsync(partitionId, replicaId, eventsHealthStateFilter, timeout).toBlocking().single().body(); + } + + /** + * 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 partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getReplicaHealthAsync(UUID partitionId, String replicaId, Integer eventsHealthStateFilter, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getReplicaHealthWithServiceResponseAsync(partitionId, replicaId, eventsHealthStateFilter, timeout), serviceCallback); + } + + /** + * 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 partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicaHealthInner object + */ + public Observable getReplicaHealthAsync(UUID partitionId, String replicaId, Integer eventsHealthStateFilter, Long timeout) { + return getReplicaHealthWithServiceResponseAsync(partitionId, replicaId, eventsHealthStateFilter, timeout).map(new Func1, ReplicaHealthInner>() { + @Override + public ReplicaHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicaHealthInner object + */ + public Observable> getReplicaHealthWithServiceResponseAsync(UUID partitionId, String replicaId, Integer eventsHealthStateFilter, Long timeout) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + if (replicaId == null) { + throw new IllegalArgumentException("Parameter replicaId is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.getReplicaHealth(partitionId, replicaId, apiVersion, eventsHealthStateFilter, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getReplicaHealthDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getReplicaHealthDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ReplicaHealthInner object if successful. + */ + public ReplicaHealthInner getReplicaHealthUsingPolicy(UUID partitionId, String replicaId) { + return getReplicaHealthUsingPolicyWithServiceResponseAsync(partitionId, replicaId).toBlocking().single().body(); + } + + /** + * 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 partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getReplicaHealthUsingPolicyAsync(UUID partitionId, String replicaId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getReplicaHealthUsingPolicyWithServiceResponseAsync(partitionId, replicaId), serviceCallback); + } + + /** + * 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 partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicaHealthInner object + */ + public Observable getReplicaHealthUsingPolicyAsync(UUID partitionId, String replicaId) { + return getReplicaHealthUsingPolicyWithServiceResponseAsync(partitionId, replicaId).map(new Func1, ReplicaHealthInner>() { + @Override + public ReplicaHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicaHealthInner object + */ + public Observable> getReplicaHealthUsingPolicyWithServiceResponseAsync(UUID partitionId, String replicaId) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + if (replicaId == null) { + throw new IllegalArgumentException("Parameter replicaId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Integer eventsHealthStateFilter = null; + final ApplicationHealthPolicy applicationHealthPolicy = null; + final Long timeout = null; + return service.getReplicaHealthUsingPolicy(partitionId, replicaId, apiVersion, eventsHealthStateFilter, applicationHealthPolicy, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getReplicaHealthUsingPolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ReplicaHealthInner object if successful. + */ + public ReplicaHealthInner getReplicaHealthUsingPolicy(UUID partitionId, String replicaId, Integer eventsHealthStateFilter, ApplicationHealthPolicy applicationHealthPolicy, Long timeout) { + return getReplicaHealthUsingPolicyWithServiceResponseAsync(partitionId, replicaId, eventsHealthStateFilter, applicationHealthPolicy, timeout).toBlocking().single().body(); + } + + /** + * 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 partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getReplicaHealthUsingPolicyAsync(UUID partitionId, String replicaId, Integer eventsHealthStateFilter, ApplicationHealthPolicy applicationHealthPolicy, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getReplicaHealthUsingPolicyWithServiceResponseAsync(partitionId, replicaId, eventsHealthStateFilter, applicationHealthPolicy, timeout), serviceCallback); + } + + /** + * 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 partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicaHealthInner object + */ + public Observable getReplicaHealthUsingPolicyAsync(UUID partitionId, String replicaId, Integer eventsHealthStateFilter, ApplicationHealthPolicy applicationHealthPolicy, Long timeout) { + return getReplicaHealthUsingPolicyWithServiceResponseAsync(partitionId, replicaId, eventsHealthStateFilter, applicationHealthPolicy, timeout).map(new Func1, ReplicaHealthInner>() { + @Override + public ReplicaHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicaHealthInner object + */ + public Observable> getReplicaHealthUsingPolicyWithServiceResponseAsync(UUID partitionId, String replicaId, Integer eventsHealthStateFilter, ApplicationHealthPolicy applicationHealthPolicy, Long timeout) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + if (replicaId == null) { + throw new IllegalArgumentException("Parameter replicaId is required and cannot be null."); + } + Validator.validate(applicationHealthPolicy); + final String apiVersion = "6.0"; + return service.getReplicaHealthUsingPolicy(partitionId, replicaId, apiVersion, eventsHealthStateFilter, applicationHealthPolicy, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getReplicaHealthUsingPolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getReplicaHealthUsingPolicyDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @param 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void reportReplicaHealth(UUID partitionId, String replicaId, ReplicaHealthReportServiceKind replicaHealthReportServiceKind, HealthInformation healthInformation) { + reportReplicaHealthWithServiceResponseAsync(partitionId, replicaId, replicaHealthReportServiceKind, healthInformation).toBlocking().single().body(); + } + + /** + * 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 partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @param 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 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture reportReplicaHealthAsync(UUID partitionId, String replicaId, ReplicaHealthReportServiceKind replicaHealthReportServiceKind, HealthInformation healthInformation, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(reportReplicaHealthWithServiceResponseAsync(partitionId, replicaId, replicaHealthReportServiceKind, healthInformation), serviceCallback); + } + + /** + * 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 partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @param 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable reportReplicaHealthAsync(UUID partitionId, String replicaId, ReplicaHealthReportServiceKind replicaHealthReportServiceKind, HealthInformation healthInformation) { + return reportReplicaHealthWithServiceResponseAsync(partitionId, replicaId, replicaHealthReportServiceKind, healthInformation).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @param 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> reportReplicaHealthWithServiceResponseAsync(UUID partitionId, String replicaId, ReplicaHealthReportServiceKind replicaHealthReportServiceKind, HealthInformation healthInformation) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + if (replicaId == null) { + throw new IllegalArgumentException("Parameter replicaId is required and cannot be null."); + } + if (replicaHealthReportServiceKind == null) { + throw new IllegalArgumentException("Parameter replicaHealthReportServiceKind is required and cannot be null."); + } + if (healthInformation == null) { + throw new IllegalArgumentException("Parameter healthInformation is required and cannot be null."); + } + Validator.validate(healthInformation); + final String apiVersion = "6.0"; + final Boolean immediate = null; + final Long timeout = null; + return service.reportReplicaHealth(partitionId, replicaId, apiVersion, replicaHealthReportServiceKind, healthInformation, immediate, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = reportReplicaHealthDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @param 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void reportReplicaHealth(UUID partitionId, String replicaId, ReplicaHealthReportServiceKind replicaHealthReportServiceKind, HealthInformation healthInformation, Boolean immediate, Long timeout) { + reportReplicaHealthWithServiceResponseAsync(partitionId, replicaId, replicaHealthReportServiceKind, healthInformation, immediate, timeout).toBlocking().single().body(); + } + + /** + * 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 partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @param 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture reportReplicaHealthAsync(UUID partitionId, String replicaId, ReplicaHealthReportServiceKind replicaHealthReportServiceKind, HealthInformation healthInformation, Boolean immediate, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(reportReplicaHealthWithServiceResponseAsync(partitionId, replicaId, replicaHealthReportServiceKind, healthInformation, immediate, timeout), serviceCallback); + } + + /** + * 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 partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @param 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable reportReplicaHealthAsync(UUID partitionId, String replicaId, ReplicaHealthReportServiceKind replicaHealthReportServiceKind, HealthInformation healthInformation, Boolean immediate, Long timeout) { + return reportReplicaHealthWithServiceResponseAsync(partitionId, replicaId, replicaHealthReportServiceKind, healthInformation, immediate, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @param 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> reportReplicaHealthWithServiceResponseAsync(UUID partitionId, String replicaId, ReplicaHealthReportServiceKind replicaHealthReportServiceKind, HealthInformation healthInformation, Boolean immediate, Long timeout) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + if (replicaId == null) { + throw new IllegalArgumentException("Parameter replicaId is required and cannot be null."); + } + if (replicaHealthReportServiceKind == null) { + throw new IllegalArgumentException("Parameter replicaHealthReportServiceKind is required and cannot be null."); + } + if (healthInformation == null) { + throw new IllegalArgumentException("Parameter healthInformation is required and cannot be null."); + } + Validator.validate(healthInformation); + final String apiVersion = "6.0"; + return service.reportReplicaHealth(partitionId, replicaId, apiVersion, replicaHealthReportServiceKind, healthInformation, immediate, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = reportReplicaHealthDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse reportReplicaHealthDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the list of replicas deployed on a Service Fabric node. + * Gets the list containing the information about replicas deployed on a Service Fabric node. The information include partition ID, replica ID, status of the replica, name of the service, name of the service type, and other information. Use PartitionId or ServiceManifestName query parameters to return information about the deployed replicas matching the specified values for those parameters. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<DeployedServiceReplicaInfoInner> object if successful. + */ + public List getDeployedServiceReplicaInfoList(String nodeName, String applicationId) { + return getDeployedServiceReplicaInfoListWithServiceResponseAsync(nodeName, applicationId).toBlocking().single().body(); + } + + /** + * Gets the list of replicas deployed on a Service Fabric node. + * Gets the list containing the information about replicas deployed on a Service Fabric node. The information include partition ID, replica ID, status of the replica, name of the service, name of the service type, and other information. Use PartitionId or ServiceManifestName query parameters to return information about the deployed replicas matching the specified values for those parameters. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDeployedServiceReplicaInfoListAsync(String nodeName, String applicationId, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getDeployedServiceReplicaInfoListWithServiceResponseAsync(nodeName, applicationId), serviceCallback); + } + + /** + * Gets the list of replicas deployed on a Service Fabric node. + * Gets the list containing the information about replicas deployed on a Service Fabric node. The information include partition ID, replica ID, status of the replica, name of the service, name of the service type, and other information. Use PartitionId or ServiceManifestName query parameters to return information about the deployed replicas matching the specified values for those parameters. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DeployedServiceReplicaInfoInner> object + */ + public Observable> getDeployedServiceReplicaInfoListAsync(String nodeName, String applicationId) { + return getDeployedServiceReplicaInfoListWithServiceResponseAsync(nodeName, applicationId).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the list of replicas deployed on a Service Fabric node. + * Gets the list containing the information about replicas deployed on a Service Fabric node. The information include partition ID, replica ID, status of the replica, name of the service, name of the service type, and other information. Use PartitionId or ServiceManifestName query parameters to return information about the deployed replicas matching the specified values for those parameters. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DeployedServiceReplicaInfoInner> object + */ + public Observable>> getDeployedServiceReplicaInfoListWithServiceResponseAsync(String nodeName, String applicationId) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final UUID partitionId = null; + final String serviceManifestName = null; + final Long timeout = null; + return service.getDeployedServiceReplicaInfoList(nodeName, applicationId, apiVersion, partitionId, serviceManifestName, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getDeployedServiceReplicaInfoListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the list of replicas deployed on a Service Fabric node. + * Gets the list containing the information about replicas deployed on a Service Fabric node. The information include partition ID, replica ID, status of the replica, name of the service, name of the service type, and other information. Use PartitionId or ServiceManifestName query parameters to return information about the deployed replicas matching the specified values for those parameters. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param partitionId The identity of the partition. + * @param serviceManifestName The name of a service manifest registered as part of an application type in a Service Fabric cluster. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<DeployedServiceReplicaInfoInner> object if successful. + */ + public List getDeployedServiceReplicaInfoList(String nodeName, String applicationId, UUID partitionId, String serviceManifestName, Long timeout) { + return getDeployedServiceReplicaInfoListWithServiceResponseAsync(nodeName, applicationId, partitionId, serviceManifestName, timeout).toBlocking().single().body(); + } + + /** + * Gets the list of replicas deployed on a Service Fabric node. + * Gets the list containing the information about replicas deployed on a Service Fabric node. The information include partition ID, replica ID, status of the replica, name of the service, name of the service type, and other information. Use PartitionId or ServiceManifestName query parameters to return information about the deployed replicas matching the specified values for those parameters. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param partitionId The identity of the partition. + * @param serviceManifestName The name of a service manifest registered as part of an application type in a Service Fabric cluster. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDeployedServiceReplicaInfoListAsync(String nodeName, String applicationId, UUID partitionId, String serviceManifestName, Long timeout, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getDeployedServiceReplicaInfoListWithServiceResponseAsync(nodeName, applicationId, partitionId, serviceManifestName, timeout), serviceCallback); + } + + /** + * Gets the list of replicas deployed on a Service Fabric node. + * Gets the list containing the information about replicas deployed on a Service Fabric node. The information include partition ID, replica ID, status of the replica, name of the service, name of the service type, and other information. Use PartitionId or ServiceManifestName query parameters to return information about the deployed replicas matching the specified values for those parameters. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param partitionId The identity of the partition. + * @param serviceManifestName The name of a service manifest registered as part of an application type in a Service Fabric cluster. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DeployedServiceReplicaInfoInner> object + */ + public Observable> getDeployedServiceReplicaInfoListAsync(String nodeName, String applicationId, UUID partitionId, String serviceManifestName, Long timeout) { + return getDeployedServiceReplicaInfoListWithServiceResponseAsync(nodeName, applicationId, partitionId, serviceManifestName, timeout).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the list of replicas deployed on a Service Fabric node. + * Gets the list containing the information about replicas deployed on a Service Fabric node. The information include partition ID, replica ID, status of the replica, name of the service, name of the service type, and other information. Use PartitionId or ServiceManifestName query parameters to return information about the deployed replicas matching the specified values for those parameters. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param partitionId The identity of the partition. + * @param serviceManifestName The name of a service manifest registered as part of an application type in a Service Fabric cluster. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DeployedServiceReplicaInfoInner> object + */ + public Observable>> getDeployedServiceReplicaInfoListWithServiceResponseAsync(String nodeName, String applicationId, UUID partitionId, String serviceManifestName, Long timeout) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.getDeployedServiceReplicaInfoList(nodeName, applicationId, apiVersion, partitionId, serviceManifestName, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getDeployedServiceReplicaInfoListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getDeployedServiceReplicaInfoListDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., FabricErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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. + * + * @param nodeName The name of the node. + * @param partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DeployedServiceReplicaDetailInfoInner object if successful. + */ + public DeployedServiceReplicaDetailInfoInner getDeployedServiceReplicaDetailInfo(String nodeName, UUID partitionId, String replicaId) { + return getDeployedServiceReplicaDetailInfoWithServiceResponseAsync(nodeName, partitionId, replicaId).toBlocking().single().body(); + } + + /** + * 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. + * + * @param nodeName The name of the node. + * @param partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getDeployedServiceReplicaDetailInfoAsync(String nodeName, UUID partitionId, String replicaId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDeployedServiceReplicaDetailInfoWithServiceResponseAsync(nodeName, partitionId, replicaId), serviceCallback); + } + + /** + * 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. + * + * @param nodeName The name of the node. + * @param partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeployedServiceReplicaDetailInfoInner object + */ + public Observable getDeployedServiceReplicaDetailInfoAsync(String nodeName, UUID partitionId, String replicaId) { + return getDeployedServiceReplicaDetailInfoWithServiceResponseAsync(nodeName, partitionId, replicaId).map(new Func1, DeployedServiceReplicaDetailInfoInner>() { + @Override + public DeployedServiceReplicaDetailInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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. + * + * @param nodeName The name of the node. + * @param partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeployedServiceReplicaDetailInfoInner object + */ + public Observable> getDeployedServiceReplicaDetailInfoWithServiceResponseAsync(String nodeName, UUID partitionId, String replicaId) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + if (replicaId == null) { + throw new IllegalArgumentException("Parameter replicaId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + return service.getDeployedServiceReplicaDetailInfo(nodeName, partitionId, replicaId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDeployedServiceReplicaDetailInfoDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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. + * + * @param nodeName The name of the node. + * @param partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DeployedServiceReplicaDetailInfoInner object if successful. + */ + public DeployedServiceReplicaDetailInfoInner getDeployedServiceReplicaDetailInfo(String nodeName, UUID partitionId, String replicaId, Long timeout) { + return getDeployedServiceReplicaDetailInfoWithServiceResponseAsync(nodeName, partitionId, replicaId, timeout).toBlocking().single().body(); + } + + /** + * 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. + * + * @param nodeName The name of the node. + * @param partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getDeployedServiceReplicaDetailInfoAsync(String nodeName, UUID partitionId, String replicaId, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDeployedServiceReplicaDetailInfoWithServiceResponseAsync(nodeName, partitionId, replicaId, timeout), serviceCallback); + } + + /** + * 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. + * + * @param nodeName The name of the node. + * @param partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeployedServiceReplicaDetailInfoInner object + */ + public Observable getDeployedServiceReplicaDetailInfoAsync(String nodeName, UUID partitionId, String replicaId, Long timeout) { + return getDeployedServiceReplicaDetailInfoWithServiceResponseAsync(nodeName, partitionId, replicaId, timeout).map(new Func1, DeployedServiceReplicaDetailInfoInner>() { + @Override + public DeployedServiceReplicaDetailInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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. + * + * @param nodeName The name of the node. + * @param partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeployedServiceReplicaDetailInfoInner object + */ + public Observable> getDeployedServiceReplicaDetailInfoWithServiceResponseAsync(String nodeName, UUID partitionId, String replicaId, Long timeout) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + if (replicaId == null) { + throw new IllegalArgumentException("Parameter replicaId is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.getDeployedServiceReplicaDetailInfo(nodeName, partitionId, replicaId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDeployedServiceReplicaDetailInfoDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDeployedServiceReplicaDetailInfoDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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. + * + * @param nodeName The name of the node. + * @param partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DeployedServiceReplicaDetailInfoInner object if successful. + */ + public DeployedServiceReplicaDetailInfoInner getDeployedServiceReplicaDetailInfoByPartitionId(String nodeName, UUID partitionId) { + return getDeployedServiceReplicaDetailInfoByPartitionIdWithServiceResponseAsync(nodeName, partitionId).toBlocking().single().body(); + } + + /** + * 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. + * + * @param nodeName The name of the node. + * @param partitionId The identity of the partition. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getDeployedServiceReplicaDetailInfoByPartitionIdAsync(String nodeName, UUID partitionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDeployedServiceReplicaDetailInfoByPartitionIdWithServiceResponseAsync(nodeName, partitionId), serviceCallback); + } + + /** + * 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. + * + * @param nodeName The name of the node. + * @param partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeployedServiceReplicaDetailInfoInner object + */ + public Observable getDeployedServiceReplicaDetailInfoByPartitionIdAsync(String nodeName, UUID partitionId) { + return getDeployedServiceReplicaDetailInfoByPartitionIdWithServiceResponseAsync(nodeName, partitionId).map(new Func1, DeployedServiceReplicaDetailInfoInner>() { + @Override + public DeployedServiceReplicaDetailInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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. + * + * @param nodeName The name of the node. + * @param partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeployedServiceReplicaDetailInfoInner object + */ + public Observable> getDeployedServiceReplicaDetailInfoByPartitionIdWithServiceResponseAsync(String nodeName, UUID partitionId) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + return service.getDeployedServiceReplicaDetailInfoByPartitionId(nodeName, partitionId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDeployedServiceReplicaDetailInfoByPartitionIdDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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. + * + * @param nodeName The name of the node. + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DeployedServiceReplicaDetailInfoInner object if successful. + */ + public DeployedServiceReplicaDetailInfoInner getDeployedServiceReplicaDetailInfoByPartitionId(String nodeName, UUID partitionId, Long timeout) { + return getDeployedServiceReplicaDetailInfoByPartitionIdWithServiceResponseAsync(nodeName, partitionId, timeout).toBlocking().single().body(); + } + + /** + * 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. + * + * @param nodeName The name of the node. + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getDeployedServiceReplicaDetailInfoByPartitionIdAsync(String nodeName, UUID partitionId, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDeployedServiceReplicaDetailInfoByPartitionIdWithServiceResponseAsync(nodeName, partitionId, timeout), serviceCallback); + } + + /** + * 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. + * + * @param nodeName The name of the node. + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeployedServiceReplicaDetailInfoInner object + */ + public Observable getDeployedServiceReplicaDetailInfoByPartitionIdAsync(String nodeName, UUID partitionId, Long timeout) { + return getDeployedServiceReplicaDetailInfoByPartitionIdWithServiceResponseAsync(nodeName, partitionId, timeout).map(new Func1, DeployedServiceReplicaDetailInfoInner>() { + @Override + public DeployedServiceReplicaDetailInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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. + * + * @param nodeName The name of the node. + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeployedServiceReplicaDetailInfoInner object + */ + public Observable> getDeployedServiceReplicaDetailInfoByPartitionIdWithServiceResponseAsync(String nodeName, UUID partitionId, Long timeout) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.getDeployedServiceReplicaDetailInfoByPartitionId(nodeName, partitionId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDeployedServiceReplicaDetailInfoByPartitionIdDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDeployedServiceReplicaDetailInfoByPartitionIdDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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. + * + * @param nodeName The name of the node. + * @param partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void restartReplica(String nodeName, UUID partitionId, String replicaId) { + restartReplicaWithServiceResponseAsync(nodeName, partitionId, replicaId).toBlocking().single().body(); + } + + /** + * 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. + * + * @param nodeName The name of the node. + * @param partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture restartReplicaAsync(String nodeName, UUID partitionId, String replicaId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(restartReplicaWithServiceResponseAsync(nodeName, partitionId, replicaId), serviceCallback); + } + + /** + * 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. + * + * @param nodeName The name of the node. + * @param partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable restartReplicaAsync(String nodeName, UUID partitionId, String replicaId) { + return restartReplicaWithServiceResponseAsync(nodeName, partitionId, replicaId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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. + * + * @param nodeName The name of the node. + * @param partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> restartReplicaWithServiceResponseAsync(String nodeName, UUID partitionId, String replicaId) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + if (replicaId == null) { + throw new IllegalArgumentException("Parameter replicaId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + return service.restartReplica(nodeName, partitionId, replicaId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = restartReplicaDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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. + * + * @param nodeName The name of the node. + * @param partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void restartReplica(String nodeName, UUID partitionId, String replicaId, Long timeout) { + restartReplicaWithServiceResponseAsync(nodeName, partitionId, replicaId, timeout).toBlocking().single().body(); + } + + /** + * 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. + * + * @param nodeName The name of the node. + * @param partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture restartReplicaAsync(String nodeName, UUID partitionId, String replicaId, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(restartReplicaWithServiceResponseAsync(nodeName, partitionId, replicaId, timeout), serviceCallback); + } + + /** + * 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. + * + * @param nodeName The name of the node. + * @param partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable restartReplicaAsync(String nodeName, UUID partitionId, String replicaId, Long timeout) { + return restartReplicaWithServiceResponseAsync(nodeName, partitionId, replicaId, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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. + * + * @param nodeName The name of the node. + * @param partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> restartReplicaWithServiceResponseAsync(String nodeName, UUID partitionId, String replicaId, Long timeout) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + if (replicaId == null) { + throw new IllegalArgumentException("Parameter replicaId is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.restartReplica(nodeName, partitionId, replicaId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = restartReplicaDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse restartReplicaDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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. + * + * @param nodeName The name of the node. + * @param partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void removeReplica(String nodeName, UUID partitionId, String replicaId) { + removeReplicaWithServiceResponseAsync(nodeName, partitionId, replicaId).toBlocking().single().body(); + } + + /** + * 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. + * + * @param nodeName The name of the node. + * @param partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture removeReplicaAsync(String nodeName, UUID partitionId, String replicaId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(removeReplicaWithServiceResponseAsync(nodeName, partitionId, replicaId), serviceCallback); + } + + /** + * 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. + * + * @param nodeName The name of the node. + * @param partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable removeReplicaAsync(String nodeName, UUID partitionId, String replicaId) { + return removeReplicaWithServiceResponseAsync(nodeName, partitionId, replicaId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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. + * + * @param nodeName The name of the node. + * @param partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> removeReplicaWithServiceResponseAsync(String nodeName, UUID partitionId, String replicaId) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + if (replicaId == null) { + throw new IllegalArgumentException("Parameter replicaId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Boolean forceRemove = null; + final Long timeout = null; + return service.removeReplica(nodeName, partitionId, replicaId, apiVersion, forceRemove, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = removeReplicaDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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. + * + * @param nodeName The name of the node. + * @param partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void removeReplica(String nodeName, UUID partitionId, String replicaId, Boolean forceRemove, Long timeout) { + removeReplicaWithServiceResponseAsync(nodeName, partitionId, replicaId, forceRemove, timeout).toBlocking().single().body(); + } + + /** + * 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. + * + * @param nodeName The name of the node. + * @param partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture removeReplicaAsync(String nodeName, UUID partitionId, String replicaId, Boolean forceRemove, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(removeReplicaWithServiceResponseAsync(nodeName, partitionId, replicaId, forceRemove, timeout), serviceCallback); + } + + /** + * 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. + * + * @param nodeName The name of the node. + * @param partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable removeReplicaAsync(String nodeName, UUID partitionId, String replicaId, Boolean forceRemove, Long timeout) { + return removeReplicaWithServiceResponseAsync(nodeName, partitionId, replicaId, forceRemove, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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. + * + * @param nodeName The name of the node. + * @param partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> removeReplicaWithServiceResponseAsync(String nodeName, UUID partitionId, String replicaId, Boolean forceRemove, Long timeout) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + if (replicaId == null) { + throw new IllegalArgumentException("Parameter replicaId is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.removeReplica(nodeName, partitionId, replicaId, apiVersion, forceRemove, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = removeReplicaDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse removeReplicaDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the list of service packages deployed on a Service Fabric node. + * Returns the information about the service packages deployed on a Service Fabric node for the given application. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<DeployedServicePackageInfoInner> object if successful. + */ + public List getDeployedServicePackageInfoList(String nodeName, String applicationId) { + return getDeployedServicePackageInfoListWithServiceResponseAsync(nodeName, applicationId).toBlocking().single().body(); + } + + /** + * Gets the list of service packages deployed on a Service Fabric node. + * Returns the information about the service packages deployed on a Service Fabric node for the given application. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDeployedServicePackageInfoListAsync(String nodeName, String applicationId, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getDeployedServicePackageInfoListWithServiceResponseAsync(nodeName, applicationId), serviceCallback); + } + + /** + * Gets the list of service packages deployed on a Service Fabric node. + * Returns the information about the service packages deployed on a Service Fabric node for the given application. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DeployedServicePackageInfoInner> object + */ + public Observable> getDeployedServicePackageInfoListAsync(String nodeName, String applicationId) { + return getDeployedServicePackageInfoListWithServiceResponseAsync(nodeName, applicationId).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the list of service packages deployed on a Service Fabric node. + * Returns the information about the service packages deployed on a Service Fabric node for the given application. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DeployedServicePackageInfoInner> object + */ + public Observable>> getDeployedServicePackageInfoListWithServiceResponseAsync(String nodeName, String applicationId) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + return service.getDeployedServicePackageInfoList(nodeName, applicationId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getDeployedServicePackageInfoListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the list of service packages deployed on a Service Fabric node. + * Returns the information about the service packages deployed on a Service Fabric node for the given application. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<DeployedServicePackageInfoInner> object if successful. + */ + public List getDeployedServicePackageInfoList(String nodeName, String applicationId, Long timeout) { + return getDeployedServicePackageInfoListWithServiceResponseAsync(nodeName, applicationId, timeout).toBlocking().single().body(); + } + + /** + * Gets the list of service packages deployed on a Service Fabric node. + * Returns the information about the service packages deployed on a Service Fabric node for the given application. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDeployedServicePackageInfoListAsync(String nodeName, String applicationId, Long timeout, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getDeployedServicePackageInfoListWithServiceResponseAsync(nodeName, applicationId, timeout), serviceCallback); + } + + /** + * Gets the list of service packages deployed on a Service Fabric node. + * Returns the information about the service packages deployed on a Service Fabric node for the given application. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DeployedServicePackageInfoInner> object + */ + public Observable> getDeployedServicePackageInfoListAsync(String nodeName, String applicationId, Long timeout) { + return getDeployedServicePackageInfoListWithServiceResponseAsync(nodeName, applicationId, timeout).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the list of service packages deployed on a Service Fabric node. + * Returns the information about the service packages deployed on a Service Fabric node for the given application. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DeployedServicePackageInfoInner> object + */ + public Observable>> getDeployedServicePackageInfoListWithServiceResponseAsync(String nodeName, String applicationId, Long timeout) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.getDeployedServicePackageInfoList(nodeName, applicationId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getDeployedServicePackageInfoListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getDeployedServicePackageInfoListDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., FabricErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the list of service packages deployed on a Service Fabric node matching exactly the specified name. + * 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 nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param servicePackageName The name of the service package. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<DeployedServicePackageInfoInner> object if successful. + */ + public List getDeployedServicePackageInfoListByName(String nodeName, String applicationId, String servicePackageName) { + return getDeployedServicePackageInfoListByNameWithServiceResponseAsync(nodeName, applicationId, servicePackageName).toBlocking().single().body(); + } + + /** + * Gets the list of service packages deployed on a Service Fabric node matching exactly the specified name. + * 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 nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param servicePackageName The name of the service package. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDeployedServicePackageInfoListByNameAsync(String nodeName, String applicationId, String servicePackageName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getDeployedServicePackageInfoListByNameWithServiceResponseAsync(nodeName, applicationId, servicePackageName), serviceCallback); + } + + /** + * Gets the list of service packages deployed on a Service Fabric node matching exactly the specified name. + * 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 nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param servicePackageName The name of the service package. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DeployedServicePackageInfoInner> object + */ + public Observable> getDeployedServicePackageInfoListByNameAsync(String nodeName, String applicationId, String servicePackageName) { + return getDeployedServicePackageInfoListByNameWithServiceResponseAsync(nodeName, applicationId, servicePackageName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the list of service packages deployed on a Service Fabric node matching exactly the specified name. + * 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 nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param servicePackageName The name of the service package. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DeployedServicePackageInfoInner> object + */ + public Observable>> getDeployedServicePackageInfoListByNameWithServiceResponseAsync(String nodeName, String applicationId, String servicePackageName) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + if (servicePackageName == null) { + throw new IllegalArgumentException("Parameter servicePackageName is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + return service.getDeployedServicePackageInfoListByName(nodeName, applicationId, servicePackageName, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getDeployedServicePackageInfoListByNameDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the list of service packages deployed on a Service Fabric node matching exactly the specified name. + * 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 nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param servicePackageName The name of the service package. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<DeployedServicePackageInfoInner> object if successful. + */ + public List getDeployedServicePackageInfoListByName(String nodeName, String applicationId, String servicePackageName, Long timeout) { + return getDeployedServicePackageInfoListByNameWithServiceResponseAsync(nodeName, applicationId, servicePackageName, timeout).toBlocking().single().body(); + } + + /** + * Gets the list of service packages deployed on a Service Fabric node matching exactly the specified name. + * 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 nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param servicePackageName The name of the service package. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDeployedServicePackageInfoListByNameAsync(String nodeName, String applicationId, String servicePackageName, Long timeout, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getDeployedServicePackageInfoListByNameWithServiceResponseAsync(nodeName, applicationId, servicePackageName, timeout), serviceCallback); + } + + /** + * Gets the list of service packages deployed on a Service Fabric node matching exactly the specified name. + * 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 nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param servicePackageName The name of the service package. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DeployedServicePackageInfoInner> object + */ + public Observable> getDeployedServicePackageInfoListByNameAsync(String nodeName, String applicationId, String servicePackageName, Long timeout) { + return getDeployedServicePackageInfoListByNameWithServiceResponseAsync(nodeName, applicationId, servicePackageName, timeout).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the list of service packages deployed on a Service Fabric node matching exactly the specified name. + * 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 nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param servicePackageName The name of the service package. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DeployedServicePackageInfoInner> object + */ + public Observable>> getDeployedServicePackageInfoListByNameWithServiceResponseAsync(String nodeName, String applicationId, String servicePackageName, Long timeout) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + if (servicePackageName == null) { + throw new IllegalArgumentException("Parameter servicePackageName is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.getDeployedServicePackageInfoListByName(nodeName, applicationId, servicePackageName, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getDeployedServicePackageInfoListByNameDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getDeployedServicePackageInfoListByNameDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., FabricErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the information about health of a service package for a specific application deployed for a Service Fabric node and application. + * Gets the information about health of a service package for a specific application deployed on a Service Fabric node. Use EventsHealthStateFilter to optionally filter for the collection of HealthEvent objects reported on the deployed service package based on health state. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param servicePackageName The name of the service package. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DeployedServicePackageHealthInner object if successful. + */ + public DeployedServicePackageHealthInner getDeployedServicePackageHealth(String nodeName, String applicationId, String servicePackageName) { + return getDeployedServicePackageHealthWithServiceResponseAsync(nodeName, applicationId, servicePackageName).toBlocking().single().body(); + } + + /** + * Gets the information about health of a service package for a specific application deployed for a Service Fabric node and application. + * Gets the information about health of a service package for a specific application deployed on a Service Fabric node. Use EventsHealthStateFilter to optionally filter for the collection of HealthEvent objects reported on the deployed service package based on health state. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param servicePackageName The name of the service package. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getDeployedServicePackageHealthAsync(String nodeName, String applicationId, String servicePackageName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDeployedServicePackageHealthWithServiceResponseAsync(nodeName, applicationId, servicePackageName), serviceCallback); + } + + /** + * Gets the information about health of a service package for a specific application deployed for a Service Fabric node and application. + * Gets the information about health of a service package for a specific application deployed on a Service Fabric node. Use EventsHealthStateFilter to optionally filter for the collection of HealthEvent objects reported on the deployed service package based on health state. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param servicePackageName The name of the service package. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeployedServicePackageHealthInner object + */ + public Observable getDeployedServicePackageHealthAsync(String nodeName, String applicationId, String servicePackageName) { + return getDeployedServicePackageHealthWithServiceResponseAsync(nodeName, applicationId, servicePackageName).map(new Func1, DeployedServicePackageHealthInner>() { + @Override + public DeployedServicePackageHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the information about health of a service package for a specific application deployed for a Service Fabric node and application. + * Gets the information about health of a service package for a specific application deployed on a Service Fabric node. Use EventsHealthStateFilter to optionally filter for the collection of HealthEvent objects reported on the deployed service package based on health state. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param servicePackageName The name of the service package. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeployedServicePackageHealthInner object + */ + public Observable> getDeployedServicePackageHealthWithServiceResponseAsync(String nodeName, String applicationId, String servicePackageName) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + if (servicePackageName == null) { + throw new IllegalArgumentException("Parameter servicePackageName is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Integer eventsHealthStateFilter = null; + final Long timeout = null; + return service.getDeployedServicePackageHealth(nodeName, applicationId, servicePackageName, apiVersion, eventsHealthStateFilter, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDeployedServicePackageHealthDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the information about health of a service package for a specific application deployed for a Service Fabric node and application. + * Gets the information about health of a service package for a specific application deployed on a Service Fabric node. Use EventsHealthStateFilter to optionally filter for the collection of HealthEvent objects reported on the deployed service package based on health state. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param servicePackageName The name of the service package. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DeployedServicePackageHealthInner object if successful. + */ + public DeployedServicePackageHealthInner getDeployedServicePackageHealth(String nodeName, String applicationId, String servicePackageName, Integer eventsHealthStateFilter, Long timeout) { + return getDeployedServicePackageHealthWithServiceResponseAsync(nodeName, applicationId, servicePackageName, eventsHealthStateFilter, timeout).toBlocking().single().body(); + } + + /** + * Gets the information about health of a service package for a specific application deployed for a Service Fabric node and application. + * Gets the information about health of a service package for a specific application deployed on a Service Fabric node. Use EventsHealthStateFilter to optionally filter for the collection of HealthEvent objects reported on the deployed service package based on health state. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param servicePackageName The name of the service package. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getDeployedServicePackageHealthAsync(String nodeName, String applicationId, String servicePackageName, Integer eventsHealthStateFilter, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDeployedServicePackageHealthWithServiceResponseAsync(nodeName, applicationId, servicePackageName, eventsHealthStateFilter, timeout), serviceCallback); + } + + /** + * Gets the information about health of a service package for a specific application deployed for a Service Fabric node and application. + * Gets the information about health of a service package for a specific application deployed on a Service Fabric node. Use EventsHealthStateFilter to optionally filter for the collection of HealthEvent objects reported on the deployed service package based on health state. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param servicePackageName The name of the service package. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeployedServicePackageHealthInner object + */ + public Observable getDeployedServicePackageHealthAsync(String nodeName, String applicationId, String servicePackageName, Integer eventsHealthStateFilter, Long timeout) { + return getDeployedServicePackageHealthWithServiceResponseAsync(nodeName, applicationId, servicePackageName, eventsHealthStateFilter, timeout).map(new Func1, DeployedServicePackageHealthInner>() { + @Override + public DeployedServicePackageHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the information about health of a service package for a specific application deployed for a Service Fabric node and application. + * Gets the information about health of a service package for a specific application deployed on a Service Fabric node. Use EventsHealthStateFilter to optionally filter for the collection of HealthEvent objects reported on the deployed service package based on health state. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param servicePackageName The name of the service package. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeployedServicePackageHealthInner object + */ + public Observable> getDeployedServicePackageHealthWithServiceResponseAsync(String nodeName, String applicationId, String servicePackageName, Integer eventsHealthStateFilter, Long timeout) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + if (servicePackageName == null) { + throw new IllegalArgumentException("Parameter servicePackageName is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.getDeployedServicePackageHealth(nodeName, applicationId, servicePackageName, apiVersion, eventsHealthStateFilter, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDeployedServicePackageHealthDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDeployedServicePackageHealthDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param servicePackageName The name of the service package. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DeployedServicePackageHealthInner object if successful. + */ + public DeployedServicePackageHealthInner getDeployedServicePackageHealthUsingPolicy(String nodeName, String applicationId, String servicePackageName) { + return getDeployedServicePackageHealthUsingPolicyWithServiceResponseAsync(nodeName, applicationId, servicePackageName).toBlocking().single().body(); + } + + /** + * 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 nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param servicePackageName The name of the service package. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getDeployedServicePackageHealthUsingPolicyAsync(String nodeName, String applicationId, String servicePackageName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDeployedServicePackageHealthUsingPolicyWithServiceResponseAsync(nodeName, applicationId, servicePackageName), serviceCallback); + } + + /** + * 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 nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param servicePackageName The name of the service package. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeployedServicePackageHealthInner object + */ + public Observable getDeployedServicePackageHealthUsingPolicyAsync(String nodeName, String applicationId, String servicePackageName) { + return getDeployedServicePackageHealthUsingPolicyWithServiceResponseAsync(nodeName, applicationId, servicePackageName).map(new Func1, DeployedServicePackageHealthInner>() { + @Override + public DeployedServicePackageHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param servicePackageName The name of the service package. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeployedServicePackageHealthInner object + */ + public Observable> getDeployedServicePackageHealthUsingPolicyWithServiceResponseAsync(String nodeName, String applicationId, String servicePackageName) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + if (servicePackageName == null) { + throw new IllegalArgumentException("Parameter servicePackageName is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Integer eventsHealthStateFilter = null; + final ApplicationHealthPolicy applicationHealthPolicy = null; + final Long timeout = null; + return service.getDeployedServicePackageHealthUsingPolicy(nodeName, applicationId, servicePackageName, apiVersion, eventsHealthStateFilter, applicationHealthPolicy, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDeployedServicePackageHealthUsingPolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param servicePackageName The name of the service package. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DeployedServicePackageHealthInner object if successful. + */ + public DeployedServicePackageHealthInner getDeployedServicePackageHealthUsingPolicy(String nodeName, String applicationId, String servicePackageName, Integer eventsHealthStateFilter, ApplicationHealthPolicy applicationHealthPolicy, Long timeout) { + return getDeployedServicePackageHealthUsingPolicyWithServiceResponseAsync(nodeName, applicationId, servicePackageName, eventsHealthStateFilter, applicationHealthPolicy, timeout).toBlocking().single().body(); + } + + /** + * 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 nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param servicePackageName The name of the service package. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getDeployedServicePackageHealthUsingPolicyAsync(String nodeName, String applicationId, String servicePackageName, Integer eventsHealthStateFilter, ApplicationHealthPolicy applicationHealthPolicy, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDeployedServicePackageHealthUsingPolicyWithServiceResponseAsync(nodeName, applicationId, servicePackageName, eventsHealthStateFilter, applicationHealthPolicy, timeout), serviceCallback); + } + + /** + * 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 nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param servicePackageName The name of the service package. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeployedServicePackageHealthInner object + */ + public Observable getDeployedServicePackageHealthUsingPolicyAsync(String nodeName, String applicationId, String servicePackageName, Integer eventsHealthStateFilter, ApplicationHealthPolicy applicationHealthPolicy, Long timeout) { + return getDeployedServicePackageHealthUsingPolicyWithServiceResponseAsync(nodeName, applicationId, servicePackageName, eventsHealthStateFilter, applicationHealthPolicy, timeout).map(new Func1, DeployedServicePackageHealthInner>() { + @Override + public DeployedServicePackageHealthInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param servicePackageName The name of the service package. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeployedServicePackageHealthInner object + */ + public Observable> getDeployedServicePackageHealthUsingPolicyWithServiceResponseAsync(String nodeName, String applicationId, String servicePackageName, Integer eventsHealthStateFilter, ApplicationHealthPolicy applicationHealthPolicy, Long timeout) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + if (servicePackageName == null) { + throw new IllegalArgumentException("Parameter servicePackageName is required and cannot be null."); + } + Validator.validate(applicationHealthPolicy); + final String apiVersion = "6.0"; + return service.getDeployedServicePackageHealthUsingPolicy(nodeName, applicationId, servicePackageName, apiVersion, eventsHealthStateFilter, applicationHealthPolicy, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDeployedServicePackageHealthUsingPolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDeployedServicePackageHealthUsingPolicyDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Sends a health report on the Service Fabric deployed service package. + * Reports health state of the service package of the application deployed on a Service Fabric node. The report must contain the information about the source of the health report and property on which it is reported. + The report is sent to a Service Fabric gateway Service, which forwards to the health store. + The report may be accepted by the gateway, but rejected by the health store after extra validation. + For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. + To see whether the report was applied in the health store, get deployed service package health and check that the report appears in the HealthEvents section. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param servicePackageName The name of the service package. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void reportDeployedServicePackageHealth(String nodeName, String applicationId, String servicePackageName, HealthInformation healthInformation) { + reportDeployedServicePackageHealthWithServiceResponseAsync(nodeName, applicationId, servicePackageName, healthInformation).toBlocking().single().body(); + } + + /** + * Sends a health report on the Service Fabric deployed service package. + * Reports health state of the service package of the application deployed on a Service Fabric node. The report must contain the information about the source of the health report and property on which it is reported. + The report is sent to a Service Fabric gateway Service, which forwards to the health store. + The report may be accepted by the gateway, but rejected by the health store after extra validation. + For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. + To see whether the report was applied in the health store, get deployed service package health and check that the report appears in the HealthEvents section. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param servicePackageName The name of the service package. + * @param 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture reportDeployedServicePackageHealthAsync(String nodeName, String applicationId, String servicePackageName, HealthInformation healthInformation, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(reportDeployedServicePackageHealthWithServiceResponseAsync(nodeName, applicationId, servicePackageName, healthInformation), serviceCallback); + } + + /** + * Sends a health report on the Service Fabric deployed service package. + * Reports health state of the service package of the application deployed on a Service Fabric node. The report must contain the information about the source of the health report and property on which it is reported. + The report is sent to a Service Fabric gateway Service, which forwards to the health store. + The report may be accepted by the gateway, but rejected by the health store after extra validation. + For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. + To see whether the report was applied in the health store, get deployed service package health and check that the report appears in the HealthEvents section. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param servicePackageName The name of the service package. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable reportDeployedServicePackageHealthAsync(String nodeName, String applicationId, String servicePackageName, HealthInformation healthInformation) { + return reportDeployedServicePackageHealthWithServiceResponseAsync(nodeName, applicationId, servicePackageName, healthInformation).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Sends a health report on the Service Fabric deployed service package. + * Reports health state of the service package of the application deployed on a Service Fabric node. The report must contain the information about the source of the health report and property on which it is reported. + The report is sent to a Service Fabric gateway Service, which forwards to the health store. + The report may be accepted by the gateway, but rejected by the health store after extra validation. + For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. + To see whether the report was applied in the health store, get deployed service package health and check that the report appears in the HealthEvents section. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param servicePackageName The name of the service package. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> reportDeployedServicePackageHealthWithServiceResponseAsync(String nodeName, String applicationId, String servicePackageName, HealthInformation healthInformation) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + if (servicePackageName == null) { + throw new IllegalArgumentException("Parameter servicePackageName is required and cannot be null."); + } + if (healthInformation == null) { + throw new IllegalArgumentException("Parameter healthInformation is required and cannot be null."); + } + Validator.validate(healthInformation); + final String apiVersion = "6.0"; + final Boolean immediate = null; + final Long timeout = null; + return service.reportDeployedServicePackageHealth(nodeName, applicationId, servicePackageName, apiVersion, healthInformation, immediate, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = reportDeployedServicePackageHealthDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Sends a health report on the Service Fabric deployed service package. + * Reports health state of the service package of the application deployed on a Service Fabric node. The report must contain the information about the source of the health report and property on which it is reported. + The report is sent to a Service Fabric gateway Service, which forwards to the health store. + The report may be accepted by the gateway, but rejected by the health store after extra validation. + For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. + To see whether the report was applied in the health store, get deployed service package health and check that the report appears in the HealthEvents section. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param servicePackageName The name of the service package. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void reportDeployedServicePackageHealth(String nodeName, String applicationId, String servicePackageName, HealthInformation healthInformation, Boolean immediate, Long timeout) { + reportDeployedServicePackageHealthWithServiceResponseAsync(nodeName, applicationId, servicePackageName, healthInformation, immediate, timeout).toBlocking().single().body(); + } + + /** + * Sends a health report on the Service Fabric deployed service package. + * Reports health state of the service package of the application deployed on a Service Fabric node. The report must contain the information about the source of the health report and property on which it is reported. + The report is sent to a Service Fabric gateway Service, which forwards to the health store. + The report may be accepted by the gateway, but rejected by the health store after extra validation. + For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. + To see whether the report was applied in the health store, get deployed service package health and check that the report appears in the HealthEvents section. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param servicePackageName The name of the service package. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture reportDeployedServicePackageHealthAsync(String nodeName, String applicationId, String servicePackageName, HealthInformation healthInformation, Boolean immediate, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(reportDeployedServicePackageHealthWithServiceResponseAsync(nodeName, applicationId, servicePackageName, healthInformation, immediate, timeout), serviceCallback); + } + + /** + * Sends a health report on the Service Fabric deployed service package. + * Reports health state of the service package of the application deployed on a Service Fabric node. The report must contain the information about the source of the health report and property on which it is reported. + The report is sent to a Service Fabric gateway Service, which forwards to the health store. + The report may be accepted by the gateway, but rejected by the health store after extra validation. + For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. + To see whether the report was applied in the health store, get deployed service package health and check that the report appears in the HealthEvents section. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param servicePackageName The name of the service package. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable reportDeployedServicePackageHealthAsync(String nodeName, String applicationId, String servicePackageName, HealthInformation healthInformation, Boolean immediate, Long timeout) { + return reportDeployedServicePackageHealthWithServiceResponseAsync(nodeName, applicationId, servicePackageName, healthInformation, immediate, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Sends a health report on the Service Fabric deployed service package. + * Reports health state of the service package of the application deployed on a Service Fabric node. The report must contain the information about the source of the health report and property on which it is reported. + The report is sent to a Service Fabric gateway Service, which forwards to the health store. + The report may be accepted by the gateway, but rejected by the health store after extra validation. + For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. + To see whether the report was applied in the health store, get deployed service package health and check that the report appears in the HealthEvents section. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param servicePackageName The name of the service package. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> reportDeployedServicePackageHealthWithServiceResponseAsync(String nodeName, String applicationId, String servicePackageName, HealthInformation healthInformation, Boolean immediate, Long timeout) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + if (servicePackageName == null) { + throw new IllegalArgumentException("Parameter servicePackageName is required and cannot be null."); + } + if (healthInformation == null) { + throw new IllegalArgumentException("Parameter healthInformation is required and cannot be null."); + } + Validator.validate(healthInformation); + final String apiVersion = "6.0"; + return service.reportDeployedServicePackageHealth(nodeName, applicationId, servicePackageName, apiVersion, healthInformation, immediate, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = reportDeployedServicePackageHealthDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse reportDeployedServicePackageHealthDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Downloads all of the code packages associated with specified service manifest on the specified node. + * This API provides a way to download code packages including the container images on a specific node outside of the normal application deployment and upgrade path. This is useful for the large code packages and container images to be present on the node before the actual application deployment and upgrade, thus significantly reducing the total time required for the deployment or upgrade. + * + * @param nodeName The name of the node. + * @param deployServicePackageToNodeDescription Describes information for deploying a service package to a Service Fabric node. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deployServicePackageToNode(String nodeName, DeployServicePackageToNodeDescription deployServicePackageToNodeDescription) { + deployServicePackageToNodeWithServiceResponseAsync(nodeName, deployServicePackageToNodeDescription).toBlocking().single().body(); + } + + /** + * Downloads all of the code packages associated with specified service manifest on the specified node. + * This API provides a way to download code packages including the container images on a specific node outside of the normal application deployment and upgrade path. This is useful for the large code packages and container images to be present on the node before the actual application deployment and upgrade, thus significantly reducing the total time required for the deployment or upgrade. + * + * @param nodeName The name of the node. + * @param deployServicePackageToNodeDescription Describes information for deploying a service package to a Service Fabric node. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deployServicePackageToNodeAsync(String nodeName, DeployServicePackageToNodeDescription deployServicePackageToNodeDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deployServicePackageToNodeWithServiceResponseAsync(nodeName, deployServicePackageToNodeDescription), serviceCallback); + } + + /** + * Downloads all of the code packages associated with specified service manifest on the specified node. + * This API provides a way to download code packages including the container images on a specific node outside of the normal application deployment and upgrade path. This is useful for the large code packages and container images to be present on the node before the actual application deployment and upgrade, thus significantly reducing the total time required for the deployment or upgrade. + * + * @param nodeName The name of the node. + * @param deployServicePackageToNodeDescription Describes information for deploying a service package to a Service Fabric node. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deployServicePackageToNodeAsync(String nodeName, DeployServicePackageToNodeDescription deployServicePackageToNodeDescription) { + return deployServicePackageToNodeWithServiceResponseAsync(nodeName, deployServicePackageToNodeDescription).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Downloads all of the code packages associated with specified service manifest on the specified node. + * This API provides a way to download code packages including the container images on a specific node outside of the normal application deployment and upgrade path. This is useful for the large code packages and container images to be present on the node before the actual application deployment and upgrade, thus significantly reducing the total time required for the deployment or upgrade. + * + * @param nodeName The name of the node. + * @param deployServicePackageToNodeDescription Describes information for deploying a service package to a Service Fabric node. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deployServicePackageToNodeWithServiceResponseAsync(String nodeName, DeployServicePackageToNodeDescription deployServicePackageToNodeDescription) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (deployServicePackageToNodeDescription == null) { + throw new IllegalArgumentException("Parameter deployServicePackageToNodeDescription is required and cannot be null."); + } + Validator.validate(deployServicePackageToNodeDescription); + final String apiVersion = "6.0"; + final Long timeout = null; + return service.deployServicePackageToNode(nodeName, apiVersion, deployServicePackageToNodeDescription, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deployServicePackageToNodeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Downloads all of the code packages associated with specified service manifest on the specified node. + * This API provides a way to download code packages including the container images on a specific node outside of the normal application deployment and upgrade path. This is useful for the large code packages and container images to be present on the node before the actual application deployment and upgrade, thus significantly reducing the total time required for the deployment or upgrade. + * + * @param nodeName The name of the node. + * @param deployServicePackageToNodeDescription Describes information for deploying a service package to a Service Fabric node. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deployServicePackageToNode(String nodeName, DeployServicePackageToNodeDescription deployServicePackageToNodeDescription, Long timeout) { + deployServicePackageToNodeWithServiceResponseAsync(nodeName, deployServicePackageToNodeDescription, timeout).toBlocking().single().body(); + } + + /** + * Downloads all of the code packages associated with specified service manifest on the specified node. + * This API provides a way to download code packages including the container images on a specific node outside of the normal application deployment and upgrade path. This is useful for the large code packages and container images to be present on the node before the actual application deployment and upgrade, thus significantly reducing the total time required for the deployment or upgrade. + * + * @param nodeName The name of the node. + * @param deployServicePackageToNodeDescription Describes information for deploying a service package to a Service Fabric node. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deployServicePackageToNodeAsync(String nodeName, DeployServicePackageToNodeDescription deployServicePackageToNodeDescription, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deployServicePackageToNodeWithServiceResponseAsync(nodeName, deployServicePackageToNodeDescription, timeout), serviceCallback); + } + + /** + * Downloads all of the code packages associated with specified service manifest on the specified node. + * This API provides a way to download code packages including the container images on a specific node outside of the normal application deployment and upgrade path. This is useful for the large code packages and container images to be present on the node before the actual application deployment and upgrade, thus significantly reducing the total time required for the deployment or upgrade. + * + * @param nodeName The name of the node. + * @param deployServicePackageToNodeDescription Describes information for deploying a service package to a Service Fabric node. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deployServicePackageToNodeAsync(String nodeName, DeployServicePackageToNodeDescription deployServicePackageToNodeDescription, Long timeout) { + return deployServicePackageToNodeWithServiceResponseAsync(nodeName, deployServicePackageToNodeDescription, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Downloads all of the code packages associated with specified service manifest on the specified node. + * This API provides a way to download code packages including the container images on a specific node outside of the normal application deployment and upgrade path. This is useful for the large code packages and container images to be present on the node before the actual application deployment and upgrade, thus significantly reducing the total time required for the deployment or upgrade. + * + * @param nodeName The name of the node. + * @param deployServicePackageToNodeDescription Describes information for deploying a service package to a Service Fabric node. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deployServicePackageToNodeWithServiceResponseAsync(String nodeName, DeployServicePackageToNodeDescription deployServicePackageToNodeDescription, Long timeout) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (deployServicePackageToNodeDescription == null) { + throw new IllegalArgumentException("Parameter deployServicePackageToNodeDescription is required and cannot be null."); + } + Validator.validate(deployServicePackageToNodeDescription); + final String apiVersion = "6.0"; + return service.deployServicePackageToNode(nodeName, apiVersion, deployServicePackageToNodeDescription, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deployServicePackageToNodeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deployServicePackageToNodeDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the list of code packages deployed on a Service Fabric node. + * Gets the list of code packages deployed on a Service Fabric node for the given application. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<DeployedCodePackageInfoInner> object if successful. + */ + public List getDeployedCodePackageInfoList(String nodeName, String applicationId) { + return getDeployedCodePackageInfoListWithServiceResponseAsync(nodeName, applicationId).toBlocking().single().body(); + } + + /** + * Gets the list of code packages deployed on a Service Fabric node. + * Gets the list of code packages deployed on a Service Fabric node for the given application. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDeployedCodePackageInfoListAsync(String nodeName, String applicationId, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getDeployedCodePackageInfoListWithServiceResponseAsync(nodeName, applicationId), serviceCallback); + } + + /** + * Gets the list of code packages deployed on a Service Fabric node. + * Gets the list of code packages deployed on a Service Fabric node for the given application. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DeployedCodePackageInfoInner> object + */ + public Observable> getDeployedCodePackageInfoListAsync(String nodeName, String applicationId) { + return getDeployedCodePackageInfoListWithServiceResponseAsync(nodeName, applicationId).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the list of code packages deployed on a Service Fabric node. + * Gets the list of code packages deployed on a Service Fabric node for the given application. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DeployedCodePackageInfoInner> object + */ + public Observable>> getDeployedCodePackageInfoListWithServiceResponseAsync(String nodeName, String applicationId) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final String serviceManifestName = null; + final String codePackageName = null; + final Long timeout = null; + return service.getDeployedCodePackageInfoList(nodeName, applicationId, apiVersion, serviceManifestName, codePackageName, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getDeployedCodePackageInfoListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the list of code packages deployed on a Service Fabric node. + * Gets the list of code packages deployed on a Service Fabric node for the given application. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceManifestName The name of a service manifest registered as part of an application type in a Service Fabric cluster. + * @param codePackageName The name of code package specified in service manifest registered as part of an application type in a Service Fabric cluster. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<DeployedCodePackageInfoInner> object if successful. + */ + public List getDeployedCodePackageInfoList(String nodeName, String applicationId, String serviceManifestName, String codePackageName, Long timeout) { + return getDeployedCodePackageInfoListWithServiceResponseAsync(nodeName, applicationId, serviceManifestName, codePackageName, timeout).toBlocking().single().body(); + } + + /** + * Gets the list of code packages deployed on a Service Fabric node. + * Gets the list of code packages deployed on a Service Fabric node for the given application. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceManifestName The name of a service manifest registered as part of an application type in a Service Fabric cluster. + * @param codePackageName The name of code package specified in service manifest registered as part of an application type in a Service Fabric cluster. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDeployedCodePackageInfoListAsync(String nodeName, String applicationId, String serviceManifestName, String codePackageName, Long timeout, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getDeployedCodePackageInfoListWithServiceResponseAsync(nodeName, applicationId, serviceManifestName, codePackageName, timeout), serviceCallback); + } + + /** + * Gets the list of code packages deployed on a Service Fabric node. + * Gets the list of code packages deployed on a Service Fabric node for the given application. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceManifestName The name of a service manifest registered as part of an application type in a Service Fabric cluster. + * @param codePackageName The name of code package specified in service manifest registered as part of an application type in a Service Fabric cluster. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DeployedCodePackageInfoInner> object + */ + public Observable> getDeployedCodePackageInfoListAsync(String nodeName, String applicationId, String serviceManifestName, String codePackageName, Long timeout) { + return getDeployedCodePackageInfoListWithServiceResponseAsync(nodeName, applicationId, serviceManifestName, codePackageName, timeout).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the list of code packages deployed on a Service Fabric node. + * Gets the list of code packages deployed on a Service Fabric node for the given application. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceManifestName The name of a service manifest registered as part of an application type in a Service Fabric cluster. + * @param codePackageName The name of code package specified in service manifest registered as part of an application type in a Service Fabric cluster. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DeployedCodePackageInfoInner> object + */ + public Observable>> getDeployedCodePackageInfoListWithServiceResponseAsync(String nodeName, String applicationId, String serviceManifestName, String codePackageName, Long timeout) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.getDeployedCodePackageInfoList(nodeName, applicationId, apiVersion, serviceManifestName, codePackageName, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getDeployedCodePackageInfoListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getDeployedCodePackageInfoListDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., FabricErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Restarts a code package deployed on a Service Fabric node in a cluster. + * Restarts a code package deployed on a Service Fabric node in a cluster. This aborts the code package process, which will restart all the user service replicas hosted in that process. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param restartDeployedCodePackageDescription Describes the deployed code package on Service Fabric node to restart. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void restartDeployedCodePackage(String nodeName, String applicationId, RestartDeployedCodePackageDescription restartDeployedCodePackageDescription) { + restartDeployedCodePackageWithServiceResponseAsync(nodeName, applicationId, restartDeployedCodePackageDescription).toBlocking().single().body(); + } + + /** + * Restarts a code package deployed on a Service Fabric node in a cluster. + * Restarts a code package deployed on a Service Fabric node in a cluster. This aborts the code package process, which will restart all the user service replicas hosted in that process. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param restartDeployedCodePackageDescription Describes the deployed code package on Service Fabric node to restart. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture restartDeployedCodePackageAsync(String nodeName, String applicationId, RestartDeployedCodePackageDescription restartDeployedCodePackageDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(restartDeployedCodePackageWithServiceResponseAsync(nodeName, applicationId, restartDeployedCodePackageDescription), serviceCallback); + } + + /** + * Restarts a code package deployed on a Service Fabric node in a cluster. + * Restarts a code package deployed on a Service Fabric node in a cluster. This aborts the code package process, which will restart all the user service replicas hosted in that process. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param restartDeployedCodePackageDescription Describes the deployed code package on Service Fabric node to restart. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable restartDeployedCodePackageAsync(String nodeName, String applicationId, RestartDeployedCodePackageDescription restartDeployedCodePackageDescription) { + return restartDeployedCodePackageWithServiceResponseAsync(nodeName, applicationId, restartDeployedCodePackageDescription).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Restarts a code package deployed on a Service Fabric node in a cluster. + * Restarts a code package deployed on a Service Fabric node in a cluster. This aborts the code package process, which will restart all the user service replicas hosted in that process. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param restartDeployedCodePackageDescription Describes the deployed code package on Service Fabric node to restart. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> restartDeployedCodePackageWithServiceResponseAsync(String nodeName, String applicationId, RestartDeployedCodePackageDescription restartDeployedCodePackageDescription) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + if (restartDeployedCodePackageDescription == null) { + throw new IllegalArgumentException("Parameter restartDeployedCodePackageDescription is required and cannot be null."); + } + Validator.validate(restartDeployedCodePackageDescription); + final String apiVersion = "6.0"; + final Long timeout = null; + return service.restartDeployedCodePackage(nodeName, applicationId, apiVersion, restartDeployedCodePackageDescription, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = restartDeployedCodePackageDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Restarts a code package deployed on a Service Fabric node in a cluster. + * Restarts a code package deployed on a Service Fabric node in a cluster. This aborts the code package process, which will restart all the user service replicas hosted in that process. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param restartDeployedCodePackageDescription Describes the deployed code package on Service Fabric node to restart. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void restartDeployedCodePackage(String nodeName, String applicationId, RestartDeployedCodePackageDescription restartDeployedCodePackageDescription, Long timeout) { + restartDeployedCodePackageWithServiceResponseAsync(nodeName, applicationId, restartDeployedCodePackageDescription, timeout).toBlocking().single().body(); + } + + /** + * Restarts a code package deployed on a Service Fabric node in a cluster. + * Restarts a code package deployed on a Service Fabric node in a cluster. This aborts the code package process, which will restart all the user service replicas hosted in that process. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param restartDeployedCodePackageDescription Describes the deployed code package on Service Fabric node to restart. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture restartDeployedCodePackageAsync(String nodeName, String applicationId, RestartDeployedCodePackageDescription restartDeployedCodePackageDescription, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(restartDeployedCodePackageWithServiceResponseAsync(nodeName, applicationId, restartDeployedCodePackageDescription, timeout), serviceCallback); + } + + /** + * Restarts a code package deployed on a Service Fabric node in a cluster. + * Restarts a code package deployed on a Service Fabric node in a cluster. This aborts the code package process, which will restart all the user service replicas hosted in that process. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param restartDeployedCodePackageDescription Describes the deployed code package on Service Fabric node to restart. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable restartDeployedCodePackageAsync(String nodeName, String applicationId, RestartDeployedCodePackageDescription restartDeployedCodePackageDescription, Long timeout) { + return restartDeployedCodePackageWithServiceResponseAsync(nodeName, applicationId, restartDeployedCodePackageDescription, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Restarts a code package deployed on a Service Fabric node in a cluster. + * Restarts a code package deployed on a Service Fabric node in a cluster. This aborts the code package process, which will restart all the user service replicas hosted in that process. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param restartDeployedCodePackageDescription Describes the deployed code package on Service Fabric node to restart. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> restartDeployedCodePackageWithServiceResponseAsync(String nodeName, String applicationId, RestartDeployedCodePackageDescription restartDeployedCodePackageDescription, Long timeout) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + if (restartDeployedCodePackageDescription == null) { + throw new IllegalArgumentException("Parameter restartDeployedCodePackageDescription is required and cannot be null."); + } + Validator.validate(restartDeployedCodePackageDescription); + final String apiVersion = "6.0"; + return service.restartDeployedCodePackage(nodeName, applicationId, apiVersion, restartDeployedCodePackageDescription, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = restartDeployedCodePackageDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse restartDeployedCodePackageDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the container logs for container deployed on a Service Fabric node. + * Gets the container logs for container deployed on a Service Fabric node for the given code package. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceManifestName The name of a service manifest registered as part of an application type in a Service Fabric cluster. + * @param codePackageName The name of code package specified in service manifest registered as part of an application type in a Service Fabric cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerLogsInner object if successful. + */ + public ContainerLogsInner getContainerLogsDeployedOnNode(String nodeName, String applicationId, String serviceManifestName, String codePackageName) { + return getContainerLogsDeployedOnNodeWithServiceResponseAsync(nodeName, applicationId, serviceManifestName, codePackageName).toBlocking().single().body(); + } + + /** + * Gets the container logs for container deployed on a Service Fabric node. + * Gets the container logs for container deployed on a Service Fabric node for the given code package. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceManifestName The name of a service manifest registered as part of an application type in a Service Fabric cluster. + * @param codePackageName The name of code package specified in service manifest registered as part of an application type in a Service Fabric cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getContainerLogsDeployedOnNodeAsync(String nodeName, String applicationId, String serviceManifestName, String codePackageName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getContainerLogsDeployedOnNodeWithServiceResponseAsync(nodeName, applicationId, serviceManifestName, codePackageName), serviceCallback); + } + + /** + * Gets the container logs for container deployed on a Service Fabric node. + * Gets the container logs for container deployed on a Service Fabric node for the given code package. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceManifestName The name of a service manifest registered as part of an application type in a Service Fabric cluster. + * @param codePackageName The name of code package specified in service manifest registered as part of an application type in a Service Fabric cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerLogsInner object + */ + public Observable getContainerLogsDeployedOnNodeAsync(String nodeName, String applicationId, String serviceManifestName, String codePackageName) { + return getContainerLogsDeployedOnNodeWithServiceResponseAsync(nodeName, applicationId, serviceManifestName, codePackageName).map(new Func1, ContainerLogsInner>() { + @Override + public ContainerLogsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the container logs for container deployed on a Service Fabric node. + * Gets the container logs for container deployed on a Service Fabric node for the given code package. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceManifestName The name of a service manifest registered as part of an application type in a Service Fabric cluster. + * @param codePackageName The name of code package specified in service manifest registered as part of an application type in a Service Fabric cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerLogsInner object + */ + public Observable> getContainerLogsDeployedOnNodeWithServiceResponseAsync(String nodeName, String applicationId, String serviceManifestName, String codePackageName) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + if (serviceManifestName == null) { + throw new IllegalArgumentException("Parameter serviceManifestName is required and cannot be null."); + } + if (codePackageName == null) { + throw new IllegalArgumentException("Parameter codePackageName is required and cannot be null."); + } + final String apiVersion = "6.2"; + final String tail = null; + final Boolean previous = null; + final Long timeout = null; + return service.getContainerLogsDeployedOnNode(nodeName, applicationId, apiVersion, serviceManifestName, codePackageName, tail, previous, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getContainerLogsDeployedOnNodeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the container logs for container deployed on a Service Fabric node. + * Gets the container logs for container deployed on a Service Fabric node for the given code package. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceManifestName The name of a service manifest registered as part of an application type in a Service Fabric cluster. + * @param codePackageName The name of code package specified in service manifest registered as part of an application type in a Service Fabric cluster. + * @param tail Number of lines to show from the end of the logs. Default is 100. 'all' to show the complete logs. + * @param previous Specifies whether to get container logs from exited/dead containers of the code package instance. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerLogsInner object if successful. + */ + public ContainerLogsInner getContainerLogsDeployedOnNode(String nodeName, String applicationId, String serviceManifestName, String codePackageName, String tail, Boolean previous, Long timeout) { + return getContainerLogsDeployedOnNodeWithServiceResponseAsync(nodeName, applicationId, serviceManifestName, codePackageName, tail, previous, timeout).toBlocking().single().body(); + } + + /** + * Gets the container logs for container deployed on a Service Fabric node. + * Gets the container logs for container deployed on a Service Fabric node for the given code package. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceManifestName The name of a service manifest registered as part of an application type in a Service Fabric cluster. + * @param codePackageName The name of code package specified in service manifest registered as part of an application type in a Service Fabric cluster. + * @param tail Number of lines to show from the end of the logs. Default is 100. 'all' to show the complete logs. + * @param previous Specifies whether to get container logs from exited/dead containers of the code package instance. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getContainerLogsDeployedOnNodeAsync(String nodeName, String applicationId, String serviceManifestName, String codePackageName, String tail, Boolean previous, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getContainerLogsDeployedOnNodeWithServiceResponseAsync(nodeName, applicationId, serviceManifestName, codePackageName, tail, previous, timeout), serviceCallback); + } + + /** + * Gets the container logs for container deployed on a Service Fabric node. + * Gets the container logs for container deployed on a Service Fabric node for the given code package. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceManifestName The name of a service manifest registered as part of an application type in a Service Fabric cluster. + * @param codePackageName The name of code package specified in service manifest registered as part of an application type in a Service Fabric cluster. + * @param tail Number of lines to show from the end of the logs. Default is 100. 'all' to show the complete logs. + * @param previous Specifies whether to get container logs from exited/dead containers of the code package instance. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerLogsInner object + */ + public Observable getContainerLogsDeployedOnNodeAsync(String nodeName, String applicationId, String serviceManifestName, String codePackageName, String tail, Boolean previous, Long timeout) { + return getContainerLogsDeployedOnNodeWithServiceResponseAsync(nodeName, applicationId, serviceManifestName, codePackageName, tail, previous, timeout).map(new Func1, ContainerLogsInner>() { + @Override + public ContainerLogsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the container logs for container deployed on a Service Fabric node. + * Gets the container logs for container deployed on a Service Fabric node for the given code package. + * + * @param nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceManifestName The name of a service manifest registered as part of an application type in a Service Fabric cluster. + * @param codePackageName The name of code package specified in service manifest registered as part of an application type in a Service Fabric cluster. + * @param tail Number of lines to show from the end of the logs. Default is 100. 'all' to show the complete logs. + * @param previous Specifies whether to get container logs from exited/dead containers of the code package instance. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerLogsInner object + */ + public Observable> getContainerLogsDeployedOnNodeWithServiceResponseAsync(String nodeName, String applicationId, String serviceManifestName, String codePackageName, String tail, Boolean previous, Long timeout) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + if (serviceManifestName == null) { + throw new IllegalArgumentException("Parameter serviceManifestName is required and cannot be null."); + } + if (codePackageName == null) { + throw new IllegalArgumentException("Parameter codePackageName is required and cannot be null."); + } + final String apiVersion = "6.2"; + return service.getContainerLogsDeployedOnNode(nodeName, applicationId, apiVersion, serviceManifestName, codePackageName, tail, previous, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getContainerLogsDeployedOnNodeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getContainerLogsDeployedOnNodeDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceManifestName The name of a service manifest registered as part of an application type in a Service Fabric cluster. + * @param codePackageName The name of code package specified in service manifest registered as part of an application type in a Service Fabric cluster. + * @param codePackageInstanceId ID that uniquely identifies a code package instance deployed on a service fabric node. + * @param containerApiRequestBody Parameters for making container API call + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerApiResponseInner object if successful. + */ + public ContainerApiResponseInner invokeContainerApi(String nodeName, String applicationId, String serviceManifestName, String codePackageName, String codePackageInstanceId, ContainerApiRequestBody containerApiRequestBody) { + return invokeContainerApiWithServiceResponseAsync(nodeName, applicationId, serviceManifestName, codePackageName, codePackageInstanceId, containerApiRequestBody).toBlocking().single().body(); + } + + /** + * 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 nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceManifestName The name of a service manifest registered as part of an application type in a Service Fabric cluster. + * @param codePackageName The name of code package specified in service manifest registered as part of an application type in a Service Fabric cluster. + * @param codePackageInstanceId ID that uniquely identifies a code package instance deployed on a service fabric node. + * @param containerApiRequestBody Parameters for making container API call + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture invokeContainerApiAsync(String nodeName, String applicationId, String serviceManifestName, String codePackageName, String codePackageInstanceId, ContainerApiRequestBody containerApiRequestBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(invokeContainerApiWithServiceResponseAsync(nodeName, applicationId, serviceManifestName, codePackageName, codePackageInstanceId, containerApiRequestBody), serviceCallback); + } + + /** + * 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 nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceManifestName The name of a service manifest registered as part of an application type in a Service Fabric cluster. + * @param codePackageName The name of code package specified in service manifest registered as part of an application type in a Service Fabric cluster. + * @param codePackageInstanceId ID that uniquely identifies a code package instance deployed on a service fabric node. + * @param containerApiRequestBody Parameters for making container API call + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerApiResponseInner object + */ + public Observable invokeContainerApiAsync(String nodeName, String applicationId, String serviceManifestName, String codePackageName, String codePackageInstanceId, ContainerApiRequestBody containerApiRequestBody) { + return invokeContainerApiWithServiceResponseAsync(nodeName, applicationId, serviceManifestName, codePackageName, codePackageInstanceId, containerApiRequestBody).map(new Func1, ContainerApiResponseInner>() { + @Override + public ContainerApiResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceManifestName The name of a service manifest registered as part of an application type in a Service Fabric cluster. + * @param codePackageName The name of code package specified in service manifest registered as part of an application type in a Service Fabric cluster. + * @param codePackageInstanceId ID that uniquely identifies a code package instance deployed on a service fabric node. + * @param containerApiRequestBody Parameters for making container API call + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerApiResponseInner object + */ + public Observable> invokeContainerApiWithServiceResponseAsync(String nodeName, String applicationId, String serviceManifestName, String codePackageName, String codePackageInstanceId, ContainerApiRequestBody containerApiRequestBody) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + if (serviceManifestName == null) { + throw new IllegalArgumentException("Parameter serviceManifestName is required and cannot be null."); + } + if (codePackageName == null) { + throw new IllegalArgumentException("Parameter codePackageName is required and cannot be null."); + } + if (codePackageInstanceId == null) { + throw new IllegalArgumentException("Parameter codePackageInstanceId is required and cannot be null."); + } + if (containerApiRequestBody == null) { + throw new IllegalArgumentException("Parameter containerApiRequestBody is required and cannot be null."); + } + Validator.validate(containerApiRequestBody); + final String apiVersion = "6.2"; + final Long timeout = null; + return service.invokeContainerApi(nodeName, applicationId, apiVersion, serviceManifestName, codePackageName, codePackageInstanceId, timeout, containerApiRequestBody, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = invokeContainerApiDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceManifestName The name of a service manifest registered as part of an application type in a Service Fabric cluster. + * @param codePackageName The name of code package specified in service manifest registered as part of an application type in a Service Fabric cluster. + * @param codePackageInstanceId ID that uniquely identifies a code package instance deployed on a service fabric node. + * @param containerApiRequestBody Parameters for making container API call + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerApiResponseInner object if successful. + */ + public ContainerApiResponseInner invokeContainerApi(String nodeName, String applicationId, String serviceManifestName, String codePackageName, String codePackageInstanceId, ContainerApiRequestBody containerApiRequestBody, Long timeout) { + return invokeContainerApiWithServiceResponseAsync(nodeName, applicationId, serviceManifestName, codePackageName, codePackageInstanceId, containerApiRequestBody, timeout).toBlocking().single().body(); + } + + /** + * 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 nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceManifestName The name of a service manifest registered as part of an application type in a Service Fabric cluster. + * @param codePackageName The name of code package specified in service manifest registered as part of an application type in a Service Fabric cluster. + * @param codePackageInstanceId ID that uniquely identifies a code package instance deployed on a service fabric node. + * @param containerApiRequestBody Parameters for making container API call + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture invokeContainerApiAsync(String nodeName, String applicationId, String serviceManifestName, String codePackageName, String codePackageInstanceId, ContainerApiRequestBody containerApiRequestBody, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(invokeContainerApiWithServiceResponseAsync(nodeName, applicationId, serviceManifestName, codePackageName, codePackageInstanceId, containerApiRequestBody, timeout), serviceCallback); + } + + /** + * 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 nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceManifestName The name of a service manifest registered as part of an application type in a Service Fabric cluster. + * @param codePackageName The name of code package specified in service manifest registered as part of an application type in a Service Fabric cluster. + * @param codePackageInstanceId ID that uniquely identifies a code package instance deployed on a service fabric node. + * @param containerApiRequestBody Parameters for making container API call + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerApiResponseInner object + */ + public Observable invokeContainerApiAsync(String nodeName, String applicationId, String serviceManifestName, String codePackageName, String codePackageInstanceId, ContainerApiRequestBody containerApiRequestBody, Long timeout) { + return invokeContainerApiWithServiceResponseAsync(nodeName, applicationId, serviceManifestName, codePackageName, codePackageInstanceId, containerApiRequestBody, timeout).map(new Func1, ContainerApiResponseInner>() { + @Override + public ContainerApiResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 nodeName The name of the node. + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceManifestName The name of a service manifest registered as part of an application type in a Service Fabric cluster. + * @param codePackageName The name of code package specified in service manifest registered as part of an application type in a Service Fabric cluster. + * @param codePackageInstanceId ID that uniquely identifies a code package instance deployed on a service fabric node. + * @param containerApiRequestBody Parameters for making container API call + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerApiResponseInner object + */ + public Observable> invokeContainerApiWithServiceResponseAsync(String nodeName, String applicationId, String serviceManifestName, String codePackageName, String codePackageInstanceId, ContainerApiRequestBody containerApiRequestBody, Long timeout) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + if (serviceManifestName == null) { + throw new IllegalArgumentException("Parameter serviceManifestName is required and cannot be null."); + } + if (codePackageName == null) { + throw new IllegalArgumentException("Parameter codePackageName is required and cannot be null."); + } + if (codePackageInstanceId == null) { + throw new IllegalArgumentException("Parameter codePackageInstanceId is required and cannot be null."); + } + if (containerApiRequestBody == null) { + throw new IllegalArgumentException("Parameter containerApiRequestBody is required and cannot be null."); + } + Validator.validate(containerApiRequestBody); + final String apiVersion = "6.2"; + return service.invokeContainerApi(nodeName, applicationId, apiVersion, serviceManifestName, codePackageName, codePackageInstanceId, timeout, containerApiRequestBody, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = invokeContainerApiDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse invokeContainerApiDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Creates a Service Fabric compose deployment. + * Compose is a file format that describes multi-container applications. This API allows deploying container based applications defined in compose format in a Service Fabric cluster. Once the deployment is created, its status can be tracked via the `GetComposeDeploymentStatus` API. + * + * @param createComposeDeploymentDescription Describes the compose deployment that needs to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void createComposeDeployment(CreateComposeDeploymentDescription createComposeDeploymentDescription) { + createComposeDeploymentWithServiceResponseAsync(createComposeDeploymentDescription).toBlocking().single().body(); + } + + /** + * Creates a Service Fabric compose deployment. + * Compose is a file format that describes multi-container applications. This API allows deploying container based applications defined in compose format in a Service Fabric cluster. Once the deployment is created, its status can be tracked via the `GetComposeDeploymentStatus` API. + * + * @param createComposeDeploymentDescription Describes the compose deployment that needs to be created. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createComposeDeploymentAsync(CreateComposeDeploymentDescription createComposeDeploymentDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createComposeDeploymentWithServiceResponseAsync(createComposeDeploymentDescription), serviceCallback); + } + + /** + * Creates a Service Fabric compose deployment. + * Compose is a file format that describes multi-container applications. This API allows deploying container based applications defined in compose format in a Service Fabric cluster. Once the deployment is created, its status can be tracked via the `GetComposeDeploymentStatus` API. + * + * @param createComposeDeploymentDescription Describes the compose deployment that needs to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable createComposeDeploymentAsync(CreateComposeDeploymentDescription createComposeDeploymentDescription) { + return createComposeDeploymentWithServiceResponseAsync(createComposeDeploymentDescription).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a Service Fabric compose deployment. + * Compose is a file format that describes multi-container applications. This API allows deploying container based applications defined in compose format in a Service Fabric cluster. Once the deployment is created, its status can be tracked via the `GetComposeDeploymentStatus` API. + * + * @param createComposeDeploymentDescription Describes the compose deployment that needs to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> createComposeDeploymentWithServiceResponseAsync(CreateComposeDeploymentDescription createComposeDeploymentDescription) { + if (createComposeDeploymentDescription == null) { + throw new IllegalArgumentException("Parameter createComposeDeploymentDescription is required and cannot be null."); + } + Validator.validate(createComposeDeploymentDescription); + final String apiVersion = "6.0-preview"; + final Long timeout = null; + return service.createComposeDeployment(apiVersion, createComposeDeploymentDescription, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createComposeDeploymentDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Creates a Service Fabric compose deployment. + * Compose is a file format that describes multi-container applications. This API allows deploying container based applications defined in compose format in a Service Fabric cluster. Once the deployment is created, its status can be tracked via the `GetComposeDeploymentStatus` API. + * + * @param createComposeDeploymentDescription Describes the compose deployment that needs to be created. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void createComposeDeployment(CreateComposeDeploymentDescription createComposeDeploymentDescription, Long timeout) { + createComposeDeploymentWithServiceResponseAsync(createComposeDeploymentDescription, timeout).toBlocking().single().body(); + } + + /** + * Creates a Service Fabric compose deployment. + * Compose is a file format that describes multi-container applications. This API allows deploying container based applications defined in compose format in a Service Fabric cluster. Once the deployment is created, its status can be tracked via the `GetComposeDeploymentStatus` API. + * + * @param createComposeDeploymentDescription Describes the compose deployment that needs to be created. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createComposeDeploymentAsync(CreateComposeDeploymentDescription createComposeDeploymentDescription, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createComposeDeploymentWithServiceResponseAsync(createComposeDeploymentDescription, timeout), serviceCallback); + } + + /** + * Creates a Service Fabric compose deployment. + * Compose is a file format that describes multi-container applications. This API allows deploying container based applications defined in compose format in a Service Fabric cluster. Once the deployment is created, its status can be tracked via the `GetComposeDeploymentStatus` API. + * + * @param createComposeDeploymentDescription Describes the compose deployment that needs to be created. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable createComposeDeploymentAsync(CreateComposeDeploymentDescription createComposeDeploymentDescription, Long timeout) { + return createComposeDeploymentWithServiceResponseAsync(createComposeDeploymentDescription, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a Service Fabric compose deployment. + * Compose is a file format that describes multi-container applications. This API allows deploying container based applications defined in compose format in a Service Fabric cluster. Once the deployment is created, its status can be tracked via the `GetComposeDeploymentStatus` API. + * + * @param createComposeDeploymentDescription Describes the compose deployment that needs to be created. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> createComposeDeploymentWithServiceResponseAsync(CreateComposeDeploymentDescription createComposeDeploymentDescription, Long timeout) { + if (createComposeDeploymentDescription == null) { + throw new IllegalArgumentException("Parameter createComposeDeploymentDescription is required and cannot be null."); + } + Validator.validate(createComposeDeploymentDescription); + final String apiVersion = "6.0-preview"; + return service.createComposeDeployment(apiVersion, createComposeDeploymentDescription, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createComposeDeploymentDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createComposeDeploymentDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets information about a Service Fabric compose deployment. + * 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 deploymentName The identity of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ComposeDeploymentStatusInfoInner object if successful. + */ + public ComposeDeploymentStatusInfoInner getComposeDeploymentStatus(String deploymentName) { + return getComposeDeploymentStatusWithServiceResponseAsync(deploymentName).toBlocking().single().body(); + } + + /** + * Gets information about a Service Fabric compose deployment. + * 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 deploymentName The identity of the deployment. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getComposeDeploymentStatusAsync(String deploymentName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getComposeDeploymentStatusWithServiceResponseAsync(deploymentName), serviceCallback); + } + + /** + * Gets information about a Service Fabric compose deployment. + * 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 deploymentName The identity of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ComposeDeploymentStatusInfoInner object + */ + public Observable getComposeDeploymentStatusAsync(String deploymentName) { + return getComposeDeploymentStatusWithServiceResponseAsync(deploymentName).map(new Func1, ComposeDeploymentStatusInfoInner>() { + @Override + public ComposeDeploymentStatusInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets information about a Service Fabric compose deployment. + * 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 deploymentName The identity of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ComposeDeploymentStatusInfoInner object + */ + public Observable> getComposeDeploymentStatusWithServiceResponseAsync(String deploymentName) { + if (deploymentName == null) { + throw new IllegalArgumentException("Parameter deploymentName is required and cannot be null."); + } + final String apiVersion = "6.0-preview"; + final Long timeout = null; + return service.getComposeDeploymentStatus(deploymentName, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getComposeDeploymentStatusDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets information about a Service Fabric compose deployment. + * 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 deploymentName The identity of the deployment. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ComposeDeploymentStatusInfoInner object if successful. + */ + public ComposeDeploymentStatusInfoInner getComposeDeploymentStatus(String deploymentName, Long timeout) { + return getComposeDeploymentStatusWithServiceResponseAsync(deploymentName, timeout).toBlocking().single().body(); + } + + /** + * Gets information about a Service Fabric compose deployment. + * 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 deploymentName The identity of the deployment. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getComposeDeploymentStatusAsync(String deploymentName, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getComposeDeploymentStatusWithServiceResponseAsync(deploymentName, timeout), serviceCallback); + } + + /** + * Gets information about a Service Fabric compose deployment. + * 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 deploymentName The identity of the deployment. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ComposeDeploymentStatusInfoInner object + */ + public Observable getComposeDeploymentStatusAsync(String deploymentName, Long timeout) { + return getComposeDeploymentStatusWithServiceResponseAsync(deploymentName, timeout).map(new Func1, ComposeDeploymentStatusInfoInner>() { + @Override + public ComposeDeploymentStatusInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets information about a Service Fabric compose deployment. + * 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 deploymentName The identity of the deployment. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ComposeDeploymentStatusInfoInner object + */ + public Observable> getComposeDeploymentStatusWithServiceResponseAsync(String deploymentName, Long timeout) { + if (deploymentName == null) { + throw new IllegalArgumentException("Parameter deploymentName is required and cannot be null."); + } + final String apiVersion = "6.0-preview"; + return service.getComposeDeploymentStatus(deploymentName, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getComposeDeploymentStatusDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getComposeDeploymentStatusDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the list of compose deployments created in the Service Fabric cluster. + * Gets the status about the compose deployments that were created or in the process of being created in the Service Fabric cluster. The response includes the name, status, and other details about the compose deployments. If the list of deployments do not fit in a page, one page of results is returned as well as a continuation token, which can be used to get the next page. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedComposeDeploymentStatusInfoListInner object if successful. + */ + public PagedComposeDeploymentStatusInfoListInner getComposeDeploymentStatusList() { + return getComposeDeploymentStatusListWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Gets the list of compose deployments created in the Service Fabric cluster. + * Gets the status about the compose deployments that were created or in the process of being created in the Service Fabric cluster. The response includes the name, status, and other details about the compose deployments. If the list of deployments do not fit in a page, one page of results is returned as well as a continuation token, which can be used to get the next page. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getComposeDeploymentStatusListAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getComposeDeploymentStatusListWithServiceResponseAsync(), serviceCallback); + } + + /** + * Gets the list of compose deployments created in the Service Fabric cluster. + * Gets the status about the compose deployments that were created or in the process of being created in the Service Fabric cluster. The response includes the name, status, and other details about the compose deployments. If the list of deployments do not fit in a page, one page of results is returned as well as a continuation token, which can be used to get the next page. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedComposeDeploymentStatusInfoListInner object + */ + public Observable getComposeDeploymentStatusListAsync() { + return getComposeDeploymentStatusListWithServiceResponseAsync().map(new Func1, PagedComposeDeploymentStatusInfoListInner>() { + @Override + public PagedComposeDeploymentStatusInfoListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the list of compose deployments created in the Service Fabric cluster. + * Gets the status about the compose deployments that were created or in the process of being created in the Service Fabric cluster. The response includes the name, status, and other details about the compose deployments. If the list of deployments do not fit in a page, one page of results is returned as well as a continuation token, which can be used to get the next page. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedComposeDeploymentStatusInfoListInner object + */ + public Observable> getComposeDeploymentStatusListWithServiceResponseAsync() { + final String apiVersion = "6.0-preview"; + final String continuationToken = null; + final Long maxResults = null; + final Long timeout = null; + return service.getComposeDeploymentStatusList(apiVersion, continuationToken, maxResults, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getComposeDeploymentStatusListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the list of compose deployments created in the Service Fabric cluster. + * Gets the status about the compose deployments that were created or in the process of being created in the Service Fabric cluster. The response includes the name, status, and other details about the compose deployments. If the list of deployments do not fit in a page, one page of results is returned as well as a continuation token, which can be used to get the next page. + * + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedComposeDeploymentStatusInfoListInner object if successful. + */ + public PagedComposeDeploymentStatusInfoListInner getComposeDeploymentStatusList(String continuationToken, Long maxResults, Long timeout) { + return getComposeDeploymentStatusListWithServiceResponseAsync(continuationToken, maxResults, timeout).toBlocking().single().body(); + } + + /** + * Gets the list of compose deployments created in the Service Fabric cluster. + * Gets the status about the compose deployments that were created or in the process of being created in the Service Fabric cluster. The response includes the name, status, and other details about the compose deployments. If the list of deployments do not fit in a page, one page of results is returned as well as a continuation token, which can be used to get the next page. + * + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getComposeDeploymentStatusListAsync(String continuationToken, Long maxResults, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getComposeDeploymentStatusListWithServiceResponseAsync(continuationToken, maxResults, timeout), serviceCallback); + } + + /** + * Gets the list of compose deployments created in the Service Fabric cluster. + * Gets the status about the compose deployments that were created or in the process of being created in the Service Fabric cluster. The response includes the name, status, and other details about the compose deployments. If the list of deployments do not fit in a page, one page of results is returned as well as a continuation token, which can be used to get the next page. + * + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedComposeDeploymentStatusInfoListInner object + */ + public Observable getComposeDeploymentStatusListAsync(String continuationToken, Long maxResults, Long timeout) { + return getComposeDeploymentStatusListWithServiceResponseAsync(continuationToken, maxResults, timeout).map(new Func1, PagedComposeDeploymentStatusInfoListInner>() { + @Override + public PagedComposeDeploymentStatusInfoListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the list of compose deployments created in the Service Fabric cluster. + * Gets the status about the compose deployments that were created or in the process of being created in the Service Fabric cluster. The response includes the name, status, and other details about the compose deployments. If the list of deployments do not fit in a page, one page of results is returned as well as a continuation token, which can be used to get the next page. + * + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedComposeDeploymentStatusInfoListInner object + */ + public Observable> getComposeDeploymentStatusListWithServiceResponseAsync(String continuationToken, Long maxResults, Long timeout) { + final String apiVersion = "6.0-preview"; + return service.getComposeDeploymentStatusList(apiVersion, continuationToken, maxResults, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getComposeDeploymentStatusListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getComposeDeploymentStatusListDelegate(Response response) throws FabricErrorException, IOException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets details for the latest upgrade performed on this Service Fabric compose deployment. + * Returns the information about the state of the compose deployment upgrade along with details to aid debugging application health issues. + * + * @param deploymentName The identity of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ComposeDeploymentUpgradeProgressInfoInner object if successful. + */ + public ComposeDeploymentUpgradeProgressInfoInner getComposeDeploymentUpgradeProgress(String deploymentName) { + return getComposeDeploymentUpgradeProgressWithServiceResponseAsync(deploymentName).toBlocking().single().body(); + } + + /** + * Gets details for the latest upgrade performed on this Service Fabric compose deployment. + * Returns the information about the state of the compose deployment upgrade along with details to aid debugging application health issues. + * + * @param deploymentName The identity of the deployment. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getComposeDeploymentUpgradeProgressAsync(String deploymentName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getComposeDeploymentUpgradeProgressWithServiceResponseAsync(deploymentName), serviceCallback); + } + + /** + * Gets details for the latest upgrade performed on this Service Fabric compose deployment. + * Returns the information about the state of the compose deployment upgrade along with details to aid debugging application health issues. + * + * @param deploymentName The identity of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ComposeDeploymentUpgradeProgressInfoInner object + */ + public Observable getComposeDeploymentUpgradeProgressAsync(String deploymentName) { + return getComposeDeploymentUpgradeProgressWithServiceResponseAsync(deploymentName).map(new Func1, ComposeDeploymentUpgradeProgressInfoInner>() { + @Override + public ComposeDeploymentUpgradeProgressInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets details for the latest upgrade performed on this Service Fabric compose deployment. + * Returns the information about the state of the compose deployment upgrade along with details to aid debugging application health issues. + * + * @param deploymentName The identity of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ComposeDeploymentUpgradeProgressInfoInner object + */ + public Observable> getComposeDeploymentUpgradeProgressWithServiceResponseAsync(String deploymentName) { + if (deploymentName == null) { + throw new IllegalArgumentException("Parameter deploymentName is required and cannot be null."); + } + final String apiVersion = "6.0-preview"; + final Long timeout = null; + return service.getComposeDeploymentUpgradeProgress(deploymentName, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getComposeDeploymentUpgradeProgressDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets details for the latest upgrade performed on this Service Fabric compose deployment. + * Returns the information about the state of the compose deployment upgrade along with details to aid debugging application health issues. + * + * @param deploymentName The identity of the deployment. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ComposeDeploymentUpgradeProgressInfoInner object if successful. + */ + public ComposeDeploymentUpgradeProgressInfoInner getComposeDeploymentUpgradeProgress(String deploymentName, Long timeout) { + return getComposeDeploymentUpgradeProgressWithServiceResponseAsync(deploymentName, timeout).toBlocking().single().body(); + } + + /** + * Gets details for the latest upgrade performed on this Service Fabric compose deployment. + * Returns the information about the state of the compose deployment upgrade along with details to aid debugging application health issues. + * + * @param deploymentName The identity of the deployment. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getComposeDeploymentUpgradeProgressAsync(String deploymentName, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getComposeDeploymentUpgradeProgressWithServiceResponseAsync(deploymentName, timeout), serviceCallback); + } + + /** + * Gets details for the latest upgrade performed on this Service Fabric compose deployment. + * Returns the information about the state of the compose deployment upgrade along with details to aid debugging application health issues. + * + * @param deploymentName The identity of the deployment. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ComposeDeploymentUpgradeProgressInfoInner object + */ + public Observable getComposeDeploymentUpgradeProgressAsync(String deploymentName, Long timeout) { + return getComposeDeploymentUpgradeProgressWithServiceResponseAsync(deploymentName, timeout).map(new Func1, ComposeDeploymentUpgradeProgressInfoInner>() { + @Override + public ComposeDeploymentUpgradeProgressInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets details for the latest upgrade performed on this Service Fabric compose deployment. + * Returns the information about the state of the compose deployment upgrade along with details to aid debugging application health issues. + * + * @param deploymentName The identity of the deployment. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ComposeDeploymentUpgradeProgressInfoInner object + */ + public Observable> getComposeDeploymentUpgradeProgressWithServiceResponseAsync(String deploymentName, Long timeout) { + if (deploymentName == null) { + throw new IllegalArgumentException("Parameter deploymentName is required and cannot be null."); + } + final String apiVersion = "6.0-preview"; + return service.getComposeDeploymentUpgradeProgress(deploymentName, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getComposeDeploymentUpgradeProgressDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getComposeDeploymentUpgradeProgressDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Deletes an existing Service Fabric compose deployment from cluster. + * Deletes an existing Service Fabric compose deployment. + * + * @param deploymentName The identity of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void removeComposeDeployment(String deploymentName) { + removeComposeDeploymentWithServiceResponseAsync(deploymentName).toBlocking().single().body(); + } + + /** + * Deletes an existing Service Fabric compose deployment from cluster. + * Deletes an existing Service Fabric compose deployment. + * + * @param deploymentName The identity of the deployment. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture removeComposeDeploymentAsync(String deploymentName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(removeComposeDeploymentWithServiceResponseAsync(deploymentName), serviceCallback); + } + + /** + * Deletes an existing Service Fabric compose deployment from cluster. + * Deletes an existing Service Fabric compose deployment. + * + * @param deploymentName The identity of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable removeComposeDeploymentAsync(String deploymentName) { + return removeComposeDeploymentWithServiceResponseAsync(deploymentName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Service Fabric compose deployment from cluster. + * Deletes an existing Service Fabric compose deployment. + * + * @param deploymentName The identity of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> removeComposeDeploymentWithServiceResponseAsync(String deploymentName) { + if (deploymentName == null) { + throw new IllegalArgumentException("Parameter deploymentName is required and cannot be null."); + } + final String apiVersion = "6.0-preview"; + final Long timeout = null; + return service.removeComposeDeployment(deploymentName, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = removeComposeDeploymentDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Deletes an existing Service Fabric compose deployment from cluster. + * Deletes an existing Service Fabric compose deployment. + * + * @param deploymentName The identity of the deployment. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void removeComposeDeployment(String deploymentName, Long timeout) { + removeComposeDeploymentWithServiceResponseAsync(deploymentName, timeout).toBlocking().single().body(); + } + + /** + * Deletes an existing Service Fabric compose deployment from cluster. + * Deletes an existing Service Fabric compose deployment. + * + * @param deploymentName The identity of the deployment. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture removeComposeDeploymentAsync(String deploymentName, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(removeComposeDeploymentWithServiceResponseAsync(deploymentName, timeout), serviceCallback); + } + + /** + * Deletes an existing Service Fabric compose deployment from cluster. + * Deletes an existing Service Fabric compose deployment. + * + * @param deploymentName The identity of the deployment. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable removeComposeDeploymentAsync(String deploymentName, Long timeout) { + return removeComposeDeploymentWithServiceResponseAsync(deploymentName, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Service Fabric compose deployment from cluster. + * Deletes an existing Service Fabric compose deployment. + * + * @param deploymentName The identity of the deployment. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> removeComposeDeploymentWithServiceResponseAsync(String deploymentName, Long timeout) { + if (deploymentName == null) { + throw new IllegalArgumentException("Parameter deploymentName is required and cannot be null."); + } + final String apiVersion = "6.0-preview"; + return service.removeComposeDeployment(deploymentName, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = removeComposeDeploymentDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse removeComposeDeploymentDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 deploymentName The identity of the deployment. + * @param composeDeploymentUpgradeDescription Parameters for upgrading compose deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void startComposeDeploymentUpgrade(String deploymentName, ComposeDeploymentUpgradeDescription composeDeploymentUpgradeDescription) { + startComposeDeploymentUpgradeWithServiceResponseAsync(deploymentName, composeDeploymentUpgradeDescription).toBlocking().single().body(); + } + + /** + * 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 deploymentName The identity of the deployment. + * @param composeDeploymentUpgradeDescription Parameters for upgrading compose deployment. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture startComposeDeploymentUpgradeAsync(String deploymentName, ComposeDeploymentUpgradeDescription composeDeploymentUpgradeDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startComposeDeploymentUpgradeWithServiceResponseAsync(deploymentName, composeDeploymentUpgradeDescription), serviceCallback); + } + + /** + * 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 deploymentName The identity of the deployment. + * @param composeDeploymentUpgradeDescription Parameters for upgrading compose deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable startComposeDeploymentUpgradeAsync(String deploymentName, ComposeDeploymentUpgradeDescription composeDeploymentUpgradeDescription) { + return startComposeDeploymentUpgradeWithServiceResponseAsync(deploymentName, composeDeploymentUpgradeDescription).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 deploymentName The identity of the deployment. + * @param composeDeploymentUpgradeDescription Parameters for upgrading compose deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> startComposeDeploymentUpgradeWithServiceResponseAsync(String deploymentName, ComposeDeploymentUpgradeDescription composeDeploymentUpgradeDescription) { + if (deploymentName == null) { + throw new IllegalArgumentException("Parameter deploymentName is required and cannot be null."); + } + if (composeDeploymentUpgradeDescription == null) { + throw new IllegalArgumentException("Parameter composeDeploymentUpgradeDescription is required and cannot be null."); + } + Validator.validate(composeDeploymentUpgradeDescription); + final String apiVersion = "6.0-preview"; + final Long timeout = null; + return service.startComposeDeploymentUpgrade(deploymentName, apiVersion, composeDeploymentUpgradeDescription, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = startComposeDeploymentUpgradeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 deploymentName The identity of the deployment. + * @param composeDeploymentUpgradeDescription Parameters for upgrading compose deployment. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void startComposeDeploymentUpgrade(String deploymentName, ComposeDeploymentUpgradeDescription composeDeploymentUpgradeDescription, Long timeout) { + startComposeDeploymentUpgradeWithServiceResponseAsync(deploymentName, composeDeploymentUpgradeDescription, timeout).toBlocking().single().body(); + } + + /** + * 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 deploymentName The identity of the deployment. + * @param composeDeploymentUpgradeDescription Parameters for upgrading compose deployment. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture startComposeDeploymentUpgradeAsync(String deploymentName, ComposeDeploymentUpgradeDescription composeDeploymentUpgradeDescription, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startComposeDeploymentUpgradeWithServiceResponseAsync(deploymentName, composeDeploymentUpgradeDescription, timeout), serviceCallback); + } + + /** + * 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 deploymentName The identity of the deployment. + * @param composeDeploymentUpgradeDescription Parameters for upgrading compose deployment. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable startComposeDeploymentUpgradeAsync(String deploymentName, ComposeDeploymentUpgradeDescription composeDeploymentUpgradeDescription, Long timeout) { + return startComposeDeploymentUpgradeWithServiceResponseAsync(deploymentName, composeDeploymentUpgradeDescription, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 deploymentName The identity of the deployment. + * @param composeDeploymentUpgradeDescription Parameters for upgrading compose deployment. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> startComposeDeploymentUpgradeWithServiceResponseAsync(String deploymentName, ComposeDeploymentUpgradeDescription composeDeploymentUpgradeDescription, Long timeout) { + if (deploymentName == null) { + throw new IllegalArgumentException("Parameter deploymentName is required and cannot be null."); + } + if (composeDeploymentUpgradeDescription == null) { + throw new IllegalArgumentException("Parameter composeDeploymentUpgradeDescription is required and cannot be null."); + } + Validator.validate(composeDeploymentUpgradeDescription); + final String apiVersion = "6.0-preview"; + return service.startComposeDeploymentUpgrade(deploymentName, apiVersion, composeDeploymentUpgradeDescription, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = startComposeDeploymentUpgradeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse startComposeDeploymentUpgradeDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Get the status of Chaos. + * Get the status of Chaos indicating whether or not Chaos is running, the Chaos parameters used for running Chaos and the status of the Chaos Schedule. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ChaosInner object if successful. + */ + public ChaosInner getChaos() { + return getChaosWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get the status of Chaos. + * Get the status of Chaos indicating whether or not Chaos is running, the Chaos parameters used for running Chaos and the status of the Chaos Schedule. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getChaosAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getChaosWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get the status of Chaos. + * Get the status of Chaos indicating whether or not Chaos is running, the Chaos parameters used for running Chaos and the status of the Chaos Schedule. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ChaosInner object + */ + public Observable getChaosAsync() { + return getChaosWithServiceResponseAsync().map(new Func1, ChaosInner>() { + @Override + public ChaosInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the status of Chaos. + * Get the status of Chaos indicating whether or not Chaos is running, the Chaos parameters used for running Chaos and the status of the Chaos Schedule. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ChaosInner object + */ + public Observable> getChaosWithServiceResponseAsync() { + final String apiVersion = "6.2"; + final Long timeout = null; + return service.getChaos(apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getChaosDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get the status of Chaos. + * Get the status of Chaos indicating whether or not Chaos is running, the Chaos parameters used for running Chaos and the status of the Chaos Schedule. + * + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ChaosInner object if successful. + */ + public ChaosInner getChaos(Long timeout) { + return getChaosWithServiceResponseAsync(timeout).toBlocking().single().body(); + } + + /** + * Get the status of Chaos. + * Get the status of Chaos indicating whether or not Chaos is running, the Chaos parameters used for running Chaos and the status of the Chaos Schedule. + * + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getChaosAsync(Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getChaosWithServiceResponseAsync(timeout), serviceCallback); + } + + /** + * Get the status of Chaos. + * Get the status of Chaos indicating whether or not Chaos is running, the Chaos parameters used for running Chaos and the status of the Chaos Schedule. + * + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ChaosInner object + */ + public Observable getChaosAsync(Long timeout) { + return getChaosWithServiceResponseAsync(timeout).map(new Func1, ChaosInner>() { + @Override + public ChaosInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the status of Chaos. + * Get the status of Chaos indicating whether or not Chaos is running, the Chaos parameters used for running Chaos and the status of the Chaos Schedule. + * + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ChaosInner object + */ + public Observable> getChaosWithServiceResponseAsync(Long timeout) { + final String apiVersion = "6.2"; + return service.getChaos(apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getChaosDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getChaosDelegate(Response response) throws FabricErrorException, IOException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 chaosParameters Describes all the parameters to configure a Chaos run. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void startChaos(ChaosParameters chaosParameters) { + startChaosWithServiceResponseAsync(chaosParameters).toBlocking().single().body(); + } + + /** + * 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 chaosParameters Describes all the parameters to configure a Chaos run. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture startChaosAsync(ChaosParameters chaosParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startChaosWithServiceResponseAsync(chaosParameters), serviceCallback); + } + + /** + * 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 chaosParameters Describes all the parameters to configure a Chaos run. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable startChaosAsync(ChaosParameters chaosParameters) { + return startChaosWithServiceResponseAsync(chaosParameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 chaosParameters Describes all the parameters to configure a Chaos run. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> startChaosWithServiceResponseAsync(ChaosParameters chaosParameters) { + if (chaosParameters == null) { + throw new IllegalArgumentException("Parameter chaosParameters is required and cannot be null."); + } + Validator.validate(chaosParameters); + final String apiVersion = "6.0"; + final Long timeout = null; + return service.startChaos(apiVersion, chaosParameters, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = startChaosDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 chaosParameters Describes all the parameters to configure a Chaos run. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void startChaos(ChaosParameters chaosParameters, Long timeout) { + startChaosWithServiceResponseAsync(chaosParameters, timeout).toBlocking().single().body(); + } + + /** + * 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 chaosParameters Describes all the parameters to configure a Chaos run. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture startChaosAsync(ChaosParameters chaosParameters, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startChaosWithServiceResponseAsync(chaosParameters, timeout), serviceCallback); + } + + /** + * 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 chaosParameters Describes all the parameters to configure a Chaos run. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable startChaosAsync(ChaosParameters chaosParameters, Long timeout) { + return startChaosWithServiceResponseAsync(chaosParameters, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 chaosParameters Describes all the parameters to configure a Chaos run. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> startChaosWithServiceResponseAsync(ChaosParameters chaosParameters, Long timeout) { + if (chaosParameters == null) { + throw new IllegalArgumentException("Parameter chaosParameters is required and cannot be null."); + } + Validator.validate(chaosParameters); + final String apiVersion = "6.0"; + return service.startChaos(apiVersion, chaosParameters, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = startChaosDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse startChaosDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Stops Chaos if it is running in the cluster and put the Chaos Schedule in a stopped state. + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void stopChaos() { + stopChaosWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Stops Chaos if it is running in the cluster and put the Chaos Schedule in a stopped state. + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture stopChaosAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(stopChaosWithServiceResponseAsync(), serviceCallback); + } + + /** + * Stops Chaos if it is running in the cluster and put the Chaos Schedule in a stopped state. + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable stopChaosAsync() { + return stopChaosWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stops Chaos if it is running in the cluster and put the Chaos Schedule in a stopped state. + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> stopChaosWithServiceResponseAsync() { + final String apiVersion = "6.0"; + final Long timeout = null; + return service.stopChaos(apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = stopChaosDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Stops Chaos if it is running in the cluster and put the Chaos Schedule in a stopped state. + * 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void stopChaos(Long timeout) { + stopChaosWithServiceResponseAsync(timeout).toBlocking().single().body(); + } + + /** + * Stops Chaos if it is running in the cluster and put the Chaos Schedule in a stopped state. + * 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture stopChaosAsync(Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(stopChaosWithServiceResponseAsync(timeout), serviceCallback); + } + + /** + * Stops Chaos if it is running in the cluster and put the Chaos Schedule in a stopped state. + * 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable stopChaosAsync(Long timeout) { + return stopChaosWithServiceResponseAsync(timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stops Chaos if it is running in the cluster and put the Chaos Schedule in a stopped state. + * 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> stopChaosWithServiceResponseAsync(Long timeout) { + final String apiVersion = "6.0"; + return service.stopChaos(apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = stopChaosDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse stopChaosDelegate(Response response) throws FabricErrorException, IOException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the next segment of the Chaos events based on the continuation token or the time range. + * To get the next segment of the Chaos events, you can specify the ContinuationToken. To get the start of a new segment of Chaos events, you can specify the time range + through StartTimeUtc and EndTimeUtc. You cannot specify both the ContinuationToken and the time range in the same call. + When there are more than 100 Chaos events, the Chaos events are returned in multiple segments where a segment contains no more than 100 Chaos events and to get the next segment you make a call to this API with the continuation token. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ChaosEventsSegmentInner object if successful. + */ + public ChaosEventsSegmentInner getChaosEvents() { + return getChaosEventsWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Gets the next segment of the Chaos events based on the continuation token or the time range. + * To get the next segment of the Chaos events, you can specify the ContinuationToken. To get the start of a new segment of Chaos events, you can specify the time range + through StartTimeUtc and EndTimeUtc. You cannot specify both the ContinuationToken and the time range in the same call. + When there are more than 100 Chaos events, the Chaos events are returned in multiple segments where a segment contains no more than 100 Chaos events and to get the next segment you make a call to this API with the continuation token. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getChaosEventsAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getChaosEventsWithServiceResponseAsync(), serviceCallback); + } + + /** + * Gets the next segment of the Chaos events based on the continuation token or the time range. + * To get the next segment of the Chaos events, you can specify the ContinuationToken. To get the start of a new segment of Chaos events, you can specify the time range + through StartTimeUtc and EndTimeUtc. You cannot specify both the ContinuationToken and the time range in the same call. + When there are more than 100 Chaos events, the Chaos events are returned in multiple segments where a segment contains no more than 100 Chaos events and to get the next segment you make a call to this API with the continuation token. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ChaosEventsSegmentInner object + */ + public Observable getChaosEventsAsync() { + return getChaosEventsWithServiceResponseAsync().map(new Func1, ChaosEventsSegmentInner>() { + @Override + public ChaosEventsSegmentInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the next segment of the Chaos events based on the continuation token or the time range. + * To get the next segment of the Chaos events, you can specify the ContinuationToken. To get the start of a new segment of Chaos events, you can specify the time range + through StartTimeUtc and EndTimeUtc. You cannot specify both the ContinuationToken and the time range in the same call. + When there are more than 100 Chaos events, the Chaos events are returned in multiple segments where a segment contains no more than 100 Chaos events and to get the next segment you make a call to this API with the continuation token. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ChaosEventsSegmentInner object + */ + public Observable> getChaosEventsWithServiceResponseAsync() { + final String apiVersion = "6.2"; + final String continuationToken = null; + final String startTimeUtc = null; + final String endTimeUtc = null; + final Long maxResults = null; + final Long timeout = null; + return service.getChaosEvents(apiVersion, continuationToken, startTimeUtc, endTimeUtc, maxResults, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getChaosEventsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the next segment of the Chaos events based on the continuation token or the time range. + * To get the next segment of the Chaos events, you can specify the ContinuationToken. To get the start of a new segment of Chaos events, you can specify the time range + through StartTimeUtc and EndTimeUtc. You cannot specify both the ContinuationToken and the time range in the same call. + When there are more than 100 Chaos events, the Chaos events are returned in multiple segments where a segment contains no more than 100 Chaos events and to get the next segment you make a call to this API with the continuation token. + * + * @param 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 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ChaosEventsSegmentInner object if successful. + */ + public ChaosEventsSegmentInner getChaosEvents(String continuationToken, String startTimeUtc, String endTimeUtc, Long maxResults, Long timeout) { + return getChaosEventsWithServiceResponseAsync(continuationToken, startTimeUtc, endTimeUtc, maxResults, timeout).toBlocking().single().body(); + } + + /** + * Gets the next segment of the Chaos events based on the continuation token or the time range. + * To get the next segment of the Chaos events, you can specify the ContinuationToken. To get the start of a new segment of Chaos events, you can specify the time range + through StartTimeUtc and EndTimeUtc. You cannot specify both the ContinuationToken and the time range in the same call. + When there are more than 100 Chaos events, the Chaos events are returned in multiple segments where a segment contains no more than 100 Chaos events and to get the next segment you make a call to this API with the continuation token. + * + * @param 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 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getChaosEventsAsync(String continuationToken, String startTimeUtc, String endTimeUtc, Long maxResults, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getChaosEventsWithServiceResponseAsync(continuationToken, startTimeUtc, endTimeUtc, maxResults, timeout), serviceCallback); + } + + /** + * Gets the next segment of the Chaos events based on the continuation token or the time range. + * To get the next segment of the Chaos events, you can specify the ContinuationToken. To get the start of a new segment of Chaos events, you can specify the time range + through StartTimeUtc and EndTimeUtc. You cannot specify both the ContinuationToken and the time range in the same call. + When there are more than 100 Chaos events, the Chaos events are returned in multiple segments where a segment contains no more than 100 Chaos events and to get the next segment you make a call to this API with the continuation token. + * + * @param 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 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ChaosEventsSegmentInner object + */ + public Observable getChaosEventsAsync(String continuationToken, String startTimeUtc, String endTimeUtc, Long maxResults, Long timeout) { + return getChaosEventsWithServiceResponseAsync(continuationToken, startTimeUtc, endTimeUtc, maxResults, timeout).map(new Func1, ChaosEventsSegmentInner>() { + @Override + public ChaosEventsSegmentInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the next segment of the Chaos events based on the continuation token or the time range. + * To get the next segment of the Chaos events, you can specify the ContinuationToken. To get the start of a new segment of Chaos events, you can specify the time range + through StartTimeUtc and EndTimeUtc. You cannot specify both the ContinuationToken and the time range in the same call. + When there are more than 100 Chaos events, the Chaos events are returned in multiple segments where a segment contains no more than 100 Chaos events and to get the next segment you make a call to this API with the continuation token. + * + * @param 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 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ChaosEventsSegmentInner object + */ + public Observable> getChaosEventsWithServiceResponseAsync(String continuationToken, String startTimeUtc, String endTimeUtc, Long maxResults, Long timeout) { + final String apiVersion = "6.2"; + return service.getChaosEvents(apiVersion, continuationToken, startTimeUtc, endTimeUtc, maxResults, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getChaosEventsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getChaosEventsDelegate(Response response) throws FabricErrorException, IOException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Get the Chaos Schedule defining when and how to run Chaos. + * Gets the version of the Chaos Schedule in use and the Chaos Schedule that defines when and how to run Chaos. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ChaosScheduleDescriptionInner object if successful. + */ + public ChaosScheduleDescriptionInner getChaosSchedule() { + return getChaosScheduleWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get the Chaos Schedule defining when and how to run Chaos. + * Gets the version of the Chaos Schedule in use and the Chaos Schedule that defines when and how to run Chaos. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getChaosScheduleAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getChaosScheduleWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get the Chaos Schedule defining when and how to run Chaos. + * Gets the version of the Chaos Schedule in use and the Chaos Schedule that defines when and how to run Chaos. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ChaosScheduleDescriptionInner object + */ + public Observable getChaosScheduleAsync() { + return getChaosScheduleWithServiceResponseAsync().map(new Func1, ChaosScheduleDescriptionInner>() { + @Override + public ChaosScheduleDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the Chaos Schedule defining when and how to run Chaos. + * Gets the version of the Chaos Schedule in use and the Chaos Schedule that defines when and how to run Chaos. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ChaosScheduleDescriptionInner object + */ + public Observable> getChaosScheduleWithServiceResponseAsync() { + final String apiVersion = "6.2"; + final Long timeout = null; + return service.getChaosSchedule(apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getChaosScheduleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get the Chaos Schedule defining when and how to run Chaos. + * Gets the version of the Chaos Schedule in use and the Chaos Schedule that defines when and how to run Chaos. + * + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ChaosScheduleDescriptionInner object if successful. + */ + public ChaosScheduleDescriptionInner getChaosSchedule(Long timeout) { + return getChaosScheduleWithServiceResponseAsync(timeout).toBlocking().single().body(); + } + + /** + * Get the Chaos Schedule defining when and how to run Chaos. + * Gets the version of the Chaos Schedule in use and the Chaos Schedule that defines when and how to run Chaos. + * + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getChaosScheduleAsync(Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getChaosScheduleWithServiceResponseAsync(timeout), serviceCallback); + } + + /** + * Get the Chaos Schedule defining when and how to run Chaos. + * Gets the version of the Chaos Schedule in use and the Chaos Schedule that defines when and how to run Chaos. + * + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ChaosScheduleDescriptionInner object + */ + public Observable getChaosScheduleAsync(Long timeout) { + return getChaosScheduleWithServiceResponseAsync(timeout).map(new Func1, ChaosScheduleDescriptionInner>() { + @Override + public ChaosScheduleDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the Chaos Schedule defining when and how to run Chaos. + * Gets the version of the Chaos Schedule in use and the Chaos Schedule that defines when and how to run Chaos. + * + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ChaosScheduleDescriptionInner object + */ + public Observable> getChaosScheduleWithServiceResponseAsync(Long timeout) { + final String apiVersion = "6.2"; + return service.getChaosSchedule(apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getChaosScheduleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getChaosScheduleDelegate(Response response) throws FabricErrorException, IOException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 chaosSchedule Describes the schedule used by Chaos. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postChaosSchedule(ChaosScheduleDescriptionInner chaosSchedule) { + postChaosScheduleWithServiceResponseAsync(chaosSchedule).toBlocking().single().body(); + } + + /** + * 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 chaosSchedule Describes the schedule used by Chaos. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postChaosScheduleAsync(ChaosScheduleDescriptionInner chaosSchedule, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postChaosScheduleWithServiceResponseAsync(chaosSchedule), serviceCallback); + } + + /** + * 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 chaosSchedule Describes the schedule used by Chaos. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postChaosScheduleAsync(ChaosScheduleDescriptionInner chaosSchedule) { + return postChaosScheduleWithServiceResponseAsync(chaosSchedule).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 chaosSchedule Describes the schedule used by Chaos. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postChaosScheduleWithServiceResponseAsync(ChaosScheduleDescriptionInner chaosSchedule) { + if (chaosSchedule == null) { + throw new IllegalArgumentException("Parameter chaosSchedule is required and cannot be null."); + } + Validator.validate(chaosSchedule); + final String apiVersion = "6.2"; + final Long timeout = null; + return service.postChaosSchedule(apiVersion, timeout, chaosSchedule, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postChaosScheduleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 chaosSchedule Describes the schedule used by Chaos. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postChaosSchedule(ChaosScheduleDescriptionInner chaosSchedule, Long timeout) { + postChaosScheduleWithServiceResponseAsync(chaosSchedule, timeout).toBlocking().single().body(); + } + + /** + * 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 chaosSchedule Describes the schedule used by Chaos. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postChaosScheduleAsync(ChaosScheduleDescriptionInner chaosSchedule, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postChaosScheduleWithServiceResponseAsync(chaosSchedule, timeout), serviceCallback); + } + + /** + * 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 chaosSchedule Describes the schedule used by Chaos. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postChaosScheduleAsync(ChaosScheduleDescriptionInner chaosSchedule, Long timeout) { + return postChaosScheduleWithServiceResponseAsync(chaosSchedule, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 chaosSchedule Describes the schedule used by Chaos. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postChaosScheduleWithServiceResponseAsync(ChaosScheduleDescriptionInner chaosSchedule, Long timeout) { + if (chaosSchedule == null) { + throw new IllegalArgumentException("Parameter chaosSchedule is required and cannot be null."); + } + Validator.validate(chaosSchedule); + final String apiVersion = "6.2"; + return service.postChaosSchedule(apiVersion, timeout, chaosSchedule, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postChaosScheduleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postChaosScheduleDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Uploads contents of the file to the image store. + * Uploads contents of the file to the image store. Use this API if the file is small enough to upload again if the connection fails. The file's data needs to be added to the request body. The contents will be uploaded to the specified path. Image store service uses a mark file to indicate the availability of the folder. The mark file is an empty file named "_.dir". The mark file is generated by the image store service when all files in a folder are uploaded. When using File-by-File approach to upload application package in REST, the image store service isn't aware of the file hierarchy of the application package; you need to create a mark file per folder and upload it last, to let the image store service know that the folder is complete. + * + * @param contentPath Relative path to file or folder in the image store from its root. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void uploadFile(String contentPath) { + uploadFileWithServiceResponseAsync(contentPath).toBlocking().single().body(); + } + + /** + * Uploads contents of the file to the image store. + * Uploads contents of the file to the image store. Use this API if the file is small enough to upload again if the connection fails. The file's data needs to be added to the request body. The contents will be uploaded to the specified path. Image store service uses a mark file to indicate the availability of the folder. The mark file is an empty file named "_.dir". The mark file is generated by the image store service when all files in a folder are uploaded. When using File-by-File approach to upload application package in REST, the image store service isn't aware of the file hierarchy of the application package; you need to create a mark file per folder and upload it last, to let the image store service know that the folder is complete. + * + * @param contentPath Relative path to file or folder in the image store from its root. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture uploadFileAsync(String contentPath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(uploadFileWithServiceResponseAsync(contentPath), serviceCallback); + } + + /** + * Uploads contents of the file to the image store. + * Uploads contents of the file to the image store. Use this API if the file is small enough to upload again if the connection fails. The file's data needs to be added to the request body. The contents will be uploaded to the specified path. Image store service uses a mark file to indicate the availability of the folder. The mark file is an empty file named "_.dir". The mark file is generated by the image store service when all files in a folder are uploaded. When using File-by-File approach to upload application package in REST, the image store service isn't aware of the file hierarchy of the application package; you need to create a mark file per folder and upload it last, to let the image store service know that the folder is complete. + * + * @param contentPath Relative path to file or folder in the image store from its root. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable uploadFileAsync(String contentPath) { + return uploadFileWithServiceResponseAsync(contentPath).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Uploads contents of the file to the image store. + * Uploads contents of the file to the image store. Use this API if the file is small enough to upload again if the connection fails. The file's data needs to be added to the request body. The contents will be uploaded to the specified path. Image store service uses a mark file to indicate the availability of the folder. The mark file is an empty file named "_.dir". The mark file is generated by the image store service when all files in a folder are uploaded. When using File-by-File approach to upload application package in REST, the image store service isn't aware of the file hierarchy of the application package; you need to create a mark file per folder and upload it last, to let the image store service know that the folder is complete. + * + * @param contentPath Relative path to file or folder in the image store from its root. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> uploadFileWithServiceResponseAsync(String contentPath) { + if (contentPath == null) { + throw new IllegalArgumentException("Parameter contentPath is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + return service.uploadFile(contentPath, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = uploadFileDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Uploads contents of the file to the image store. + * Uploads contents of the file to the image store. Use this API if the file is small enough to upload again if the connection fails. The file's data needs to be added to the request body. The contents will be uploaded to the specified path. Image store service uses a mark file to indicate the availability of the folder. The mark file is an empty file named "_.dir". The mark file is generated by the image store service when all files in a folder are uploaded. When using File-by-File approach to upload application package in REST, the image store service isn't aware of the file hierarchy of the application package; you need to create a mark file per folder and upload it last, to let the image store service know that the folder is complete. + * + * @param contentPath Relative path to file or folder in the image store from its root. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void uploadFile(String contentPath, Long timeout) { + uploadFileWithServiceResponseAsync(contentPath, timeout).toBlocking().single().body(); + } + + /** + * Uploads contents of the file to the image store. + * Uploads contents of the file to the image store. Use this API if the file is small enough to upload again if the connection fails. The file's data needs to be added to the request body. The contents will be uploaded to the specified path. Image store service uses a mark file to indicate the availability of the folder. The mark file is an empty file named "_.dir". The mark file is generated by the image store service when all files in a folder are uploaded. When using File-by-File approach to upload application package in REST, the image store service isn't aware of the file hierarchy of the application package; you need to create a mark file per folder and upload it last, to let the image store service know that the folder is complete. + * + * @param contentPath Relative path to file or folder in the image store from its root. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture uploadFileAsync(String contentPath, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(uploadFileWithServiceResponseAsync(contentPath, timeout), serviceCallback); + } + + /** + * Uploads contents of the file to the image store. + * Uploads contents of the file to the image store. Use this API if the file is small enough to upload again if the connection fails. The file's data needs to be added to the request body. The contents will be uploaded to the specified path. Image store service uses a mark file to indicate the availability of the folder. The mark file is an empty file named "_.dir". The mark file is generated by the image store service when all files in a folder are uploaded. When using File-by-File approach to upload application package in REST, the image store service isn't aware of the file hierarchy of the application package; you need to create a mark file per folder and upload it last, to let the image store service know that the folder is complete. + * + * @param contentPath Relative path to file or folder in the image store from its root. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable uploadFileAsync(String contentPath, Long timeout) { + return uploadFileWithServiceResponseAsync(contentPath, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Uploads contents of the file to the image store. + * Uploads contents of the file to the image store. Use this API if the file is small enough to upload again if the connection fails. The file's data needs to be added to the request body. The contents will be uploaded to the specified path. Image store service uses a mark file to indicate the availability of the folder. The mark file is an empty file named "_.dir". The mark file is generated by the image store service when all files in a folder are uploaded. When using File-by-File approach to upload application package in REST, the image store service isn't aware of the file hierarchy of the application package; you need to create a mark file per folder and upload it last, to let the image store service know that the folder is complete. + * + * @param contentPath Relative path to file or folder in the image store from its root. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> uploadFileWithServiceResponseAsync(String contentPath, Long timeout) { + if (contentPath == null) { + throw new IllegalArgumentException("Parameter contentPath is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.uploadFile(contentPath, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = uploadFileDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse uploadFileDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the image store content information. + * Returns the information about the image store content at the specified contentPath. The contentPath is relative to the root of the image store. + * + * @param contentPath Relative path to file or folder in the image store from its root. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImageStoreContentInner object if successful. + */ + public ImageStoreContentInner getImageStoreContent(String contentPath) { + return getImageStoreContentWithServiceResponseAsync(contentPath).toBlocking().single().body(); + } + + /** + * Gets the image store content information. + * Returns the information about the image store content at the specified contentPath. The contentPath is relative to the root of the image store. + * + * @param contentPath Relative path to file or folder in the image store from its root. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getImageStoreContentAsync(String contentPath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getImageStoreContentWithServiceResponseAsync(contentPath), serviceCallback); + } + + /** + * Gets the image store content information. + * Returns the information about the image store content at the specified contentPath. The contentPath is relative to the root of the image store. + * + * @param contentPath Relative path to file or folder in the image store from its root. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageStoreContentInner object + */ + public Observable getImageStoreContentAsync(String contentPath) { + return getImageStoreContentWithServiceResponseAsync(contentPath).map(new Func1, ImageStoreContentInner>() { + @Override + public ImageStoreContentInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the image store content information. + * Returns the information about the image store content at the specified contentPath. The contentPath is relative to the root of the image store. + * + * @param contentPath Relative path to file or folder in the image store from its root. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageStoreContentInner object + */ + public Observable> getImageStoreContentWithServiceResponseAsync(String contentPath) { + if (contentPath == null) { + throw new IllegalArgumentException("Parameter contentPath is required and cannot be null."); + } + final String apiVersion = "6.2"; + final Long timeout = null; + return service.getImageStoreContent(contentPath, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getImageStoreContentDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the image store content information. + * Returns the information about the image store content at the specified contentPath. The contentPath is relative to the root of the image store. + * + * @param contentPath Relative path to file or folder in the image store from its root. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImageStoreContentInner object if successful. + */ + public ImageStoreContentInner getImageStoreContent(String contentPath, Long timeout) { + return getImageStoreContentWithServiceResponseAsync(contentPath, timeout).toBlocking().single().body(); + } + + /** + * Gets the image store content information. + * Returns the information about the image store content at the specified contentPath. The contentPath is relative to the root of the image store. + * + * @param contentPath Relative path to file or folder in the image store from its root. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getImageStoreContentAsync(String contentPath, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getImageStoreContentWithServiceResponseAsync(contentPath, timeout), serviceCallback); + } + + /** + * Gets the image store content information. + * Returns the information about the image store content at the specified contentPath. The contentPath is relative to the root of the image store. + * + * @param contentPath Relative path to file or folder in the image store from its root. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageStoreContentInner object + */ + public Observable getImageStoreContentAsync(String contentPath, Long timeout) { + return getImageStoreContentWithServiceResponseAsync(contentPath, timeout).map(new Func1, ImageStoreContentInner>() { + @Override + public ImageStoreContentInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the image store content information. + * Returns the information about the image store content at the specified contentPath. The contentPath is relative to the root of the image store. + * + * @param contentPath Relative path to file or folder in the image store from its root. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageStoreContentInner object + */ + public Observable> getImageStoreContentWithServiceResponseAsync(String contentPath, Long timeout) { + if (contentPath == null) { + throw new IllegalArgumentException("Parameter contentPath is required and cannot be null."); + } + final String apiVersion = "6.2"; + return service.getImageStoreContent(contentPath, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getImageStoreContentDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getImageStoreContentDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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. + * + * @param contentPath Relative path to file or folder in the image store from its root. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteImageStoreContent(String contentPath) { + deleteImageStoreContentWithServiceResponseAsync(contentPath).toBlocking().single().body(); + } + + /** + * 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. + * + * @param contentPath Relative path to file or folder in the image store from its root. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteImageStoreContentAsync(String contentPath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteImageStoreContentWithServiceResponseAsync(contentPath), serviceCallback); + } + + /** + * 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. + * + * @param contentPath Relative path to file or folder in the image store from its root. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteImageStoreContentAsync(String contentPath) { + return deleteImageStoreContentWithServiceResponseAsync(contentPath).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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. + * + * @param contentPath Relative path to file or folder in the image store from its root. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteImageStoreContentWithServiceResponseAsync(String contentPath) { + if (contentPath == null) { + throw new IllegalArgumentException("Parameter contentPath is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + return service.deleteImageStoreContent(contentPath, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteImageStoreContentDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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. + * + * @param contentPath Relative path to file or folder in the image store from its root. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteImageStoreContent(String contentPath, Long timeout) { + deleteImageStoreContentWithServiceResponseAsync(contentPath, timeout).toBlocking().single().body(); + } + + /** + * 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. + * + * @param contentPath Relative path to file or folder in the image store from its root. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteImageStoreContentAsync(String contentPath, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteImageStoreContentWithServiceResponseAsync(contentPath, timeout), serviceCallback); + } + + /** + * 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. + * + * @param contentPath Relative path to file or folder in the image store from its root. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteImageStoreContentAsync(String contentPath, Long timeout) { + return deleteImageStoreContentWithServiceResponseAsync(contentPath, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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. + * + * @param contentPath Relative path to file or folder in the image store from its root. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteImageStoreContentWithServiceResponseAsync(String contentPath, Long timeout) { + if (contentPath == null) { + throw new IllegalArgumentException("Parameter contentPath is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.deleteImageStoreContent(contentPath, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteImageStoreContentDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteImageStoreContentDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImageStoreContentInner object if successful. + */ + public ImageStoreContentInner getImageStoreRootContent() { + return getImageStoreRootContentWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getImageStoreRootContentAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getImageStoreRootContentWithServiceResponseAsync(), serviceCallback); + } + + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageStoreContentInner object + */ + public Observable getImageStoreRootContentAsync() { + return getImageStoreRootContentWithServiceResponseAsync().map(new Func1, ImageStoreContentInner>() { + @Override + public ImageStoreContentInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageStoreContentInner object + */ + public Observable> getImageStoreRootContentWithServiceResponseAsync() { + final String apiVersion = "6.0"; + final Long timeout = null; + return service.getImageStoreRootContent(apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getImageStoreRootContentDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImageStoreContentInner object if successful. + */ + public ImageStoreContentInner getImageStoreRootContent(Long timeout) { + return getImageStoreRootContentWithServiceResponseAsync(timeout).toBlocking().single().body(); + } + + /** + * 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getImageStoreRootContentAsync(Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getImageStoreRootContentWithServiceResponseAsync(timeout), serviceCallback); + } + + /** + * 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageStoreContentInner object + */ + public Observable getImageStoreRootContentAsync(Long timeout) { + return getImageStoreRootContentWithServiceResponseAsync(timeout).map(new Func1, ImageStoreContentInner>() { + @Override + public ImageStoreContentInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageStoreContentInner object + */ + public Observable> getImageStoreRootContentWithServiceResponseAsync(Long timeout) { + final String apiVersion = "6.0"; + return service.getImageStoreRootContent(apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getImageStoreRootContentDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getImageStoreRootContentDelegate(Response response) throws FabricErrorException, IOException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Copies image store content internally. + * Copies the image store content from the source image store relative path to the destination image store relative path. + * + * @param imageStoreCopyDescription Describes the copy description for the image store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void copyImageStoreContent(ImageStoreCopyDescription imageStoreCopyDescription) { + copyImageStoreContentWithServiceResponseAsync(imageStoreCopyDescription).toBlocking().single().body(); + } + + /** + * Copies image store content internally. + * Copies the image store content from the source image store relative path to the destination image store relative path. + * + * @param imageStoreCopyDescription Describes the copy description for the image store. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture copyImageStoreContentAsync(ImageStoreCopyDescription imageStoreCopyDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(copyImageStoreContentWithServiceResponseAsync(imageStoreCopyDescription), serviceCallback); + } + + /** + * Copies image store content internally. + * Copies the image store content from the source image store relative path to the destination image store relative path. + * + * @param imageStoreCopyDescription Describes the copy description for the image store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable copyImageStoreContentAsync(ImageStoreCopyDescription imageStoreCopyDescription) { + return copyImageStoreContentWithServiceResponseAsync(imageStoreCopyDescription).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Copies image store content internally. + * Copies the image store content from the source image store relative path to the destination image store relative path. + * + * @param imageStoreCopyDescription Describes the copy description for the image store. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> copyImageStoreContentWithServiceResponseAsync(ImageStoreCopyDescription imageStoreCopyDescription) { + if (imageStoreCopyDescription == null) { + throw new IllegalArgumentException("Parameter imageStoreCopyDescription is required and cannot be null."); + } + Validator.validate(imageStoreCopyDescription); + final String apiVersion = "6.0"; + final Long timeout = null; + return service.copyImageStoreContent(apiVersion, imageStoreCopyDescription, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = copyImageStoreContentDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Copies image store content internally. + * Copies the image store content from the source image store relative path to the destination image store relative path. + * + * @param imageStoreCopyDescription Describes the copy description for the image store. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void copyImageStoreContent(ImageStoreCopyDescription imageStoreCopyDescription, Long timeout) { + copyImageStoreContentWithServiceResponseAsync(imageStoreCopyDescription, timeout).toBlocking().single().body(); + } + + /** + * Copies image store content internally. + * Copies the image store content from the source image store relative path to the destination image store relative path. + * + * @param imageStoreCopyDescription Describes the copy description for the image store. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture copyImageStoreContentAsync(ImageStoreCopyDescription imageStoreCopyDescription, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(copyImageStoreContentWithServiceResponseAsync(imageStoreCopyDescription, timeout), serviceCallback); + } + + /** + * Copies image store content internally. + * Copies the image store content from the source image store relative path to the destination image store relative path. + * + * @param imageStoreCopyDescription Describes the copy description for the image store. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable copyImageStoreContentAsync(ImageStoreCopyDescription imageStoreCopyDescription, Long timeout) { + return copyImageStoreContentWithServiceResponseAsync(imageStoreCopyDescription, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Copies image store content internally. + * Copies the image store content from the source image store relative path to the destination image store relative path. + * + * @param imageStoreCopyDescription Describes the copy description for the image store. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> copyImageStoreContentWithServiceResponseAsync(ImageStoreCopyDescription imageStoreCopyDescription, Long timeout) { + if (imageStoreCopyDescription == null) { + throw new IllegalArgumentException("Parameter imageStoreCopyDescription is required and cannot be null."); + } + Validator.validate(imageStoreCopyDescription); + final String apiVersion = "6.0"; + return service.copyImageStoreContent(apiVersion, imageStoreCopyDescription, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = copyImageStoreContentDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse copyImageStoreContentDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Cancels an image store upload session. + * The DELETE request will cause the existing upload session to expire and remove any previously uploaded file chunks. + * + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteImageStoreUploadSession(UUID sessionId) { + deleteImageStoreUploadSessionWithServiceResponseAsync(sessionId).toBlocking().single().body(); + } + + /** + * Cancels an image store upload session. + * The DELETE request will cause the existing upload session to expire and remove any previously uploaded file chunks. + * + * @param 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteImageStoreUploadSessionAsync(UUID sessionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteImageStoreUploadSessionWithServiceResponseAsync(sessionId), serviceCallback); + } + + /** + * Cancels an image store upload session. + * The DELETE request will cause the existing upload session to expire and remove any previously uploaded file chunks. + * + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteImageStoreUploadSessionAsync(UUID sessionId) { + return deleteImageStoreUploadSessionWithServiceResponseAsync(sessionId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Cancels an image store upload session. + * The DELETE request will cause the existing upload session to expire and remove any previously uploaded file chunks. + * + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteImageStoreUploadSessionWithServiceResponseAsync(UUID sessionId) { + if (sessionId == null) { + throw new IllegalArgumentException("Parameter sessionId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + return service.deleteImageStoreUploadSession(apiVersion, sessionId, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteImageStoreUploadSessionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Cancels an image store upload session. + * The DELETE request will cause the existing upload session to expire and remove any previously uploaded file chunks. + * + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteImageStoreUploadSession(UUID sessionId, Long timeout) { + deleteImageStoreUploadSessionWithServiceResponseAsync(sessionId, timeout).toBlocking().single().body(); + } + + /** + * Cancels an image store upload session. + * The DELETE request will cause the existing upload session to expire and remove any previously uploaded file chunks. + * + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteImageStoreUploadSessionAsync(UUID sessionId, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteImageStoreUploadSessionWithServiceResponseAsync(sessionId, timeout), serviceCallback); + } + + /** + * Cancels an image store upload session. + * The DELETE request will cause the existing upload session to expire and remove any previously uploaded file chunks. + * + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteImageStoreUploadSessionAsync(UUID sessionId, Long timeout) { + return deleteImageStoreUploadSessionWithServiceResponseAsync(sessionId, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Cancels an image store upload session. + * The DELETE request will cause the existing upload session to expire and remove any previously uploaded file chunks. + * + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteImageStoreUploadSessionWithServiceResponseAsync(UUID sessionId, Long timeout) { + if (sessionId == null) { + throw new IllegalArgumentException("Parameter sessionId is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.deleteImageStoreUploadSession(apiVersion, sessionId, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteImageStoreUploadSessionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteImageStoreUploadSessionDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Commit an image store upload session. + * When all file chunks have been uploaded, the upload session needs to be committed explicitly to complete the upload. Image store preserves the upload session until the expiration time, which is 30 minutes after the last chunk received. + * + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void commitImageStoreUploadSession(UUID sessionId) { + commitImageStoreUploadSessionWithServiceResponseAsync(sessionId).toBlocking().single().body(); + } + + /** + * Commit an image store upload session. + * When all file chunks have been uploaded, the upload session needs to be committed explicitly to complete the upload. Image store preserves the upload session until the expiration time, which is 30 minutes after the last chunk received. + * + * @param 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture commitImageStoreUploadSessionAsync(UUID sessionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(commitImageStoreUploadSessionWithServiceResponseAsync(sessionId), serviceCallback); + } + + /** + * Commit an image store upload session. + * When all file chunks have been uploaded, the upload session needs to be committed explicitly to complete the upload. Image store preserves the upload session until the expiration time, which is 30 minutes after the last chunk received. + * + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable commitImageStoreUploadSessionAsync(UUID sessionId) { + return commitImageStoreUploadSessionWithServiceResponseAsync(sessionId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Commit an image store upload session. + * When all file chunks have been uploaded, the upload session needs to be committed explicitly to complete the upload. Image store preserves the upload session until the expiration time, which is 30 minutes after the last chunk received. + * + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> commitImageStoreUploadSessionWithServiceResponseAsync(UUID sessionId) { + if (sessionId == null) { + throw new IllegalArgumentException("Parameter sessionId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + return service.commitImageStoreUploadSession(apiVersion, sessionId, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = commitImageStoreUploadSessionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Commit an image store upload session. + * When all file chunks have been uploaded, the upload session needs to be committed explicitly to complete the upload. Image store preserves the upload session until the expiration time, which is 30 minutes after the last chunk received. + * + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void commitImageStoreUploadSession(UUID sessionId, Long timeout) { + commitImageStoreUploadSessionWithServiceResponseAsync(sessionId, timeout).toBlocking().single().body(); + } + + /** + * Commit an image store upload session. + * When all file chunks have been uploaded, the upload session needs to be committed explicitly to complete the upload. Image store preserves the upload session until the expiration time, which is 30 minutes after the last chunk received. + * + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture commitImageStoreUploadSessionAsync(UUID sessionId, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(commitImageStoreUploadSessionWithServiceResponseAsync(sessionId, timeout), serviceCallback); + } + + /** + * Commit an image store upload session. + * When all file chunks have been uploaded, the upload session needs to be committed explicitly to complete the upload. Image store preserves the upload session until the expiration time, which is 30 minutes after the last chunk received. + * + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable commitImageStoreUploadSessionAsync(UUID sessionId, Long timeout) { + return commitImageStoreUploadSessionWithServiceResponseAsync(sessionId, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Commit an image store upload session. + * When all file chunks have been uploaded, the upload session needs to be committed explicitly to complete the upload. Image store preserves the upload session until the expiration time, which is 30 minutes after the last chunk received. + * + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> commitImageStoreUploadSessionWithServiceResponseAsync(UUID sessionId, Long timeout) { + if (sessionId == null) { + throw new IllegalArgumentException("Parameter sessionId is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.commitImageStoreUploadSession(apiVersion, sessionId, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = commitImageStoreUploadSessionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse commitImageStoreUploadSessionDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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. + * + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the UploadSessionInner object if successful. + */ + public UploadSessionInner getImageStoreUploadSessionById(UUID sessionId) { + return getImageStoreUploadSessionByIdWithServiceResponseAsync(sessionId).toBlocking().single().body(); + } + + /** + * 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. + * + * @param 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getImageStoreUploadSessionByIdAsync(UUID sessionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getImageStoreUploadSessionByIdWithServiceResponseAsync(sessionId), serviceCallback); + } + + /** + * 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. + * + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UploadSessionInner object + */ + public Observable getImageStoreUploadSessionByIdAsync(UUID sessionId) { + return getImageStoreUploadSessionByIdWithServiceResponseAsync(sessionId).map(new Func1, UploadSessionInner>() { + @Override + public UploadSessionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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. + * + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UploadSessionInner object + */ + public Observable> getImageStoreUploadSessionByIdWithServiceResponseAsync(UUID sessionId) { + if (sessionId == null) { + throw new IllegalArgumentException("Parameter sessionId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + return service.getImageStoreUploadSessionById(apiVersion, sessionId, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getImageStoreUploadSessionByIdDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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. + * + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the UploadSessionInner object if successful. + */ + public UploadSessionInner getImageStoreUploadSessionById(UUID sessionId, Long timeout) { + return getImageStoreUploadSessionByIdWithServiceResponseAsync(sessionId, timeout).toBlocking().single().body(); + } + + /** + * 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. + * + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getImageStoreUploadSessionByIdAsync(UUID sessionId, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getImageStoreUploadSessionByIdWithServiceResponseAsync(sessionId, timeout), serviceCallback); + } + + /** + * 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. + * + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UploadSessionInner object + */ + public Observable getImageStoreUploadSessionByIdAsync(UUID sessionId, Long timeout) { + return getImageStoreUploadSessionByIdWithServiceResponseAsync(sessionId, timeout).map(new Func1, UploadSessionInner>() { + @Override + public UploadSessionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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. + * + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UploadSessionInner object + */ + public Observable> getImageStoreUploadSessionByIdWithServiceResponseAsync(UUID sessionId, Long timeout) { + if (sessionId == null) { + throw new IllegalArgumentException("Parameter sessionId is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.getImageStoreUploadSessionById(apiVersion, sessionId, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getImageStoreUploadSessionByIdDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getImageStoreUploadSessionByIdDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Get the image store upload session by relative path. + * Gets the image store upload session associated with the given image store relative path. User can query the upload session at any time during uploading. + * + * @param contentPath Relative path to file or folder in the image store from its root. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the UploadSessionInner object if successful. + */ + public UploadSessionInner getImageStoreUploadSessionByPath(String contentPath) { + return getImageStoreUploadSessionByPathWithServiceResponseAsync(contentPath).toBlocking().single().body(); + } + + /** + * Get the image store upload session by relative path. + * Gets the image store upload session associated with the given image store relative path. User can query the upload session at any time during uploading. + * + * @param contentPath Relative path to file or folder in the image store from its root. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getImageStoreUploadSessionByPathAsync(String contentPath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getImageStoreUploadSessionByPathWithServiceResponseAsync(contentPath), serviceCallback); + } + + /** + * Get the image store upload session by relative path. + * Gets the image store upload session associated with the given image store relative path. User can query the upload session at any time during uploading. + * + * @param contentPath Relative path to file or folder in the image store from its root. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UploadSessionInner object + */ + public Observable getImageStoreUploadSessionByPathAsync(String contentPath) { + return getImageStoreUploadSessionByPathWithServiceResponseAsync(contentPath).map(new Func1, UploadSessionInner>() { + @Override + public UploadSessionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the image store upload session by relative path. + * Gets the image store upload session associated with the given image store relative path. User can query the upload session at any time during uploading. + * + * @param contentPath Relative path to file or folder in the image store from its root. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UploadSessionInner object + */ + public Observable> getImageStoreUploadSessionByPathWithServiceResponseAsync(String contentPath) { + if (contentPath == null) { + throw new IllegalArgumentException("Parameter contentPath is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + return service.getImageStoreUploadSessionByPath(contentPath, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getImageStoreUploadSessionByPathDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get the image store upload session by relative path. + * Gets the image store upload session associated with the given image store relative path. User can query the upload session at any time during uploading. + * + * @param contentPath Relative path to file or folder in the image store from its root. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the UploadSessionInner object if successful. + */ + public UploadSessionInner getImageStoreUploadSessionByPath(String contentPath, Long timeout) { + return getImageStoreUploadSessionByPathWithServiceResponseAsync(contentPath, timeout).toBlocking().single().body(); + } + + /** + * Get the image store upload session by relative path. + * Gets the image store upload session associated with the given image store relative path. User can query the upload session at any time during uploading. + * + * @param contentPath Relative path to file or folder in the image store from its root. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getImageStoreUploadSessionByPathAsync(String contentPath, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getImageStoreUploadSessionByPathWithServiceResponseAsync(contentPath, timeout), serviceCallback); + } + + /** + * Get the image store upload session by relative path. + * Gets the image store upload session associated with the given image store relative path. User can query the upload session at any time during uploading. + * + * @param contentPath Relative path to file or folder in the image store from its root. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UploadSessionInner object + */ + public Observable getImageStoreUploadSessionByPathAsync(String contentPath, Long timeout) { + return getImageStoreUploadSessionByPathWithServiceResponseAsync(contentPath, timeout).map(new Func1, UploadSessionInner>() { + @Override + public UploadSessionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the image store upload session by relative path. + * Gets the image store upload session associated with the given image store relative path. User can query the upload session at any time during uploading. + * + * @param contentPath Relative path to file or folder in the image store from its root. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UploadSessionInner object + */ + public Observable> getImageStoreUploadSessionByPathWithServiceResponseAsync(String contentPath, Long timeout) { + if (contentPath == null) { + throw new IllegalArgumentException("Parameter contentPath is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.getImageStoreUploadSessionByPath(contentPath, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getImageStoreUploadSessionByPathDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getImageStoreUploadSessionByPathDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Uploads a file chunk to the image store relative path. + * Uploads a file chunk to the image store with the specified upload session ID and image store relative path. This API allows user to resume the file upload operation. user doesn't have to restart the file upload from scratch whenever there is a network interruption. Use this option if the file size is large. + To perform a resumable file upload, user need to break the file into multiple chunks and upload these chunks to the image store one-by-one. Chunks don't have to be uploaded in order. If the file represented by the image store relative path already exists, it will be overwritten when the upload session commits. + * + * @param contentPath Relative path to file or folder in the image store from its root. + * @param 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void uploadFileChunk(String contentPath, UUID sessionId, String contentRange) { + uploadFileChunkWithServiceResponseAsync(contentPath, sessionId, contentRange).toBlocking().single().body(); + } + + /** + * Uploads a file chunk to the image store relative path. + * Uploads a file chunk to the image store with the specified upload session ID and image store relative path. This API allows user to resume the file upload operation. user doesn't have to restart the file upload from scratch whenever there is a network interruption. Use this option if the file size is large. + To perform a resumable file upload, user need to break the file into multiple chunks and upload these chunks to the image store one-by-one. Chunks don't have to be uploaded in order. If the file represented by the image store relative path already exists, it will be overwritten when the upload session commits. + * + * @param contentPath Relative path to file or folder in the image store from its root. + * @param 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 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture uploadFileChunkAsync(String contentPath, UUID sessionId, String contentRange, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(uploadFileChunkWithServiceResponseAsync(contentPath, sessionId, contentRange), serviceCallback); + } + + /** + * Uploads a file chunk to the image store relative path. + * Uploads a file chunk to the image store with the specified upload session ID and image store relative path. This API allows user to resume the file upload operation. user doesn't have to restart the file upload from scratch whenever there is a network interruption. Use this option if the file size is large. + To perform a resumable file upload, user need to break the file into multiple chunks and upload these chunks to the image store one-by-one. Chunks don't have to be uploaded in order. If the file represented by the image store relative path already exists, it will be overwritten when the upload session commits. + * + * @param contentPath Relative path to file or folder in the image store from its root. + * @param 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable uploadFileChunkAsync(String contentPath, UUID sessionId, String contentRange) { + return uploadFileChunkWithServiceResponseAsync(contentPath, sessionId, contentRange).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Uploads a file chunk to the image store relative path. + * Uploads a file chunk to the image store with the specified upload session ID and image store relative path. This API allows user to resume the file upload operation. user doesn't have to restart the file upload from scratch whenever there is a network interruption. Use this option if the file size is large. + To perform a resumable file upload, user need to break the file into multiple chunks and upload these chunks to the image store one-by-one. Chunks don't have to be uploaded in order. If the file represented by the image store relative path already exists, it will be overwritten when the upload session commits. + * + * @param contentPath Relative path to file or folder in the image store from its root. + * @param 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> uploadFileChunkWithServiceResponseAsync(String contentPath, UUID sessionId, String contentRange) { + if (contentPath == null) { + throw new IllegalArgumentException("Parameter contentPath is required and cannot be null."); + } + if (sessionId == null) { + throw new IllegalArgumentException("Parameter sessionId is required and cannot be null."); + } + if (contentRange == null) { + throw new IllegalArgumentException("Parameter contentRange is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + return service.uploadFileChunk(contentPath, apiVersion, sessionId, contentRange, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = uploadFileChunkDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Uploads a file chunk to the image store relative path. + * Uploads a file chunk to the image store with the specified upload session ID and image store relative path. This API allows user to resume the file upload operation. user doesn't have to restart the file upload from scratch whenever there is a network interruption. Use this option if the file size is large. + To perform a resumable file upload, user need to break the file into multiple chunks and upload these chunks to the image store one-by-one. Chunks don't have to be uploaded in order. If the file represented by the image store relative path already exists, it will be overwritten when the upload session commits. + * + * @param contentPath Relative path to file or folder in the image store from its root. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void uploadFileChunk(String contentPath, UUID sessionId, String contentRange, Long timeout) { + uploadFileChunkWithServiceResponseAsync(contentPath, sessionId, contentRange, timeout).toBlocking().single().body(); + } + + /** + * Uploads a file chunk to the image store relative path. + * Uploads a file chunk to the image store with the specified upload session ID and image store relative path. This API allows user to resume the file upload operation. user doesn't have to restart the file upload from scratch whenever there is a network interruption. Use this option if the file size is large. + To perform a resumable file upload, user need to break the file into multiple chunks and upload these chunks to the image store one-by-one. Chunks don't have to be uploaded in order. If the file represented by the image store relative path already exists, it will be overwritten when the upload session commits. + * + * @param contentPath Relative path to file or folder in the image store from its root. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture uploadFileChunkAsync(String contentPath, UUID sessionId, String contentRange, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(uploadFileChunkWithServiceResponseAsync(contentPath, sessionId, contentRange, timeout), serviceCallback); + } + + /** + * Uploads a file chunk to the image store relative path. + * Uploads a file chunk to the image store with the specified upload session ID and image store relative path. This API allows user to resume the file upload operation. user doesn't have to restart the file upload from scratch whenever there is a network interruption. Use this option if the file size is large. + To perform a resumable file upload, user need to break the file into multiple chunks and upload these chunks to the image store one-by-one. Chunks don't have to be uploaded in order. If the file represented by the image store relative path already exists, it will be overwritten when the upload session commits. + * + * @param contentPath Relative path to file or folder in the image store from its root. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable uploadFileChunkAsync(String contentPath, UUID sessionId, String contentRange, Long timeout) { + return uploadFileChunkWithServiceResponseAsync(contentPath, sessionId, contentRange, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Uploads a file chunk to the image store relative path. + * Uploads a file chunk to the image store with the specified upload session ID and image store relative path. This API allows user to resume the file upload operation. user doesn't have to restart the file upload from scratch whenever there is a network interruption. Use this option if the file size is large. + To perform a resumable file upload, user need to break the file into multiple chunks and upload these chunks to the image store one-by-one. Chunks don't have to be uploaded in order. If the file represented by the image store relative path already exists, it will be overwritten when the upload session commits. + * + * @param contentPath Relative path to file or folder in the image store from its root. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> uploadFileChunkWithServiceResponseAsync(String contentPath, UUID sessionId, String contentRange, Long timeout) { + if (contentPath == null) { + throw new IllegalArgumentException("Parameter contentPath is required and cannot be null."); + } + if (sessionId == null) { + throw new IllegalArgumentException("Parameter sessionId is required and cannot be null."); + } + if (contentRange == null) { + throw new IllegalArgumentException("Parameter contentRange is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.uploadFileChunk(contentPath, apiVersion, sessionId, contentRange, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = uploadFileChunkDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse uploadFileChunkDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Invokes an administrative command on the given Infrastructure Service instance. + * For clusters that have one or more instances of the Infrastructure Service configured, + this API provides a way to send infrastructure-specific commands to a particular + instance of the Infrastructure Service. + Available commands and their corresponding response formats vary depending upon + the infrastructure on which the cluster is running. + This API supports the Service Fabric platform; it is not meant to be used directly from your code. + * + * @param command The text of the command to be invoked. The content of the command is infrastructure-specific. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the String object if successful. + */ + public String invokeInfrastructureCommand(String command) { + return invokeInfrastructureCommandWithServiceResponseAsync(command).toBlocking().single().body(); + } + + /** + * Invokes an administrative command on the given Infrastructure Service instance. + * For clusters that have one or more instances of the Infrastructure Service configured, + this API provides a way to send infrastructure-specific commands to a particular + instance of the Infrastructure Service. + Available commands and their corresponding response formats vary depending upon + the infrastructure on which the cluster is running. + This API supports the Service Fabric platform; it is not meant to be used directly from your code. + * + * @param command The text of the command to be invoked. The content of the command is infrastructure-specific. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture invokeInfrastructureCommandAsync(String command, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(invokeInfrastructureCommandWithServiceResponseAsync(command), serviceCallback); + } + + /** + * Invokes an administrative command on the given Infrastructure Service instance. + * For clusters that have one or more instances of the Infrastructure Service configured, + this API provides a way to send infrastructure-specific commands to a particular + instance of the Infrastructure Service. + Available commands and their corresponding response formats vary depending upon + the infrastructure on which the cluster is running. + This API supports the Service Fabric platform; it is not meant to be used directly from your code. + * + * @param command The text of the command to be invoked. The content of the command is infrastructure-specific. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable invokeInfrastructureCommandAsync(String command) { + return invokeInfrastructureCommandWithServiceResponseAsync(command).map(new Func1, String>() { + @Override + public String call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Invokes an administrative command on the given Infrastructure Service instance. + * For clusters that have one or more instances of the Infrastructure Service configured, + this API provides a way to send infrastructure-specific commands to a particular + instance of the Infrastructure Service. + Available commands and their corresponding response formats vary depending upon + the infrastructure on which the cluster is running. + This API supports the Service Fabric platform; it is not meant to be used directly from your code. + * + * @param command The text of the command to be invoked. The content of the command is infrastructure-specific. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable> invokeInfrastructureCommandWithServiceResponseAsync(String command) { + if (command == null) { + throw new IllegalArgumentException("Parameter command is required and cannot be null."); + } + final String apiVersion = "6.0"; + final String serviceId = null; + final Long timeout = null; + return service.invokeInfrastructureCommand(apiVersion, command, serviceId, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = invokeInfrastructureCommandDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Invokes an administrative command on the given Infrastructure Service instance. + * For clusters that have one or more instances of the Infrastructure Service configured, + this API provides a way to send infrastructure-specific commands to a particular + instance of the Infrastructure Service. + Available commands and their corresponding response formats vary depending upon + the infrastructure on which the cluster is running. + This API supports the Service Fabric platform; it is not meant to be used directly from your code. + * + * @param command The text of the command to be invoked. The content of the command is infrastructure-specific. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the String object if successful. + */ + public String invokeInfrastructureCommand(String command, String serviceId, Long timeout) { + return invokeInfrastructureCommandWithServiceResponseAsync(command, serviceId, timeout).toBlocking().single().body(); + } + + /** + * Invokes an administrative command on the given Infrastructure Service instance. + * For clusters that have one or more instances of the Infrastructure Service configured, + this API provides a way to send infrastructure-specific commands to a particular + instance of the Infrastructure Service. + Available commands and their corresponding response formats vary depending upon + the infrastructure on which the cluster is running. + This API supports the Service Fabric platform; it is not meant to be used directly from your code. + * + * @param command The text of the command to be invoked. The content of the command is infrastructure-specific. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture invokeInfrastructureCommandAsync(String command, String serviceId, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(invokeInfrastructureCommandWithServiceResponseAsync(command, serviceId, timeout), serviceCallback); + } + + /** + * Invokes an administrative command on the given Infrastructure Service instance. + * For clusters that have one or more instances of the Infrastructure Service configured, + this API provides a way to send infrastructure-specific commands to a particular + instance of the Infrastructure Service. + Available commands and their corresponding response formats vary depending upon + the infrastructure on which the cluster is running. + This API supports the Service Fabric platform; it is not meant to be used directly from your code. + * + * @param command The text of the command to be invoked. The content of the command is infrastructure-specific. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable invokeInfrastructureCommandAsync(String command, String serviceId, Long timeout) { + return invokeInfrastructureCommandWithServiceResponseAsync(command, serviceId, timeout).map(new Func1, String>() { + @Override + public String call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Invokes an administrative command on the given Infrastructure Service instance. + * For clusters that have one or more instances of the Infrastructure Service configured, + this API provides a way to send infrastructure-specific commands to a particular + instance of the Infrastructure Service. + Available commands and their corresponding response formats vary depending upon + the infrastructure on which the cluster is running. + This API supports the Service Fabric platform; it is not meant to be used directly from your code. + * + * @param command The text of the command to be invoked. The content of the command is infrastructure-specific. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable> invokeInfrastructureCommandWithServiceResponseAsync(String command, String serviceId, Long timeout) { + if (command == null) { + throw new IllegalArgumentException("Parameter command is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.invokeInfrastructureCommand(apiVersion, command, serviceId, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = invokeInfrastructureCommandDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse invokeInfrastructureCommandDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Invokes a read-only query on the given infrastructure service instance. + * For clusters that have one or more instances of the Infrastructure Service configured, + this API provides a way to send infrastructure-specific queries to a particular + instance of the Infrastructure Service. + Available commands and their corresponding response formats vary depending upon + the infrastructure on which the cluster is running. + This API supports the Service Fabric platform; it is not meant to be used directly from your code. + * + * @param command The text of the command to be invoked. The content of the command is infrastructure-specific. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the String object if successful. + */ + public String invokeInfrastructureQuery(String command) { + return invokeInfrastructureQueryWithServiceResponseAsync(command).toBlocking().single().body(); + } + + /** + * Invokes a read-only query on the given infrastructure service instance. + * For clusters that have one or more instances of the Infrastructure Service configured, + this API provides a way to send infrastructure-specific queries to a particular + instance of the Infrastructure Service. + Available commands and their corresponding response formats vary depending upon + the infrastructure on which the cluster is running. + This API supports the Service Fabric platform; it is not meant to be used directly from your code. + * + * @param command The text of the command to be invoked. The content of the command is infrastructure-specific. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture invokeInfrastructureQueryAsync(String command, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(invokeInfrastructureQueryWithServiceResponseAsync(command), serviceCallback); + } + + /** + * Invokes a read-only query on the given infrastructure service instance. + * For clusters that have one or more instances of the Infrastructure Service configured, + this API provides a way to send infrastructure-specific queries to a particular + instance of the Infrastructure Service. + Available commands and their corresponding response formats vary depending upon + the infrastructure on which the cluster is running. + This API supports the Service Fabric platform; it is not meant to be used directly from your code. + * + * @param command The text of the command to be invoked. The content of the command is infrastructure-specific. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable invokeInfrastructureQueryAsync(String command) { + return invokeInfrastructureQueryWithServiceResponseAsync(command).map(new Func1, String>() { + @Override + public String call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Invokes a read-only query on the given infrastructure service instance. + * For clusters that have one or more instances of the Infrastructure Service configured, + this API provides a way to send infrastructure-specific queries to a particular + instance of the Infrastructure Service. + Available commands and their corresponding response formats vary depending upon + the infrastructure on which the cluster is running. + This API supports the Service Fabric platform; it is not meant to be used directly from your code. + * + * @param command The text of the command to be invoked. The content of the command is infrastructure-specific. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable> invokeInfrastructureQueryWithServiceResponseAsync(String command) { + if (command == null) { + throw new IllegalArgumentException("Parameter command is required and cannot be null."); + } + final String apiVersion = "6.0"; + final String serviceId = null; + final Long timeout = null; + return service.invokeInfrastructureQuery(apiVersion, command, serviceId, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = invokeInfrastructureQueryDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Invokes a read-only query on the given infrastructure service instance. + * For clusters that have one or more instances of the Infrastructure Service configured, + this API provides a way to send infrastructure-specific queries to a particular + instance of the Infrastructure Service. + Available commands and their corresponding response formats vary depending upon + the infrastructure on which the cluster is running. + This API supports the Service Fabric platform; it is not meant to be used directly from your code. + * + * @param command The text of the command to be invoked. The content of the command is infrastructure-specific. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the String object if successful. + */ + public String invokeInfrastructureQuery(String command, String serviceId, Long timeout) { + return invokeInfrastructureQueryWithServiceResponseAsync(command, serviceId, timeout).toBlocking().single().body(); + } + + /** + * Invokes a read-only query on the given infrastructure service instance. + * For clusters that have one or more instances of the Infrastructure Service configured, + this API provides a way to send infrastructure-specific queries to a particular + instance of the Infrastructure Service. + Available commands and their corresponding response formats vary depending upon + the infrastructure on which the cluster is running. + This API supports the Service Fabric platform; it is not meant to be used directly from your code. + * + * @param command The text of the command to be invoked. The content of the command is infrastructure-specific. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture invokeInfrastructureQueryAsync(String command, String serviceId, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(invokeInfrastructureQueryWithServiceResponseAsync(command, serviceId, timeout), serviceCallback); + } + + /** + * Invokes a read-only query on the given infrastructure service instance. + * For clusters that have one or more instances of the Infrastructure Service configured, + this API provides a way to send infrastructure-specific queries to a particular + instance of the Infrastructure Service. + Available commands and their corresponding response formats vary depending upon + the infrastructure on which the cluster is running. + This API supports the Service Fabric platform; it is not meant to be used directly from your code. + * + * @param command The text of the command to be invoked. The content of the command is infrastructure-specific. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable invokeInfrastructureQueryAsync(String command, String serviceId, Long timeout) { + return invokeInfrastructureQueryWithServiceResponseAsync(command, serviceId, timeout).map(new Func1, String>() { + @Override + public String call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Invokes a read-only query on the given infrastructure service instance. + * For clusters that have one or more instances of the Infrastructure Service configured, + this API provides a way to send infrastructure-specific queries to a particular + instance of the Infrastructure Service. + Available commands and their corresponding response formats vary depending upon + the infrastructure on which the cluster is running. + This API supports the Service Fabric platform; it is not meant to be used directly from your code. + * + * @param command The text of the command to be invoked. The content of the command is infrastructure-specific. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable> invokeInfrastructureQueryWithServiceResponseAsync(String command, String serviceId, Long timeout) { + if (command == null) { + throw new IllegalArgumentException("Parameter command is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.invokeInfrastructureQuery(apiVersion, command, serviceId, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = invokeInfrastructureQueryDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse invokeInfrastructureQueryDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param dataLossMode This enum is passed to the StartDataLoss API to indicate what type of data loss to induce. Possible values include: 'Invalid', 'PartialDataLoss', 'FullDataLoss' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void startDataLoss(String serviceId, UUID partitionId, UUID operationId, DataLossMode dataLossMode) { + startDataLossWithServiceResponseAsync(serviceId, partitionId, operationId, dataLossMode).toBlocking().single().body(); + } + + /** + * 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 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture startDataLossAsync(String serviceId, UUID partitionId, UUID operationId, DataLossMode dataLossMode, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startDataLossWithServiceResponseAsync(serviceId, partitionId, operationId, dataLossMode), serviceCallback); + } + + /** + * 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 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param dataLossMode This enum is passed to the StartDataLoss API to indicate what type of data loss to induce. Possible values include: 'Invalid', 'PartialDataLoss', 'FullDataLoss' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable startDataLossAsync(String serviceId, UUID partitionId, UUID operationId, DataLossMode dataLossMode) { + return startDataLossWithServiceResponseAsync(serviceId, partitionId, operationId, dataLossMode).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param dataLossMode This enum is passed to the StartDataLoss API to indicate what type of data loss to induce. Possible values include: 'Invalid', 'PartialDataLoss', 'FullDataLoss' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> startDataLossWithServiceResponseAsync(String serviceId, UUID partitionId, UUID operationId, DataLossMode dataLossMode) { + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + if (operationId == null) { + throw new IllegalArgumentException("Parameter operationId is required and cannot be null."); + } + if (dataLossMode == null) { + throw new IllegalArgumentException("Parameter dataLossMode is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + return service.startDataLoss(serviceId, partitionId, apiVersion, operationId, dataLossMode, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = startDataLossDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void startDataLoss(String serviceId, UUID partitionId, UUID operationId, DataLossMode dataLossMode, Long timeout) { + startDataLossWithServiceResponseAsync(serviceId, partitionId, operationId, dataLossMode, timeout).toBlocking().single().body(); + } + + /** + * 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 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture startDataLossAsync(String serviceId, UUID partitionId, UUID operationId, DataLossMode dataLossMode, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startDataLossWithServiceResponseAsync(serviceId, partitionId, operationId, dataLossMode, timeout), serviceCallback); + } + + /** + * 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 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable startDataLossAsync(String serviceId, UUID partitionId, UUID operationId, DataLossMode dataLossMode, Long timeout) { + return startDataLossWithServiceResponseAsync(serviceId, partitionId, operationId, dataLossMode, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> startDataLossWithServiceResponseAsync(String serviceId, UUID partitionId, UUID operationId, DataLossMode dataLossMode, Long timeout) { + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + if (operationId == null) { + throw new IllegalArgumentException("Parameter operationId is required and cannot be null."); + } + if (dataLossMode == null) { + throw new IllegalArgumentException("Parameter dataLossMode is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.startDataLoss(serviceId, partitionId, apiVersion, operationId, dataLossMode, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = startDataLossDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse startDataLossDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the progress of a partition data loss operation started using the StartDataLoss API. + * Gets the progress of a data loss operation started with StartDataLoss, using the OperationId. + * + * @param 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PartitionDataLossProgressInner object if successful. + */ + public PartitionDataLossProgressInner getDataLossProgress(String serviceId, UUID partitionId, UUID operationId) { + return getDataLossProgressWithServiceResponseAsync(serviceId, partitionId, operationId).toBlocking().single().body(); + } + + /** + * Gets the progress of a partition data loss operation started using the StartDataLoss API. + * Gets the progress of a data loss operation started with StartDataLoss, using the OperationId. + * + * @param 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getDataLossProgressAsync(String serviceId, UUID partitionId, UUID operationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDataLossProgressWithServiceResponseAsync(serviceId, partitionId, operationId), serviceCallback); + } + + /** + * Gets the progress of a partition data loss operation started using the StartDataLoss API. + * Gets the progress of a data loss operation started with StartDataLoss, using the OperationId. + * + * @param 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PartitionDataLossProgressInner object + */ + public Observable getDataLossProgressAsync(String serviceId, UUID partitionId, UUID operationId) { + return getDataLossProgressWithServiceResponseAsync(serviceId, partitionId, operationId).map(new Func1, PartitionDataLossProgressInner>() { + @Override + public PartitionDataLossProgressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the progress of a partition data loss operation started using the StartDataLoss API. + * Gets the progress of a data loss operation started with StartDataLoss, using the OperationId. + * + * @param 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PartitionDataLossProgressInner object + */ + public Observable> getDataLossProgressWithServiceResponseAsync(String serviceId, UUID partitionId, UUID operationId) { + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + if (operationId == null) { + throw new IllegalArgumentException("Parameter operationId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + return service.getDataLossProgress(serviceId, partitionId, apiVersion, operationId, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDataLossProgressDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the progress of a partition data loss operation started using the StartDataLoss API. + * Gets the progress of a data loss operation started with StartDataLoss, using the OperationId. + * + * @param 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PartitionDataLossProgressInner object if successful. + */ + public PartitionDataLossProgressInner getDataLossProgress(String serviceId, UUID partitionId, UUID operationId, Long timeout) { + return getDataLossProgressWithServiceResponseAsync(serviceId, partitionId, operationId, timeout).toBlocking().single().body(); + } + + /** + * Gets the progress of a partition data loss operation started using the StartDataLoss API. + * Gets the progress of a data loss operation started with StartDataLoss, using the OperationId. + * + * @param 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getDataLossProgressAsync(String serviceId, UUID partitionId, UUID operationId, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDataLossProgressWithServiceResponseAsync(serviceId, partitionId, operationId, timeout), serviceCallback); + } + + /** + * Gets the progress of a partition data loss operation started using the StartDataLoss API. + * Gets the progress of a data loss operation started with StartDataLoss, using the OperationId. + * + * @param 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PartitionDataLossProgressInner object + */ + public Observable getDataLossProgressAsync(String serviceId, UUID partitionId, UUID operationId, Long timeout) { + return getDataLossProgressWithServiceResponseAsync(serviceId, partitionId, operationId, timeout).map(new Func1, PartitionDataLossProgressInner>() { + @Override + public PartitionDataLossProgressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the progress of a partition data loss operation started using the StartDataLoss API. + * Gets the progress of a data loss operation started with StartDataLoss, using the OperationId. + * + * @param 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PartitionDataLossProgressInner object + */ + public Observable> getDataLossProgressWithServiceResponseAsync(String serviceId, UUID partitionId, UUID operationId, Long timeout) { + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + if (operationId == null) { + throw new IllegalArgumentException("Parameter operationId is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.getDataLossProgress(serviceId, partitionId, apiVersion, operationId, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDataLossProgressDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDataLossProgressDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param 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 quorumLossDuration The amount of time for which the partition will be kept in quorum loss. This must be specified in seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void startQuorumLoss(String serviceId, UUID partitionId, UUID operationId, QuorumLossMode quorumLossMode, int quorumLossDuration) { + startQuorumLossWithServiceResponseAsync(serviceId, partitionId, operationId, quorumLossMode, quorumLossDuration).toBlocking().single().body(); + } + + /** + * 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 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param 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 quorumLossDuration The amount of time for which the partition will be kept in quorum loss. This must be specified in seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture startQuorumLossAsync(String serviceId, UUID partitionId, UUID operationId, QuorumLossMode quorumLossMode, int quorumLossDuration, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startQuorumLossWithServiceResponseAsync(serviceId, partitionId, operationId, quorumLossMode, quorumLossDuration), serviceCallback); + } + + /** + * 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 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param 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 quorumLossDuration The amount of time for which the partition will be kept in quorum loss. This must be specified in seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable startQuorumLossAsync(String serviceId, UUID partitionId, UUID operationId, QuorumLossMode quorumLossMode, int quorumLossDuration) { + return startQuorumLossWithServiceResponseAsync(serviceId, partitionId, operationId, quorumLossMode, quorumLossDuration).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param 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 quorumLossDuration The amount of time for which the partition will be kept in quorum loss. This must be specified in seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> startQuorumLossWithServiceResponseAsync(String serviceId, UUID partitionId, UUID operationId, QuorumLossMode quorumLossMode, int quorumLossDuration) { + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + if (operationId == null) { + throw new IllegalArgumentException("Parameter operationId is required and cannot be null."); + } + if (quorumLossMode == null) { + throw new IllegalArgumentException("Parameter quorumLossMode is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + return service.startQuorumLoss(serviceId, partitionId, apiVersion, operationId, quorumLossMode, quorumLossDuration, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = startQuorumLossDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param 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 quorumLossDuration The amount of time for which the partition will be kept in quorum loss. This must be specified in seconds. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void startQuorumLoss(String serviceId, UUID partitionId, UUID operationId, QuorumLossMode quorumLossMode, int quorumLossDuration, Long timeout) { + startQuorumLossWithServiceResponseAsync(serviceId, partitionId, operationId, quorumLossMode, quorumLossDuration, timeout).toBlocking().single().body(); + } + + /** + * 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 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param 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 quorumLossDuration The amount of time for which the partition will be kept in quorum loss. This must be specified in seconds. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture startQuorumLossAsync(String serviceId, UUID partitionId, UUID operationId, QuorumLossMode quorumLossMode, int quorumLossDuration, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startQuorumLossWithServiceResponseAsync(serviceId, partitionId, operationId, quorumLossMode, quorumLossDuration, timeout), serviceCallback); + } + + /** + * 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 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param 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 quorumLossDuration The amount of time for which the partition will be kept in quorum loss. This must be specified in seconds. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable startQuorumLossAsync(String serviceId, UUID partitionId, UUID operationId, QuorumLossMode quorumLossMode, int quorumLossDuration, Long timeout) { + return startQuorumLossWithServiceResponseAsync(serviceId, partitionId, operationId, quorumLossMode, quorumLossDuration, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param 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 quorumLossDuration The amount of time for which the partition will be kept in quorum loss. This must be specified in seconds. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> startQuorumLossWithServiceResponseAsync(String serviceId, UUID partitionId, UUID operationId, QuorumLossMode quorumLossMode, int quorumLossDuration, Long timeout) { + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + if (operationId == null) { + throw new IllegalArgumentException("Parameter operationId is required and cannot be null."); + } + if (quorumLossMode == null) { + throw new IllegalArgumentException("Parameter quorumLossMode is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.startQuorumLoss(serviceId, partitionId, apiVersion, operationId, quorumLossMode, quorumLossDuration, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = startQuorumLossDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse startQuorumLossDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PartitionQuorumLossProgressInner object if successful. + */ + public PartitionQuorumLossProgressInner getQuorumLossProgress(String serviceId, UUID partitionId, UUID operationId) { + return getQuorumLossProgressWithServiceResponseAsync(serviceId, partitionId, operationId).toBlocking().single().body(); + } + + /** + * 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 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getQuorumLossProgressAsync(String serviceId, UUID partitionId, UUID operationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getQuorumLossProgressWithServiceResponseAsync(serviceId, partitionId, operationId), serviceCallback); + } + + /** + * 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 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PartitionQuorumLossProgressInner object + */ + public Observable getQuorumLossProgressAsync(String serviceId, UUID partitionId, UUID operationId) { + return getQuorumLossProgressWithServiceResponseAsync(serviceId, partitionId, operationId).map(new Func1, PartitionQuorumLossProgressInner>() { + @Override + public PartitionQuorumLossProgressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PartitionQuorumLossProgressInner object + */ + public Observable> getQuorumLossProgressWithServiceResponseAsync(String serviceId, UUID partitionId, UUID operationId) { + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + if (operationId == null) { + throw new IllegalArgumentException("Parameter operationId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + return service.getQuorumLossProgress(serviceId, partitionId, apiVersion, operationId, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getQuorumLossProgressDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PartitionQuorumLossProgressInner object if successful. + */ + public PartitionQuorumLossProgressInner getQuorumLossProgress(String serviceId, UUID partitionId, UUID operationId, Long timeout) { + return getQuorumLossProgressWithServiceResponseAsync(serviceId, partitionId, operationId, timeout).toBlocking().single().body(); + } + + /** + * 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 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getQuorumLossProgressAsync(String serviceId, UUID partitionId, UUID operationId, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getQuorumLossProgressWithServiceResponseAsync(serviceId, partitionId, operationId, timeout), serviceCallback); + } + + /** + * 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 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PartitionQuorumLossProgressInner object + */ + public Observable getQuorumLossProgressAsync(String serviceId, UUID partitionId, UUID operationId, Long timeout) { + return getQuorumLossProgressWithServiceResponseAsync(serviceId, partitionId, operationId, timeout).map(new Func1, PartitionQuorumLossProgressInner>() { + @Override + public PartitionQuorumLossProgressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PartitionQuorumLossProgressInner object + */ + public Observable> getQuorumLossProgressWithServiceResponseAsync(String serviceId, UUID partitionId, UUID operationId, Long timeout) { + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + if (operationId == null) { + throw new IllegalArgumentException("Parameter operationId is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.getQuorumLossProgress(serviceId, partitionId, apiVersion, operationId, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getQuorumLossProgressDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getQuorumLossProgressDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param restartPartitionMode Describe which partitions to restart. Possible values include: 'Invalid', 'AllReplicasOrInstances', 'OnlyActiveSecondaries' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void startPartitionRestart(String serviceId, UUID partitionId, UUID operationId, RestartPartitionMode restartPartitionMode) { + startPartitionRestartWithServiceResponseAsync(serviceId, partitionId, operationId, restartPartitionMode).toBlocking().single().body(); + } + + /** + * 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 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param restartPartitionMode Describe which partitions to restart. Possible values include: 'Invalid', 'AllReplicasOrInstances', 'OnlyActiveSecondaries' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture startPartitionRestartAsync(String serviceId, UUID partitionId, UUID operationId, RestartPartitionMode restartPartitionMode, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startPartitionRestartWithServiceResponseAsync(serviceId, partitionId, operationId, restartPartitionMode), serviceCallback); + } + + /** + * 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 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param restartPartitionMode Describe which partitions to restart. Possible values include: 'Invalid', 'AllReplicasOrInstances', 'OnlyActiveSecondaries' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable startPartitionRestartAsync(String serviceId, UUID partitionId, UUID operationId, RestartPartitionMode restartPartitionMode) { + return startPartitionRestartWithServiceResponseAsync(serviceId, partitionId, operationId, restartPartitionMode).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param restartPartitionMode Describe which partitions to restart. Possible values include: 'Invalid', 'AllReplicasOrInstances', 'OnlyActiveSecondaries' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> startPartitionRestartWithServiceResponseAsync(String serviceId, UUID partitionId, UUID operationId, RestartPartitionMode restartPartitionMode) { + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + if (operationId == null) { + throw new IllegalArgumentException("Parameter operationId is required and cannot be null."); + } + if (restartPartitionMode == null) { + throw new IllegalArgumentException("Parameter restartPartitionMode is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + return service.startPartitionRestart(serviceId, partitionId, apiVersion, operationId, restartPartitionMode, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = startPartitionRestartDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param restartPartitionMode Describe which partitions to restart. Possible values include: 'Invalid', 'AllReplicasOrInstances', 'OnlyActiveSecondaries' + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void startPartitionRestart(String serviceId, UUID partitionId, UUID operationId, RestartPartitionMode restartPartitionMode, Long timeout) { + startPartitionRestartWithServiceResponseAsync(serviceId, partitionId, operationId, restartPartitionMode, timeout).toBlocking().single().body(); + } + + /** + * 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 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param restartPartitionMode Describe which partitions to restart. Possible values include: 'Invalid', 'AllReplicasOrInstances', 'OnlyActiveSecondaries' + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture startPartitionRestartAsync(String serviceId, UUID partitionId, UUID operationId, RestartPartitionMode restartPartitionMode, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startPartitionRestartWithServiceResponseAsync(serviceId, partitionId, operationId, restartPartitionMode, timeout), serviceCallback); + } + + /** + * 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 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param restartPartitionMode Describe which partitions to restart. Possible values include: 'Invalid', 'AllReplicasOrInstances', 'OnlyActiveSecondaries' + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable startPartitionRestartAsync(String serviceId, UUID partitionId, UUID operationId, RestartPartitionMode restartPartitionMode, Long timeout) { + return startPartitionRestartWithServiceResponseAsync(serviceId, partitionId, operationId, restartPartitionMode, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param restartPartitionMode Describe which partitions to restart. Possible values include: 'Invalid', 'AllReplicasOrInstances', 'OnlyActiveSecondaries' + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> startPartitionRestartWithServiceResponseAsync(String serviceId, UUID partitionId, UUID operationId, RestartPartitionMode restartPartitionMode, Long timeout) { + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + if (operationId == null) { + throw new IllegalArgumentException("Parameter operationId is required and cannot be null."); + } + if (restartPartitionMode == null) { + throw new IllegalArgumentException("Parameter restartPartitionMode is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.startPartitionRestart(serviceId, partitionId, apiVersion, operationId, restartPartitionMode, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = startPartitionRestartDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse startPartitionRestartDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the progress of a PartitionRestart operation started using StartPartitionRestart. + * Gets the progress of a PartitionRestart started with StartPartitionRestart using the provided OperationId. + * + * @param 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PartitionRestartProgressInner object if successful. + */ + public PartitionRestartProgressInner getPartitionRestartProgress(String serviceId, UUID partitionId, UUID operationId) { + return getPartitionRestartProgressWithServiceResponseAsync(serviceId, partitionId, operationId).toBlocking().single().body(); + } + + /** + * Gets the progress of a PartitionRestart operation started using StartPartitionRestart. + * Gets the progress of a PartitionRestart started with StartPartitionRestart using the provided OperationId. + * + * @param 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getPartitionRestartProgressAsync(String serviceId, UUID partitionId, UUID operationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPartitionRestartProgressWithServiceResponseAsync(serviceId, partitionId, operationId), serviceCallback); + } + + /** + * Gets the progress of a PartitionRestart operation started using StartPartitionRestart. + * Gets the progress of a PartitionRestart started with StartPartitionRestart using the provided OperationId. + * + * @param 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PartitionRestartProgressInner object + */ + public Observable getPartitionRestartProgressAsync(String serviceId, UUID partitionId, UUID operationId) { + return getPartitionRestartProgressWithServiceResponseAsync(serviceId, partitionId, operationId).map(new Func1, PartitionRestartProgressInner>() { + @Override + public PartitionRestartProgressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the progress of a PartitionRestart operation started using StartPartitionRestart. + * Gets the progress of a PartitionRestart started with StartPartitionRestart using the provided OperationId. + * + * @param 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PartitionRestartProgressInner object + */ + public Observable> getPartitionRestartProgressWithServiceResponseAsync(String serviceId, UUID partitionId, UUID operationId) { + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + if (operationId == null) { + throw new IllegalArgumentException("Parameter operationId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + return service.getPartitionRestartProgress(serviceId, partitionId, apiVersion, operationId, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPartitionRestartProgressDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the progress of a PartitionRestart operation started using StartPartitionRestart. + * Gets the progress of a PartitionRestart started with StartPartitionRestart using the provided OperationId. + * + * @param 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PartitionRestartProgressInner object if successful. + */ + public PartitionRestartProgressInner getPartitionRestartProgress(String serviceId, UUID partitionId, UUID operationId, Long timeout) { + return getPartitionRestartProgressWithServiceResponseAsync(serviceId, partitionId, operationId, timeout).toBlocking().single().body(); + } + + /** + * Gets the progress of a PartitionRestart operation started using StartPartitionRestart. + * Gets the progress of a PartitionRestart started with StartPartitionRestart using the provided OperationId. + * + * @param 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getPartitionRestartProgressAsync(String serviceId, UUID partitionId, UUID operationId, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPartitionRestartProgressWithServiceResponseAsync(serviceId, partitionId, operationId, timeout), serviceCallback); + } + + /** + * Gets the progress of a PartitionRestart operation started using StartPartitionRestart. + * Gets the progress of a PartitionRestart started with StartPartitionRestart using the provided OperationId. + * + * @param 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PartitionRestartProgressInner object + */ + public Observable getPartitionRestartProgressAsync(String serviceId, UUID partitionId, UUID operationId, Long timeout) { + return getPartitionRestartProgressWithServiceResponseAsync(serviceId, partitionId, operationId, timeout).map(new Func1, PartitionRestartProgressInner>() { + @Override + public PartitionRestartProgressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the progress of a PartitionRestart operation started using StartPartitionRestart. + * Gets the progress of a PartitionRestart started with StartPartitionRestart using the provided OperationId. + * + * @param 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 partitionId The identity of the partition. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PartitionRestartProgressInner object + */ + public Observable> getPartitionRestartProgressWithServiceResponseAsync(String serviceId, UUID partitionId, UUID operationId, Long timeout) { + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + if (operationId == null) { + throw new IllegalArgumentException("Parameter operationId is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.getPartitionRestartProgress(serviceId, partitionId, apiVersion, operationId, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPartitionRestartProgressDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getPartitionRestartProgressDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Starts or stops a cluster node. + * Starts or stops a cluster node. A cluster node is a process, not the OS instance itself. To start a node, pass in "Start" for the NodeTransitionType parameter. + To stop a node, pass in "Stop" for the NodeTransitionType parameter. This API starts the operation - when the API returns the node may not have finished transitioning yet. + Call GetNodeTransitionProgress with the same OperationId to get the progress of the operation. + * + * @param nodeName The name of the node. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param 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 nodeInstanceId The node instance ID of the target node. This can be determined through GetNodeInfo API. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void startNodeTransition(String nodeName, UUID operationId, NodeTransitionType nodeTransitionType, String nodeInstanceId, int stopDurationInSeconds) { + startNodeTransitionWithServiceResponseAsync(nodeName, operationId, nodeTransitionType, nodeInstanceId, stopDurationInSeconds).toBlocking().single().body(); + } + + /** + * Starts or stops a cluster node. + * Starts or stops a cluster node. A cluster node is a process, not the OS instance itself. To start a node, pass in "Start" for the NodeTransitionType parameter. + To stop a node, pass in "Stop" for the NodeTransitionType parameter. This API starts the operation - when the API returns the node may not have finished transitioning yet. + Call GetNodeTransitionProgress with the same OperationId to get the progress of the operation. + * + * @param nodeName The name of the node. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param 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 nodeInstanceId The node instance ID of the target node. This can be determined through GetNodeInfo API. + * @param 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture startNodeTransitionAsync(String nodeName, UUID operationId, NodeTransitionType nodeTransitionType, String nodeInstanceId, int stopDurationInSeconds, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startNodeTransitionWithServiceResponseAsync(nodeName, operationId, nodeTransitionType, nodeInstanceId, stopDurationInSeconds), serviceCallback); + } + + /** + * Starts or stops a cluster node. + * Starts or stops a cluster node. A cluster node is a process, not the OS instance itself. To start a node, pass in "Start" for the NodeTransitionType parameter. + To stop a node, pass in "Stop" for the NodeTransitionType parameter. This API starts the operation - when the API returns the node may not have finished transitioning yet. + Call GetNodeTransitionProgress with the same OperationId to get the progress of the operation. + * + * @param nodeName The name of the node. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param 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 nodeInstanceId The node instance ID of the target node. This can be determined through GetNodeInfo API. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable startNodeTransitionAsync(String nodeName, UUID operationId, NodeTransitionType nodeTransitionType, String nodeInstanceId, int stopDurationInSeconds) { + return startNodeTransitionWithServiceResponseAsync(nodeName, operationId, nodeTransitionType, nodeInstanceId, stopDurationInSeconds).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Starts or stops a cluster node. + * Starts or stops a cluster node. A cluster node is a process, not the OS instance itself. To start a node, pass in "Start" for the NodeTransitionType parameter. + To stop a node, pass in "Stop" for the NodeTransitionType parameter. This API starts the operation - when the API returns the node may not have finished transitioning yet. + Call GetNodeTransitionProgress with the same OperationId to get the progress of the operation. + * + * @param nodeName The name of the node. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param 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 nodeInstanceId The node instance ID of the target node. This can be determined through GetNodeInfo API. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> startNodeTransitionWithServiceResponseAsync(String nodeName, UUID operationId, NodeTransitionType nodeTransitionType, String nodeInstanceId, int stopDurationInSeconds) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (operationId == null) { + throw new IllegalArgumentException("Parameter operationId is required and cannot be null."); + } + if (nodeTransitionType == null) { + throw new IllegalArgumentException("Parameter nodeTransitionType is required and cannot be null."); + } + if (nodeInstanceId == null) { + throw new IllegalArgumentException("Parameter nodeInstanceId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + return service.startNodeTransition(nodeName, apiVersion, operationId, nodeTransitionType, nodeInstanceId, stopDurationInSeconds, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = startNodeTransitionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Starts or stops a cluster node. + * Starts or stops a cluster node. A cluster node is a process, not the OS instance itself. To start a node, pass in "Start" for the NodeTransitionType parameter. + To stop a node, pass in "Stop" for the NodeTransitionType parameter. This API starts the operation - when the API returns the node may not have finished transitioning yet. + Call GetNodeTransitionProgress with the same OperationId to get the progress of the operation. + * + * @param nodeName The name of the node. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param 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 nodeInstanceId The node instance ID of the target node. This can be determined through GetNodeInfo API. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void startNodeTransition(String nodeName, UUID operationId, NodeTransitionType nodeTransitionType, String nodeInstanceId, int stopDurationInSeconds, Long timeout) { + startNodeTransitionWithServiceResponseAsync(nodeName, operationId, nodeTransitionType, nodeInstanceId, stopDurationInSeconds, timeout).toBlocking().single().body(); + } + + /** + * Starts or stops a cluster node. + * Starts or stops a cluster node. A cluster node is a process, not the OS instance itself. To start a node, pass in "Start" for the NodeTransitionType parameter. + To stop a node, pass in "Stop" for the NodeTransitionType parameter. This API starts the operation - when the API returns the node may not have finished transitioning yet. + Call GetNodeTransitionProgress with the same OperationId to get the progress of the operation. + * + * @param nodeName The name of the node. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param 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 nodeInstanceId The node instance ID of the target node. This can be determined through GetNodeInfo API. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture startNodeTransitionAsync(String nodeName, UUID operationId, NodeTransitionType nodeTransitionType, String nodeInstanceId, int stopDurationInSeconds, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startNodeTransitionWithServiceResponseAsync(nodeName, operationId, nodeTransitionType, nodeInstanceId, stopDurationInSeconds, timeout), serviceCallback); + } + + /** + * Starts or stops a cluster node. + * Starts or stops a cluster node. A cluster node is a process, not the OS instance itself. To start a node, pass in "Start" for the NodeTransitionType parameter. + To stop a node, pass in "Stop" for the NodeTransitionType parameter. This API starts the operation - when the API returns the node may not have finished transitioning yet. + Call GetNodeTransitionProgress with the same OperationId to get the progress of the operation. + * + * @param nodeName The name of the node. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param 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 nodeInstanceId The node instance ID of the target node. This can be determined through GetNodeInfo API. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable startNodeTransitionAsync(String nodeName, UUID operationId, NodeTransitionType nodeTransitionType, String nodeInstanceId, int stopDurationInSeconds, Long timeout) { + return startNodeTransitionWithServiceResponseAsync(nodeName, operationId, nodeTransitionType, nodeInstanceId, stopDurationInSeconds, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Starts or stops a cluster node. + * Starts or stops a cluster node. A cluster node is a process, not the OS instance itself. To start a node, pass in "Start" for the NodeTransitionType parameter. + To stop a node, pass in "Stop" for the NodeTransitionType parameter. This API starts the operation - when the API returns the node may not have finished transitioning yet. + Call GetNodeTransitionProgress with the same OperationId to get the progress of the operation. + * + * @param nodeName The name of the node. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param 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 nodeInstanceId The node instance ID of the target node. This can be determined through GetNodeInfo API. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> startNodeTransitionWithServiceResponseAsync(String nodeName, UUID operationId, NodeTransitionType nodeTransitionType, String nodeInstanceId, int stopDurationInSeconds, Long timeout) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (operationId == null) { + throw new IllegalArgumentException("Parameter operationId is required and cannot be null."); + } + if (nodeTransitionType == null) { + throw new IllegalArgumentException("Parameter nodeTransitionType is required and cannot be null."); + } + if (nodeInstanceId == null) { + throw new IllegalArgumentException("Parameter nodeInstanceId is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.startNodeTransition(nodeName, apiVersion, operationId, nodeTransitionType, nodeInstanceId, stopDurationInSeconds, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = startNodeTransitionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse startNodeTransitionDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the progress of an operation started using StartNodeTransition. + * Gets the progress of an operation started with StartNodeTransition using the provided OperationId. + * + * @param nodeName The name of the node. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NodeTransitionProgressInner object if successful. + */ + public NodeTransitionProgressInner getNodeTransitionProgress(String nodeName, UUID operationId) { + return getNodeTransitionProgressWithServiceResponseAsync(nodeName, operationId).toBlocking().single().body(); + } + + /** + * Gets the progress of an operation started using StartNodeTransition. + * Gets the progress of an operation started with StartNodeTransition using the provided OperationId. + * + * @param nodeName The name of the node. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNodeTransitionProgressAsync(String nodeName, UUID operationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNodeTransitionProgressWithServiceResponseAsync(nodeName, operationId), serviceCallback); + } + + /** + * Gets the progress of an operation started using StartNodeTransition. + * Gets the progress of an operation started with StartNodeTransition using the provided OperationId. + * + * @param nodeName The name of the node. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NodeTransitionProgressInner object + */ + public Observable getNodeTransitionProgressAsync(String nodeName, UUID operationId) { + return getNodeTransitionProgressWithServiceResponseAsync(nodeName, operationId).map(new Func1, NodeTransitionProgressInner>() { + @Override + public NodeTransitionProgressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the progress of an operation started using StartNodeTransition. + * Gets the progress of an operation started with StartNodeTransition using the provided OperationId. + * + * @param nodeName The name of the node. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NodeTransitionProgressInner object + */ + public Observable> getNodeTransitionProgressWithServiceResponseAsync(String nodeName, UUID operationId) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (operationId == null) { + throw new IllegalArgumentException("Parameter operationId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + return service.getNodeTransitionProgress(nodeName, apiVersion, operationId, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getNodeTransitionProgressDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the progress of an operation started using StartNodeTransition. + * Gets the progress of an operation started with StartNodeTransition using the provided OperationId. + * + * @param nodeName The name of the node. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NodeTransitionProgressInner object if successful. + */ + public NodeTransitionProgressInner getNodeTransitionProgress(String nodeName, UUID operationId, Long timeout) { + return getNodeTransitionProgressWithServiceResponseAsync(nodeName, operationId, timeout).toBlocking().single().body(); + } + + /** + * Gets the progress of an operation started using StartNodeTransition. + * Gets the progress of an operation started with StartNodeTransition using the provided OperationId. + * + * @param nodeName The name of the node. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNodeTransitionProgressAsync(String nodeName, UUID operationId, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNodeTransitionProgressWithServiceResponseAsync(nodeName, operationId, timeout), serviceCallback); + } + + /** + * Gets the progress of an operation started using StartNodeTransition. + * Gets the progress of an operation started with StartNodeTransition using the provided OperationId. + * + * @param nodeName The name of the node. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NodeTransitionProgressInner object + */ + public Observable getNodeTransitionProgressAsync(String nodeName, UUID operationId, Long timeout) { + return getNodeTransitionProgressWithServiceResponseAsync(nodeName, operationId, timeout).map(new Func1, NodeTransitionProgressInner>() { + @Override + public NodeTransitionProgressInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the progress of an operation started using StartNodeTransition. + * Gets the progress of an operation started with StartNodeTransition using the provided OperationId. + * + * @param nodeName The name of the node. + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NodeTransitionProgressInner object + */ + public Observable> getNodeTransitionProgressWithServiceResponseAsync(String nodeName, UUID operationId, Long timeout) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (operationId == null) { + throw new IllegalArgumentException("Parameter operationId is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.getNodeTransitionProgress(nodeName, apiVersion, operationId, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getNodeTransitionProgressDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getNodeTransitionProgressDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets a list of user-induced fault operations filtered by provided input. + * Gets the a list of user-induced fault operations filtered by provided input. + * + * @param 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 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 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<OperationStatusInner> object if successful. + */ + public List getFaultOperationList(int typeFilter, int stateFilter) { + return getFaultOperationListWithServiceResponseAsync(typeFilter, stateFilter).toBlocking().single().body(); + } + + /** + * Gets a list of user-induced fault operations filtered by provided input. + * Gets the a list of user-induced fault operations filtered by provided input. + * + * @param 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 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getFaultOperationListAsync(int typeFilter, int stateFilter, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getFaultOperationListWithServiceResponseAsync(typeFilter, stateFilter), serviceCallback); + } + + /** + * Gets a list of user-induced fault operations filtered by provided input. + * Gets the a list of user-induced fault operations filtered by provided input. + * + * @param 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 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 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<OperationStatusInner> object + */ + public Observable> getFaultOperationListAsync(int typeFilter, int stateFilter) { + return getFaultOperationListWithServiceResponseAsync(typeFilter, stateFilter).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of user-induced fault operations filtered by provided input. + * Gets the a list of user-induced fault operations filtered by provided input. + * + * @param 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 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 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<OperationStatusInner> object + */ + public Observable>> getFaultOperationListWithServiceResponseAsync(int typeFilter, int stateFilter) { + final String apiVersion = "6.0"; + final Long timeout = null; + return service.getFaultOperationList(apiVersion, typeFilter, stateFilter, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getFaultOperationListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets a list of user-induced fault operations filtered by provided input. + * Gets the a list of user-induced fault operations filtered by provided input. + * + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<OperationStatusInner> object if successful. + */ + public List getFaultOperationList(int typeFilter, int stateFilter, Long timeout) { + return getFaultOperationListWithServiceResponseAsync(typeFilter, stateFilter, timeout).toBlocking().single().body(); + } + + /** + * Gets a list of user-induced fault operations filtered by provided input. + * Gets the a list of user-induced fault operations filtered by provided input. + * + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getFaultOperationListAsync(int typeFilter, int stateFilter, Long timeout, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getFaultOperationListWithServiceResponseAsync(typeFilter, stateFilter, timeout), serviceCallback); + } + + /** + * Gets a list of user-induced fault operations filtered by provided input. + * Gets the a list of user-induced fault operations filtered by provided input. + * + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<OperationStatusInner> object + */ + public Observable> getFaultOperationListAsync(int typeFilter, int stateFilter, Long timeout) { + return getFaultOperationListWithServiceResponseAsync(typeFilter, stateFilter, timeout).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of user-induced fault operations filtered by provided input. + * Gets the a list of user-induced fault operations filtered by provided input. + * + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<OperationStatusInner> object + */ + public Observable>> getFaultOperationListWithServiceResponseAsync(int typeFilter, int stateFilter, Long timeout) { + final String apiVersion = "6.0"; + return service.getFaultOperationList(apiVersion, typeFilter, stateFilter, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getFaultOperationListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getFaultOperationListDelegate(Response response) throws FabricErrorException, IOException { + return this.restClient().responseBuilderFactory()., FabricErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Cancels a user-induced fault operation. + * The following APIs start fault operations that may be cancelled by using CancelOperation: StartDataLoss, StartQuorumLoss, StartPartitionRestart, StartNodeTransition. + If force is false, then the specified user-induced operation will be gracefully stopped and cleaned up. If force is true, the command will be aborted, and some internal state + may be left behind. Specifying force as true should be used with care. Calling this API with force set to true is not allowed until this API has already + been called on the same test command with force set to false first, or unless the test command already has an OperationState of OperationState.RollingBack. + Clarification: OperationState.RollingBack means that the system will be/is cleaning up internal system state caused by executing the command. It will not restore data if the + test command was to cause data loss. For example, if you call StartDataLoss then call this API, the system will only clean up internal state from running the command. + It will not restore the target partition's data, if the command progressed far enough to cause data loss. + Important note: if this API is invoked with force==true, internal state may be left behind. + * + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param force Indicates whether to gracefully rollback and clean up internal system state modified by executing the user-induced operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void cancelOperation(UUID operationId, boolean force) { + cancelOperationWithServiceResponseAsync(operationId, force).toBlocking().single().body(); + } + + /** + * Cancels a user-induced fault operation. + * The following APIs start fault operations that may be cancelled by using CancelOperation: StartDataLoss, StartQuorumLoss, StartPartitionRestart, StartNodeTransition. + If force is false, then the specified user-induced operation will be gracefully stopped and cleaned up. If force is true, the command will be aborted, and some internal state + may be left behind. Specifying force as true should be used with care. Calling this API with force set to true is not allowed until this API has already + been called on the same test command with force set to false first, or unless the test command already has an OperationState of OperationState.RollingBack. + Clarification: OperationState.RollingBack means that the system will be/is cleaning up internal system state caused by executing the command. It will not restore data if the + test command was to cause data loss. For example, if you call StartDataLoss then call this API, the system will only clean up internal state from running the command. + It will not restore the target partition's data, if the command progressed far enough to cause data loss. + Important note: if this API is invoked with force==true, internal state may be left behind. + * + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param force Indicates whether to gracefully rollback and clean up internal system state modified by executing the user-induced operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture cancelOperationAsync(UUID operationId, boolean force, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(cancelOperationWithServiceResponseAsync(operationId, force), serviceCallback); + } + + /** + * Cancels a user-induced fault operation. + * The following APIs start fault operations that may be cancelled by using CancelOperation: StartDataLoss, StartQuorumLoss, StartPartitionRestart, StartNodeTransition. + If force is false, then the specified user-induced operation will be gracefully stopped and cleaned up. If force is true, the command will be aborted, and some internal state + may be left behind. Specifying force as true should be used with care. Calling this API with force set to true is not allowed until this API has already + been called on the same test command with force set to false first, or unless the test command already has an OperationState of OperationState.RollingBack. + Clarification: OperationState.RollingBack means that the system will be/is cleaning up internal system state caused by executing the command. It will not restore data if the + test command was to cause data loss. For example, if you call StartDataLoss then call this API, the system will only clean up internal state from running the command. + It will not restore the target partition's data, if the command progressed far enough to cause data loss. + Important note: if this API is invoked with force==true, internal state may be left behind. + * + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param force Indicates whether to gracefully rollback and clean up internal system state modified by executing the user-induced operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable cancelOperationAsync(UUID operationId, boolean force) { + return cancelOperationWithServiceResponseAsync(operationId, force).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Cancels a user-induced fault operation. + * The following APIs start fault operations that may be cancelled by using CancelOperation: StartDataLoss, StartQuorumLoss, StartPartitionRestart, StartNodeTransition. + If force is false, then the specified user-induced operation will be gracefully stopped and cleaned up. If force is true, the command will be aborted, and some internal state + may be left behind. Specifying force as true should be used with care. Calling this API with force set to true is not allowed until this API has already + been called on the same test command with force set to false first, or unless the test command already has an OperationState of OperationState.RollingBack. + Clarification: OperationState.RollingBack means that the system will be/is cleaning up internal system state caused by executing the command. It will not restore data if the + test command was to cause data loss. For example, if you call StartDataLoss then call this API, the system will only clean up internal state from running the command. + It will not restore the target partition's data, if the command progressed far enough to cause data loss. + Important note: if this API is invoked with force==true, internal state may be left behind. + * + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param force Indicates whether to gracefully rollback and clean up internal system state modified by executing the user-induced operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> cancelOperationWithServiceResponseAsync(UUID operationId, boolean force) { + if (operationId == null) { + throw new IllegalArgumentException("Parameter operationId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + return service.cancelOperation(apiVersion, operationId, force, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = cancelOperationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Cancels a user-induced fault operation. + * The following APIs start fault operations that may be cancelled by using CancelOperation: StartDataLoss, StartQuorumLoss, StartPartitionRestart, StartNodeTransition. + If force is false, then the specified user-induced operation will be gracefully stopped and cleaned up. If force is true, the command will be aborted, and some internal state + may be left behind. Specifying force as true should be used with care. Calling this API with force set to true is not allowed until this API has already + been called on the same test command with force set to false first, or unless the test command already has an OperationState of OperationState.RollingBack. + Clarification: OperationState.RollingBack means that the system will be/is cleaning up internal system state caused by executing the command. It will not restore data if the + test command was to cause data loss. For example, if you call StartDataLoss then call this API, the system will only clean up internal state from running the command. + It will not restore the target partition's data, if the command progressed far enough to cause data loss. + Important note: if this API is invoked with force==true, internal state may be left behind. + * + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param force Indicates whether to gracefully rollback and clean up internal system state modified by executing the user-induced operation. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void cancelOperation(UUID operationId, boolean force, Long timeout) { + cancelOperationWithServiceResponseAsync(operationId, force, timeout).toBlocking().single().body(); + } + + /** + * Cancels a user-induced fault operation. + * The following APIs start fault operations that may be cancelled by using CancelOperation: StartDataLoss, StartQuorumLoss, StartPartitionRestart, StartNodeTransition. + If force is false, then the specified user-induced operation will be gracefully stopped and cleaned up. If force is true, the command will be aborted, and some internal state + may be left behind. Specifying force as true should be used with care. Calling this API with force set to true is not allowed until this API has already + been called on the same test command with force set to false first, or unless the test command already has an OperationState of OperationState.RollingBack. + Clarification: OperationState.RollingBack means that the system will be/is cleaning up internal system state caused by executing the command. It will not restore data if the + test command was to cause data loss. For example, if you call StartDataLoss then call this API, the system will only clean up internal state from running the command. + It will not restore the target partition's data, if the command progressed far enough to cause data loss. + Important note: if this API is invoked with force==true, internal state may be left behind. + * + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param force Indicates whether to gracefully rollback and clean up internal system state modified by executing the user-induced operation. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture cancelOperationAsync(UUID operationId, boolean force, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(cancelOperationWithServiceResponseAsync(operationId, force, timeout), serviceCallback); + } + + /** + * Cancels a user-induced fault operation. + * The following APIs start fault operations that may be cancelled by using CancelOperation: StartDataLoss, StartQuorumLoss, StartPartitionRestart, StartNodeTransition. + If force is false, then the specified user-induced operation will be gracefully stopped and cleaned up. If force is true, the command will be aborted, and some internal state + may be left behind. Specifying force as true should be used with care. Calling this API with force set to true is not allowed until this API has already + been called on the same test command with force set to false first, or unless the test command already has an OperationState of OperationState.RollingBack. + Clarification: OperationState.RollingBack means that the system will be/is cleaning up internal system state caused by executing the command. It will not restore data if the + test command was to cause data loss. For example, if you call StartDataLoss then call this API, the system will only clean up internal state from running the command. + It will not restore the target partition's data, if the command progressed far enough to cause data loss. + Important note: if this API is invoked with force==true, internal state may be left behind. + * + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param force Indicates whether to gracefully rollback and clean up internal system state modified by executing the user-induced operation. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable cancelOperationAsync(UUID operationId, boolean force, Long timeout) { + return cancelOperationWithServiceResponseAsync(operationId, force, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Cancels a user-induced fault operation. + * The following APIs start fault operations that may be cancelled by using CancelOperation: StartDataLoss, StartQuorumLoss, StartPartitionRestart, StartNodeTransition. + If force is false, then the specified user-induced operation will be gracefully stopped and cleaned up. If force is true, the command will be aborted, and some internal state + may be left behind. Specifying force as true should be used with care. Calling this API with force set to true is not allowed until this API has already + been called on the same test command with force set to false first, or unless the test command already has an OperationState of OperationState.RollingBack. + Clarification: OperationState.RollingBack means that the system will be/is cleaning up internal system state caused by executing the command. It will not restore data if the + test command was to cause data loss. For example, if you call StartDataLoss then call this API, the system will only clean up internal state from running the command. + It will not restore the target partition's data, if the command progressed far enough to cause data loss. + Important note: if this API is invoked with force==true, internal state may be left behind. + * + * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API + * @param force Indicates whether to gracefully rollback and clean up internal system state modified by executing the user-induced operation. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> cancelOperationWithServiceResponseAsync(UUID operationId, boolean force, Long timeout) { + if (operationId == null) { + throw new IllegalArgumentException("Parameter operationId is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.cancelOperation(apiVersion, operationId, force, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = cancelOperationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse cancelOperationDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 backupPolicyDescription Describes the backup policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void createBackupPolicy(BackupPolicyDescriptionInner backupPolicyDescription) { + createBackupPolicyWithServiceResponseAsync(backupPolicyDescription).toBlocking().single().body(); + } + + /** + * 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 backupPolicyDescription Describes the backup policy. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createBackupPolicyAsync(BackupPolicyDescriptionInner backupPolicyDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createBackupPolicyWithServiceResponseAsync(backupPolicyDescription), serviceCallback); + } + + /** + * 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 backupPolicyDescription Describes the backup policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable createBackupPolicyAsync(BackupPolicyDescriptionInner backupPolicyDescription) { + return createBackupPolicyWithServiceResponseAsync(backupPolicyDescription).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 backupPolicyDescription Describes the backup policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> createBackupPolicyWithServiceResponseAsync(BackupPolicyDescriptionInner backupPolicyDescription) { + if (backupPolicyDescription == null) { + throw new IllegalArgumentException("Parameter backupPolicyDescription is required and cannot be null."); + } + Validator.validate(backupPolicyDescription); + final String apiVersion = "6.2-preview"; + final Long timeout = null; + return service.createBackupPolicy(backupPolicyDescription, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createBackupPolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 backupPolicyDescription Describes the backup policy. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void createBackupPolicy(BackupPolicyDescriptionInner backupPolicyDescription, Long timeout) { + createBackupPolicyWithServiceResponseAsync(backupPolicyDescription, timeout).toBlocking().single().body(); + } + + /** + * 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 backupPolicyDescription Describes the backup policy. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createBackupPolicyAsync(BackupPolicyDescriptionInner backupPolicyDescription, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createBackupPolicyWithServiceResponseAsync(backupPolicyDescription, timeout), serviceCallback); + } + + /** + * 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 backupPolicyDescription Describes the backup policy. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable createBackupPolicyAsync(BackupPolicyDescriptionInner backupPolicyDescription, Long timeout) { + return createBackupPolicyWithServiceResponseAsync(backupPolicyDescription, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 backupPolicyDescription Describes the backup policy. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> createBackupPolicyWithServiceResponseAsync(BackupPolicyDescriptionInner backupPolicyDescription, Long timeout) { + if (backupPolicyDescription == null) { + throw new IllegalArgumentException("Parameter backupPolicyDescription is required and cannot be null."); + } + Validator.validate(backupPolicyDescription); + final String apiVersion = "6.2-preview"; + return service.createBackupPolicy(backupPolicyDescription, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createBackupPolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createBackupPolicyDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Deletes the backup policy. + * Deletes an existing backup policy. A backup policy must be created before it can be deleted. A currently active backup policy, associated with any Service Fabric application, service or partition, cannot be deleted without first deleting the mapping. + * + * @param backupPolicyName The name of the backup policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteBackupPolicy(String backupPolicyName) { + deleteBackupPolicyWithServiceResponseAsync(backupPolicyName).toBlocking().single().body(); + } + + /** + * Deletes the backup policy. + * Deletes an existing backup policy. A backup policy must be created before it can be deleted. A currently active backup policy, associated with any Service Fabric application, service or partition, cannot be deleted without first deleting the mapping. + * + * @param backupPolicyName The name of the backup policy. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteBackupPolicyAsync(String backupPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteBackupPolicyWithServiceResponseAsync(backupPolicyName), serviceCallback); + } + + /** + * Deletes the backup policy. + * Deletes an existing backup policy. A backup policy must be created before it can be deleted. A currently active backup policy, associated with any Service Fabric application, service or partition, cannot be deleted without first deleting the mapping. + * + * @param backupPolicyName The name of the backup policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteBackupPolicyAsync(String backupPolicyName) { + return deleteBackupPolicyWithServiceResponseAsync(backupPolicyName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the backup policy. + * Deletes an existing backup policy. A backup policy must be created before it can be deleted. A currently active backup policy, associated with any Service Fabric application, service or partition, cannot be deleted without first deleting the mapping. + * + * @param backupPolicyName The name of the backup policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteBackupPolicyWithServiceResponseAsync(String backupPolicyName) { + if (backupPolicyName == null) { + throw new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + final Long timeout = null; + return service.deleteBackupPolicy(backupPolicyName, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteBackupPolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Deletes the backup policy. + * Deletes an existing backup policy. A backup policy must be created before it can be deleted. A currently active backup policy, associated with any Service Fabric application, service or partition, cannot be deleted without first deleting the mapping. + * + * @param backupPolicyName The name of the backup policy. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteBackupPolicy(String backupPolicyName, Long timeout) { + deleteBackupPolicyWithServiceResponseAsync(backupPolicyName, timeout).toBlocking().single().body(); + } + + /** + * Deletes the backup policy. + * Deletes an existing backup policy. A backup policy must be created before it can be deleted. A currently active backup policy, associated with any Service Fabric application, service or partition, cannot be deleted without first deleting the mapping. + * + * @param backupPolicyName The name of the backup policy. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteBackupPolicyAsync(String backupPolicyName, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteBackupPolicyWithServiceResponseAsync(backupPolicyName, timeout), serviceCallback); + } + + /** + * Deletes the backup policy. + * Deletes an existing backup policy. A backup policy must be created before it can be deleted. A currently active backup policy, associated with any Service Fabric application, service or partition, cannot be deleted without first deleting the mapping. + * + * @param backupPolicyName The name of the backup policy. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteBackupPolicyAsync(String backupPolicyName, Long timeout) { + return deleteBackupPolicyWithServiceResponseAsync(backupPolicyName, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the backup policy. + * Deletes an existing backup policy. A backup policy must be created before it can be deleted. A currently active backup policy, associated with any Service Fabric application, service or partition, cannot be deleted without first deleting the mapping. + * + * @param backupPolicyName The name of the backup policy. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteBackupPolicyWithServiceResponseAsync(String backupPolicyName, Long timeout) { + if (backupPolicyName == null) { + throw new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + return service.deleteBackupPolicy(backupPolicyName, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteBackupPolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteBackupPolicyDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets all the backup policies configured. + * Get a list of all the backup policies configured. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedBackupPolicyDescriptionListInner object if successful. + */ + public PagedBackupPolicyDescriptionListInner getBackupPolicyList() { + return getBackupPolicyListWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Gets all the backup policies configured. + * Get a list of all the backup policies configured. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getBackupPolicyListAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getBackupPolicyListWithServiceResponseAsync(), serviceCallback); + } + + /** + * Gets all the backup policies configured. + * Get a list of all the backup policies configured. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedBackupPolicyDescriptionListInner object + */ + public Observable getBackupPolicyListAsync() { + return getBackupPolicyListWithServiceResponseAsync().map(new Func1, PagedBackupPolicyDescriptionListInner>() { + @Override + public PagedBackupPolicyDescriptionListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets all the backup policies configured. + * Get a list of all the backup policies configured. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedBackupPolicyDescriptionListInner object + */ + public Observable> getBackupPolicyListWithServiceResponseAsync() { + final String apiVersion = "6.2-preview"; + final String continuationToken = null; + final Long maxResults = null; + final Long timeout = null; + return service.getBackupPolicyList(apiVersion, continuationToken, maxResults, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getBackupPolicyListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets all the backup policies configured. + * Get a list of all the backup policies configured. + * + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedBackupPolicyDescriptionListInner object if successful. + */ + public PagedBackupPolicyDescriptionListInner getBackupPolicyList(String continuationToken, Long maxResults, Long timeout) { + return getBackupPolicyListWithServiceResponseAsync(continuationToken, maxResults, timeout).toBlocking().single().body(); + } + + /** + * Gets all the backup policies configured. + * Get a list of all the backup policies configured. + * + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getBackupPolicyListAsync(String continuationToken, Long maxResults, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getBackupPolicyListWithServiceResponseAsync(continuationToken, maxResults, timeout), serviceCallback); + } + + /** + * Gets all the backup policies configured. + * Get a list of all the backup policies configured. + * + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedBackupPolicyDescriptionListInner object + */ + public Observable getBackupPolicyListAsync(String continuationToken, Long maxResults, Long timeout) { + return getBackupPolicyListWithServiceResponseAsync(continuationToken, maxResults, timeout).map(new Func1, PagedBackupPolicyDescriptionListInner>() { + @Override + public PagedBackupPolicyDescriptionListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets all the backup policies configured. + * Get a list of all the backup policies configured. + * + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedBackupPolicyDescriptionListInner object + */ + public Observable> getBackupPolicyListWithServiceResponseAsync(String continuationToken, Long maxResults, Long timeout) { + final String apiVersion = "6.2-preview"; + return service.getBackupPolicyList(apiVersion, continuationToken, maxResults, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getBackupPolicyListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getBackupPolicyListDelegate(Response response) throws FabricErrorException, IOException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets a particular backup policy by name. + * Gets a particular backup policy identified by {backupPolicyName}. + * + * @param backupPolicyName The name of the backup policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BackupPolicyDescriptionInner object if successful. + */ + public BackupPolicyDescriptionInner getBackupPolicyByName(String backupPolicyName) { + return getBackupPolicyByNameWithServiceResponseAsync(backupPolicyName).toBlocking().single().body(); + } + + /** + * Gets a particular backup policy by name. + * Gets a particular backup policy identified by {backupPolicyName}. + * + * @param backupPolicyName The name of the backup policy. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getBackupPolicyByNameAsync(String backupPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getBackupPolicyByNameWithServiceResponseAsync(backupPolicyName), serviceCallback); + } + + /** + * Gets a particular backup policy by name. + * Gets a particular backup policy identified by {backupPolicyName}. + * + * @param backupPolicyName The name of the backup policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupPolicyDescriptionInner object + */ + public Observable getBackupPolicyByNameAsync(String backupPolicyName) { + return getBackupPolicyByNameWithServiceResponseAsync(backupPolicyName).map(new Func1, BackupPolicyDescriptionInner>() { + @Override + public BackupPolicyDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a particular backup policy by name. + * Gets a particular backup policy identified by {backupPolicyName}. + * + * @param backupPolicyName The name of the backup policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupPolicyDescriptionInner object + */ + public Observable> getBackupPolicyByNameWithServiceResponseAsync(String backupPolicyName) { + if (backupPolicyName == null) { + throw new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + final Long timeout = null; + return service.getBackupPolicyByName(backupPolicyName, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getBackupPolicyByNameDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets a particular backup policy by name. + * Gets a particular backup policy identified by {backupPolicyName}. + * + * @param backupPolicyName The name of the backup policy. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BackupPolicyDescriptionInner object if successful. + */ + public BackupPolicyDescriptionInner getBackupPolicyByName(String backupPolicyName, Long timeout) { + return getBackupPolicyByNameWithServiceResponseAsync(backupPolicyName, timeout).toBlocking().single().body(); + } + + /** + * Gets a particular backup policy by name. + * Gets a particular backup policy identified by {backupPolicyName}. + * + * @param backupPolicyName The name of the backup policy. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getBackupPolicyByNameAsync(String backupPolicyName, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getBackupPolicyByNameWithServiceResponseAsync(backupPolicyName, timeout), serviceCallback); + } + + /** + * Gets a particular backup policy by name. + * Gets a particular backup policy identified by {backupPolicyName}. + * + * @param backupPolicyName The name of the backup policy. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupPolicyDescriptionInner object + */ + public Observable getBackupPolicyByNameAsync(String backupPolicyName, Long timeout) { + return getBackupPolicyByNameWithServiceResponseAsync(backupPolicyName, timeout).map(new Func1, BackupPolicyDescriptionInner>() { + @Override + public BackupPolicyDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a particular backup policy by name. + * Gets a particular backup policy identified by {backupPolicyName}. + * + * @param backupPolicyName The name of the backup policy. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupPolicyDescriptionInner object + */ + public Observable> getBackupPolicyByNameWithServiceResponseAsync(String backupPolicyName, Long timeout) { + if (backupPolicyName == null) { + throw new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + return service.getBackupPolicyByName(backupPolicyName, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getBackupPolicyByNameDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getBackupPolicyByNameDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the list of backup entities that are associated with this policy. + * Returns a list of Service Fabric application, service or partition which are associated with this backup policy. + * + * @param backupPolicyName The name of the backup policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedBackupEntityListInner object if successful. + */ + public PagedBackupEntityListInner getAllEntitiesBackedUpByPolicy(String backupPolicyName) { + return getAllEntitiesBackedUpByPolicyWithServiceResponseAsync(backupPolicyName).toBlocking().single().body(); + } + + /** + * Gets the list of backup entities that are associated with this policy. + * Returns a list of Service Fabric application, service or partition which are associated with this backup policy. + * + * @param backupPolicyName The name of the backup policy. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAllEntitiesBackedUpByPolicyAsync(String backupPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getAllEntitiesBackedUpByPolicyWithServiceResponseAsync(backupPolicyName), serviceCallback); + } + + /** + * Gets the list of backup entities that are associated with this policy. + * Returns a list of Service Fabric application, service or partition which are associated with this backup policy. + * + * @param backupPolicyName The name of the backup policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedBackupEntityListInner object + */ + public Observable getAllEntitiesBackedUpByPolicyAsync(String backupPolicyName) { + return getAllEntitiesBackedUpByPolicyWithServiceResponseAsync(backupPolicyName).map(new Func1, PagedBackupEntityListInner>() { + @Override + public PagedBackupEntityListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the list of backup entities that are associated with this policy. + * Returns a list of Service Fabric application, service or partition which are associated with this backup policy. + * + * @param backupPolicyName The name of the backup policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedBackupEntityListInner object + */ + public Observable> getAllEntitiesBackedUpByPolicyWithServiceResponseAsync(String backupPolicyName) { + if (backupPolicyName == null) { + throw new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + final String continuationToken = null; + final Long maxResults = null; + final Long timeout = null; + return service.getAllEntitiesBackedUpByPolicy(backupPolicyName, apiVersion, continuationToken, maxResults, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getAllEntitiesBackedUpByPolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the list of backup entities that are associated with this policy. + * Returns a list of Service Fabric application, service or partition which are associated with this backup policy. + * + * @param backupPolicyName The name of the backup policy. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedBackupEntityListInner object if successful. + */ + public PagedBackupEntityListInner getAllEntitiesBackedUpByPolicy(String backupPolicyName, String continuationToken, Long maxResults, Long timeout) { + return getAllEntitiesBackedUpByPolicyWithServiceResponseAsync(backupPolicyName, continuationToken, maxResults, timeout).toBlocking().single().body(); + } + + /** + * Gets the list of backup entities that are associated with this policy. + * Returns a list of Service Fabric application, service or partition which are associated with this backup policy. + * + * @param backupPolicyName The name of the backup policy. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAllEntitiesBackedUpByPolicyAsync(String backupPolicyName, String continuationToken, Long maxResults, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getAllEntitiesBackedUpByPolicyWithServiceResponseAsync(backupPolicyName, continuationToken, maxResults, timeout), serviceCallback); + } + + /** + * Gets the list of backup entities that are associated with this policy. + * Returns a list of Service Fabric application, service or partition which are associated with this backup policy. + * + * @param backupPolicyName The name of the backup policy. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedBackupEntityListInner object + */ + public Observable getAllEntitiesBackedUpByPolicyAsync(String backupPolicyName, String continuationToken, Long maxResults, Long timeout) { + return getAllEntitiesBackedUpByPolicyWithServiceResponseAsync(backupPolicyName, continuationToken, maxResults, timeout).map(new Func1, PagedBackupEntityListInner>() { + @Override + public PagedBackupEntityListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the list of backup entities that are associated with this policy. + * Returns a list of Service Fabric application, service or partition which are associated with this backup policy. + * + * @param backupPolicyName The name of the backup policy. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedBackupEntityListInner object + */ + public Observable> getAllEntitiesBackedUpByPolicyWithServiceResponseAsync(String backupPolicyName, String continuationToken, Long maxResults, Long timeout) { + if (backupPolicyName == null) { + throw new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + return service.getAllEntitiesBackedUpByPolicy(backupPolicyName, apiVersion, continuationToken, maxResults, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getAllEntitiesBackedUpByPolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getAllEntitiesBackedUpByPolicyDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Updates the backup policy. + * Updates the backup policy identified by {backupPolicyName}. + * + * @param backupPolicyName The name of the backup policy. + * @param backupPolicyDescription Describes the backup policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void updateBackupPolicy(String backupPolicyName, BackupPolicyDescriptionInner backupPolicyDescription) { + updateBackupPolicyWithServiceResponseAsync(backupPolicyName, backupPolicyDescription).toBlocking().single().body(); + } + + /** + * Updates the backup policy. + * Updates the backup policy identified by {backupPolicyName}. + * + * @param backupPolicyName The name of the backup policy. + * @param backupPolicyDescription Describes the backup policy. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateBackupPolicyAsync(String backupPolicyName, BackupPolicyDescriptionInner backupPolicyDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateBackupPolicyWithServiceResponseAsync(backupPolicyName, backupPolicyDescription), serviceCallback); + } + + /** + * Updates the backup policy. + * Updates the backup policy identified by {backupPolicyName}. + * + * @param backupPolicyName The name of the backup policy. + * @param backupPolicyDescription Describes the backup policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable updateBackupPolicyAsync(String backupPolicyName, BackupPolicyDescriptionInner backupPolicyDescription) { + return updateBackupPolicyWithServiceResponseAsync(backupPolicyName, backupPolicyDescription).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the backup policy. + * Updates the backup policy identified by {backupPolicyName}. + * + * @param backupPolicyName The name of the backup policy. + * @param backupPolicyDescription Describes the backup policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> updateBackupPolicyWithServiceResponseAsync(String backupPolicyName, BackupPolicyDescriptionInner backupPolicyDescription) { + if (backupPolicyName == null) { + throw new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null."); + } + if (backupPolicyDescription == null) { + throw new IllegalArgumentException("Parameter backupPolicyDescription is required and cannot be null."); + } + Validator.validate(backupPolicyDescription); + final String apiVersion = "6.2-preview"; + final Long timeout = null; + return service.updateBackupPolicy(backupPolicyName, backupPolicyDescription, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateBackupPolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates the backup policy. + * Updates the backup policy identified by {backupPolicyName}. + * + * @param backupPolicyName The name of the backup policy. + * @param backupPolicyDescription Describes the backup policy. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void updateBackupPolicy(String backupPolicyName, BackupPolicyDescriptionInner backupPolicyDescription, Long timeout) { + updateBackupPolicyWithServiceResponseAsync(backupPolicyName, backupPolicyDescription, timeout).toBlocking().single().body(); + } + + /** + * Updates the backup policy. + * Updates the backup policy identified by {backupPolicyName}. + * + * @param backupPolicyName The name of the backup policy. + * @param backupPolicyDescription Describes the backup policy. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateBackupPolicyAsync(String backupPolicyName, BackupPolicyDescriptionInner backupPolicyDescription, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateBackupPolicyWithServiceResponseAsync(backupPolicyName, backupPolicyDescription, timeout), serviceCallback); + } + + /** + * Updates the backup policy. + * Updates the backup policy identified by {backupPolicyName}. + * + * @param backupPolicyName The name of the backup policy. + * @param backupPolicyDescription Describes the backup policy. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable updateBackupPolicyAsync(String backupPolicyName, BackupPolicyDescriptionInner backupPolicyDescription, Long timeout) { + return updateBackupPolicyWithServiceResponseAsync(backupPolicyName, backupPolicyDescription, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the backup policy. + * Updates the backup policy identified by {backupPolicyName}. + * + * @param backupPolicyName The name of the backup policy. + * @param backupPolicyDescription Describes the backup policy. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> updateBackupPolicyWithServiceResponseAsync(String backupPolicyName, BackupPolicyDescriptionInner backupPolicyDescription, Long timeout) { + if (backupPolicyName == null) { + throw new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null."); + } + if (backupPolicyDescription == null) { + throw new IllegalArgumentException("Parameter backupPolicyDescription is required and cannot be null."); + } + Validator.validate(backupPolicyDescription); + final String apiVersion = "6.2-preview"; + return service.updateBackupPolicy(backupPolicyName, backupPolicyDescription, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateBackupPolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateBackupPolicyDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Enables periodic backup of stateful partitions under this Service Fabric application. + * Enables periodic backup of stateful partitions which are part of this Service Fabric application. Each partition is backed up individually as per the specified backup policy description. + Note only C# based Reliable Actor and Reliable Stateful services are currently supported for periodic backup. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param backupPolicyName Name of the backup policy to be used for enabling periodic backups. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void enableApplicationBackup(String applicationId, String backupPolicyName) { + enableApplicationBackupWithServiceResponseAsync(applicationId, backupPolicyName).toBlocking().single().body(); + } + + /** + * Enables periodic backup of stateful partitions under this Service Fabric application. + * Enables periodic backup of stateful partitions which are part of this Service Fabric application. Each partition is backed up individually as per the specified backup policy description. + Note only C# based Reliable Actor and Reliable Stateful services are currently supported for periodic backup. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param backupPolicyName Name of the backup policy to be used for enabling periodic backups. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture enableApplicationBackupAsync(String applicationId, String backupPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(enableApplicationBackupWithServiceResponseAsync(applicationId, backupPolicyName), serviceCallback); + } + + /** + * Enables periodic backup of stateful partitions under this Service Fabric application. + * Enables periodic backup of stateful partitions which are part of this Service Fabric application. Each partition is backed up individually as per the specified backup policy description. + Note only C# based Reliable Actor and Reliable Stateful services are currently supported for periodic backup. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param backupPolicyName Name of the backup policy to be used for enabling periodic backups. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable enableApplicationBackupAsync(String applicationId, String backupPolicyName) { + return enableApplicationBackupWithServiceResponseAsync(applicationId, backupPolicyName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Enables periodic backup of stateful partitions under this Service Fabric application. + * Enables periodic backup of stateful partitions which are part of this Service Fabric application. Each partition is backed up individually as per the specified backup policy description. + Note only C# based Reliable Actor and Reliable Stateful services are currently supported for periodic backup. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param backupPolicyName Name of the backup policy to be used for enabling periodic backups. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> enableApplicationBackupWithServiceResponseAsync(String applicationId, String backupPolicyName) { + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + if (backupPolicyName == null) { + throw new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + final Long timeout = null; + EnableBackupDescription enableBackupDescription = new EnableBackupDescription(); + enableBackupDescription.withBackupPolicyName(backupPolicyName); + return service.enableApplicationBackup(applicationId, apiVersion, timeout, this.acceptLanguage(), enableBackupDescription, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = enableApplicationBackupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Enables periodic backup of stateful partitions under this Service Fabric application. + * Enables periodic backup of stateful partitions which are part of this Service Fabric application. Each partition is backed up individually as per the specified backup policy description. + Note only C# based Reliable Actor and Reliable Stateful services are currently supported for periodic backup. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param backupPolicyName Name of the backup policy to be used for enabling periodic backups. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void enableApplicationBackup(String applicationId, String backupPolicyName, Long timeout) { + enableApplicationBackupWithServiceResponseAsync(applicationId, backupPolicyName, timeout).toBlocking().single().body(); + } + + /** + * Enables periodic backup of stateful partitions under this Service Fabric application. + * Enables periodic backup of stateful partitions which are part of this Service Fabric application. Each partition is backed up individually as per the specified backup policy description. + Note only C# based Reliable Actor and Reliable Stateful services are currently supported for periodic backup. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param backupPolicyName Name of the backup policy to be used for enabling periodic backups. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture enableApplicationBackupAsync(String applicationId, String backupPolicyName, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(enableApplicationBackupWithServiceResponseAsync(applicationId, backupPolicyName, timeout), serviceCallback); + } + + /** + * Enables periodic backup of stateful partitions under this Service Fabric application. + * Enables periodic backup of stateful partitions which are part of this Service Fabric application. Each partition is backed up individually as per the specified backup policy description. + Note only C# based Reliable Actor and Reliable Stateful services are currently supported for periodic backup. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param backupPolicyName Name of the backup policy to be used for enabling periodic backups. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable enableApplicationBackupAsync(String applicationId, String backupPolicyName, Long timeout) { + return enableApplicationBackupWithServiceResponseAsync(applicationId, backupPolicyName, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Enables periodic backup of stateful partitions under this Service Fabric application. + * Enables periodic backup of stateful partitions which are part of this Service Fabric application. Each partition is backed up individually as per the specified backup policy description. + Note only C# based Reliable Actor and Reliable Stateful services are currently supported for periodic backup. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param backupPolicyName Name of the backup policy to be used for enabling periodic backups. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> enableApplicationBackupWithServiceResponseAsync(String applicationId, String backupPolicyName, Long timeout) { + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + if (backupPolicyName == null) { + throw new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + EnableBackupDescription enableBackupDescription = new EnableBackupDescription(); + enableBackupDescription.withBackupPolicyName(backupPolicyName); + return service.enableApplicationBackup(applicationId, apiVersion, timeout, this.acceptLanguage(), enableBackupDescription, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = enableApplicationBackupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse enableApplicationBackupDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Disables periodic backup of Service Fabric application. + * Disables periodic backup of Service Fabric application which was previously enabled. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void disableApplicationBackup(String applicationId) { + disableApplicationBackupWithServiceResponseAsync(applicationId).toBlocking().single().body(); + } + + /** + * Disables periodic backup of Service Fabric application. + * Disables periodic backup of Service Fabric application which was previously enabled. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture disableApplicationBackupAsync(String applicationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(disableApplicationBackupWithServiceResponseAsync(applicationId), serviceCallback); + } + + /** + * Disables periodic backup of Service Fabric application. + * Disables periodic backup of Service Fabric application which was previously enabled. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable disableApplicationBackupAsync(String applicationId) { + return disableApplicationBackupWithServiceResponseAsync(applicationId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Disables periodic backup of Service Fabric application. + * Disables periodic backup of Service Fabric application which was previously enabled. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> disableApplicationBackupWithServiceResponseAsync(String applicationId) { + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + final Long timeout = null; + return service.disableApplicationBackup(applicationId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = disableApplicationBackupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Disables periodic backup of Service Fabric application. + * Disables periodic backup of Service Fabric application which was previously enabled. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void disableApplicationBackup(String applicationId, Long timeout) { + disableApplicationBackupWithServiceResponseAsync(applicationId, timeout).toBlocking().single().body(); + } + + /** + * Disables periodic backup of Service Fabric application. + * Disables periodic backup of Service Fabric application which was previously enabled. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture disableApplicationBackupAsync(String applicationId, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(disableApplicationBackupWithServiceResponseAsync(applicationId, timeout), serviceCallback); + } + + /** + * Disables periodic backup of Service Fabric application. + * Disables periodic backup of Service Fabric application which was previously enabled. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable disableApplicationBackupAsync(String applicationId, Long timeout) { + return disableApplicationBackupWithServiceResponseAsync(applicationId, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Disables periodic backup of Service Fabric application. + * Disables periodic backup of Service Fabric application which was previously enabled. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> disableApplicationBackupWithServiceResponseAsync(String applicationId, Long timeout) { + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + return service.disableApplicationBackup(applicationId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = disableApplicationBackupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse disableApplicationBackupDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the Service Fabric application backup configuration information. + * Gets the Service Fabric backup configuration information for the application and the services and partitions under this application. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedBackupConfigurationInfoListInner object if successful. + */ + public PagedBackupConfigurationInfoListInner getApplicationBackupConfigurationInfo(String applicationId) { + return getApplicationBackupConfigurationInfoWithServiceResponseAsync(applicationId).toBlocking().single().body(); + } + + /** + * Gets the Service Fabric application backup configuration information. + * Gets the Service Fabric backup configuration information for the application and the services and partitions under this application. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getApplicationBackupConfigurationInfoAsync(String applicationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getApplicationBackupConfigurationInfoWithServiceResponseAsync(applicationId), serviceCallback); + } + + /** + * Gets the Service Fabric application backup configuration information. + * Gets the Service Fabric backup configuration information for the application and the services and partitions under this application. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedBackupConfigurationInfoListInner object + */ + public Observable getApplicationBackupConfigurationInfoAsync(String applicationId) { + return getApplicationBackupConfigurationInfoWithServiceResponseAsync(applicationId).map(new Func1, PagedBackupConfigurationInfoListInner>() { + @Override + public PagedBackupConfigurationInfoListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the Service Fabric application backup configuration information. + * Gets the Service Fabric backup configuration information for the application and the services and partitions under this application. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedBackupConfigurationInfoListInner object + */ + public Observable> getApplicationBackupConfigurationInfoWithServiceResponseAsync(String applicationId) { + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + final String continuationToken = null; + final Long maxResults = null; + final Long timeout = null; + return service.getApplicationBackupConfigurationInfo(applicationId, apiVersion, continuationToken, maxResults, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getApplicationBackupConfigurationInfoDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the Service Fabric application backup configuration information. + * Gets the Service Fabric backup configuration information for the application and the services and partitions under this application. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedBackupConfigurationInfoListInner object if successful. + */ + public PagedBackupConfigurationInfoListInner getApplicationBackupConfigurationInfo(String applicationId, String continuationToken, Long maxResults, Long timeout) { + return getApplicationBackupConfigurationInfoWithServiceResponseAsync(applicationId, continuationToken, maxResults, timeout).toBlocking().single().body(); + } + + /** + * Gets the Service Fabric application backup configuration information. + * Gets the Service Fabric backup configuration information for the application and the services and partitions under this application. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getApplicationBackupConfigurationInfoAsync(String applicationId, String continuationToken, Long maxResults, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getApplicationBackupConfigurationInfoWithServiceResponseAsync(applicationId, continuationToken, maxResults, timeout), serviceCallback); + } + + /** + * Gets the Service Fabric application backup configuration information. + * Gets the Service Fabric backup configuration information for the application and the services and partitions under this application. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedBackupConfigurationInfoListInner object + */ + public Observable getApplicationBackupConfigurationInfoAsync(String applicationId, String continuationToken, Long maxResults, Long timeout) { + return getApplicationBackupConfigurationInfoWithServiceResponseAsync(applicationId, continuationToken, maxResults, timeout).map(new Func1, PagedBackupConfigurationInfoListInner>() { + @Override + public PagedBackupConfigurationInfoListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the Service Fabric application backup configuration information. + * Gets the Service Fabric backup configuration information for the application and the services and partitions under this application. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedBackupConfigurationInfoListInner object + */ + public Observable> getApplicationBackupConfigurationInfoWithServiceResponseAsync(String applicationId, String continuationToken, Long maxResults, Long timeout) { + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + return service.getApplicationBackupConfigurationInfo(applicationId, apiVersion, continuationToken, maxResults, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getApplicationBackupConfigurationInfoDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getApplicationBackupConfigurationInfoDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the list of backups available for every partition in this application. + * Returns a list of backups available for every partition in this Service Fabric application. The server enumerates all the backups available at the backup location configured in the backup policy. It also allows filtering of the result based on start and end datetime or just fetching the latest available backup for every partition. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedBackupInfoListInner object if successful. + */ + public PagedBackupInfoListInner getApplicationBackupList(String applicationId) { + return getApplicationBackupListWithServiceResponseAsync(applicationId).toBlocking().single().body(); + } + + /** + * Gets the list of backups available for every partition in this application. + * Returns a list of backups available for every partition in this Service Fabric application. The server enumerates all the backups available at the backup location configured in the backup policy. It also allows filtering of the result based on start and end datetime or just fetching the latest available backup for every partition. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getApplicationBackupListAsync(String applicationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getApplicationBackupListWithServiceResponseAsync(applicationId), serviceCallback); + } + + /** + * Gets the list of backups available for every partition in this application. + * Returns a list of backups available for every partition in this Service Fabric application. The server enumerates all the backups available at the backup location configured in the backup policy. It also allows filtering of the result based on start and end datetime or just fetching the latest available backup for every partition. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedBackupInfoListInner object + */ + public Observable getApplicationBackupListAsync(String applicationId) { + return getApplicationBackupListWithServiceResponseAsync(applicationId).map(new Func1, PagedBackupInfoListInner>() { + @Override + public PagedBackupInfoListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the list of backups available for every partition in this application. + * Returns a list of backups available for every partition in this Service Fabric application. The server enumerates all the backups available at the backup location configured in the backup policy. It also allows filtering of the result based on start and end datetime or just fetching the latest available backup for every partition. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedBackupInfoListInner object + */ + public Observable> getApplicationBackupListWithServiceResponseAsync(String applicationId) { + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + final Long timeout = null; + final Boolean latest = null; + final DateTime startDateTimeFilter = null; + final DateTime endDateTimeFilter = null; + final String continuationToken = null; + final Long maxResults = null; + return service.getApplicationBackupList(applicationId, apiVersion, timeout, latest, startDateTimeFilter, endDateTimeFilter, continuationToken, maxResults, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getApplicationBackupListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the list of backups available for every partition in this application. + * Returns a list of backups available for every partition in this Service Fabric application. The server enumerates all the backups available at the backup location configured in the backup policy. It also allows filtering of the result based on start and end datetime or just fetching the latest available backup for every partition. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param latest Specifies whether to get only the most recent backup available for a partition for the specified time range. + * @param 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 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 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedBackupInfoListInner object if successful. + */ + public PagedBackupInfoListInner getApplicationBackupList(String applicationId, Long timeout, Boolean latest, DateTime startDateTimeFilter, DateTime endDateTimeFilter, String continuationToken, Long maxResults) { + return getApplicationBackupListWithServiceResponseAsync(applicationId, timeout, latest, startDateTimeFilter, endDateTimeFilter, continuationToken, maxResults).toBlocking().single().body(); + } + + /** + * Gets the list of backups available for every partition in this application. + * Returns a list of backups available for every partition in this Service Fabric application. The server enumerates all the backups available at the backup location configured in the backup policy. It also allows filtering of the result based on start and end datetime or just fetching the latest available backup for every partition. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param latest Specifies whether to get only the most recent backup available for a partition for the specified time range. + * @param 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 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 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 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getApplicationBackupListAsync(String applicationId, Long timeout, Boolean latest, DateTime startDateTimeFilter, DateTime endDateTimeFilter, String continuationToken, Long maxResults, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getApplicationBackupListWithServiceResponseAsync(applicationId, timeout, latest, startDateTimeFilter, endDateTimeFilter, continuationToken, maxResults), serviceCallback); + } + + /** + * Gets the list of backups available for every partition in this application. + * Returns a list of backups available for every partition in this Service Fabric application. The server enumerates all the backups available at the backup location configured in the backup policy. It also allows filtering of the result based on start and end datetime or just fetching the latest available backup for every partition. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param latest Specifies whether to get only the most recent backup available for a partition for the specified time range. + * @param 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 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 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedBackupInfoListInner object + */ + public Observable getApplicationBackupListAsync(String applicationId, Long timeout, Boolean latest, DateTime startDateTimeFilter, DateTime endDateTimeFilter, String continuationToken, Long maxResults) { + return getApplicationBackupListWithServiceResponseAsync(applicationId, timeout, latest, startDateTimeFilter, endDateTimeFilter, continuationToken, maxResults).map(new Func1, PagedBackupInfoListInner>() { + @Override + public PagedBackupInfoListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the list of backups available for every partition in this application. + * Returns a list of backups available for every partition in this Service Fabric application. The server enumerates all the backups available at the backup location configured in the backup policy. It also allows filtering of the result based on start and end datetime or just fetching the latest available backup for every partition. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param latest Specifies whether to get only the most recent backup available for a partition for the specified time range. + * @param 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 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 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedBackupInfoListInner object + */ + public Observable> getApplicationBackupListWithServiceResponseAsync(String applicationId, Long timeout, Boolean latest, DateTime startDateTimeFilter, DateTime endDateTimeFilter, String continuationToken, Long maxResults) { + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + return service.getApplicationBackupList(applicationId, apiVersion, timeout, latest, startDateTimeFilter, endDateTimeFilter, continuationToken, maxResults, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getApplicationBackupListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getApplicationBackupListDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Suspends periodic backup for the specified Service Fabric application. + * The application which is configured to take periodic backups, is suspended for taking further backups till it is resumed again. This operation applies to the entire application's hierarchy. It means all the services and partitions under this application are now suspended for backup. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void suspendApplicationBackup(String applicationId) { + suspendApplicationBackupWithServiceResponseAsync(applicationId).toBlocking().single().body(); + } + + /** + * Suspends periodic backup for the specified Service Fabric application. + * The application which is configured to take periodic backups, is suspended for taking further backups till it is resumed again. This operation applies to the entire application's hierarchy. It means all the services and partitions under this application are now suspended for backup. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture suspendApplicationBackupAsync(String applicationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(suspendApplicationBackupWithServiceResponseAsync(applicationId), serviceCallback); + } + + /** + * Suspends periodic backup for the specified Service Fabric application. + * The application which is configured to take periodic backups, is suspended for taking further backups till it is resumed again. This operation applies to the entire application's hierarchy. It means all the services and partitions under this application are now suspended for backup. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable suspendApplicationBackupAsync(String applicationId) { + return suspendApplicationBackupWithServiceResponseAsync(applicationId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Suspends periodic backup for the specified Service Fabric application. + * The application which is configured to take periodic backups, is suspended for taking further backups till it is resumed again. This operation applies to the entire application's hierarchy. It means all the services and partitions under this application are now suspended for backup. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> suspendApplicationBackupWithServiceResponseAsync(String applicationId) { + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + final Long timeout = null; + return service.suspendApplicationBackup(applicationId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = suspendApplicationBackupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Suspends periodic backup for the specified Service Fabric application. + * The application which is configured to take periodic backups, is suspended for taking further backups till it is resumed again. This operation applies to the entire application's hierarchy. It means all the services and partitions under this application are now suspended for backup. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void suspendApplicationBackup(String applicationId, Long timeout) { + suspendApplicationBackupWithServiceResponseAsync(applicationId, timeout).toBlocking().single().body(); + } + + /** + * Suspends periodic backup for the specified Service Fabric application. + * The application which is configured to take periodic backups, is suspended for taking further backups till it is resumed again. This operation applies to the entire application's hierarchy. It means all the services and partitions under this application are now suspended for backup. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture suspendApplicationBackupAsync(String applicationId, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(suspendApplicationBackupWithServiceResponseAsync(applicationId, timeout), serviceCallback); + } + + /** + * Suspends periodic backup for the specified Service Fabric application. + * The application which is configured to take periodic backups, is suspended for taking further backups till it is resumed again. This operation applies to the entire application's hierarchy. It means all the services and partitions under this application are now suspended for backup. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable suspendApplicationBackupAsync(String applicationId, Long timeout) { + return suspendApplicationBackupWithServiceResponseAsync(applicationId, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Suspends periodic backup for the specified Service Fabric application. + * The application which is configured to take periodic backups, is suspended for taking further backups till it is resumed again. This operation applies to the entire application's hierarchy. It means all the services and partitions under this application are now suspended for backup. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> suspendApplicationBackupWithServiceResponseAsync(String applicationId, Long timeout) { + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + return service.suspendApplicationBackup(applicationId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = suspendApplicationBackupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse suspendApplicationBackupDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Resumes periodic backup of a Service Fabric application which was previously suspended. + * The previously suspended Service Fabric application resumes taking periodic backup as per the backup policy currently configured for the same. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void resumeApplicationBackup(String applicationId) { + resumeApplicationBackupWithServiceResponseAsync(applicationId).toBlocking().single().body(); + } + + /** + * Resumes periodic backup of a Service Fabric application which was previously suspended. + * The previously suspended Service Fabric application resumes taking periodic backup as per the backup policy currently configured for the same. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture resumeApplicationBackupAsync(String applicationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resumeApplicationBackupWithServiceResponseAsync(applicationId), serviceCallback); + } + + /** + * Resumes periodic backup of a Service Fabric application which was previously suspended. + * The previously suspended Service Fabric application resumes taking periodic backup as per the backup policy currently configured for the same. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable resumeApplicationBackupAsync(String applicationId) { + return resumeApplicationBackupWithServiceResponseAsync(applicationId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resumes periodic backup of a Service Fabric application which was previously suspended. + * The previously suspended Service Fabric application resumes taking periodic backup as per the backup policy currently configured for the same. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> resumeApplicationBackupWithServiceResponseAsync(String applicationId) { + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + final Long timeout = null; + return service.resumeApplicationBackup(applicationId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = resumeApplicationBackupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Resumes periodic backup of a Service Fabric application which was previously suspended. + * The previously suspended Service Fabric application resumes taking periodic backup as per the backup policy currently configured for the same. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void resumeApplicationBackup(String applicationId, Long timeout) { + resumeApplicationBackupWithServiceResponseAsync(applicationId, timeout).toBlocking().single().body(); + } + + /** + * Resumes periodic backup of a Service Fabric application which was previously suspended. + * The previously suspended Service Fabric application resumes taking periodic backup as per the backup policy currently configured for the same. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture resumeApplicationBackupAsync(String applicationId, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resumeApplicationBackupWithServiceResponseAsync(applicationId, timeout), serviceCallback); + } + + /** + * Resumes periodic backup of a Service Fabric application which was previously suspended. + * The previously suspended Service Fabric application resumes taking periodic backup as per the backup policy currently configured for the same. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable resumeApplicationBackupAsync(String applicationId, Long timeout) { + return resumeApplicationBackupWithServiceResponseAsync(applicationId, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resumes periodic backup of a Service Fabric application which was previously suspended. + * The previously suspended Service Fabric application resumes taking periodic backup as per the backup policy currently configured for the same. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> resumeApplicationBackupWithServiceResponseAsync(String applicationId, Long timeout) { + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + return service.resumeApplicationBackup(applicationId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = resumeApplicationBackupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse resumeApplicationBackupDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 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 backupPolicyName Name of the backup policy to be used for enabling periodic backups. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void enableServiceBackup(String serviceId, String backupPolicyName) { + enableServiceBackupWithServiceResponseAsync(serviceId, backupPolicyName).toBlocking().single().body(); + } + + /** + * 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 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 backupPolicyName Name of the backup policy to be used for enabling periodic backups. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture enableServiceBackupAsync(String serviceId, String backupPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(enableServiceBackupWithServiceResponseAsync(serviceId, backupPolicyName), serviceCallback); + } + + /** + * 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 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 backupPolicyName Name of the backup policy to be used for enabling periodic backups. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable enableServiceBackupAsync(String serviceId, String backupPolicyName) { + return enableServiceBackupWithServiceResponseAsync(serviceId, backupPolicyName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 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 backupPolicyName Name of the backup policy to be used for enabling periodic backups. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> enableServiceBackupWithServiceResponseAsync(String serviceId, String backupPolicyName) { + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + if (backupPolicyName == null) { + throw new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + final Long timeout = null; + EnableBackupDescription enableBackupDescription = new EnableBackupDescription(); + enableBackupDescription.withBackupPolicyName(backupPolicyName); + return service.enableServiceBackup(serviceId, apiVersion, timeout, this.acceptLanguage(), enableBackupDescription, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = enableServiceBackupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 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 backupPolicyName Name of the backup policy to be used for enabling periodic backups. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void enableServiceBackup(String serviceId, String backupPolicyName, Long timeout) { + enableServiceBackupWithServiceResponseAsync(serviceId, backupPolicyName, timeout).toBlocking().single().body(); + } + + /** + * 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 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 backupPolicyName Name of the backup policy to be used for enabling periodic backups. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture enableServiceBackupAsync(String serviceId, String backupPolicyName, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(enableServiceBackupWithServiceResponseAsync(serviceId, backupPolicyName, timeout), serviceCallback); + } + + /** + * 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 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 backupPolicyName Name of the backup policy to be used for enabling periodic backups. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable enableServiceBackupAsync(String serviceId, String backupPolicyName, Long timeout) { + return enableServiceBackupWithServiceResponseAsync(serviceId, backupPolicyName, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 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 backupPolicyName Name of the backup policy to be used for enabling periodic backups. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> enableServiceBackupWithServiceResponseAsync(String serviceId, String backupPolicyName, Long timeout) { + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + if (backupPolicyName == null) { + throw new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + EnableBackupDescription enableBackupDescription = new EnableBackupDescription(); + enableBackupDescription.withBackupPolicyName(backupPolicyName); + return service.enableServiceBackup(serviceId, apiVersion, timeout, this.acceptLanguage(), enableBackupDescription, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = enableServiceBackupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse enableServiceBackupDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Disables periodic backup of Service Fabric service which was previously enabled. + * Disables periodic backup of Service Fabric service which was previously enabled. Backup must be explicitly enabled before it can be disabled. + In case the backup is enabled for the Service Fabric application, which this service is part of, this service would continue to be periodically backed up as per the policy mapped at the application level. + * + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void disableServiceBackup(String serviceId) { + disableServiceBackupWithServiceResponseAsync(serviceId).toBlocking().single().body(); + } + + /** + * Disables periodic backup of Service Fabric service which was previously enabled. + * Disables periodic backup of Service Fabric service which was previously enabled. Backup must be explicitly enabled before it can be disabled. + In case the backup is enabled for the Service Fabric application, which this service is part of, this service would continue to be periodically backed up as per the policy mapped at the application level. + * + * @param 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture disableServiceBackupAsync(String serviceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(disableServiceBackupWithServiceResponseAsync(serviceId), serviceCallback); + } + + /** + * Disables periodic backup of Service Fabric service which was previously enabled. + * Disables periodic backup of Service Fabric service which was previously enabled. Backup must be explicitly enabled before it can be disabled. + In case the backup is enabled for the Service Fabric application, which this service is part of, this service would continue to be periodically backed up as per the policy mapped at the application level. + * + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable disableServiceBackupAsync(String serviceId) { + return disableServiceBackupWithServiceResponseAsync(serviceId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Disables periodic backup of Service Fabric service which was previously enabled. + * Disables periodic backup of Service Fabric service which was previously enabled. Backup must be explicitly enabled before it can be disabled. + In case the backup is enabled for the Service Fabric application, which this service is part of, this service would continue to be periodically backed up as per the policy mapped at the application level. + * + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> disableServiceBackupWithServiceResponseAsync(String serviceId) { + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + final Long timeout = null; + return service.disableServiceBackup(serviceId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = disableServiceBackupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Disables periodic backup of Service Fabric service which was previously enabled. + * Disables periodic backup of Service Fabric service which was previously enabled. Backup must be explicitly enabled before it can be disabled. + In case the backup is enabled for the Service Fabric application, which this service is part of, this service would continue to be periodically backed up as per the policy mapped at the application level. + * + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void disableServiceBackup(String serviceId, Long timeout) { + disableServiceBackupWithServiceResponseAsync(serviceId, timeout).toBlocking().single().body(); + } + + /** + * Disables periodic backup of Service Fabric service which was previously enabled. + * Disables periodic backup of Service Fabric service which was previously enabled. Backup must be explicitly enabled before it can be disabled. + In case the backup is enabled for the Service Fabric application, which this service is part of, this service would continue to be periodically backed up as per the policy mapped at the application level. + * + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture disableServiceBackupAsync(String serviceId, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(disableServiceBackupWithServiceResponseAsync(serviceId, timeout), serviceCallback); + } + + /** + * Disables periodic backup of Service Fabric service which was previously enabled. + * Disables periodic backup of Service Fabric service which was previously enabled. Backup must be explicitly enabled before it can be disabled. + In case the backup is enabled for the Service Fabric application, which this service is part of, this service would continue to be periodically backed up as per the policy mapped at the application level. + * + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable disableServiceBackupAsync(String serviceId, Long timeout) { + return disableServiceBackupWithServiceResponseAsync(serviceId, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Disables periodic backup of Service Fabric service which was previously enabled. + * Disables periodic backup of Service Fabric service which was previously enabled. Backup must be explicitly enabled before it can be disabled. + In case the backup is enabled for the Service Fabric application, which this service is part of, this service would continue to be periodically backed up as per the policy mapped at the application level. + * + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> disableServiceBackupWithServiceResponseAsync(String serviceId, Long timeout) { + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + return service.disableServiceBackup(serviceId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = disableServiceBackupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse disableServiceBackupDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the Service Fabric service backup configuration information. + * Gets the Service Fabric backup configuration information for the service and the partitions under this service. + * + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedBackupConfigurationInfoListInner object if successful. + */ + public PagedBackupConfigurationInfoListInner getServiceBackupConfigurationInfo(String serviceId) { + return getServiceBackupConfigurationInfoWithServiceResponseAsync(serviceId).toBlocking().single().body(); + } + + /** + * Gets the Service Fabric service backup configuration information. + * Gets the Service Fabric backup configuration information for the service and the partitions under this service. + * + * @param 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getServiceBackupConfigurationInfoAsync(String serviceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getServiceBackupConfigurationInfoWithServiceResponseAsync(serviceId), serviceCallback); + } + + /** + * Gets the Service Fabric service backup configuration information. + * Gets the Service Fabric backup configuration information for the service and the partitions under this service. + * + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedBackupConfigurationInfoListInner object + */ + public Observable getServiceBackupConfigurationInfoAsync(String serviceId) { + return getServiceBackupConfigurationInfoWithServiceResponseAsync(serviceId).map(new Func1, PagedBackupConfigurationInfoListInner>() { + @Override + public PagedBackupConfigurationInfoListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the Service Fabric service backup configuration information. + * Gets the Service Fabric backup configuration information for the service and the partitions under this service. + * + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedBackupConfigurationInfoListInner object + */ + public Observable> getServiceBackupConfigurationInfoWithServiceResponseAsync(String serviceId) { + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + final String continuationToken = null; + final Long maxResults = null; + final Long timeout = null; + return service.getServiceBackupConfigurationInfo(serviceId, apiVersion, continuationToken, maxResults, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getServiceBackupConfigurationInfoDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the Service Fabric service backup configuration information. + * Gets the Service Fabric backup configuration information for the service and the partitions under this service. + * + * @param 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedBackupConfigurationInfoListInner object if successful. + */ + public PagedBackupConfigurationInfoListInner getServiceBackupConfigurationInfo(String serviceId, String continuationToken, Long maxResults, Long timeout) { + return getServiceBackupConfigurationInfoWithServiceResponseAsync(serviceId, continuationToken, maxResults, timeout).toBlocking().single().body(); + } + + /** + * Gets the Service Fabric service backup configuration information. + * Gets the Service Fabric backup configuration information for the service and the partitions under this service. + * + * @param 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getServiceBackupConfigurationInfoAsync(String serviceId, String continuationToken, Long maxResults, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getServiceBackupConfigurationInfoWithServiceResponseAsync(serviceId, continuationToken, maxResults, timeout), serviceCallback); + } + + /** + * Gets the Service Fabric service backup configuration information. + * Gets the Service Fabric backup configuration information for the service and the partitions under this service. + * + * @param 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedBackupConfigurationInfoListInner object + */ + public Observable getServiceBackupConfigurationInfoAsync(String serviceId, String continuationToken, Long maxResults, Long timeout) { + return getServiceBackupConfigurationInfoWithServiceResponseAsync(serviceId, continuationToken, maxResults, timeout).map(new Func1, PagedBackupConfigurationInfoListInner>() { + @Override + public PagedBackupConfigurationInfoListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the Service Fabric service backup configuration information. + * Gets the Service Fabric backup configuration information for the service and the partitions under this service. + * + * @param 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedBackupConfigurationInfoListInner object + */ + public Observable> getServiceBackupConfigurationInfoWithServiceResponseAsync(String serviceId, String continuationToken, Long maxResults, Long timeout) { + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + return service.getServiceBackupConfigurationInfo(serviceId, apiVersion, continuationToken, maxResults, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getServiceBackupConfigurationInfoDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getServiceBackupConfigurationInfoDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the list of backups available for every partition in this service. + * Returns a list of backups available for every partition in this Service Fabric service. The server enumerates all the backups available in the backup store configured in the backup policy. It also allows filtering of the result based on start and end datetime or just fetching the latest available backup for every partition. + * + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedBackupInfoListInner object if successful. + */ + public PagedBackupInfoListInner getServiceBackupList(String serviceId) { + return getServiceBackupListWithServiceResponseAsync(serviceId).toBlocking().single().body(); + } + + /** + * Gets the list of backups available for every partition in this service. + * Returns a list of backups available for every partition in this Service Fabric service. The server enumerates all the backups available in the backup store configured in the backup policy. It also allows filtering of the result based on start and end datetime or just fetching the latest available backup for every partition. + * + * @param 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getServiceBackupListAsync(String serviceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getServiceBackupListWithServiceResponseAsync(serviceId), serviceCallback); + } + + /** + * Gets the list of backups available for every partition in this service. + * Returns a list of backups available for every partition in this Service Fabric service. The server enumerates all the backups available in the backup store configured in the backup policy. It also allows filtering of the result based on start and end datetime or just fetching the latest available backup for every partition. + * + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedBackupInfoListInner object + */ + public Observable getServiceBackupListAsync(String serviceId) { + return getServiceBackupListWithServiceResponseAsync(serviceId).map(new Func1, PagedBackupInfoListInner>() { + @Override + public PagedBackupInfoListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the list of backups available for every partition in this service. + * Returns a list of backups available for every partition in this Service Fabric service. The server enumerates all the backups available in the backup store configured in the backup policy. It also allows filtering of the result based on start and end datetime or just fetching the latest available backup for every partition. + * + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedBackupInfoListInner object + */ + public Observable> getServiceBackupListWithServiceResponseAsync(String serviceId) { + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + final Long timeout = null; + final Boolean latest = null; + final DateTime startDateTimeFilter = null; + final DateTime endDateTimeFilter = null; + final String continuationToken = null; + final Long maxResults = null; + return service.getServiceBackupList(serviceId, apiVersion, timeout, latest, startDateTimeFilter, endDateTimeFilter, continuationToken, maxResults, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getServiceBackupListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the list of backups available for every partition in this service. + * Returns a list of backups available for every partition in this Service Fabric service. The server enumerates all the backups available in the backup store configured in the backup policy. It also allows filtering of the result based on start and end datetime or just fetching the latest available backup for every partition. + * + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param latest Specifies whether to get only the most recent backup available for a partition for the specified time range. + * @param 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 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 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedBackupInfoListInner object if successful. + */ + public PagedBackupInfoListInner getServiceBackupList(String serviceId, Long timeout, Boolean latest, DateTime startDateTimeFilter, DateTime endDateTimeFilter, String continuationToken, Long maxResults) { + return getServiceBackupListWithServiceResponseAsync(serviceId, timeout, latest, startDateTimeFilter, endDateTimeFilter, continuationToken, maxResults).toBlocking().single().body(); + } + + /** + * Gets the list of backups available for every partition in this service. + * Returns a list of backups available for every partition in this Service Fabric service. The server enumerates all the backups available in the backup store configured in the backup policy. It also allows filtering of the result based on start and end datetime or just fetching the latest available backup for every partition. + * + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param latest Specifies whether to get only the most recent backup available for a partition for the specified time range. + * @param 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 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 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 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getServiceBackupListAsync(String serviceId, Long timeout, Boolean latest, DateTime startDateTimeFilter, DateTime endDateTimeFilter, String continuationToken, Long maxResults, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getServiceBackupListWithServiceResponseAsync(serviceId, timeout, latest, startDateTimeFilter, endDateTimeFilter, continuationToken, maxResults), serviceCallback); + } + + /** + * Gets the list of backups available for every partition in this service. + * Returns a list of backups available for every partition in this Service Fabric service. The server enumerates all the backups available in the backup store configured in the backup policy. It also allows filtering of the result based on start and end datetime or just fetching the latest available backup for every partition. + * + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param latest Specifies whether to get only the most recent backup available for a partition for the specified time range. + * @param 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 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 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedBackupInfoListInner object + */ + public Observable getServiceBackupListAsync(String serviceId, Long timeout, Boolean latest, DateTime startDateTimeFilter, DateTime endDateTimeFilter, String continuationToken, Long maxResults) { + return getServiceBackupListWithServiceResponseAsync(serviceId, timeout, latest, startDateTimeFilter, endDateTimeFilter, continuationToken, maxResults).map(new Func1, PagedBackupInfoListInner>() { + @Override + public PagedBackupInfoListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the list of backups available for every partition in this service. + * Returns a list of backups available for every partition in this Service Fabric service. The server enumerates all the backups available in the backup store configured in the backup policy. It also allows filtering of the result based on start and end datetime or just fetching the latest available backup for every partition. + * + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param latest Specifies whether to get only the most recent backup available for a partition for the specified time range. + * @param 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 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 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedBackupInfoListInner object + */ + public Observable> getServiceBackupListWithServiceResponseAsync(String serviceId, Long timeout, Boolean latest, DateTime startDateTimeFilter, DateTime endDateTimeFilter, String continuationToken, Long maxResults) { + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + return service.getServiceBackupList(serviceId, apiVersion, timeout, latest, startDateTimeFilter, endDateTimeFilter, continuationToken, maxResults, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getServiceBackupListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getServiceBackupListDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Suspends periodic backup for the specified Service Fabric service. + * The service which is configured to take periodic backups, is suspended for taking further backups till it is resumed again. This operation applies to the entire service's hierarchy. It means all the partitions under this service are now suspended for backup. + * + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void suspendServiceBackup(String serviceId) { + suspendServiceBackupWithServiceResponseAsync(serviceId).toBlocking().single().body(); + } + + /** + * Suspends periodic backup for the specified Service Fabric service. + * The service which is configured to take periodic backups, is suspended for taking further backups till it is resumed again. This operation applies to the entire service's hierarchy. It means all the partitions under this service are now suspended for backup. + * + * @param 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture suspendServiceBackupAsync(String serviceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(suspendServiceBackupWithServiceResponseAsync(serviceId), serviceCallback); + } + + /** + * Suspends periodic backup for the specified Service Fabric service. + * The service which is configured to take periodic backups, is suspended for taking further backups till it is resumed again. This operation applies to the entire service's hierarchy. It means all the partitions under this service are now suspended for backup. + * + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable suspendServiceBackupAsync(String serviceId) { + return suspendServiceBackupWithServiceResponseAsync(serviceId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Suspends periodic backup for the specified Service Fabric service. + * The service which is configured to take periodic backups, is suspended for taking further backups till it is resumed again. This operation applies to the entire service's hierarchy. It means all the partitions under this service are now suspended for backup. + * + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> suspendServiceBackupWithServiceResponseAsync(String serviceId) { + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + final Long timeout = null; + return service.suspendServiceBackup(serviceId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = suspendServiceBackupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Suspends periodic backup for the specified Service Fabric service. + * The service which is configured to take periodic backups, is suspended for taking further backups till it is resumed again. This operation applies to the entire service's hierarchy. It means all the partitions under this service are now suspended for backup. + * + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void suspendServiceBackup(String serviceId, Long timeout) { + suspendServiceBackupWithServiceResponseAsync(serviceId, timeout).toBlocking().single().body(); + } + + /** + * Suspends periodic backup for the specified Service Fabric service. + * The service which is configured to take periodic backups, is suspended for taking further backups till it is resumed again. This operation applies to the entire service's hierarchy. It means all the partitions under this service are now suspended for backup. + * + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture suspendServiceBackupAsync(String serviceId, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(suspendServiceBackupWithServiceResponseAsync(serviceId, timeout), serviceCallback); + } + + /** + * Suspends periodic backup for the specified Service Fabric service. + * The service which is configured to take periodic backups, is suspended for taking further backups till it is resumed again. This operation applies to the entire service's hierarchy. It means all the partitions under this service are now suspended for backup. + * + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable suspendServiceBackupAsync(String serviceId, Long timeout) { + return suspendServiceBackupWithServiceResponseAsync(serviceId, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Suspends periodic backup for the specified Service Fabric service. + * The service which is configured to take periodic backups, is suspended for taking further backups till it is resumed again. This operation applies to the entire service's hierarchy. It means all the partitions under this service are now suspended for backup. + * + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> suspendServiceBackupWithServiceResponseAsync(String serviceId, Long timeout) { + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + return service.suspendServiceBackup(serviceId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = suspendServiceBackupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse suspendServiceBackupDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Resumes periodic backup of a Service Fabric service which was previously suspended. + * The previously suspended Service Fabric service resumes taking periodic backup as per the backup policy currently configured for the same. + * + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void resumeServiceBackup(String serviceId) { + resumeServiceBackupWithServiceResponseAsync(serviceId).toBlocking().single().body(); + } + + /** + * Resumes periodic backup of a Service Fabric service which was previously suspended. + * The previously suspended Service Fabric service resumes taking periodic backup as per the backup policy currently configured for the same. + * + * @param 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture resumeServiceBackupAsync(String serviceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resumeServiceBackupWithServiceResponseAsync(serviceId), serviceCallback); + } + + /** + * Resumes periodic backup of a Service Fabric service which was previously suspended. + * The previously suspended Service Fabric service resumes taking periodic backup as per the backup policy currently configured for the same. + * + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable resumeServiceBackupAsync(String serviceId) { + return resumeServiceBackupWithServiceResponseAsync(serviceId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resumes periodic backup of a Service Fabric service which was previously suspended. + * The previously suspended Service Fabric service resumes taking periodic backup as per the backup policy currently configured for the same. + * + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> resumeServiceBackupWithServiceResponseAsync(String serviceId) { + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + final Long timeout = null; + return service.resumeServiceBackup(serviceId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = resumeServiceBackupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Resumes periodic backup of a Service Fabric service which was previously suspended. + * The previously suspended Service Fabric service resumes taking periodic backup as per the backup policy currently configured for the same. + * + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void resumeServiceBackup(String serviceId, Long timeout) { + resumeServiceBackupWithServiceResponseAsync(serviceId, timeout).toBlocking().single().body(); + } + + /** + * Resumes periodic backup of a Service Fabric service which was previously suspended. + * The previously suspended Service Fabric service resumes taking periodic backup as per the backup policy currently configured for the same. + * + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture resumeServiceBackupAsync(String serviceId, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resumeServiceBackupWithServiceResponseAsync(serviceId, timeout), serviceCallback); + } + + /** + * Resumes periodic backup of a Service Fabric service which was previously suspended. + * The previously suspended Service Fabric service resumes taking periodic backup as per the backup policy currently configured for the same. + * + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable resumeServiceBackupAsync(String serviceId, Long timeout) { + return resumeServiceBackupWithServiceResponseAsync(serviceId, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resumes periodic backup of a Service Fabric service which was previously suspended. + * The previously suspended Service Fabric service resumes taking periodic backup as per the backup policy currently configured for the same. + * + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> resumeServiceBackupWithServiceResponseAsync(String serviceId, Long timeout) { + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + return service.resumeServiceBackup(serviceId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = resumeServiceBackupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse resumeServiceBackupDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 partitionId The identity of the partition. + * @param backupPolicyName Name of the backup policy to be used for enabling periodic backups. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void enablePartitionBackup(UUID partitionId, String backupPolicyName) { + enablePartitionBackupWithServiceResponseAsync(partitionId, backupPolicyName).toBlocking().single().body(); + } + + /** + * 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 partitionId The identity of the partition. + * @param backupPolicyName Name of the backup policy to be used for enabling periodic backups. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture enablePartitionBackupAsync(UUID partitionId, String backupPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(enablePartitionBackupWithServiceResponseAsync(partitionId, backupPolicyName), serviceCallback); + } + + /** + * 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 partitionId The identity of the partition. + * @param backupPolicyName Name of the backup policy to be used for enabling periodic backups. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable enablePartitionBackupAsync(UUID partitionId, String backupPolicyName) { + return enablePartitionBackupWithServiceResponseAsync(partitionId, backupPolicyName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 partitionId The identity of the partition. + * @param backupPolicyName Name of the backup policy to be used for enabling periodic backups. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> enablePartitionBackupWithServiceResponseAsync(UUID partitionId, String backupPolicyName) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + if (backupPolicyName == null) { + throw new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + final Long timeout = null; + EnableBackupDescription enableBackupDescription = new EnableBackupDescription(); + enableBackupDescription.withBackupPolicyName(backupPolicyName); + return service.enablePartitionBackup(partitionId, apiVersion, timeout, this.acceptLanguage(), enableBackupDescription, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = enablePartitionBackupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 partitionId The identity of the partition. + * @param backupPolicyName Name of the backup policy to be used for enabling periodic backups. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void enablePartitionBackup(UUID partitionId, String backupPolicyName, Long timeout) { + enablePartitionBackupWithServiceResponseAsync(partitionId, backupPolicyName, timeout).toBlocking().single().body(); + } + + /** + * 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 partitionId The identity of the partition. + * @param backupPolicyName Name of the backup policy to be used for enabling periodic backups. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture enablePartitionBackupAsync(UUID partitionId, String backupPolicyName, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(enablePartitionBackupWithServiceResponseAsync(partitionId, backupPolicyName, timeout), serviceCallback); + } + + /** + * 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 partitionId The identity of the partition. + * @param backupPolicyName Name of the backup policy to be used for enabling periodic backups. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable enablePartitionBackupAsync(UUID partitionId, String backupPolicyName, Long timeout) { + return enablePartitionBackupWithServiceResponseAsync(partitionId, backupPolicyName, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 partitionId The identity of the partition. + * @param backupPolicyName Name of the backup policy to be used for enabling periodic backups. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> enablePartitionBackupWithServiceResponseAsync(UUID partitionId, String backupPolicyName, Long timeout) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + if (backupPolicyName == null) { + throw new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + EnableBackupDescription enableBackupDescription = new EnableBackupDescription(); + enableBackupDescription.withBackupPolicyName(backupPolicyName); + return service.enablePartitionBackup(partitionId, apiVersion, timeout, this.acceptLanguage(), enableBackupDescription, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = enablePartitionBackupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse enablePartitionBackupDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Disables periodic backup of Service Fabric partition which was previously enabled. + * Disables periodic backup of partition which was previously enabled. Backup must be explicitly enabled before it can be disabled. + In case the backup is enabled for the Service Fabric application or service, which this partition is part of, this partition would continue to be periodically backed up as per the policy mapped at the higher level entity. + * + * @param partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void disablePartitionBackup(UUID partitionId) { + disablePartitionBackupWithServiceResponseAsync(partitionId).toBlocking().single().body(); + } + + /** + * Disables periodic backup of Service Fabric partition which was previously enabled. + * Disables periodic backup of partition which was previously enabled. Backup must be explicitly enabled before it can be disabled. + In case the backup is enabled for the Service Fabric application or service, which this partition is part of, this partition would continue to be periodically backed up as per the policy mapped at the higher level entity. + * + * @param partitionId The identity of the partition. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture disablePartitionBackupAsync(UUID partitionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(disablePartitionBackupWithServiceResponseAsync(partitionId), serviceCallback); + } + + /** + * Disables periodic backup of Service Fabric partition which was previously enabled. + * Disables periodic backup of partition which was previously enabled. Backup must be explicitly enabled before it can be disabled. + In case the backup is enabled for the Service Fabric application or service, which this partition is part of, this partition would continue to be periodically backed up as per the policy mapped at the higher level entity. + * + * @param partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable disablePartitionBackupAsync(UUID partitionId) { + return disablePartitionBackupWithServiceResponseAsync(partitionId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Disables periodic backup of Service Fabric partition which was previously enabled. + * Disables periodic backup of partition which was previously enabled. Backup must be explicitly enabled before it can be disabled. + In case the backup is enabled for the Service Fabric application or service, which this partition is part of, this partition would continue to be periodically backed up as per the policy mapped at the higher level entity. + * + * @param partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> disablePartitionBackupWithServiceResponseAsync(UUID partitionId) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + final Long timeout = null; + return service.disablePartitionBackup(partitionId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = disablePartitionBackupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Disables periodic backup of Service Fabric partition which was previously enabled. + * Disables periodic backup of partition which was previously enabled. Backup must be explicitly enabled before it can be disabled. + In case the backup is enabled for the Service Fabric application or service, which this partition is part of, this partition would continue to be periodically backed up as per the policy mapped at the higher level entity. + * + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void disablePartitionBackup(UUID partitionId, Long timeout) { + disablePartitionBackupWithServiceResponseAsync(partitionId, timeout).toBlocking().single().body(); + } + + /** + * Disables periodic backup of Service Fabric partition which was previously enabled. + * Disables periodic backup of partition which was previously enabled. Backup must be explicitly enabled before it can be disabled. + In case the backup is enabled for the Service Fabric application or service, which this partition is part of, this partition would continue to be periodically backed up as per the policy mapped at the higher level entity. + * + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture disablePartitionBackupAsync(UUID partitionId, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(disablePartitionBackupWithServiceResponseAsync(partitionId, timeout), serviceCallback); + } + + /** + * Disables periodic backup of Service Fabric partition which was previously enabled. + * Disables periodic backup of partition which was previously enabled. Backup must be explicitly enabled before it can be disabled. + In case the backup is enabled for the Service Fabric application or service, which this partition is part of, this partition would continue to be periodically backed up as per the policy mapped at the higher level entity. + * + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable disablePartitionBackupAsync(UUID partitionId, Long timeout) { + return disablePartitionBackupWithServiceResponseAsync(partitionId, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Disables periodic backup of Service Fabric partition which was previously enabled. + * Disables periodic backup of partition which was previously enabled. Backup must be explicitly enabled before it can be disabled. + In case the backup is enabled for the Service Fabric application or service, which this partition is part of, this partition would continue to be periodically backed up as per the policy mapped at the higher level entity. + * + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> disablePartitionBackupWithServiceResponseAsync(UUID partitionId, Long timeout) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + return service.disablePartitionBackup(partitionId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = disablePartitionBackupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse disablePartitionBackupDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the partition backup configuration information. + * Gets the Service Fabric Backup configuration information for the specified partition. + * + * @param partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PartitionBackupConfigurationInfoInner object if successful. + */ + public PartitionBackupConfigurationInfoInner getPartitionBackupConfigurationInfo(UUID partitionId) { + return getPartitionBackupConfigurationInfoWithServiceResponseAsync(partitionId).toBlocking().single().body(); + } + + /** + * Gets the partition backup configuration information. + * Gets the Service Fabric Backup configuration information for the specified partition. + * + * @param partitionId The identity of the partition. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getPartitionBackupConfigurationInfoAsync(UUID partitionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPartitionBackupConfigurationInfoWithServiceResponseAsync(partitionId), serviceCallback); + } + + /** + * Gets the partition backup configuration information. + * Gets the Service Fabric Backup configuration information for the specified partition. + * + * @param partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PartitionBackupConfigurationInfoInner object + */ + public Observable getPartitionBackupConfigurationInfoAsync(UUID partitionId) { + return getPartitionBackupConfigurationInfoWithServiceResponseAsync(partitionId).map(new Func1, PartitionBackupConfigurationInfoInner>() { + @Override + public PartitionBackupConfigurationInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the partition backup configuration information. + * Gets the Service Fabric Backup configuration information for the specified partition. + * + * @param partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PartitionBackupConfigurationInfoInner object + */ + public Observable> getPartitionBackupConfigurationInfoWithServiceResponseAsync(UUID partitionId) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + final Long timeout = null; + return service.getPartitionBackupConfigurationInfo(partitionId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPartitionBackupConfigurationInfoDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the partition backup configuration information. + * Gets the Service Fabric Backup configuration information for the specified partition. + * + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PartitionBackupConfigurationInfoInner object if successful. + */ + public PartitionBackupConfigurationInfoInner getPartitionBackupConfigurationInfo(UUID partitionId, Long timeout) { + return getPartitionBackupConfigurationInfoWithServiceResponseAsync(partitionId, timeout).toBlocking().single().body(); + } + + /** + * Gets the partition backup configuration information. + * Gets the Service Fabric Backup configuration information for the specified partition. + * + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getPartitionBackupConfigurationInfoAsync(UUID partitionId, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPartitionBackupConfigurationInfoWithServiceResponseAsync(partitionId, timeout), serviceCallback); + } + + /** + * Gets the partition backup configuration information. + * Gets the Service Fabric Backup configuration information for the specified partition. + * + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PartitionBackupConfigurationInfoInner object + */ + public Observable getPartitionBackupConfigurationInfoAsync(UUID partitionId, Long timeout) { + return getPartitionBackupConfigurationInfoWithServiceResponseAsync(partitionId, timeout).map(new Func1, PartitionBackupConfigurationInfoInner>() { + @Override + public PartitionBackupConfigurationInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the partition backup configuration information. + * Gets the Service Fabric Backup configuration information for the specified partition. + * + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PartitionBackupConfigurationInfoInner object + */ + public Observable> getPartitionBackupConfigurationInfoWithServiceResponseAsync(UUID partitionId, Long timeout) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + return service.getPartitionBackupConfigurationInfo(partitionId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPartitionBackupConfigurationInfoDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getPartitionBackupConfigurationInfoDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the list of backups available for the specified partition. + * Returns a list of backups available for the specified partition. The server enumerates all the backups available in the backup store configured in the backup policy. It also allows filtering of the result based on start and end datetime or just fetching the latest available backup for the partition. + * + * @param partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedBackupInfoListInner object if successful. + */ + public PagedBackupInfoListInner getPartitionBackupList(UUID partitionId) { + return getPartitionBackupListWithServiceResponseAsync(partitionId).toBlocking().single().body(); + } + + /** + * Gets the list of backups available for the specified partition. + * Returns a list of backups available for the specified partition. The server enumerates all the backups available in the backup store configured in the backup policy. It also allows filtering of the result based on start and end datetime or just fetching the latest available backup for the partition. + * + * @param partitionId The identity of the partition. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getPartitionBackupListAsync(UUID partitionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPartitionBackupListWithServiceResponseAsync(partitionId), serviceCallback); + } + + /** + * Gets the list of backups available for the specified partition. + * Returns a list of backups available for the specified partition. The server enumerates all the backups available in the backup store configured in the backup policy. It also allows filtering of the result based on start and end datetime or just fetching the latest available backup for the partition. + * + * @param partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedBackupInfoListInner object + */ + public Observable getPartitionBackupListAsync(UUID partitionId) { + return getPartitionBackupListWithServiceResponseAsync(partitionId).map(new Func1, PagedBackupInfoListInner>() { + @Override + public PagedBackupInfoListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the list of backups available for the specified partition. + * Returns a list of backups available for the specified partition. The server enumerates all the backups available in the backup store configured in the backup policy. It also allows filtering of the result based on start and end datetime or just fetching the latest available backup for the partition. + * + * @param partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedBackupInfoListInner object + */ + public Observable> getPartitionBackupListWithServiceResponseAsync(UUID partitionId) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + final Long timeout = null; + final Boolean latest = null; + final DateTime startDateTimeFilter = null; + final DateTime endDateTimeFilter = null; + return service.getPartitionBackupList(partitionId, apiVersion, timeout, latest, startDateTimeFilter, endDateTimeFilter, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPartitionBackupListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the list of backups available for the specified partition. + * Returns a list of backups available for the specified partition. The server enumerates all the backups available in the backup store configured in the backup policy. It also allows filtering of the result based on start and end datetime or just fetching the latest available backup for the partition. + * + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param latest Specifies whether to get only the most recent backup available for a partition for the specified time range. + * @param 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedBackupInfoListInner object if successful. + */ + public PagedBackupInfoListInner getPartitionBackupList(UUID partitionId, Long timeout, Boolean latest, DateTime startDateTimeFilter, DateTime endDateTimeFilter) { + return getPartitionBackupListWithServiceResponseAsync(partitionId, timeout, latest, startDateTimeFilter, endDateTimeFilter).toBlocking().single().body(); + } + + /** + * Gets the list of backups available for the specified partition. + * Returns a list of backups available for the specified partition. The server enumerates all the backups available in the backup store configured in the backup policy. It also allows filtering of the result based on start and end datetime or just fetching the latest available backup for the partition. + * + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param latest Specifies whether to get only the most recent backup available for a partition for the specified time range. + * @param 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 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getPartitionBackupListAsync(UUID partitionId, Long timeout, Boolean latest, DateTime startDateTimeFilter, DateTime endDateTimeFilter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPartitionBackupListWithServiceResponseAsync(partitionId, timeout, latest, startDateTimeFilter, endDateTimeFilter), serviceCallback); + } + + /** + * Gets the list of backups available for the specified partition. + * Returns a list of backups available for the specified partition. The server enumerates all the backups available in the backup store configured in the backup policy. It also allows filtering of the result based on start and end datetime or just fetching the latest available backup for the partition. + * + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param latest Specifies whether to get only the most recent backup available for a partition for the specified time range. + * @param 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedBackupInfoListInner object + */ + public Observable getPartitionBackupListAsync(UUID partitionId, Long timeout, Boolean latest, DateTime startDateTimeFilter, DateTime endDateTimeFilter) { + return getPartitionBackupListWithServiceResponseAsync(partitionId, timeout, latest, startDateTimeFilter, endDateTimeFilter).map(new Func1, PagedBackupInfoListInner>() { + @Override + public PagedBackupInfoListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the list of backups available for the specified partition. + * Returns a list of backups available for the specified partition. The server enumerates all the backups available in the backup store configured in the backup policy. It also allows filtering of the result based on start and end datetime or just fetching the latest available backup for the partition. + * + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param latest Specifies whether to get only the most recent backup available for a partition for the specified time range. + * @param 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedBackupInfoListInner object + */ + public Observable> getPartitionBackupListWithServiceResponseAsync(UUID partitionId, Long timeout, Boolean latest, DateTime startDateTimeFilter, DateTime endDateTimeFilter) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + return service.getPartitionBackupList(partitionId, apiVersion, timeout, latest, startDateTimeFilter, endDateTimeFilter, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPartitionBackupListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getPartitionBackupListDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Suspends periodic backup for the specified partition. + * The partition which is configured to take periodic backups, is suspended for taking further backups till it is resumed again. + * + * @param partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void suspendPartitionBackup(UUID partitionId) { + suspendPartitionBackupWithServiceResponseAsync(partitionId).toBlocking().single().body(); + } + + /** + * Suspends periodic backup for the specified partition. + * The partition which is configured to take periodic backups, is suspended for taking further backups till it is resumed again. + * + * @param partitionId The identity of the partition. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture suspendPartitionBackupAsync(UUID partitionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(suspendPartitionBackupWithServiceResponseAsync(partitionId), serviceCallback); + } + + /** + * Suspends periodic backup for the specified partition. + * The partition which is configured to take periodic backups, is suspended for taking further backups till it is resumed again. + * + * @param partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable suspendPartitionBackupAsync(UUID partitionId) { + return suspendPartitionBackupWithServiceResponseAsync(partitionId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Suspends periodic backup for the specified partition. + * The partition which is configured to take periodic backups, is suspended for taking further backups till it is resumed again. + * + * @param partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> suspendPartitionBackupWithServiceResponseAsync(UUID partitionId) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + final Long timeout = null; + return service.suspendPartitionBackup(partitionId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = suspendPartitionBackupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Suspends periodic backup for the specified partition. + * The partition which is configured to take periodic backups, is suspended for taking further backups till it is resumed again. + * + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void suspendPartitionBackup(UUID partitionId, Long timeout) { + suspendPartitionBackupWithServiceResponseAsync(partitionId, timeout).toBlocking().single().body(); + } + + /** + * Suspends periodic backup for the specified partition. + * The partition which is configured to take periodic backups, is suspended for taking further backups till it is resumed again. + * + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture suspendPartitionBackupAsync(UUID partitionId, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(suspendPartitionBackupWithServiceResponseAsync(partitionId, timeout), serviceCallback); + } + + /** + * Suspends periodic backup for the specified partition. + * The partition which is configured to take periodic backups, is suspended for taking further backups till it is resumed again. + * + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable suspendPartitionBackupAsync(UUID partitionId, Long timeout) { + return suspendPartitionBackupWithServiceResponseAsync(partitionId, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Suspends periodic backup for the specified partition. + * The partition which is configured to take periodic backups, is suspended for taking further backups till it is resumed again. + * + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> suspendPartitionBackupWithServiceResponseAsync(UUID partitionId, Long timeout) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + return service.suspendPartitionBackup(partitionId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = suspendPartitionBackupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse suspendPartitionBackupDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Resumes periodic backup of partition which was previously suspended. + * The previously suspended partition resumes taking periodic backup as per the backup policy currently configured for the same. + * + * @param partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void resumePartitionBackup(UUID partitionId) { + resumePartitionBackupWithServiceResponseAsync(partitionId).toBlocking().single().body(); + } + + /** + * Resumes periodic backup of partition which was previously suspended. + * The previously suspended partition resumes taking periodic backup as per the backup policy currently configured for the same. + * + * @param partitionId The identity of the partition. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture resumePartitionBackupAsync(UUID partitionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resumePartitionBackupWithServiceResponseAsync(partitionId), serviceCallback); + } + + /** + * Resumes periodic backup of partition which was previously suspended. + * The previously suspended partition resumes taking periodic backup as per the backup policy currently configured for the same. + * + * @param partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable resumePartitionBackupAsync(UUID partitionId) { + return resumePartitionBackupWithServiceResponseAsync(partitionId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resumes periodic backup of partition which was previously suspended. + * The previously suspended partition resumes taking periodic backup as per the backup policy currently configured for the same. + * + * @param partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> resumePartitionBackupWithServiceResponseAsync(UUID partitionId) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + final Long timeout = null; + return service.resumePartitionBackup(partitionId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = resumePartitionBackupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Resumes periodic backup of partition which was previously suspended. + * The previously suspended partition resumes taking periodic backup as per the backup policy currently configured for the same. + * + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void resumePartitionBackup(UUID partitionId, Long timeout) { + resumePartitionBackupWithServiceResponseAsync(partitionId, timeout).toBlocking().single().body(); + } + + /** + * Resumes periodic backup of partition which was previously suspended. + * The previously suspended partition resumes taking periodic backup as per the backup policy currently configured for the same. + * + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture resumePartitionBackupAsync(UUID partitionId, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resumePartitionBackupWithServiceResponseAsync(partitionId, timeout), serviceCallback); + } + + /** + * Resumes periodic backup of partition which was previously suspended. + * The previously suspended partition resumes taking periodic backup as per the backup policy currently configured for the same. + * + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable resumePartitionBackupAsync(UUID partitionId, Long timeout) { + return resumePartitionBackupWithServiceResponseAsync(partitionId, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resumes periodic backup of partition which was previously suspended. + * The previously suspended partition resumes taking periodic backup as per the backup policy currently configured for the same. + * + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> resumePartitionBackupWithServiceResponseAsync(UUID partitionId, Long timeout) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + return service.resumePartitionBackup(partitionId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = resumePartitionBackupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse resumePartitionBackupDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Triggers backup of the partition's state. + * Creates a backup of the stateful persisted partition's state. In case the partition is already being periodically backed up, then by default the new backup is created at the same backup storage. One can also override the same by specifying the backup storage details as part of the request body. Once the backup is initiated, its progress can be tracked using the GetBackupProgress operation. + In case, the operation times out, specify a greater backup timeout value in the query parameter. + * + * @param partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void backupPartition(UUID partitionId) { + backupPartitionWithServiceResponseAsync(partitionId).toBlocking().single().body(); + } + + /** + * Triggers backup of the partition's state. + * Creates a backup of the stateful persisted partition's state. In case the partition is already being periodically backed up, then by default the new backup is created at the same backup storage. One can also override the same by specifying the backup storage details as part of the request body. Once the backup is initiated, its progress can be tracked using the GetBackupProgress operation. + In case, the operation times out, specify a greater backup timeout value in the query parameter. + * + * @param partitionId The identity of the partition. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture backupPartitionAsync(UUID partitionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(backupPartitionWithServiceResponseAsync(partitionId), serviceCallback); + } + + /** + * Triggers backup of the partition's state. + * Creates a backup of the stateful persisted partition's state. In case the partition is already being periodically backed up, then by default the new backup is created at the same backup storage. One can also override the same by specifying the backup storage details as part of the request body. Once the backup is initiated, its progress can be tracked using the GetBackupProgress operation. + In case, the operation times out, specify a greater backup timeout value in the query parameter. + * + * @param partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable backupPartitionAsync(UUID partitionId) { + return backupPartitionWithServiceResponseAsync(partitionId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Triggers backup of the partition's state. + * Creates a backup of the stateful persisted partition's state. In case the partition is already being periodically backed up, then by default the new backup is created at the same backup storage. One can also override the same by specifying the backup storage details as part of the request body. Once the backup is initiated, its progress can be tracked using the GetBackupProgress operation. + In case, the operation times out, specify a greater backup timeout value in the query parameter. + * + * @param partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> backupPartitionWithServiceResponseAsync(UUID partitionId) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + final Integer backupTimeout = null; + final Long timeout = null; + final BackupStorageDescription backupStorage = null; + BackupPartitionDescription backupPartitionDescription = new BackupPartitionDescription(); + backupPartitionDescription.withBackupStorage(null); + return service.backupPartition(partitionId, backupTimeout, apiVersion, timeout, this.acceptLanguage(), backupPartitionDescription, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = backupPartitionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Triggers backup of the partition's state. + * Creates a backup of the stateful persisted partition's state. In case the partition is already being periodically backed up, then by default the new backup is created at the same backup storage. One can also override the same by specifying the backup storage details as part of the request body. Once the backup is initiated, its progress can be tracked using the GetBackupProgress operation. + In case, the operation times out, specify a greater backup timeout value in the query parameter. + * + * @param partitionId The identity of the partition. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param backupStorage Specifies the details of the backup storage where to save the backup. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void backupPartition(UUID partitionId, Integer backupTimeout, Long timeout, BackupStorageDescription backupStorage) { + backupPartitionWithServiceResponseAsync(partitionId, backupTimeout, timeout, backupStorage).toBlocking().single().body(); + } + + /** + * Triggers backup of the partition's state. + * Creates a backup of the stateful persisted partition's state. In case the partition is already being periodically backed up, then by default the new backup is created at the same backup storage. One can also override the same by specifying the backup storage details as part of the request body. Once the backup is initiated, its progress can be tracked using the GetBackupProgress operation. + In case, the operation times out, specify a greater backup timeout value in the query parameter. + * + * @param partitionId The identity of the partition. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param backupStorage Specifies the details of the backup storage where to save the backup. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture backupPartitionAsync(UUID partitionId, Integer backupTimeout, Long timeout, BackupStorageDescription backupStorage, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(backupPartitionWithServiceResponseAsync(partitionId, backupTimeout, timeout, backupStorage), serviceCallback); + } + + /** + * Triggers backup of the partition's state. + * Creates a backup of the stateful persisted partition's state. In case the partition is already being periodically backed up, then by default the new backup is created at the same backup storage. One can also override the same by specifying the backup storage details as part of the request body. Once the backup is initiated, its progress can be tracked using the GetBackupProgress operation. + In case, the operation times out, specify a greater backup timeout value in the query parameter. + * + * @param partitionId The identity of the partition. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param backupStorage Specifies the details of the backup storage where to save the backup. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable backupPartitionAsync(UUID partitionId, Integer backupTimeout, Long timeout, BackupStorageDescription backupStorage) { + return backupPartitionWithServiceResponseAsync(partitionId, backupTimeout, timeout, backupStorage).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Triggers backup of the partition's state. + * Creates a backup of the stateful persisted partition's state. In case the partition is already being periodically backed up, then by default the new backup is created at the same backup storage. One can also override the same by specifying the backup storage details as part of the request body. Once the backup is initiated, its progress can be tracked using the GetBackupProgress operation. + In case, the operation times out, specify a greater backup timeout value in the query parameter. + * + * @param partitionId The identity of the partition. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param backupStorage Specifies the details of the backup storage where to save the backup. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> backupPartitionWithServiceResponseAsync(UUID partitionId, Integer backupTimeout, Long timeout, BackupStorageDescription backupStorage) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + Validator.validate(backupStorage); + final String apiVersion = "6.2-preview"; + BackupPartitionDescription backupPartitionDescription = null; + if (backupStorage != null) { + backupPartitionDescription = new BackupPartitionDescription(); + backupPartitionDescription.withBackupStorage(backupStorage); + } + return service.backupPartition(partitionId, backupTimeout, apiVersion, timeout, this.acceptLanguage(), backupPartitionDescription, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = backupPartitionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse backupPartitionDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets details for the latest backup triggered for this partition. + * Returns information about the state of the latest backup along with details or failure reason in case of completion. + * + * @param partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BackupProgressInfoInner object if successful. + */ + public BackupProgressInfoInner getPartitionBackupProgress(UUID partitionId) { + return getPartitionBackupProgressWithServiceResponseAsync(partitionId).toBlocking().single().body(); + } + + /** + * Gets details for the latest backup triggered for this partition. + * Returns information about the state of the latest backup along with details or failure reason in case of completion. + * + * @param partitionId The identity of the partition. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getPartitionBackupProgressAsync(UUID partitionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPartitionBackupProgressWithServiceResponseAsync(partitionId), serviceCallback); + } + + /** + * Gets details for the latest backup triggered for this partition. + * Returns information about the state of the latest backup along with details or failure reason in case of completion. + * + * @param partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupProgressInfoInner object + */ + public Observable getPartitionBackupProgressAsync(UUID partitionId) { + return getPartitionBackupProgressWithServiceResponseAsync(partitionId).map(new Func1, BackupProgressInfoInner>() { + @Override + public BackupProgressInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets details for the latest backup triggered for this partition. + * Returns information about the state of the latest backup along with details or failure reason in case of completion. + * + * @param partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupProgressInfoInner object + */ + public Observable> getPartitionBackupProgressWithServiceResponseAsync(UUID partitionId) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + final Long timeout = null; + return service.getPartitionBackupProgress(partitionId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPartitionBackupProgressDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets details for the latest backup triggered for this partition. + * Returns information about the state of the latest backup along with details or failure reason in case of completion. + * + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BackupProgressInfoInner object if successful. + */ + public BackupProgressInfoInner getPartitionBackupProgress(UUID partitionId, Long timeout) { + return getPartitionBackupProgressWithServiceResponseAsync(partitionId, timeout).toBlocking().single().body(); + } + + /** + * Gets details for the latest backup triggered for this partition. + * Returns information about the state of the latest backup along with details or failure reason in case of completion. + * + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getPartitionBackupProgressAsync(UUID partitionId, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPartitionBackupProgressWithServiceResponseAsync(partitionId, timeout), serviceCallback); + } + + /** + * Gets details for the latest backup triggered for this partition. + * Returns information about the state of the latest backup along with details or failure reason in case of completion. + * + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupProgressInfoInner object + */ + public Observable getPartitionBackupProgressAsync(UUID partitionId, Long timeout) { + return getPartitionBackupProgressWithServiceResponseAsync(partitionId, timeout).map(new Func1, BackupProgressInfoInner>() { + @Override + public BackupProgressInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets details for the latest backup triggered for this partition. + * Returns information about the state of the latest backup along with details or failure reason in case of completion. + * + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupProgressInfoInner object + */ + public Observable> getPartitionBackupProgressWithServiceResponseAsync(UUID partitionId, Long timeout) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + return service.getPartitionBackupProgress(partitionId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPartitionBackupProgressDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getPartitionBackupProgressDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 partitionId The identity of the partition. + * @param restorePartitionDescription Describes the parameters to restore the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void restorePartition(UUID partitionId, RestorePartitionDescription restorePartitionDescription) { + restorePartitionWithServiceResponseAsync(partitionId, restorePartitionDescription).toBlocking().single().body(); + } + + /** + * 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 partitionId The identity of the partition. + * @param restorePartitionDescription Describes the parameters to restore the partition. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture restorePartitionAsync(UUID partitionId, RestorePartitionDescription restorePartitionDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(restorePartitionWithServiceResponseAsync(partitionId, restorePartitionDescription), serviceCallback); + } + + /** + * 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 partitionId The identity of the partition. + * @param restorePartitionDescription Describes the parameters to restore the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable restorePartitionAsync(UUID partitionId, RestorePartitionDescription restorePartitionDescription) { + return restorePartitionWithServiceResponseAsync(partitionId, restorePartitionDescription).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 partitionId The identity of the partition. + * @param restorePartitionDescription Describes the parameters to restore the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> restorePartitionWithServiceResponseAsync(UUID partitionId, RestorePartitionDescription restorePartitionDescription) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + if (restorePartitionDescription == null) { + throw new IllegalArgumentException("Parameter restorePartitionDescription is required and cannot be null."); + } + Validator.validate(restorePartitionDescription); + final String apiVersion = "6.2-preview"; + final Integer restoreTimeout = null; + final Long timeout = null; + return service.restorePartition(partitionId, restorePartitionDescription, restoreTimeout, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = restorePartitionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 partitionId The identity of the partition. + * @param restorePartitionDescription Describes the parameters to restore the partition. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void restorePartition(UUID partitionId, RestorePartitionDescription restorePartitionDescription, Integer restoreTimeout, Long timeout) { + restorePartitionWithServiceResponseAsync(partitionId, restorePartitionDescription, restoreTimeout, timeout).toBlocking().single().body(); + } + + /** + * 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 partitionId The identity of the partition. + * @param restorePartitionDescription Describes the parameters to restore the partition. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture restorePartitionAsync(UUID partitionId, RestorePartitionDescription restorePartitionDescription, Integer restoreTimeout, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(restorePartitionWithServiceResponseAsync(partitionId, restorePartitionDescription, restoreTimeout, timeout), serviceCallback); + } + + /** + * 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 partitionId The identity of the partition. + * @param restorePartitionDescription Describes the parameters to restore the partition. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable restorePartitionAsync(UUID partitionId, RestorePartitionDescription restorePartitionDescription, Integer restoreTimeout, Long timeout) { + return restorePartitionWithServiceResponseAsync(partitionId, restorePartitionDescription, restoreTimeout, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 partitionId The identity of the partition. + * @param restorePartitionDescription Describes the parameters to restore the partition. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> restorePartitionWithServiceResponseAsync(UUID partitionId, RestorePartitionDescription restorePartitionDescription, Integer restoreTimeout, Long timeout) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + if (restorePartitionDescription == null) { + throw new IllegalArgumentException("Parameter restorePartitionDescription is required and cannot be null."); + } + Validator.validate(restorePartitionDescription); + final String apiVersion = "6.2-preview"; + return service.restorePartition(partitionId, restorePartitionDescription, restoreTimeout, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = restorePartitionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse restorePartitionDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets details for the latest restore operation triggered for this partition. + * Returns information about the state of the latest restore operation along with details or failure reason in case of completion. + * + * @param partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RestoreProgressInfoInner object if successful. + */ + public RestoreProgressInfoInner getPartitionRestoreProgress(UUID partitionId) { + return getPartitionRestoreProgressWithServiceResponseAsync(partitionId).toBlocking().single().body(); + } + + /** + * Gets details for the latest restore operation triggered for this partition. + * Returns information about the state of the latest restore operation along with details or failure reason in case of completion. + * + * @param partitionId The identity of the partition. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getPartitionRestoreProgressAsync(UUID partitionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPartitionRestoreProgressWithServiceResponseAsync(partitionId), serviceCallback); + } + + /** + * Gets details for the latest restore operation triggered for this partition. + * Returns information about the state of the latest restore operation along with details or failure reason in case of completion. + * + * @param partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RestoreProgressInfoInner object + */ + public Observable getPartitionRestoreProgressAsync(UUID partitionId) { + return getPartitionRestoreProgressWithServiceResponseAsync(partitionId).map(new Func1, RestoreProgressInfoInner>() { + @Override + public RestoreProgressInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets details for the latest restore operation triggered for this partition. + * Returns information about the state of the latest restore operation along with details or failure reason in case of completion. + * + * @param partitionId The identity of the partition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RestoreProgressInfoInner object + */ + public Observable> getPartitionRestoreProgressWithServiceResponseAsync(UUID partitionId) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + final Long timeout = null; + return service.getPartitionRestoreProgress(partitionId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPartitionRestoreProgressDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets details for the latest restore operation triggered for this partition. + * Returns information about the state of the latest restore operation along with details or failure reason in case of completion. + * + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RestoreProgressInfoInner object if successful. + */ + public RestoreProgressInfoInner getPartitionRestoreProgress(UUID partitionId, Long timeout) { + return getPartitionRestoreProgressWithServiceResponseAsync(partitionId, timeout).toBlocking().single().body(); + } + + /** + * Gets details for the latest restore operation triggered for this partition. + * Returns information about the state of the latest restore operation along with details or failure reason in case of completion. + * + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getPartitionRestoreProgressAsync(UUID partitionId, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPartitionRestoreProgressWithServiceResponseAsync(partitionId, timeout), serviceCallback); + } + + /** + * Gets details for the latest restore operation triggered for this partition. + * Returns information about the state of the latest restore operation along with details or failure reason in case of completion. + * + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RestoreProgressInfoInner object + */ + public Observable getPartitionRestoreProgressAsync(UUID partitionId, Long timeout) { + return getPartitionRestoreProgressWithServiceResponseAsync(partitionId, timeout).map(new Func1, RestoreProgressInfoInner>() { + @Override + public RestoreProgressInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets details for the latest restore operation triggered for this partition. + * Returns information about the state of the latest restore operation along with details or failure reason in case of completion. + * + * @param partitionId The identity of the partition. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RestoreProgressInfoInner object + */ + public Observable> getPartitionRestoreProgressWithServiceResponseAsync(UUID partitionId, Long timeout) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + return service.getPartitionRestoreProgress(partitionId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPartitionRestoreProgressDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getPartitionRestoreProgressDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 getBackupByStorageQueryDescription Describes the filters and backup storage details to be used for enumerating backups. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedBackupInfoListInner object if successful. + */ + public PagedBackupInfoListInner getBackupsFromBackupLocation(GetBackupByStorageQueryDescription getBackupByStorageQueryDescription) { + return getBackupsFromBackupLocationWithServiceResponseAsync(getBackupByStorageQueryDescription).toBlocking().single().body(); + } + + /** + * 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 getBackupByStorageQueryDescription Describes the filters and backup storage details to be used for enumerating backups. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getBackupsFromBackupLocationAsync(GetBackupByStorageQueryDescription getBackupByStorageQueryDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getBackupsFromBackupLocationWithServiceResponseAsync(getBackupByStorageQueryDescription), serviceCallback); + } + + /** + * 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 getBackupByStorageQueryDescription Describes the filters and backup storage details to be used for enumerating backups. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedBackupInfoListInner object + */ + public Observable getBackupsFromBackupLocationAsync(GetBackupByStorageQueryDescription getBackupByStorageQueryDescription) { + return getBackupsFromBackupLocationWithServiceResponseAsync(getBackupByStorageQueryDescription).map(new Func1, PagedBackupInfoListInner>() { + @Override + public PagedBackupInfoListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 getBackupByStorageQueryDescription Describes the filters and backup storage details to be used for enumerating backups. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedBackupInfoListInner object + */ + public Observable> getBackupsFromBackupLocationWithServiceResponseAsync(GetBackupByStorageQueryDescription getBackupByStorageQueryDescription) { + if (getBackupByStorageQueryDescription == null) { + throw new IllegalArgumentException("Parameter getBackupByStorageQueryDescription is required and cannot be null."); + } + Validator.validate(getBackupByStorageQueryDescription); + final String apiVersion = "6.2-preview"; + final Long timeout = null; + final String continuationToken = null; + final Long maxResults = null; + return service.getBackupsFromBackupLocation(apiVersion, timeout, continuationToken, maxResults, getBackupByStorageQueryDescription, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getBackupsFromBackupLocationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 getBackupByStorageQueryDescription Describes the filters and backup storage details to be used for enumerating backups. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedBackupInfoListInner object if successful. + */ + public PagedBackupInfoListInner getBackupsFromBackupLocation(GetBackupByStorageQueryDescription getBackupByStorageQueryDescription, Long timeout, String continuationToken, Long maxResults) { + return getBackupsFromBackupLocationWithServiceResponseAsync(getBackupByStorageQueryDescription, timeout, continuationToken, maxResults).toBlocking().single().body(); + } + + /** + * 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 getBackupByStorageQueryDescription Describes the filters and backup storage details to be used for enumerating backups. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param 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 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getBackupsFromBackupLocationAsync(GetBackupByStorageQueryDescription getBackupByStorageQueryDescription, Long timeout, String continuationToken, Long maxResults, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getBackupsFromBackupLocationWithServiceResponseAsync(getBackupByStorageQueryDescription, timeout, continuationToken, maxResults), serviceCallback); + } + + /** + * 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 getBackupByStorageQueryDescription Describes the filters and backup storage details to be used for enumerating backups. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedBackupInfoListInner object + */ + public Observable getBackupsFromBackupLocationAsync(GetBackupByStorageQueryDescription getBackupByStorageQueryDescription, Long timeout, String continuationToken, Long maxResults) { + return getBackupsFromBackupLocationWithServiceResponseAsync(getBackupByStorageQueryDescription, timeout, continuationToken, maxResults).map(new Func1, PagedBackupInfoListInner>() { + @Override + public PagedBackupInfoListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 getBackupByStorageQueryDescription Describes the filters and backup storage details to be used for enumerating backups. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedBackupInfoListInner object + */ + public Observable> getBackupsFromBackupLocationWithServiceResponseAsync(GetBackupByStorageQueryDescription getBackupByStorageQueryDescription, Long timeout, String continuationToken, Long maxResults) { + if (getBackupByStorageQueryDescription == null) { + throw new IllegalArgumentException("Parameter getBackupByStorageQueryDescription is required and cannot be null."); + } + Validator.validate(getBackupByStorageQueryDescription); + final String apiVersion = "6.2-preview"; + return service.getBackupsFromBackupLocation(apiVersion, timeout, continuationToken, maxResults, getBackupByStorageQueryDescription, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getBackupsFromBackupLocationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getBackupsFromBackupLocationDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Creates a Service Fabric name. + * Creates the specified Service Fabric name. + * + * @param name The Service Fabric name, including the 'fabric:' URI scheme. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void createName(String name) { + createNameWithServiceResponseAsync(name).toBlocking().single().body(); + } + + /** + * Creates a Service Fabric name. + * Creates the specified Service Fabric name. + * + * @param name The Service Fabric name, including the 'fabric:' URI scheme. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createNameAsync(String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createNameWithServiceResponseAsync(name), serviceCallback); + } + + /** + * Creates a Service Fabric name. + * Creates the specified Service Fabric name. + * + * @param name The Service Fabric name, including the 'fabric:' URI scheme. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable createNameAsync(String name) { + return createNameWithServiceResponseAsync(name).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a Service Fabric name. + * Creates the specified Service Fabric name. + * + * @param name The Service Fabric name, including the 'fabric:' URI scheme. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> createNameWithServiceResponseAsync(String name) { + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + NameDescription nameDescription = new NameDescription(); + nameDescription.withName(name); + return service.createName(apiVersion, timeout, this.acceptLanguage(), nameDescription, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createNameDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Creates a Service Fabric name. + * Creates the specified Service Fabric name. + * + * @param name The Service Fabric name, including the 'fabric:' URI scheme. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void createName(String name, Long timeout) { + createNameWithServiceResponseAsync(name, timeout).toBlocking().single().body(); + } + + /** + * Creates a Service Fabric name. + * Creates the specified Service Fabric name. + * + * @param name The Service Fabric name, including the 'fabric:' URI scheme. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createNameAsync(String name, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createNameWithServiceResponseAsync(name, timeout), serviceCallback); + } + + /** + * Creates a Service Fabric name. + * Creates the specified Service Fabric name. + * + * @param name The Service Fabric name, including the 'fabric:' URI scheme. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable createNameAsync(String name, Long timeout) { + return createNameWithServiceResponseAsync(name, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a Service Fabric name. + * Creates the specified Service Fabric name. + * + * @param name The Service Fabric name, including the 'fabric:' URI scheme. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> createNameWithServiceResponseAsync(String name, Long timeout) { + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + final String apiVersion = "6.0"; + NameDescription nameDescription = new NameDescription(); + nameDescription.withName(name); + return service.createName(apiVersion, timeout, this.acceptLanguage(), nameDescription, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createNameDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createNameDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Returns whether the Service Fabric name exists. + * Returns whether the specified Service Fabric name exists. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getNameExistsInfo(String nameId) { + getNameExistsInfoWithServiceResponseAsync(nameId).toBlocking().single().body(); + } + + /** + * Returns whether the Service Fabric name exists. + * Returns whether the specified Service Fabric name exists. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNameExistsInfoAsync(String nameId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNameExistsInfoWithServiceResponseAsync(nameId), serviceCallback); + } + + /** + * Returns whether the Service Fabric name exists. + * Returns whether the specified Service Fabric name exists. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getNameExistsInfoAsync(String nameId) { + return getNameExistsInfoWithServiceResponseAsync(nameId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns whether the Service Fabric name exists. + * Returns whether the specified Service Fabric name exists. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getNameExistsInfoWithServiceResponseAsync(String nameId) { + if (nameId == null) { + throw new IllegalArgumentException("Parameter nameId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + return service.getNameExistsInfo(nameId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getNameExistsInfoDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Returns whether the Service Fabric name exists. + * Returns whether the specified Service Fabric name exists. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getNameExistsInfo(String nameId, Long timeout) { + getNameExistsInfoWithServiceResponseAsync(nameId, timeout).toBlocking().single().body(); + } + + /** + * Returns whether the Service Fabric name exists. + * Returns whether the specified Service Fabric name exists. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNameExistsInfoAsync(String nameId, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNameExistsInfoWithServiceResponseAsync(nameId, timeout), serviceCallback); + } + + /** + * Returns whether the Service Fabric name exists. + * Returns whether the specified Service Fabric name exists. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getNameExistsInfoAsync(String nameId, Long timeout) { + return getNameExistsInfoWithServiceResponseAsync(nameId, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns whether the Service Fabric name exists. + * Returns whether the specified Service Fabric name exists. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getNameExistsInfoWithServiceResponseAsync(String nameId, Long timeout) { + if (nameId == null) { + throw new IllegalArgumentException("Parameter nameId is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.getNameExistsInfo(nameId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getNameExistsInfoDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getNameExistsInfoDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Deletes a Service Fabric name. + * Deletes the specified Service Fabric name. A name must be created before it can be deleted. Deleting a name with child properties will fail. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteName(String nameId) { + deleteNameWithServiceResponseAsync(nameId).toBlocking().single().body(); + } + + /** + * Deletes a Service Fabric name. + * Deletes the specified Service Fabric name. A name must be created before it can be deleted. Deleting a name with child properties will fail. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteNameAsync(String nameId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteNameWithServiceResponseAsync(nameId), serviceCallback); + } + + /** + * Deletes a Service Fabric name. + * Deletes the specified Service Fabric name. A name must be created before it can be deleted. Deleting a name with child properties will fail. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteNameAsync(String nameId) { + return deleteNameWithServiceResponseAsync(nameId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a Service Fabric name. + * Deletes the specified Service Fabric name. A name must be created before it can be deleted. Deleting a name with child properties will fail. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteNameWithServiceResponseAsync(String nameId) { + if (nameId == null) { + throw new IllegalArgumentException("Parameter nameId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + return service.deleteName(nameId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteNameDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Deletes a Service Fabric name. + * Deletes the specified Service Fabric name. A name must be created before it can be deleted. Deleting a name with child properties will fail. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteName(String nameId, Long timeout) { + deleteNameWithServiceResponseAsync(nameId, timeout).toBlocking().single().body(); + } + + /** + * Deletes a Service Fabric name. + * Deletes the specified Service Fabric name. A name must be created before it can be deleted. Deleting a name with child properties will fail. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteNameAsync(String nameId, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteNameWithServiceResponseAsync(nameId, timeout), serviceCallback); + } + + /** + * Deletes a Service Fabric name. + * Deletes the specified Service Fabric name. A name must be created before it can be deleted. Deleting a name with child properties will fail. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteNameAsync(String nameId, Long timeout) { + return deleteNameWithServiceResponseAsync(nameId, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a Service Fabric name. + * Deletes the specified Service Fabric name. A name must be created before it can be deleted. Deleting a name with child properties will fail. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteNameWithServiceResponseAsync(String nameId, Long timeout) { + if (nameId == null) { + throw new IllegalArgumentException("Parameter nameId is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.deleteName(nameId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteNameDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteNameDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Enumerates all the Service Fabric names under a given name. + * Enumerates all the Service Fabric names under a given name. If the subnames do not fit in a page, one page of results is returned as well as a continuation token, which can be used to get the next page. Querying a name that doesn't exist will fail. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedSubNameInfoListInner object if successful. + */ + public PagedSubNameInfoListInner getSubNameInfoList(String nameId) { + return getSubNameInfoListWithServiceResponseAsync(nameId).toBlocking().single().body(); + } + + /** + * Enumerates all the Service Fabric names under a given name. + * Enumerates all the Service Fabric names under a given name. If the subnames do not fit in a page, one page of results is returned as well as a continuation token, which can be used to get the next page. Querying a name that doesn't exist will fail. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getSubNameInfoListAsync(String nameId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSubNameInfoListWithServiceResponseAsync(nameId), serviceCallback); + } + + /** + * Enumerates all the Service Fabric names under a given name. + * Enumerates all the Service Fabric names under a given name. If the subnames do not fit in a page, one page of results is returned as well as a continuation token, which can be used to get the next page. Querying a name that doesn't exist will fail. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedSubNameInfoListInner object + */ + public Observable getSubNameInfoListAsync(String nameId) { + return getSubNameInfoListWithServiceResponseAsync(nameId).map(new Func1, PagedSubNameInfoListInner>() { + @Override + public PagedSubNameInfoListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Enumerates all the Service Fabric names under a given name. + * Enumerates all the Service Fabric names under a given name. If the subnames do not fit in a page, one page of results is returned as well as a continuation token, which can be used to get the next page. Querying a name that doesn't exist will fail. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedSubNameInfoListInner object + */ + public Observable> getSubNameInfoListWithServiceResponseAsync(String nameId) { + if (nameId == null) { + throw new IllegalArgumentException("Parameter nameId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Boolean recursive = null; + final String continuationToken = null; + final Long timeout = null; + return service.getSubNameInfoList(nameId, apiVersion, recursive, continuationToken, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSubNameInfoListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Enumerates all the Service Fabric names under a given name. + * Enumerates all the Service Fabric names under a given name. If the subnames do not fit in a page, one page of results is returned as well as a continuation token, which can be used to get the next page. Querying a name that doesn't exist will fail. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param recursive Allows specifying that the search performed should be recursive. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedSubNameInfoListInner object if successful. + */ + public PagedSubNameInfoListInner getSubNameInfoList(String nameId, Boolean recursive, String continuationToken, Long timeout) { + return getSubNameInfoListWithServiceResponseAsync(nameId, recursive, continuationToken, timeout).toBlocking().single().body(); + } + + /** + * Enumerates all the Service Fabric names under a given name. + * Enumerates all the Service Fabric names under a given name. If the subnames do not fit in a page, one page of results is returned as well as a continuation token, which can be used to get the next page. Querying a name that doesn't exist will fail. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param recursive Allows specifying that the search performed should be recursive. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getSubNameInfoListAsync(String nameId, Boolean recursive, String continuationToken, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSubNameInfoListWithServiceResponseAsync(nameId, recursive, continuationToken, timeout), serviceCallback); + } + + /** + * Enumerates all the Service Fabric names under a given name. + * Enumerates all the Service Fabric names under a given name. If the subnames do not fit in a page, one page of results is returned as well as a continuation token, which can be used to get the next page. Querying a name that doesn't exist will fail. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param recursive Allows specifying that the search performed should be recursive. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedSubNameInfoListInner object + */ + public Observable getSubNameInfoListAsync(String nameId, Boolean recursive, String continuationToken, Long timeout) { + return getSubNameInfoListWithServiceResponseAsync(nameId, recursive, continuationToken, timeout).map(new Func1, PagedSubNameInfoListInner>() { + @Override + public PagedSubNameInfoListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Enumerates all the Service Fabric names under a given name. + * Enumerates all the Service Fabric names under a given name. If the subnames do not fit in a page, one page of results is returned as well as a continuation token, which can be used to get the next page. Querying a name that doesn't exist will fail. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param recursive Allows specifying that the search performed should be recursive. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedSubNameInfoListInner object + */ + public Observable> getSubNameInfoListWithServiceResponseAsync(String nameId, Boolean recursive, String continuationToken, Long timeout) { + if (nameId == null) { + throw new IllegalArgumentException("Parameter nameId is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.getSubNameInfoList(nameId, apiVersion, recursive, continuationToken, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSubNameInfoListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getSubNameInfoListDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets information on all Service Fabric properties under a given name. + * A Service Fabric name can have one or more named properties that store custom information. This operation gets the information about these properties in a paged list. The information includes name, value, and metadata about each of the properties. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedPropertyInfoListInner object if successful. + */ + public PagedPropertyInfoListInner getPropertyInfoList(String nameId) { + return getPropertyInfoListWithServiceResponseAsync(nameId).toBlocking().single().body(); + } + + /** + * Gets information on all Service Fabric properties under a given name. + * A Service Fabric name can have one or more named properties that store custom information. This operation gets the information about these properties in a paged list. The information includes name, value, and metadata about each of the properties. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getPropertyInfoListAsync(String nameId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPropertyInfoListWithServiceResponseAsync(nameId), serviceCallback); + } + + /** + * Gets information on all Service Fabric properties under a given name. + * A Service Fabric name can have one or more named properties that store custom information. This operation gets the information about these properties in a paged list. The information includes name, value, and metadata about each of the properties. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedPropertyInfoListInner object + */ + public Observable getPropertyInfoListAsync(String nameId) { + return getPropertyInfoListWithServiceResponseAsync(nameId).map(new Func1, PagedPropertyInfoListInner>() { + @Override + public PagedPropertyInfoListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets information on all Service Fabric properties under a given name. + * A Service Fabric name can have one or more named properties that store custom information. This operation gets the information about these properties in a paged list. The information includes name, value, and metadata about each of the properties. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedPropertyInfoListInner object + */ + public Observable> getPropertyInfoListWithServiceResponseAsync(String nameId) { + if (nameId == null) { + throw new IllegalArgumentException("Parameter nameId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Boolean includeValues = null; + final String continuationToken = null; + final Long timeout = null; + return service.getPropertyInfoList(nameId, apiVersion, includeValues, continuationToken, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPropertyInfoListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets information on all Service Fabric properties under a given name. + * A Service Fabric name can have one or more named properties that store custom information. This operation gets the information about these properties in a paged list. The information includes name, value, and metadata about each of the properties. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedPropertyInfoListInner object if successful. + */ + public PagedPropertyInfoListInner getPropertyInfoList(String nameId, Boolean includeValues, String continuationToken, Long timeout) { + return getPropertyInfoListWithServiceResponseAsync(nameId, includeValues, continuationToken, timeout).toBlocking().single().body(); + } + + /** + * Gets information on all Service Fabric properties under a given name. + * A Service Fabric name can have one or more named properties that store custom information. This operation gets the information about these properties in a paged list. The information includes name, value, and metadata about each of the properties. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getPropertyInfoListAsync(String nameId, Boolean includeValues, String continuationToken, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPropertyInfoListWithServiceResponseAsync(nameId, includeValues, continuationToken, timeout), serviceCallback); + } + + /** + * Gets information on all Service Fabric properties under a given name. + * A Service Fabric name can have one or more named properties that store custom information. This operation gets the information about these properties in a paged list. The information includes name, value, and metadata about each of the properties. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedPropertyInfoListInner object + */ + public Observable getPropertyInfoListAsync(String nameId, Boolean includeValues, String continuationToken, Long timeout) { + return getPropertyInfoListWithServiceResponseAsync(nameId, includeValues, continuationToken, timeout).map(new Func1, PagedPropertyInfoListInner>() { + @Override + public PagedPropertyInfoListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets information on all Service Fabric properties under a given name. + * A Service Fabric name can have one or more named properties that store custom information. This operation gets the information about these properties in a paged list. The information includes name, value, and metadata about each of the properties. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedPropertyInfoListInner object + */ + public Observable> getPropertyInfoListWithServiceResponseAsync(String nameId, Boolean includeValues, String continuationToken, Long timeout) { + if (nameId == null) { + throw new IllegalArgumentException("Parameter nameId is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.getPropertyInfoList(nameId, apiVersion, includeValues, continuationToken, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPropertyInfoListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getPropertyInfoListDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Creates or updates a Service Fabric property. + * Creates or updates the specified Service Fabric property under a given name. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param propertyDescription Describes the Service Fabric property to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putProperty(String nameId, PropertyDescription propertyDescription) { + putPropertyWithServiceResponseAsync(nameId, propertyDescription).toBlocking().single().body(); + } + + /** + * Creates or updates a Service Fabric property. + * Creates or updates the specified Service Fabric property under a given name. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param propertyDescription Describes the Service Fabric property to be created. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putPropertyAsync(String nameId, PropertyDescription propertyDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putPropertyWithServiceResponseAsync(nameId, propertyDescription), serviceCallback); + } + + /** + * Creates or updates a Service Fabric property. + * Creates or updates the specified Service Fabric property under a given name. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param propertyDescription Describes the Service Fabric property to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putPropertyAsync(String nameId, PropertyDescription propertyDescription) { + return putPropertyWithServiceResponseAsync(nameId, propertyDescription).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a Service Fabric property. + * Creates or updates the specified Service Fabric property under a given name. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param propertyDescription Describes the Service Fabric property to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putPropertyWithServiceResponseAsync(String nameId, PropertyDescription propertyDescription) { + if (nameId == null) { + throw new IllegalArgumentException("Parameter nameId is required and cannot be null."); + } + if (propertyDescription == null) { + throw new IllegalArgumentException("Parameter propertyDescription is required and cannot be null."); + } + Validator.validate(propertyDescription); + final String apiVersion = "6.0"; + final Long timeout = null; + return service.putProperty(nameId, apiVersion, propertyDescription, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putPropertyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Creates or updates a Service Fabric property. + * Creates or updates the specified Service Fabric property under a given name. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param propertyDescription Describes the Service Fabric property to be created. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putProperty(String nameId, PropertyDescription propertyDescription, Long timeout) { + putPropertyWithServiceResponseAsync(nameId, propertyDescription, timeout).toBlocking().single().body(); + } + + /** + * Creates or updates a Service Fabric property. + * Creates or updates the specified Service Fabric property under a given name. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param propertyDescription Describes the Service Fabric property to be created. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putPropertyAsync(String nameId, PropertyDescription propertyDescription, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putPropertyWithServiceResponseAsync(nameId, propertyDescription, timeout), serviceCallback); + } + + /** + * Creates or updates a Service Fabric property. + * Creates or updates the specified Service Fabric property under a given name. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param propertyDescription Describes the Service Fabric property to be created. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putPropertyAsync(String nameId, PropertyDescription propertyDescription, Long timeout) { + return putPropertyWithServiceResponseAsync(nameId, propertyDescription, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a Service Fabric property. + * Creates or updates the specified Service Fabric property under a given name. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param propertyDescription Describes the Service Fabric property to be created. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putPropertyWithServiceResponseAsync(String nameId, PropertyDescription propertyDescription, Long timeout) { + if (nameId == null) { + throw new IllegalArgumentException("Parameter nameId is required and cannot be null."); + } + if (propertyDescription == null) { + throw new IllegalArgumentException("Parameter propertyDescription is required and cannot be null."); + } + Validator.validate(propertyDescription); + final String apiVersion = "6.0"; + return service.putProperty(nameId, apiVersion, propertyDescription, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putPropertyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putPropertyDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets the specified Service Fabric property. + * Gets the specified Service Fabric property under a given name. This will always return both value and metadata. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param propertyName Specifies the name of the property to get. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PropertyInfoInner object if successful. + */ + public PropertyInfoInner getPropertyInfo(String nameId, String propertyName) { + return getPropertyInfoWithServiceResponseAsync(nameId, propertyName).toBlocking().single().body(); + } + + /** + * Gets the specified Service Fabric property. + * Gets the specified Service Fabric property under a given name. This will always return both value and metadata. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param propertyName Specifies the name of the property to get. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getPropertyInfoAsync(String nameId, String propertyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPropertyInfoWithServiceResponseAsync(nameId, propertyName), serviceCallback); + } + + /** + * Gets the specified Service Fabric property. + * Gets the specified Service Fabric property under a given name. This will always return both value and metadata. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param propertyName Specifies the name of the property to get. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PropertyInfoInner object + */ + public Observable getPropertyInfoAsync(String nameId, String propertyName) { + return getPropertyInfoWithServiceResponseAsync(nameId, propertyName).map(new Func1, PropertyInfoInner>() { + @Override + public PropertyInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified Service Fabric property. + * Gets the specified Service Fabric property under a given name. This will always return both value and metadata. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param propertyName Specifies the name of the property to get. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PropertyInfoInner object + */ + public Observable> getPropertyInfoWithServiceResponseAsync(String nameId, String propertyName) { + if (nameId == null) { + throw new IllegalArgumentException("Parameter nameId is required and cannot be null."); + } + if (propertyName == null) { + throw new IllegalArgumentException("Parameter propertyName is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + return service.getPropertyInfo(nameId, apiVersion, propertyName, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPropertyInfoDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the specified Service Fabric property. + * Gets the specified Service Fabric property under a given name. This will always return both value and metadata. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param propertyName Specifies the name of the property to get. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PropertyInfoInner object if successful. + */ + public PropertyInfoInner getPropertyInfo(String nameId, String propertyName, Long timeout) { + return getPropertyInfoWithServiceResponseAsync(nameId, propertyName, timeout).toBlocking().single().body(); + } + + /** + * Gets the specified Service Fabric property. + * Gets the specified Service Fabric property under a given name. This will always return both value and metadata. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param propertyName Specifies the name of the property to get. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getPropertyInfoAsync(String nameId, String propertyName, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPropertyInfoWithServiceResponseAsync(nameId, propertyName, timeout), serviceCallback); + } + + /** + * Gets the specified Service Fabric property. + * Gets the specified Service Fabric property under a given name. This will always return both value and metadata. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param propertyName Specifies the name of the property to get. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PropertyInfoInner object + */ + public Observable getPropertyInfoAsync(String nameId, String propertyName, Long timeout) { + return getPropertyInfoWithServiceResponseAsync(nameId, propertyName, timeout).map(new Func1, PropertyInfoInner>() { + @Override + public PropertyInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified Service Fabric property. + * Gets the specified Service Fabric property under a given name. This will always return both value and metadata. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param propertyName Specifies the name of the property to get. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PropertyInfoInner object + */ + public Observable> getPropertyInfoWithServiceResponseAsync(String nameId, String propertyName, Long timeout) { + if (nameId == null) { + throw new IllegalArgumentException("Parameter nameId is required and cannot be null."); + } + if (propertyName == null) { + throw new IllegalArgumentException("Parameter propertyName is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.getPropertyInfo(nameId, apiVersion, propertyName, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPropertyInfoDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getPropertyInfoDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Deletes the specified Service Fabric property. + * Deletes the specified Service Fabric property under a given name. A property must be created before it can be deleted. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param propertyName Specifies the name of the property to get. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteProperty(String nameId, String propertyName) { + deletePropertyWithServiceResponseAsync(nameId, propertyName).toBlocking().single().body(); + } + + /** + * Deletes the specified Service Fabric property. + * Deletes the specified Service Fabric property under a given name. A property must be created before it can be deleted. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param propertyName Specifies the name of the property to get. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deletePropertyAsync(String nameId, String propertyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deletePropertyWithServiceResponseAsync(nameId, propertyName), serviceCallback); + } + + /** + * Deletes the specified Service Fabric property. + * Deletes the specified Service Fabric property under a given name. A property must be created before it can be deleted. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param propertyName Specifies the name of the property to get. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deletePropertyAsync(String nameId, String propertyName) { + return deletePropertyWithServiceResponseAsync(nameId, propertyName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified Service Fabric property. + * Deletes the specified Service Fabric property under a given name. A property must be created before it can be deleted. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param propertyName Specifies the name of the property to get. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deletePropertyWithServiceResponseAsync(String nameId, String propertyName) { + if (nameId == null) { + throw new IllegalArgumentException("Parameter nameId is required and cannot be null."); + } + if (propertyName == null) { + throw new IllegalArgumentException("Parameter propertyName is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + return service.deleteProperty(nameId, apiVersion, propertyName, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deletePropertyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Deletes the specified Service Fabric property. + * Deletes the specified Service Fabric property under a given name. A property must be created before it can be deleted. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param propertyName Specifies the name of the property to get. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteProperty(String nameId, String propertyName, Long timeout) { + deletePropertyWithServiceResponseAsync(nameId, propertyName, timeout).toBlocking().single().body(); + } + + /** + * Deletes the specified Service Fabric property. + * Deletes the specified Service Fabric property under a given name. A property must be created before it can be deleted. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param propertyName Specifies the name of the property to get. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deletePropertyAsync(String nameId, String propertyName, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deletePropertyWithServiceResponseAsync(nameId, propertyName, timeout), serviceCallback); + } + + /** + * Deletes the specified Service Fabric property. + * Deletes the specified Service Fabric property under a given name. A property must be created before it can be deleted. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param propertyName Specifies the name of the property to get. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deletePropertyAsync(String nameId, String propertyName, Long timeout) { + return deletePropertyWithServiceResponseAsync(nameId, propertyName, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified Service Fabric property. + * Deletes the specified Service Fabric property under a given name. A property must be created before it can be deleted. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param propertyName Specifies the name of the property to get. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deletePropertyWithServiceResponseAsync(String nameId, String propertyName, Long timeout) { + if (nameId == null) { + throw new IllegalArgumentException("Parameter nameId is required and cannot be null."); + } + if (propertyName == null) { + throw new IllegalArgumentException("Parameter propertyName is required and cannot be null."); + } + final String apiVersion = "6.0"; + return service.deleteProperty(nameId, apiVersion, propertyName, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deletePropertyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deletePropertyDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Submits a property batch. + * Submits a batch of property operations. Either all or none of the operations will be committed. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PropertyBatchInfo object if successful. + */ + public PropertyBatchInfo submitPropertyBatch(String nameId) { + return submitPropertyBatchWithServiceResponseAsync(nameId).toBlocking().single().body(); + } + + /** + * Submits a property batch. + * Submits a batch of property operations. Either all or none of the operations will be committed. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture submitPropertyBatchAsync(String nameId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(submitPropertyBatchWithServiceResponseAsync(nameId), serviceCallback); + } + + /** + * Submits a property batch. + * Submits a batch of property operations. Either all or none of the operations will be committed. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PropertyBatchInfo object + */ + public Observable submitPropertyBatchAsync(String nameId) { + return submitPropertyBatchWithServiceResponseAsync(nameId).map(new Func1, PropertyBatchInfo>() { + @Override + public PropertyBatchInfo call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Submits a property batch. + * Submits a batch of property operations. Either all or none of the operations will be committed. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PropertyBatchInfo object + */ + public Observable> submitPropertyBatchWithServiceResponseAsync(String nameId) { + if (nameId == null) { + throw new IllegalArgumentException("Parameter nameId is required and cannot be null."); + } + final String apiVersion = "6.0"; + final Long timeout = null; + final List operations = null; + PropertyBatchDescriptionList propertyBatchDescriptionList = new PropertyBatchDescriptionList(); + propertyBatchDescriptionList.withOperations(null); + return service.submitPropertyBatch(nameId, apiVersion, timeout, this.acceptLanguage(), propertyBatchDescriptionList, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = submitPropertyBatchDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Submits a property batch. + * Submits a batch of property operations. Either all or none of the operations will be committed. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param operations A list of the property batch operations to be executed. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PropertyBatchInfo object if successful. + */ + public PropertyBatchInfo submitPropertyBatch(String nameId, Long timeout, List operations) { + return submitPropertyBatchWithServiceResponseAsync(nameId, timeout, operations).toBlocking().single().body(); + } + + /** + * Submits a property batch. + * Submits a batch of property operations. Either all or none of the operations will be committed. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param operations A list of the property batch operations to be executed. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture submitPropertyBatchAsync(String nameId, Long timeout, List operations, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(submitPropertyBatchWithServiceResponseAsync(nameId, timeout, operations), serviceCallback); + } + + /** + * Submits a property batch. + * Submits a batch of property operations. Either all or none of the operations will be committed. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param operations A list of the property batch operations to be executed. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PropertyBatchInfo object + */ + public Observable submitPropertyBatchAsync(String nameId, Long timeout, List operations) { + return submitPropertyBatchWithServiceResponseAsync(nameId, timeout, operations).map(new Func1, PropertyBatchInfo>() { + @Override + public PropertyBatchInfo call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Submits a property batch. + * Submits a batch of property operations. Either all or none of the operations will be committed. + * + * @param nameId The Service Fabric name, without the 'fabric:' URI scheme. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param operations A list of the property batch operations to be executed. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PropertyBatchInfo object + */ + public Observable> submitPropertyBatchWithServiceResponseAsync(String nameId, Long timeout, List operations) { + if (nameId == null) { + throw new IllegalArgumentException("Parameter nameId is required and cannot be null."); + } + Validator.validate(operations); + final String apiVersion = "6.0"; + PropertyBatchDescriptionList propertyBatchDescriptionList = new PropertyBatchDescriptionList(); + propertyBatchDescriptionList.withOperations(operations); + return service.submitPropertyBatch(nameId, apiVersion, timeout, this.acceptLanguage(), propertyBatchDescriptionList, this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = submitPropertyBatchDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse submitPropertyBatchDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(409, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets all Cluster-related events. + * The response is list of ClusterEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<ClusterEventInner> object if successful. + */ + public List getClusterEventList(String startTimeUtc, String endTimeUtc) { + return getClusterEventListWithServiceResponseAsync(startTimeUtc, endTimeUtc).toBlocking().single().body(); + } + + /** + * Gets all Cluster-related events. + * The response is list of ClusterEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getClusterEventListAsync(String startTimeUtc, String endTimeUtc, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getClusterEventListWithServiceResponseAsync(startTimeUtc, endTimeUtc), serviceCallback); + } + + /** + * Gets all Cluster-related events. + * The response is list of ClusterEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ClusterEventInner> object + */ + public Observable> getClusterEventListAsync(String startTimeUtc, String endTimeUtc) { + return getClusterEventListWithServiceResponseAsync(startTimeUtc, endTimeUtc).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all Cluster-related events. + * The response is list of ClusterEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ClusterEventInner> object + */ + public Observable>> getClusterEventListWithServiceResponseAsync(String startTimeUtc, String endTimeUtc) { + if (startTimeUtc == null) { + throw new IllegalArgumentException("Parameter startTimeUtc is required and cannot be null."); + } + if (endTimeUtc == null) { + throw new IllegalArgumentException("Parameter endTimeUtc is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + final Long timeout = null; + final String eventsTypesFilter = null; + final Boolean excludeAnalysisEvents = null; + final Boolean skipCorrelationLookup = null; + return service.getClusterEventList(apiVersion, timeout, startTimeUtc, endTimeUtc, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getClusterEventListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets all Cluster-related events. + * The response is list of ClusterEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<ClusterEventInner> object if successful. + */ + public List getClusterEventList(String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup) { + return getClusterEventListWithServiceResponseAsync(startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup).toBlocking().single().body(); + } + + /** + * Gets all Cluster-related events. + * The response is list of ClusterEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getClusterEventListAsync(String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getClusterEventListWithServiceResponseAsync(startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup), serviceCallback); + } + + /** + * Gets all Cluster-related events. + * The response is list of ClusterEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ClusterEventInner> object + */ + public Observable> getClusterEventListAsync(String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup) { + return getClusterEventListWithServiceResponseAsync(startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all Cluster-related events. + * The response is list of ClusterEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ClusterEventInner> object + */ + public Observable>> getClusterEventListWithServiceResponseAsync(String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup) { + if (startTimeUtc == null) { + throw new IllegalArgumentException("Parameter startTimeUtc is required and cannot be null."); + } + if (endTimeUtc == null) { + throw new IllegalArgumentException("Parameter endTimeUtc is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + return service.getClusterEventList(apiVersion, timeout, startTimeUtc, endTimeUtc, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getClusterEventListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getClusterEventListDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., FabricErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets all Containers-related events. + * The response is list of ContainerInstanceEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<ContainerInstanceEventInner> object if successful. + */ + public List getContainersEventList(String startTimeUtc, String endTimeUtc) { + return getContainersEventListWithServiceResponseAsync(startTimeUtc, endTimeUtc).toBlocking().single().body(); + } + + /** + * Gets all Containers-related events. + * The response is list of ContainerInstanceEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getContainersEventListAsync(String startTimeUtc, String endTimeUtc, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getContainersEventListWithServiceResponseAsync(startTimeUtc, endTimeUtc), serviceCallback); + } + + /** + * Gets all Containers-related events. + * The response is list of ContainerInstanceEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ContainerInstanceEventInner> object + */ + public Observable> getContainersEventListAsync(String startTimeUtc, String endTimeUtc) { + return getContainersEventListWithServiceResponseAsync(startTimeUtc, endTimeUtc).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all Containers-related events. + * The response is list of ContainerInstanceEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ContainerInstanceEventInner> object + */ + public Observable>> getContainersEventListWithServiceResponseAsync(String startTimeUtc, String endTimeUtc) { + if (startTimeUtc == null) { + throw new IllegalArgumentException("Parameter startTimeUtc is required and cannot be null."); + } + if (endTimeUtc == null) { + throw new IllegalArgumentException("Parameter endTimeUtc is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + final Long timeout = null; + final String eventsTypesFilter = null; + final Boolean excludeAnalysisEvents = null; + final Boolean skipCorrelationLookup = null; + return service.getContainersEventList(apiVersion, timeout, startTimeUtc, endTimeUtc, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getContainersEventListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets all Containers-related events. + * The response is list of ContainerInstanceEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<ContainerInstanceEventInner> object if successful. + */ + public List getContainersEventList(String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup) { + return getContainersEventListWithServiceResponseAsync(startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup).toBlocking().single().body(); + } + + /** + * Gets all Containers-related events. + * The response is list of ContainerInstanceEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getContainersEventListAsync(String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getContainersEventListWithServiceResponseAsync(startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup), serviceCallback); + } + + /** + * Gets all Containers-related events. + * The response is list of ContainerInstanceEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ContainerInstanceEventInner> object + */ + public Observable> getContainersEventListAsync(String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup) { + return getContainersEventListWithServiceResponseAsync(startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all Containers-related events. + * The response is list of ContainerInstanceEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ContainerInstanceEventInner> object + */ + public Observable>> getContainersEventListWithServiceResponseAsync(String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup) { + if (startTimeUtc == null) { + throw new IllegalArgumentException("Parameter startTimeUtc is required and cannot be null."); + } + if (endTimeUtc == null) { + throw new IllegalArgumentException("Parameter endTimeUtc is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + return service.getContainersEventList(apiVersion, timeout, startTimeUtc, endTimeUtc, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getContainersEventListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getContainersEventListDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., FabricErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets a Node-related events. + * The response is list of NodeEvent objects. + * + * @param nodeName The name of the node. + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<NodeEventInner> object if successful. + */ + public List getNodeEventList(String nodeName, String startTimeUtc, String endTimeUtc) { + return getNodeEventListWithServiceResponseAsync(nodeName, startTimeUtc, endTimeUtc).toBlocking().single().body(); + } + + /** + * Gets a Node-related events. + * The response is list of NodeEvent objects. + * + * @param nodeName The name of the node. + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getNodeEventListAsync(String nodeName, String startTimeUtc, String endTimeUtc, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getNodeEventListWithServiceResponseAsync(nodeName, startTimeUtc, endTimeUtc), serviceCallback); + } + + /** + * Gets a Node-related events. + * The response is list of NodeEvent objects. + * + * @param nodeName The name of the node. + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<NodeEventInner> object + */ + public Observable> getNodeEventListAsync(String nodeName, String startTimeUtc, String endTimeUtc) { + return getNodeEventListWithServiceResponseAsync(nodeName, startTimeUtc, endTimeUtc).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a Node-related events. + * The response is list of NodeEvent objects. + * + * @param nodeName The name of the node. + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<NodeEventInner> object + */ + public Observable>> getNodeEventListWithServiceResponseAsync(String nodeName, String startTimeUtc, String endTimeUtc) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (startTimeUtc == null) { + throw new IllegalArgumentException("Parameter startTimeUtc is required and cannot be null."); + } + if (endTimeUtc == null) { + throw new IllegalArgumentException("Parameter endTimeUtc is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + final Long timeout = null; + final String eventsTypesFilter = null; + final Boolean excludeAnalysisEvents = null; + final Boolean skipCorrelationLookup = null; + return service.getNodeEventList(nodeName, apiVersion, timeout, startTimeUtc, endTimeUtc, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getNodeEventListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets a Node-related events. + * The response is list of NodeEvent objects. + * + * @param nodeName The name of the node. + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<NodeEventInner> object if successful. + */ + public List getNodeEventList(String nodeName, String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup) { + return getNodeEventListWithServiceResponseAsync(nodeName, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup).toBlocking().single().body(); + } + + /** + * Gets a Node-related events. + * The response is list of NodeEvent objects. + * + * @param nodeName The name of the node. + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getNodeEventListAsync(String nodeName, String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getNodeEventListWithServiceResponseAsync(nodeName, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup), serviceCallback); + } + + /** + * Gets a Node-related events. + * The response is list of NodeEvent objects. + * + * @param nodeName The name of the node. + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<NodeEventInner> object + */ + public Observable> getNodeEventListAsync(String nodeName, String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup) { + return getNodeEventListWithServiceResponseAsync(nodeName, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a Node-related events. + * The response is list of NodeEvent objects. + * + * @param nodeName The name of the node. + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<NodeEventInner> object + */ + public Observable>> getNodeEventListWithServiceResponseAsync(String nodeName, String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup) { + if (nodeName == null) { + throw new IllegalArgumentException("Parameter nodeName is required and cannot be null."); + } + if (startTimeUtc == null) { + throw new IllegalArgumentException("Parameter startTimeUtc is required and cannot be null."); + } + if (endTimeUtc == null) { + throw new IllegalArgumentException("Parameter endTimeUtc is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + return service.getNodeEventList(nodeName, apiVersion, timeout, startTimeUtc, endTimeUtc, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getNodeEventListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getNodeEventListDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., FabricErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets all Nodes-related Events. + * The response is list of NodeEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<NodeEventInner> object if successful. + */ + public List getNodesEventList(String startTimeUtc, String endTimeUtc) { + return getNodesEventListWithServiceResponseAsync(startTimeUtc, endTimeUtc).toBlocking().single().body(); + } + + /** + * Gets all Nodes-related Events. + * The response is list of NodeEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getNodesEventListAsync(String startTimeUtc, String endTimeUtc, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getNodesEventListWithServiceResponseAsync(startTimeUtc, endTimeUtc), serviceCallback); + } + + /** + * Gets all Nodes-related Events. + * The response is list of NodeEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<NodeEventInner> object + */ + public Observable> getNodesEventListAsync(String startTimeUtc, String endTimeUtc) { + return getNodesEventListWithServiceResponseAsync(startTimeUtc, endTimeUtc).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all Nodes-related Events. + * The response is list of NodeEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<NodeEventInner> object + */ + public Observable>> getNodesEventListWithServiceResponseAsync(String startTimeUtc, String endTimeUtc) { + if (startTimeUtc == null) { + throw new IllegalArgumentException("Parameter startTimeUtc is required and cannot be null."); + } + if (endTimeUtc == null) { + throw new IllegalArgumentException("Parameter endTimeUtc is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + final Long timeout = null; + final String eventsTypesFilter = null; + final Boolean excludeAnalysisEvents = null; + final Boolean skipCorrelationLookup = null; + return service.getNodesEventList(apiVersion, timeout, startTimeUtc, endTimeUtc, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getNodesEventListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets all Nodes-related Events. + * The response is list of NodeEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<NodeEventInner> object if successful. + */ + public List getNodesEventList(String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup) { + return getNodesEventListWithServiceResponseAsync(startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup).toBlocking().single().body(); + } + + /** + * Gets all Nodes-related Events. + * The response is list of NodeEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getNodesEventListAsync(String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getNodesEventListWithServiceResponseAsync(startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup), serviceCallback); + } + + /** + * Gets all Nodes-related Events. + * The response is list of NodeEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<NodeEventInner> object + */ + public Observable> getNodesEventListAsync(String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup) { + return getNodesEventListWithServiceResponseAsync(startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all Nodes-related Events. + * The response is list of NodeEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<NodeEventInner> object + */ + public Observable>> getNodesEventListWithServiceResponseAsync(String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup) { + if (startTimeUtc == null) { + throw new IllegalArgumentException("Parameter startTimeUtc is required and cannot be null."); + } + if (endTimeUtc == null) { + throw new IllegalArgumentException("Parameter endTimeUtc is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + return service.getNodesEventList(apiVersion, timeout, startTimeUtc, endTimeUtc, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getNodesEventListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getNodesEventListDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., FabricErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets an Application-related events. + * The response is list of ApplicationEvent objects. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<ApplicationEventInner> object if successful. + */ + public List getApplicationEventList(String applicationId, String startTimeUtc, String endTimeUtc) { + return getApplicationEventListWithServiceResponseAsync(applicationId, startTimeUtc, endTimeUtc).toBlocking().single().body(); + } + + /** + * Gets an Application-related events. + * The response is list of ApplicationEvent objects. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getApplicationEventListAsync(String applicationId, String startTimeUtc, String endTimeUtc, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getApplicationEventListWithServiceResponseAsync(applicationId, startTimeUtc, endTimeUtc), serviceCallback); + } + + /** + * Gets an Application-related events. + * The response is list of ApplicationEvent objects. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ApplicationEventInner> object + */ + public Observable> getApplicationEventListAsync(String applicationId, String startTimeUtc, String endTimeUtc) { + return getApplicationEventListWithServiceResponseAsync(applicationId, startTimeUtc, endTimeUtc).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets an Application-related events. + * The response is list of ApplicationEvent objects. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ApplicationEventInner> object + */ + public Observable>> getApplicationEventListWithServiceResponseAsync(String applicationId, String startTimeUtc, String endTimeUtc) { + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + if (startTimeUtc == null) { + throw new IllegalArgumentException("Parameter startTimeUtc is required and cannot be null."); + } + if (endTimeUtc == null) { + throw new IllegalArgumentException("Parameter endTimeUtc is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + final Long timeout = null; + final String eventsTypesFilter = null; + final Boolean excludeAnalysisEvents = null; + final Boolean skipCorrelationLookup = null; + return service.getApplicationEventList(applicationId, apiVersion, timeout, startTimeUtc, endTimeUtc, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getApplicationEventListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets an Application-related events. + * The response is list of ApplicationEvent objects. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<ApplicationEventInner> object if successful. + */ + public List getApplicationEventList(String applicationId, String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup) { + return getApplicationEventListWithServiceResponseAsync(applicationId, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup).toBlocking().single().body(); + } + + /** + * Gets an Application-related events. + * The response is list of ApplicationEvent objects. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getApplicationEventListAsync(String applicationId, String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getApplicationEventListWithServiceResponseAsync(applicationId, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup), serviceCallback); + } + + /** + * Gets an Application-related events. + * The response is list of ApplicationEvent objects. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ApplicationEventInner> object + */ + public Observable> getApplicationEventListAsync(String applicationId, String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup) { + return getApplicationEventListWithServiceResponseAsync(applicationId, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets an Application-related events. + * The response is list of ApplicationEvent objects. + * + * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. + Starting from version 6.0, hierarchical names are delimited with the "~" character. + For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ApplicationEventInner> object + */ + public Observable>> getApplicationEventListWithServiceResponseAsync(String applicationId, String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup) { + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + if (startTimeUtc == null) { + throw new IllegalArgumentException("Parameter startTimeUtc is required and cannot be null."); + } + if (endTimeUtc == null) { + throw new IllegalArgumentException("Parameter endTimeUtc is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + return service.getApplicationEventList(applicationId, apiVersion, timeout, startTimeUtc, endTimeUtc, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getApplicationEventListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getApplicationEventListDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., FabricErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets all Applications-related events. + * The response is list of ApplicationEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<ApplicationEventInner> object if successful. + */ + public List getApplicationsEventList(String startTimeUtc, String endTimeUtc) { + return getApplicationsEventListWithServiceResponseAsync(startTimeUtc, endTimeUtc).toBlocking().single().body(); + } + + /** + * Gets all Applications-related events. + * The response is list of ApplicationEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getApplicationsEventListAsync(String startTimeUtc, String endTimeUtc, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getApplicationsEventListWithServiceResponseAsync(startTimeUtc, endTimeUtc), serviceCallback); + } + + /** + * Gets all Applications-related events. + * The response is list of ApplicationEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ApplicationEventInner> object + */ + public Observable> getApplicationsEventListAsync(String startTimeUtc, String endTimeUtc) { + return getApplicationsEventListWithServiceResponseAsync(startTimeUtc, endTimeUtc).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all Applications-related events. + * The response is list of ApplicationEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ApplicationEventInner> object + */ + public Observable>> getApplicationsEventListWithServiceResponseAsync(String startTimeUtc, String endTimeUtc) { + if (startTimeUtc == null) { + throw new IllegalArgumentException("Parameter startTimeUtc is required and cannot be null."); + } + if (endTimeUtc == null) { + throw new IllegalArgumentException("Parameter endTimeUtc is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + final Long timeout = null; + final String eventsTypesFilter = null; + final Boolean excludeAnalysisEvents = null; + final Boolean skipCorrelationLookup = null; + return service.getApplicationsEventList(apiVersion, timeout, startTimeUtc, endTimeUtc, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getApplicationsEventListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets all Applications-related events. + * The response is list of ApplicationEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<ApplicationEventInner> object if successful. + */ + public List getApplicationsEventList(String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup) { + return getApplicationsEventListWithServiceResponseAsync(startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup).toBlocking().single().body(); + } + + /** + * Gets all Applications-related events. + * The response is list of ApplicationEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getApplicationsEventListAsync(String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getApplicationsEventListWithServiceResponseAsync(startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup), serviceCallback); + } + + /** + * Gets all Applications-related events. + * The response is list of ApplicationEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ApplicationEventInner> object + */ + public Observable> getApplicationsEventListAsync(String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup) { + return getApplicationsEventListWithServiceResponseAsync(startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all Applications-related events. + * The response is list of ApplicationEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ApplicationEventInner> object + */ + public Observable>> getApplicationsEventListWithServiceResponseAsync(String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup) { + if (startTimeUtc == null) { + throw new IllegalArgumentException("Parameter startTimeUtc is required and cannot be null."); + } + if (endTimeUtc == null) { + throw new IllegalArgumentException("Parameter endTimeUtc is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + return service.getApplicationsEventList(apiVersion, timeout, startTimeUtc, endTimeUtc, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getApplicationsEventListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getApplicationsEventListDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., FabricErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets a Service-related events. + * The response is list of ServiceEvent objects. + * + * @param 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 startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<ServiceEventInner> object if successful. + */ + public List getServiceEventList(String serviceId, String startTimeUtc, String endTimeUtc) { + return getServiceEventListWithServiceResponseAsync(serviceId, startTimeUtc, endTimeUtc).toBlocking().single().body(); + } + + /** + * Gets a Service-related events. + * The response is list of ServiceEvent objects. + * + * @param 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 startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getServiceEventListAsync(String serviceId, String startTimeUtc, String endTimeUtc, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getServiceEventListWithServiceResponseAsync(serviceId, startTimeUtc, endTimeUtc), serviceCallback); + } + + /** + * Gets a Service-related events. + * The response is list of ServiceEvent objects. + * + * @param 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 startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ServiceEventInner> object + */ + public Observable> getServiceEventListAsync(String serviceId, String startTimeUtc, String endTimeUtc) { + return getServiceEventListWithServiceResponseAsync(serviceId, startTimeUtc, endTimeUtc).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a Service-related events. + * The response is list of ServiceEvent objects. + * + * @param 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 startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ServiceEventInner> object + */ + public Observable>> getServiceEventListWithServiceResponseAsync(String serviceId, String startTimeUtc, String endTimeUtc) { + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + if (startTimeUtc == null) { + throw new IllegalArgumentException("Parameter startTimeUtc is required and cannot be null."); + } + if (endTimeUtc == null) { + throw new IllegalArgumentException("Parameter endTimeUtc is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + final Long timeout = null; + final String eventsTypesFilter = null; + final Boolean excludeAnalysisEvents = null; + final Boolean skipCorrelationLookup = null; + return service.getServiceEventList(serviceId, apiVersion, timeout, startTimeUtc, endTimeUtc, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getServiceEventListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets a Service-related events. + * The response is list of ServiceEvent objects. + * + * @param 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 startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<ServiceEventInner> object if successful. + */ + public List getServiceEventList(String serviceId, String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup) { + return getServiceEventListWithServiceResponseAsync(serviceId, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup).toBlocking().single().body(); + } + + /** + * Gets a Service-related events. + * The response is list of ServiceEvent objects. + * + * @param 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 startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getServiceEventListAsync(String serviceId, String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getServiceEventListWithServiceResponseAsync(serviceId, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup), serviceCallback); + } + + /** + * Gets a Service-related events. + * The response is list of ServiceEvent objects. + * + * @param 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 startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ServiceEventInner> object + */ + public Observable> getServiceEventListAsync(String serviceId, String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup) { + return getServiceEventListWithServiceResponseAsync(serviceId, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a Service-related events. + * The response is list of ServiceEvent objects. + * + * @param 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 startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ServiceEventInner> object + */ + public Observable>> getServiceEventListWithServiceResponseAsync(String serviceId, String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup) { + if (serviceId == null) { + throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); + } + if (startTimeUtc == null) { + throw new IllegalArgumentException("Parameter startTimeUtc is required and cannot be null."); + } + if (endTimeUtc == null) { + throw new IllegalArgumentException("Parameter endTimeUtc is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + return service.getServiceEventList(serviceId, apiVersion, timeout, startTimeUtc, endTimeUtc, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getServiceEventListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getServiceEventListDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., FabricErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets all Services-related events. + * The response is list of ServiceEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<ServiceEventInner> object if successful. + */ + public List getServicesEventList(String startTimeUtc, String endTimeUtc) { + return getServicesEventListWithServiceResponseAsync(startTimeUtc, endTimeUtc).toBlocking().single().body(); + } + + /** + * Gets all Services-related events. + * The response is list of ServiceEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getServicesEventListAsync(String startTimeUtc, String endTimeUtc, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getServicesEventListWithServiceResponseAsync(startTimeUtc, endTimeUtc), serviceCallback); + } + + /** + * Gets all Services-related events. + * The response is list of ServiceEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ServiceEventInner> object + */ + public Observable> getServicesEventListAsync(String startTimeUtc, String endTimeUtc) { + return getServicesEventListWithServiceResponseAsync(startTimeUtc, endTimeUtc).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all Services-related events. + * The response is list of ServiceEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ServiceEventInner> object + */ + public Observable>> getServicesEventListWithServiceResponseAsync(String startTimeUtc, String endTimeUtc) { + if (startTimeUtc == null) { + throw new IllegalArgumentException("Parameter startTimeUtc is required and cannot be null."); + } + if (endTimeUtc == null) { + throw new IllegalArgumentException("Parameter endTimeUtc is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + final Long timeout = null; + final String eventsTypesFilter = null; + final Boolean excludeAnalysisEvents = null; + final Boolean skipCorrelationLookup = null; + return service.getServicesEventList(apiVersion, timeout, startTimeUtc, endTimeUtc, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getServicesEventListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets all Services-related events. + * The response is list of ServiceEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<ServiceEventInner> object if successful. + */ + public List getServicesEventList(String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup) { + return getServicesEventListWithServiceResponseAsync(startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup).toBlocking().single().body(); + } + + /** + * Gets all Services-related events. + * The response is list of ServiceEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getServicesEventListAsync(String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getServicesEventListWithServiceResponseAsync(startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup), serviceCallback); + } + + /** + * Gets all Services-related events. + * The response is list of ServiceEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ServiceEventInner> object + */ + public Observable> getServicesEventListAsync(String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup) { + return getServicesEventListWithServiceResponseAsync(startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all Services-related events. + * The response is list of ServiceEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ServiceEventInner> object + */ + public Observable>> getServicesEventListWithServiceResponseAsync(String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup) { + if (startTimeUtc == null) { + throw new IllegalArgumentException("Parameter startTimeUtc is required and cannot be null."); + } + if (endTimeUtc == null) { + throw new IllegalArgumentException("Parameter endTimeUtc is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + return service.getServicesEventList(apiVersion, timeout, startTimeUtc, endTimeUtc, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getServicesEventListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getServicesEventListDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., FabricErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets a Partition-related events. + * The response is list of PartitionEvent objects. + * + * @param partitionId The identity of the partition. + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<PartitionEventInner> object if successful. + */ + public List getPartitionEventList(UUID partitionId, String startTimeUtc, String endTimeUtc) { + return getPartitionEventListWithServiceResponseAsync(partitionId, startTimeUtc, endTimeUtc).toBlocking().single().body(); + } + + /** + * Gets a Partition-related events. + * The response is list of PartitionEvent objects. + * + * @param partitionId The identity of the partition. + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getPartitionEventListAsync(UUID partitionId, String startTimeUtc, String endTimeUtc, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getPartitionEventListWithServiceResponseAsync(partitionId, startTimeUtc, endTimeUtc), serviceCallback); + } + + /** + * Gets a Partition-related events. + * The response is list of PartitionEvent objects. + * + * @param partitionId The identity of the partition. + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PartitionEventInner> object + */ + public Observable> getPartitionEventListAsync(UUID partitionId, String startTimeUtc, String endTimeUtc) { + return getPartitionEventListWithServiceResponseAsync(partitionId, startTimeUtc, endTimeUtc).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a Partition-related events. + * The response is list of PartitionEvent objects. + * + * @param partitionId The identity of the partition. + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PartitionEventInner> object + */ + public Observable>> getPartitionEventListWithServiceResponseAsync(UUID partitionId, String startTimeUtc, String endTimeUtc) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + if (startTimeUtc == null) { + throw new IllegalArgumentException("Parameter startTimeUtc is required and cannot be null."); + } + if (endTimeUtc == null) { + throw new IllegalArgumentException("Parameter endTimeUtc is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + final Long timeout = null; + final String eventsTypesFilter = null; + final Boolean excludeAnalysisEvents = null; + final Boolean skipCorrelationLookup = null; + return service.getPartitionEventList(partitionId, apiVersion, timeout, startTimeUtc, endTimeUtc, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getPartitionEventListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets a Partition-related events. + * The response is list of PartitionEvent objects. + * + * @param partitionId The identity of the partition. + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<PartitionEventInner> object if successful. + */ + public List getPartitionEventList(UUID partitionId, String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup) { + return getPartitionEventListWithServiceResponseAsync(partitionId, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup).toBlocking().single().body(); + } + + /** + * Gets a Partition-related events. + * The response is list of PartitionEvent objects. + * + * @param partitionId The identity of the partition. + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getPartitionEventListAsync(UUID partitionId, String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getPartitionEventListWithServiceResponseAsync(partitionId, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup), serviceCallback); + } + + /** + * Gets a Partition-related events. + * The response is list of PartitionEvent objects. + * + * @param partitionId The identity of the partition. + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PartitionEventInner> object + */ + public Observable> getPartitionEventListAsync(UUID partitionId, String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup) { + return getPartitionEventListWithServiceResponseAsync(partitionId, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a Partition-related events. + * The response is list of PartitionEvent objects. + * + * @param partitionId The identity of the partition. + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PartitionEventInner> object + */ + public Observable>> getPartitionEventListWithServiceResponseAsync(UUID partitionId, String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + if (startTimeUtc == null) { + throw new IllegalArgumentException("Parameter startTimeUtc is required and cannot be null."); + } + if (endTimeUtc == null) { + throw new IllegalArgumentException("Parameter endTimeUtc is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + return service.getPartitionEventList(partitionId, apiVersion, timeout, startTimeUtc, endTimeUtc, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getPartitionEventListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getPartitionEventListDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., FabricErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets all Partitions-related events. + * The response is list of PartitionEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<PartitionEventInner> object if successful. + */ + public List getPartitionsEventList(String startTimeUtc, String endTimeUtc) { + return getPartitionsEventListWithServiceResponseAsync(startTimeUtc, endTimeUtc).toBlocking().single().body(); + } + + /** + * Gets all Partitions-related events. + * The response is list of PartitionEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getPartitionsEventListAsync(String startTimeUtc, String endTimeUtc, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getPartitionsEventListWithServiceResponseAsync(startTimeUtc, endTimeUtc), serviceCallback); + } + + /** + * Gets all Partitions-related events. + * The response is list of PartitionEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PartitionEventInner> object + */ + public Observable> getPartitionsEventListAsync(String startTimeUtc, String endTimeUtc) { + return getPartitionsEventListWithServiceResponseAsync(startTimeUtc, endTimeUtc).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all Partitions-related events. + * The response is list of PartitionEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PartitionEventInner> object + */ + public Observable>> getPartitionsEventListWithServiceResponseAsync(String startTimeUtc, String endTimeUtc) { + if (startTimeUtc == null) { + throw new IllegalArgumentException("Parameter startTimeUtc is required and cannot be null."); + } + if (endTimeUtc == null) { + throw new IllegalArgumentException("Parameter endTimeUtc is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + final Long timeout = null; + final String eventsTypesFilter = null; + final Boolean excludeAnalysisEvents = null; + final Boolean skipCorrelationLookup = null; + return service.getPartitionsEventList(apiVersion, timeout, startTimeUtc, endTimeUtc, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getPartitionsEventListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets all Partitions-related events. + * The response is list of PartitionEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<PartitionEventInner> object if successful. + */ + public List getPartitionsEventList(String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup) { + return getPartitionsEventListWithServiceResponseAsync(startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup).toBlocking().single().body(); + } + + /** + * Gets all Partitions-related events. + * The response is list of PartitionEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getPartitionsEventListAsync(String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getPartitionsEventListWithServiceResponseAsync(startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup), serviceCallback); + } + + /** + * Gets all Partitions-related events. + * The response is list of PartitionEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PartitionEventInner> object + */ + public Observable> getPartitionsEventListAsync(String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup) { + return getPartitionsEventListWithServiceResponseAsync(startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all Partitions-related events. + * The response is list of PartitionEvent objects. + * + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PartitionEventInner> object + */ + public Observable>> getPartitionsEventListWithServiceResponseAsync(String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup) { + if (startTimeUtc == null) { + throw new IllegalArgumentException("Parameter startTimeUtc is required and cannot be null."); + } + if (endTimeUtc == null) { + throw new IllegalArgumentException("Parameter endTimeUtc is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + return service.getPartitionsEventList(apiVersion, timeout, startTimeUtc, endTimeUtc, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getPartitionsEventListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getPartitionsEventListDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., FabricErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets a Partition Replica-related events. + * The response is list of ReplicaEvent objects. + * + * @param partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<ReplicaEventInner> object if successful. + */ + public List getPartitionReplicaEventList(UUID partitionId, String replicaId, String startTimeUtc, String endTimeUtc) { + return getPartitionReplicaEventListWithServiceResponseAsync(partitionId, replicaId, startTimeUtc, endTimeUtc).toBlocking().single().body(); + } + + /** + * Gets a Partition Replica-related events. + * The response is list of ReplicaEvent objects. + * + * @param partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getPartitionReplicaEventListAsync(UUID partitionId, String replicaId, String startTimeUtc, String endTimeUtc, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getPartitionReplicaEventListWithServiceResponseAsync(partitionId, replicaId, startTimeUtc, endTimeUtc), serviceCallback); + } + + /** + * Gets a Partition Replica-related events. + * The response is list of ReplicaEvent objects. + * + * @param partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ReplicaEventInner> object + */ + public Observable> getPartitionReplicaEventListAsync(UUID partitionId, String replicaId, String startTimeUtc, String endTimeUtc) { + return getPartitionReplicaEventListWithServiceResponseAsync(partitionId, replicaId, startTimeUtc, endTimeUtc).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a Partition Replica-related events. + * The response is list of ReplicaEvent objects. + * + * @param partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ReplicaEventInner> object + */ + public Observable>> getPartitionReplicaEventListWithServiceResponseAsync(UUID partitionId, String replicaId, String startTimeUtc, String endTimeUtc) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + if (replicaId == null) { + throw new IllegalArgumentException("Parameter replicaId is required and cannot be null."); + } + if (startTimeUtc == null) { + throw new IllegalArgumentException("Parameter startTimeUtc is required and cannot be null."); + } + if (endTimeUtc == null) { + throw new IllegalArgumentException("Parameter endTimeUtc is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + final Long timeout = null; + final String eventsTypesFilter = null; + final Boolean excludeAnalysisEvents = null; + final Boolean skipCorrelationLookup = null; + return service.getPartitionReplicaEventList(partitionId, replicaId, apiVersion, timeout, startTimeUtc, endTimeUtc, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getPartitionReplicaEventListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets a Partition Replica-related events. + * The response is list of ReplicaEvent objects. + * + * @param partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<ReplicaEventInner> object if successful. + */ + public List getPartitionReplicaEventList(UUID partitionId, String replicaId, String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup) { + return getPartitionReplicaEventListWithServiceResponseAsync(partitionId, replicaId, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup).toBlocking().single().body(); + } + + /** + * Gets a Partition Replica-related events. + * The response is list of ReplicaEvent objects. + * + * @param partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getPartitionReplicaEventListAsync(UUID partitionId, String replicaId, String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getPartitionReplicaEventListWithServiceResponseAsync(partitionId, replicaId, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup), serviceCallback); + } + + /** + * Gets a Partition Replica-related events. + * The response is list of ReplicaEvent objects. + * + * @param partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ReplicaEventInner> object + */ + public Observable> getPartitionReplicaEventListAsync(UUID partitionId, String replicaId, String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup) { + return getPartitionReplicaEventListWithServiceResponseAsync(partitionId, replicaId, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a Partition Replica-related events. + * The response is list of ReplicaEvent objects. + * + * @param partitionId The identity of the partition. + * @param replicaId The identifier of the replica. + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ReplicaEventInner> object + */ + public Observable>> getPartitionReplicaEventListWithServiceResponseAsync(UUID partitionId, String replicaId, String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + if (replicaId == null) { + throw new IllegalArgumentException("Parameter replicaId is required and cannot be null."); + } + if (startTimeUtc == null) { + throw new IllegalArgumentException("Parameter startTimeUtc is required and cannot be null."); + } + if (endTimeUtc == null) { + throw new IllegalArgumentException("Parameter endTimeUtc is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + return service.getPartitionReplicaEventList(partitionId, replicaId, apiVersion, timeout, startTimeUtc, endTimeUtc, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getPartitionReplicaEventListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getPartitionReplicaEventListDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., FabricErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets all Replicas-related events for a Partition. + * The response is list of ReplicaEvent objects. + * + * @param partitionId The identity of the partition. + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<ReplicaEventInner> object if successful. + */ + public List getPartitionReplicasEventList(UUID partitionId, String startTimeUtc, String endTimeUtc) { + return getPartitionReplicasEventListWithServiceResponseAsync(partitionId, startTimeUtc, endTimeUtc).toBlocking().single().body(); + } + + /** + * Gets all Replicas-related events for a Partition. + * The response is list of ReplicaEvent objects. + * + * @param partitionId The identity of the partition. + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getPartitionReplicasEventListAsync(UUID partitionId, String startTimeUtc, String endTimeUtc, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getPartitionReplicasEventListWithServiceResponseAsync(partitionId, startTimeUtc, endTimeUtc), serviceCallback); + } + + /** + * Gets all Replicas-related events for a Partition. + * The response is list of ReplicaEvent objects. + * + * @param partitionId The identity of the partition. + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ReplicaEventInner> object + */ + public Observable> getPartitionReplicasEventListAsync(UUID partitionId, String startTimeUtc, String endTimeUtc) { + return getPartitionReplicasEventListWithServiceResponseAsync(partitionId, startTimeUtc, endTimeUtc).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all Replicas-related events for a Partition. + * The response is list of ReplicaEvent objects. + * + * @param partitionId The identity of the partition. + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ReplicaEventInner> object + */ + public Observable>> getPartitionReplicasEventListWithServiceResponseAsync(UUID partitionId, String startTimeUtc, String endTimeUtc) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + if (startTimeUtc == null) { + throw new IllegalArgumentException("Parameter startTimeUtc is required and cannot be null."); + } + if (endTimeUtc == null) { + throw new IllegalArgumentException("Parameter endTimeUtc is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + final Long timeout = null; + final String eventsTypesFilter = null; + final Boolean excludeAnalysisEvents = null; + final Boolean skipCorrelationLookup = null; + return service.getPartitionReplicasEventList(partitionId, apiVersion, timeout, startTimeUtc, endTimeUtc, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getPartitionReplicasEventListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets all Replicas-related events for a Partition. + * The response is list of ReplicaEvent objects. + * + * @param partitionId The identity of the partition. + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<ReplicaEventInner> object if successful. + */ + public List getPartitionReplicasEventList(UUID partitionId, String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup) { + return getPartitionReplicasEventListWithServiceResponseAsync(partitionId, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup).toBlocking().single().body(); + } + + /** + * Gets all Replicas-related events for a Partition. + * The response is list of ReplicaEvent objects. + * + * @param partitionId The identity of the partition. + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getPartitionReplicasEventListAsync(UUID partitionId, String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getPartitionReplicasEventListWithServiceResponseAsync(partitionId, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup), serviceCallback); + } + + /** + * Gets all Replicas-related events for a Partition. + * The response is list of ReplicaEvent objects. + * + * @param partitionId The identity of the partition. + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ReplicaEventInner> object + */ + public Observable> getPartitionReplicasEventListAsync(UUID partitionId, String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup) { + return getPartitionReplicasEventListWithServiceResponseAsync(partitionId, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all Replicas-related events for a Partition. + * The response is list of ReplicaEvent objects. + * + * @param partitionId The identity of the partition. + * @param startTimeUtc The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param endTimeUtc The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param eventsTypesFilter This is a comma separated string specifying the types of FabricEvents that should only be included in the response. + * @param excludeAnalysisEvents This param disables the retrieval of AnalysisEvents if true is passed. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ReplicaEventInner> object + */ + public Observable>> getPartitionReplicasEventListWithServiceResponseAsync(UUID partitionId, String startTimeUtc, String endTimeUtc, Long timeout, String eventsTypesFilter, Boolean excludeAnalysisEvents, Boolean skipCorrelationLookup) { + if (partitionId == null) { + throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); + } + if (startTimeUtc == null) { + throw new IllegalArgumentException("Parameter startTimeUtc is required and cannot be null."); + } + if (endTimeUtc == null) { + throw new IllegalArgumentException("Parameter endTimeUtc is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + return service.getPartitionReplicasEventList(partitionId, apiVersion, timeout, startTimeUtc, endTimeUtc, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getPartitionReplicasEventListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getPartitionReplicasEventListDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., FabricErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets all correlated events for a given event. + * The response is list of FabricEvents. + * + * @param eventInstanceId The EventInstanceId. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<FabricEventInner> object if successful. + */ + public List getCorrelatedEventList(String eventInstanceId) { + return getCorrelatedEventListWithServiceResponseAsync(eventInstanceId).toBlocking().single().body(); + } + + /** + * Gets all correlated events for a given event. + * The response is list of FabricEvents. + * + * @param eventInstanceId The EventInstanceId. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getCorrelatedEventListAsync(String eventInstanceId, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getCorrelatedEventListWithServiceResponseAsync(eventInstanceId), serviceCallback); + } + + /** + * Gets all correlated events for a given event. + * The response is list of FabricEvents. + * + * @param eventInstanceId The EventInstanceId. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<FabricEventInner> object + */ + public Observable> getCorrelatedEventListAsync(String eventInstanceId) { + return getCorrelatedEventListWithServiceResponseAsync(eventInstanceId).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all correlated events for a given event. + * The response is list of FabricEvents. + * + * @param eventInstanceId The EventInstanceId. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<FabricEventInner> object + */ + public Observable>> getCorrelatedEventListWithServiceResponseAsync(String eventInstanceId) { + if (eventInstanceId == null) { + throw new IllegalArgumentException("Parameter eventInstanceId is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + final Long timeout = null; + return service.getCorrelatedEventList(eventInstanceId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getCorrelatedEventListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets all correlated events for a given event. + * The response is list of FabricEvents. + * + * @param eventInstanceId The EventInstanceId. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<FabricEventInner> object if successful. + */ + public List getCorrelatedEventList(String eventInstanceId, Long timeout) { + return getCorrelatedEventListWithServiceResponseAsync(eventInstanceId, timeout).toBlocking().single().body(); + } + + /** + * Gets all correlated events for a given event. + * The response is list of FabricEvents. + * + * @param eventInstanceId The EventInstanceId. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getCorrelatedEventListAsync(String eventInstanceId, Long timeout, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getCorrelatedEventListWithServiceResponseAsync(eventInstanceId, timeout), serviceCallback); + } + + /** + * Gets all correlated events for a given event. + * The response is list of FabricEvents. + * + * @param eventInstanceId The EventInstanceId. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<FabricEventInner> object + */ + public Observable> getCorrelatedEventListAsync(String eventInstanceId, Long timeout) { + return getCorrelatedEventListWithServiceResponseAsync(eventInstanceId, timeout).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all correlated events for a given event. + * The response is list of FabricEvents. + * + * @param eventInstanceId The EventInstanceId. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<FabricEventInner> object + */ + public Observable>> getCorrelatedEventListWithServiceResponseAsync(String eventInstanceId, Long timeout) { + if (eventInstanceId == null) { + throw new IllegalArgumentException("Parameter eventInstanceId is required and cannot be null."); + } + final String apiVersion = "6.2-preview"; + return service.getCorrelatedEventList(eventInstanceId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getCorrelatedEventListDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getCorrelatedEventListDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., FabricErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 applicationResourceName Service Fabric application resource name. + * @param applicationResourceDescription Description for creating an application resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void createApplicationResource(String applicationResourceName, ApplicationResourceDescriptionInner applicationResourceDescription) { + createApplicationResourceWithServiceResponseAsync(applicationResourceName, applicationResourceDescription).toBlocking().single().body(); + } + + /** + * 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 applicationResourceName Service Fabric application resource name. + * @param applicationResourceDescription Description for creating an application resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createApplicationResourceAsync(String applicationResourceName, ApplicationResourceDescriptionInner applicationResourceDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createApplicationResourceWithServiceResponseAsync(applicationResourceName, applicationResourceDescription), serviceCallback); + } + + /** + * 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 applicationResourceName Service Fabric application resource name. + * @param applicationResourceDescription Description for creating an application resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable createApplicationResourceAsync(String applicationResourceName, ApplicationResourceDescriptionInner applicationResourceDescription) { + return createApplicationResourceWithServiceResponseAsync(applicationResourceName, applicationResourceDescription).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 applicationResourceName Service Fabric application resource name. + * @param applicationResourceDescription Description for creating an application resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> createApplicationResourceWithServiceResponseAsync(String applicationResourceName, ApplicationResourceDescriptionInner applicationResourceDescription) { + if (applicationResourceName == null) { + throw new IllegalArgumentException("Parameter applicationResourceName is required and cannot be null."); + } + if (applicationResourceDescription == null) { + throw new IllegalArgumentException("Parameter applicationResourceDescription is required and cannot be null."); + } + Validator.validate(applicationResourceDescription); + final String apiVersion = "6.3-preview"; + return service.createApplicationResource(applicationResourceName, apiVersion, applicationResourceDescription, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createApplicationResourceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createApplicationResourceDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 applicationResourceName Service Fabric application resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationResourceDescriptionInner object if successful. + */ + public ApplicationResourceDescriptionInner getApplicationResource(String applicationResourceName) { + return getApplicationResourceWithServiceResponseAsync(applicationResourceName).toBlocking().single().body(); + } + + /** + * 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 applicationResourceName Service Fabric application resource name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getApplicationResourceAsync(String applicationResourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getApplicationResourceWithServiceResponseAsync(applicationResourceName), serviceCallback); + } + + /** + * 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 applicationResourceName Service Fabric application resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationResourceDescriptionInner object + */ + public Observable getApplicationResourceAsync(String applicationResourceName) { + return getApplicationResourceWithServiceResponseAsync(applicationResourceName).map(new Func1, ApplicationResourceDescriptionInner>() { + @Override + public ApplicationResourceDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 applicationResourceName Service Fabric application resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationResourceDescriptionInner object + */ + public Observable> getApplicationResourceWithServiceResponseAsync(String applicationResourceName) { + if (applicationResourceName == null) { + throw new IllegalArgumentException("Parameter applicationResourceName is required and cannot be null."); + } + final String apiVersion = "6.3-preview"; + return service.getApplicationResource(applicationResourceName, apiVersion, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getApplicationResourceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getApplicationResourceDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Deletes the specified application. + * Deletes the application identified by the name. + * + * @param applicationResourceName Service Fabric application resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteApplicationResource(String applicationResourceName) { + deleteApplicationResourceWithServiceResponseAsync(applicationResourceName).toBlocking().single().body(); + } + + /** + * Deletes the specified application. + * Deletes the application identified by the name. + * + * @param applicationResourceName Service Fabric application resource name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteApplicationResourceAsync(String applicationResourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteApplicationResourceWithServiceResponseAsync(applicationResourceName), serviceCallback); + } + + /** + * Deletes the specified application. + * Deletes the application identified by the name. + * + * @param applicationResourceName Service Fabric application resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteApplicationResourceAsync(String applicationResourceName) { + return deleteApplicationResourceWithServiceResponseAsync(applicationResourceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified application. + * Deletes the application identified by the name. + * + * @param applicationResourceName Service Fabric application resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteApplicationResourceWithServiceResponseAsync(String applicationResourceName) { + if (applicationResourceName == null) { + throw new IllegalArgumentException("Parameter applicationResourceName is required and cannot be null."); + } + final String apiVersion = "6.3-preview"; + return service.deleteApplicationResource(applicationResourceName, apiVersion, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteApplicationResourceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteApplicationResourceDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Gets all the services in the application resource. + * The operation returns the service descriptions of all the services in the application resource. + * + * @param applicationResourceName Service Fabric application resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedServiceResourceDescriptionListInner object if successful. + */ + public PagedServiceResourceDescriptionListInner getServices(String applicationResourceName) { + return getServicesWithServiceResponseAsync(applicationResourceName).toBlocking().single().body(); + } + + /** + * Gets all the services in the application resource. + * The operation returns the service descriptions of all the services in the application resource. + * + * @param applicationResourceName Service Fabric application resource name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getServicesAsync(String applicationResourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getServicesWithServiceResponseAsync(applicationResourceName), serviceCallback); + } + + /** + * Gets all the services in the application resource. + * The operation returns the service descriptions of all the services in the application resource. + * + * @param applicationResourceName Service Fabric application resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedServiceResourceDescriptionListInner object + */ + public Observable getServicesAsync(String applicationResourceName) { + return getServicesWithServiceResponseAsync(applicationResourceName).map(new Func1, PagedServiceResourceDescriptionListInner>() { + @Override + public PagedServiceResourceDescriptionListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets all the services in the application resource. + * The operation returns the service descriptions of all the services in the application resource. + * + * @param applicationResourceName Service Fabric application resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedServiceResourceDescriptionListInner object + */ + public Observable> getServicesWithServiceResponseAsync(String applicationResourceName) { + if (applicationResourceName == null) { + throw new IllegalArgumentException("Parameter applicationResourceName is required and cannot be null."); + } + final String apiVersion = "6.3-preview"; + return service.getServices(applicationResourceName, apiVersion, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getServicesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getServicesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the description of the specified service in an application resource. + * Gets the description of the service resource. + * + * @param applicationResourceName Service Fabric application resource name. + * @param serviceResourceName Service Fabric service resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceResourceDescriptionInner object if successful. + */ + public ServiceResourceDescriptionInner getService(String applicationResourceName, String serviceResourceName) { + return getServiceWithServiceResponseAsync(applicationResourceName, serviceResourceName).toBlocking().single().body(); + } + + /** + * Gets the description of the specified service in an application resource. + * Gets the description of the service resource. + * + * @param applicationResourceName Service Fabric application resource name. + * @param serviceResourceName Service Fabric service resource name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getServiceAsync(String applicationResourceName, String serviceResourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getServiceWithServiceResponseAsync(applicationResourceName, serviceResourceName), serviceCallback); + } + + /** + * Gets the description of the specified service in an application resource. + * Gets the description of the service resource. + * + * @param applicationResourceName Service Fabric application resource name. + * @param serviceResourceName Service Fabric service resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceResourceDescriptionInner object + */ + public Observable getServiceAsync(String applicationResourceName, String serviceResourceName) { + return getServiceWithServiceResponseAsync(applicationResourceName, serviceResourceName).map(new Func1, ServiceResourceDescriptionInner>() { + @Override + public ServiceResourceDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the description of the specified service in an application resource. + * Gets the description of the service resource. + * + * @param applicationResourceName Service Fabric application resource name. + * @param serviceResourceName Service Fabric service resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceResourceDescriptionInner object + */ + public Observable> getServiceWithServiceResponseAsync(String applicationResourceName, String serviceResourceName) { + if (applicationResourceName == null) { + throw new IllegalArgumentException("Parameter applicationResourceName is required and cannot be null."); + } + if (serviceResourceName == null) { + throw new IllegalArgumentException("Parameter serviceResourceName is required and cannot be null."); + } + final String apiVersion = "6.3-preview"; + return service.getService(applicationResourceName, serviceResourceName, apiVersion, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getServiceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getServiceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets replicas of a given service in an applciation resource. + * Gets the information about all replicas of a given service of an application. The information includes the runtime properties of the replica instance. + * + * @param applicationResourceName Service Fabric application resource name. + * @param serviceResourceName Service Fabric service resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedServiceResourceReplicaDescriptionListInner object if successful. + */ + public PagedServiceResourceReplicaDescriptionListInner getReplicas(String applicationResourceName, String serviceResourceName) { + return getReplicasWithServiceResponseAsync(applicationResourceName, serviceResourceName).toBlocking().single().body(); + } + + /** + * Gets replicas of a given service in an applciation resource. + * Gets the information about all replicas of a given service of an application. The information includes the runtime properties of the replica instance. + * + * @param applicationResourceName Service Fabric application resource name. + * @param serviceResourceName Service Fabric service resource name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getReplicasAsync(String applicationResourceName, String serviceResourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getReplicasWithServiceResponseAsync(applicationResourceName, serviceResourceName), serviceCallback); + } + + /** + * Gets replicas of a given service in an applciation resource. + * Gets the information about all replicas of a given service of an application. The information includes the runtime properties of the replica instance. + * + * @param applicationResourceName Service Fabric application resource name. + * @param serviceResourceName Service Fabric service resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedServiceResourceReplicaDescriptionListInner object + */ + public Observable getReplicasAsync(String applicationResourceName, String serviceResourceName) { + return getReplicasWithServiceResponseAsync(applicationResourceName, serviceResourceName).map(new Func1, PagedServiceResourceReplicaDescriptionListInner>() { + @Override + public PagedServiceResourceReplicaDescriptionListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets replicas of a given service in an applciation resource. + * Gets the information about all replicas of a given service of an application. The information includes the runtime properties of the replica instance. + * + * @param applicationResourceName Service Fabric application resource name. + * @param serviceResourceName Service Fabric service resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedServiceResourceReplicaDescriptionListInner object + */ + public Observable> getReplicasWithServiceResponseAsync(String applicationResourceName, String serviceResourceName) { + if (applicationResourceName == null) { + throw new IllegalArgumentException("Parameter applicationResourceName is required and cannot be null."); + } + if (serviceResourceName == null) { + throw new IllegalArgumentException("Parameter serviceResourceName is required and cannot be null."); + } + final String apiVersion = "6.3-preview"; + return service.getReplicas(applicationResourceName, serviceResourceName, apiVersion, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getReplicasDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getReplicasDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 applicationResourceName Service Fabric application resource name. + * @param serviceResourceName Service Fabric service resource name. + * @param replicaName Service Fabric replica name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceResourceReplicaDescriptionInner object if successful. + */ + public ServiceResourceReplicaDescriptionInner getReplica(String applicationResourceName, String serviceResourceName, String replicaName) { + return getReplicaWithServiceResponseAsync(applicationResourceName, serviceResourceName, replicaName).toBlocking().single().body(); + } + + /** + * 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 applicationResourceName Service Fabric application resource name. + * @param serviceResourceName Service Fabric service resource name. + * @param replicaName Service Fabric replica name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getReplicaAsync(String applicationResourceName, String serviceResourceName, String replicaName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getReplicaWithServiceResponseAsync(applicationResourceName, serviceResourceName, replicaName), serviceCallback); + } + + /** + * 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 applicationResourceName Service Fabric application resource name. + * @param serviceResourceName Service Fabric service resource name. + * @param replicaName Service Fabric replica name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceResourceReplicaDescriptionInner object + */ + public Observable getReplicaAsync(String applicationResourceName, String serviceResourceName, String replicaName) { + return getReplicaWithServiceResponseAsync(applicationResourceName, serviceResourceName, replicaName).map(new Func1, ServiceResourceReplicaDescriptionInner>() { + @Override + public ServiceResourceReplicaDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 applicationResourceName Service Fabric application resource name. + * @param serviceResourceName Service Fabric service resource name. + * @param replicaName Service Fabric replica name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceResourceReplicaDescriptionInner object + */ + public Observable> getReplicaWithServiceResponseAsync(String applicationResourceName, String serviceResourceName, String replicaName) { + if (applicationResourceName == null) { + throw new IllegalArgumentException("Parameter applicationResourceName is required and cannot be null."); + } + if (serviceResourceName == null) { + throw new IllegalArgumentException("Parameter serviceResourceName is required and cannot be null."); + } + if (replicaName == null) { + throw new IllegalArgumentException("Parameter replicaName is required and cannot be null."); + } + final String apiVersion = "6.3-preview"; + return service.getReplica(applicationResourceName, serviceResourceName, replicaName, apiVersion, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getReplicaDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getReplicaDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 volumeResourceName Service Fabric volume resource name. + * @param volumeResourceDescription Description for creating a volume resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void createVolumeResource(String volumeResourceName, VolumeResourceDescriptionInner volumeResourceDescription) { + createVolumeResourceWithServiceResponseAsync(volumeResourceName, volumeResourceDescription).toBlocking().single().body(); + } + + /** + * 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 volumeResourceName Service Fabric volume resource name. + * @param volumeResourceDescription Description for creating a volume resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createVolumeResourceAsync(String volumeResourceName, VolumeResourceDescriptionInner volumeResourceDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createVolumeResourceWithServiceResponseAsync(volumeResourceName, volumeResourceDescription), serviceCallback); + } + + /** + * 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 volumeResourceName Service Fabric volume resource name. + * @param volumeResourceDescription Description for creating a volume resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable createVolumeResourceAsync(String volumeResourceName, VolumeResourceDescriptionInner volumeResourceDescription) { + return createVolumeResourceWithServiceResponseAsync(volumeResourceName, volumeResourceDescription).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 volumeResourceName Service Fabric volume resource name. + * @param volumeResourceDescription Description for creating a volume resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> createVolumeResourceWithServiceResponseAsync(String volumeResourceName, VolumeResourceDescriptionInner volumeResourceDescription) { + if (volumeResourceName == null) { + throw new IllegalArgumentException("Parameter volumeResourceName is required and cannot be null."); + } + if (volumeResourceDescription == null) { + throw new IllegalArgumentException("Parameter volumeResourceDescription is required and cannot be null."); + } + Validator.validate(volumeResourceDescription); + final String apiVersion = "6.3-preview"; + return service.createVolumeResource(volumeResourceName, apiVersion, volumeResourceDescription, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createVolumeResourceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createVolumeResourceDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 volumeResourceName Service Fabric volume resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VolumeResourceDescriptionInner object if successful. + */ + public VolumeResourceDescriptionInner getVolumeResource(String volumeResourceName) { + return getVolumeResourceWithServiceResponseAsync(volumeResourceName).toBlocking().single().body(); + } + + /** + * 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 volumeResourceName Service Fabric volume resource name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getVolumeResourceAsync(String volumeResourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getVolumeResourceWithServiceResponseAsync(volumeResourceName), serviceCallback); + } + + /** + * 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 volumeResourceName Service Fabric volume resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VolumeResourceDescriptionInner object + */ + public Observable getVolumeResourceAsync(String volumeResourceName) { + return getVolumeResourceWithServiceResponseAsync(volumeResourceName).map(new Func1, VolumeResourceDescriptionInner>() { + @Override + public VolumeResourceDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 volumeResourceName Service Fabric volume resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VolumeResourceDescriptionInner object + */ + public Observable> getVolumeResourceWithServiceResponseAsync(String volumeResourceName) { + if (volumeResourceName == null) { + throw new IllegalArgumentException("Parameter volumeResourceName is required and cannot be null."); + } + final String apiVersion = "6.3-preview"; + return service.getVolumeResource(volumeResourceName, apiVersion, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getVolumeResourceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getVolumeResourceDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Deletes the volume resource. + * Deletes the volume identified by the name. + * + * @param volumeResourceName Service Fabric volume resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteVolumeResource(String volumeResourceName) { + deleteVolumeResourceWithServiceResponseAsync(volumeResourceName).toBlocking().single().body(); + } + + /** + * Deletes the volume resource. + * Deletes the volume identified by the name. + * + * @param volumeResourceName Service Fabric volume resource name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteVolumeResourceAsync(String volumeResourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteVolumeResourceWithServiceResponseAsync(volumeResourceName), serviceCallback); + } + + /** + * Deletes the volume resource. + * Deletes the volume identified by the name. + * + * @param volumeResourceName Service Fabric volume resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteVolumeResourceAsync(String volumeResourceName) { + return deleteVolumeResourceWithServiceResponseAsync(volumeResourceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the volume resource. + * Deletes the volume identified by the name. + * + * @param volumeResourceName Service Fabric volume resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteVolumeResourceWithServiceResponseAsync(String volumeResourceName) { + if (volumeResourceName == null) { + throw new IllegalArgumentException("Parameter volumeResourceName is required and cannot be null."); + } + final String apiVersion = "6.3-preview"; + return service.deleteVolumeResource(volumeResourceName, apiVersion, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteVolumeResourceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteVolumeResourceDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceHealthInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceHealthInner.java new file mode 100644 index 0000000000000..53ba751bd8022 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceHealthInner.java @@ -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. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import java.util.List; +import com.microsoft.azure.servicefabric.PartitionHealthState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.servicefabric.EntityHealth; + +/** + * Information about the health of a Service Fabric service. + */ +public class ServiceHealthInner extends EntityHealth { + /** + * The name of the service whose health information is described by this + * object. + */ + @JsonProperty(value = "Name") + private String name; + + /** + * The list of partition health states associated with the service. + */ + @JsonProperty(value = "PartitionHealthStates") + private List partitionHealthStates; + + /** + * Get the name of the service whose health information is described by this object. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the service whose health information is described by this object. + * + * @param name the name value to set + * @return the ServiceHealthInner object itself. + */ + public ServiceHealthInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the list of partition health states associated with the service. + * + * @return the partitionHealthStates value + */ + public List partitionHealthStates() { + return this.partitionHealthStates; + } + + /** + * Set the list of partition health states associated with the service. + * + * @param partitionHealthStates the partitionHealthStates value to set + * @return the ServiceHealthInner object itself. + */ + public ServiceHealthInner withPartitionHealthStates(List partitionHealthStates) { + this.partitionHealthStates = partitionHealthStates; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceInfoInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceInfoInner.java new file mode 100644 index 0000000000000..838f3e18fd377 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceInfoInner.java @@ -0,0 +1,224 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.microsoft.azure.servicefabric.HealthState; +import com.microsoft.azure.servicefabric.ServiceStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Information about a Service Fabric service. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ServiceKind") +@JsonTypeName("ServiceInfo") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Stateful", value = StatefulServiceInfo.class), + @JsonSubTypes.Type(name = "Stateless", value = StatelessServiceInfo.class) +}) +public class ServiceInfoInner { + /** + * The identity of the service. This ID is an encoded representation of the + * service name. This is used in the REST APIs to identify the service + * resource. + * Starting in version 6.0, hierarchical names are delimited with the "\~" + * character. For example, if the service name is + * "fabric:/myapp/app1/svc1", + * the service identity would be "myapp~app1\~svc1" in 6.0+ and + * "myapp/app1/svc1" in previous versions. + */ + @JsonProperty(value = "Id") + private String id; + + /** + * The full name of the service with 'fabric:' URI scheme. + */ + @JsonProperty(value = "Name") + private String name; + + /** + * Name of the service type as specified in the service manifest. + */ + @JsonProperty(value = "TypeName") + private String typeName; + + /** + * The version of the service manifest. + */ + @JsonProperty(value = "ManifestVersion") + private String manifestVersion; + + /** + * 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'. + */ + @JsonProperty(value = "HealthState") + private HealthState healthState; + + /** + * The status of the application. Possible values include: 'Unknown', + * 'Active', 'Upgrading', 'Deleting', 'Creating', 'Failed'. + */ + @JsonProperty(value = "ServiceStatus") + private ServiceStatus serviceStatus; + + /** + * Whether the service is in a service group. + */ + @JsonProperty(value = "IsServiceGroup") + private Boolean isServiceGroup; + + /** + * Get the identity of the service. This ID is an encoded representation of the service name. This is used in the REST APIs to identify the service resource. + Starting in version 6.0, hierarchical names are delimited with the "\~" character. For example, if the service name is "fabric:/myapp/app1/svc1", + the service identity would be "myapp~app1\~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the identity of the service. This ID is an encoded representation of the service name. This is used in the REST APIs to identify the service resource. + Starting in version 6.0, hierarchical names are delimited with the "\~" character. For example, if the service name is "fabric:/myapp/app1/svc1", + the service identity would be "myapp~app1\~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. + * + * @param id the id value to set + * @return the ServiceInfoInner object itself. + */ + public ServiceInfoInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the full name of the service with 'fabric:' URI scheme. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the full name of the service with 'fabric:' URI scheme. + * + * @param name the name value to set + * @return the ServiceInfoInner object itself. + */ + public ServiceInfoInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get name of the service type as specified in the service manifest. + * + * @return the typeName value + */ + public String typeName() { + return this.typeName; + } + + /** + * Set name of the service type as specified in the service manifest. + * + * @param typeName the typeName value to set + * @return the ServiceInfoInner object itself. + */ + public ServiceInfoInner withTypeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get the version of the service manifest. + * + * @return the manifestVersion value + */ + public String manifestVersion() { + return this.manifestVersion; + } + + /** + * Set the version of the service manifest. + * + * @param manifestVersion the manifestVersion value to set + * @return the ServiceInfoInner object itself. + */ + public ServiceInfoInner withManifestVersion(String manifestVersion) { + this.manifestVersion = manifestVersion; + return this; + } + + /** + * Get 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'. + * + * @return the healthState value + */ + public HealthState healthState() { + return this.healthState; + } + + /** + * Set 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 healthState the healthState value to set + * @return the ServiceInfoInner object itself. + */ + public ServiceInfoInner withHealthState(HealthState healthState) { + this.healthState = healthState; + return this; + } + + /** + * Get the status of the application. Possible values include: 'Unknown', 'Active', 'Upgrading', 'Deleting', 'Creating', 'Failed'. + * + * @return the serviceStatus value + */ + public ServiceStatus serviceStatus() { + return this.serviceStatus; + } + + /** + * Set the status of the application. Possible values include: 'Unknown', 'Active', 'Upgrading', 'Deleting', 'Creating', 'Failed'. + * + * @param serviceStatus the serviceStatus value to set + * @return the ServiceInfoInner object itself. + */ + public ServiceInfoInner withServiceStatus(ServiceStatus serviceStatus) { + this.serviceStatus = serviceStatus; + return this; + } + + /** + * Get whether the service is in a service group. + * + * @return the isServiceGroup value + */ + public Boolean isServiceGroup() { + return this.isServiceGroup; + } + + /** + * Set whether the service is in a service group. + * + * @param isServiceGroup the isServiceGroup value to set + * @return the ServiceInfoInner object itself. + */ + public ServiceInfoInner withIsServiceGroup(Boolean isServiceGroup) { + this.isServiceGroup = isServiceGroup; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceNameInfoInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceNameInfoInner.java new file mode 100644 index 0000000000000..117cb7fda5c1e --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceNameInfoInner.java @@ -0,0 +1,80 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about the service name. + */ +public class ServiceNameInfoInner { + /** + * The identity of the service. This ID is an encoded representation of the + * service name. This is used in the REST APIs to identify the service + * resource. + * Starting in version 6.0, hierarchical names are delimited with the "\~" + * character. For example, if the service name is + * "fabric:/myapp/app1/svc1", + * the service identity would be "myapp~app1\~svc1" in 6.0+ and + * "myapp/app1/svc1" in previous versions. + */ + @JsonProperty(value = "Id") + private String id; + + /** + * The full name of the service with 'fabric:' URI scheme. + */ + @JsonProperty(value = "Name") + private String name; + + /** + * Get the identity of the service. This ID is an encoded representation of the service name. This is used in the REST APIs to identify the service resource. + Starting in version 6.0, hierarchical names are delimited with the "\~" character. For example, if the service name is "fabric:/myapp/app1/svc1", + the service identity would be "myapp~app1\~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the identity of the service. This ID is an encoded representation of the service name. This is used in the REST APIs to identify the service resource. + Starting in version 6.0, hierarchical names are delimited with the "\~" character. For example, if the service name is "fabric:/myapp/app1/svc1", + the service identity would be "myapp~app1\~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. + * + * @param id the id value to set + * @return the ServiceNameInfoInner object itself. + */ + public ServiceNameInfoInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the full name of the service with 'fabric:' URI scheme. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the full name of the service with 'fabric:' URI scheme. + * + * @param name the name value to set + * @return the ServiceNameInfoInner object itself. + */ + public ServiceNameInfoInner withName(String name) { + this.name = name; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServicePartitionInfoInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServicePartitionInfoInner.java new file mode 100644 index 0000000000000..367e2baf5647b --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServicePartitionInfoInner.java @@ -0,0 +1,112 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.microsoft.azure.servicefabric.HealthState; +import com.microsoft.azure.servicefabric.ServicePartitionStatus; +import com.microsoft.azure.servicefabric.PartitionInformation; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Information about a partition of a Service Fabric service. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ServiceKind") +@JsonTypeName("ServicePartitionInfo") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Stateful", value = StatefulServicePartitionInfo.class), + @JsonSubTypes.Type(name = "Stateless", value = StatelessServicePartitionInfo.class) +}) +public class ServicePartitionInfoInner { + /** + * 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'. + */ + @JsonProperty(value = "HealthState") + private HealthState healthState; + + /** + * The status of the service fabric service partition. Possible values + * include: 'Invalid', 'Ready', 'NotReady', 'InQuorumLoss', + * 'Reconfiguring', 'Deleting'. + */ + @JsonProperty(value = "PartitionStatus") + private ServicePartitionStatus partitionStatus; + + /** + * Information about the partition identity, partitioning scheme and keys + * supported by it. + */ + @JsonProperty(value = "PartitionInformation") + private PartitionInformation partitionInformation; + + /** + * Get 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'. + * + * @return the healthState value + */ + public HealthState healthState() { + return this.healthState; + } + + /** + * Set 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 healthState the healthState value to set + * @return the ServicePartitionInfoInner object itself. + */ + public ServicePartitionInfoInner withHealthState(HealthState healthState) { + this.healthState = healthState; + return this; + } + + /** + * Get the status of the service fabric service partition. Possible values include: 'Invalid', 'Ready', 'NotReady', 'InQuorumLoss', 'Reconfiguring', 'Deleting'. + * + * @return the partitionStatus value + */ + public ServicePartitionStatus partitionStatus() { + return this.partitionStatus; + } + + /** + * Set the status of the service fabric service partition. Possible values include: 'Invalid', 'Ready', 'NotReady', 'InQuorumLoss', 'Reconfiguring', 'Deleting'. + * + * @param partitionStatus the partitionStatus value to set + * @return the ServicePartitionInfoInner object itself. + */ + public ServicePartitionInfoInner withPartitionStatus(ServicePartitionStatus partitionStatus) { + this.partitionStatus = partitionStatus; + return this; + } + + /** + * Get information about the partition identity, partitioning scheme and keys supported by it. + * + * @return the partitionInformation value + */ + public PartitionInformation partitionInformation() { + return this.partitionInformation; + } + + /** + * Set information about the partition identity, partitioning scheme and keys supported by it. + * + * @param partitionInformation the partitionInformation value to set + * @return the ServicePartitionInfoInner object itself. + */ + public ServicePartitionInfoInner withPartitionInformation(PartitionInformation partitionInformation) { + this.partitionInformation = partitionInformation; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceResourceDescriptionInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceResourceDescriptionInner.java new file mode 100644 index 0000000000000..868950dcccfa1 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceResourceDescriptionInner.java @@ -0,0 +1,259 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.microsoft.azure.servicefabric.OperatingSystemTypes; +import java.util.List; +import com.microsoft.azure.servicefabric.ContainerCodePackageProperties; +import com.microsoft.azure.servicefabric.NetworkRef; +import com.microsoft.azure.servicefabric.DiagnosticsRef; +import com.microsoft.azure.servicefabric.HealthState; +import com.microsoft.azure.servicefabric.ServiceResourceStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Describes a service fabric service resource. + */ +@JsonFlatten +public class ServiceResourceDescriptionInner { + /** + * The Operating system type required by the code in service. + * . Possible values include: 'Linux', 'Windows'. + */ + @JsonProperty(value = "properties.osType", required = true) + private OperatingSystemTypes osType; + + /** + * 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.). + */ + @JsonProperty(value = "properties.codePackages", required = true) + private List codePackages; + + /** + * The names of the private networks that this service needs to be part of. + */ + @JsonProperty(value = "properties.networkRefs") + private List networkRefs; + + /** + * Reference to sinks in DiagnosticsDescription. + */ + @JsonProperty(value = "properties.diagnostics") + private DiagnosticsRef diagnostics; + + /** + * User readable description of the service. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * The number of replicas of the service to create. Defaults to 1 if not + * specified. + */ + @JsonProperty(value = "properties.replicaCount") + private Integer replicaCount; + + /** + * 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'. + */ + @JsonProperty(value = "properties.healthState") + private HealthState healthState; + + /** + * Represents the status of the service. Possible values include: + * 'Unknown', 'Active', 'Upgrading', 'Deleting', 'Creating', 'Failed'. + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private ServiceResourceStatus status; + + /** + * Service resource name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get the Operating system type required by the code in service. + . Possible values include: 'Linux', 'Windows'. + * + * @return the osType value + */ + public OperatingSystemTypes osType() { + return this.osType; + } + + /** + * Set the Operating system type required by the code in service. + . Possible values include: 'Linux', 'Windows'. + * + * @param osType the osType value to set + * @return the ServiceResourceDescriptionInner object itself. + */ + public ServiceResourceDescriptionInner withOsType(OperatingSystemTypes osType) { + this.osType = osType; + return this; + } + + /** + * Get 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.). + * + * @return the codePackages value + */ + public List codePackages() { + return this.codePackages; + } + + /** + * Set 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.). + * + * @param codePackages the codePackages value to set + * @return the ServiceResourceDescriptionInner object itself. + */ + public ServiceResourceDescriptionInner withCodePackages(List codePackages) { + this.codePackages = codePackages; + return this; + } + + /** + * Get the names of the private networks that this service needs to be part of. + * + * @return the networkRefs value + */ + public List networkRefs() { + return this.networkRefs; + } + + /** + * Set the names of the private networks that this service needs to be part of. + * + * @param networkRefs the networkRefs value to set + * @return the ServiceResourceDescriptionInner object itself. + */ + public ServiceResourceDescriptionInner withNetworkRefs(List networkRefs) { + this.networkRefs = networkRefs; + return this; + } + + /** + * Get reference to sinks in DiagnosticsDescription. + * + * @return the diagnostics value + */ + public DiagnosticsRef diagnostics() { + return this.diagnostics; + } + + /** + * Set reference to sinks in DiagnosticsDescription. + * + * @param diagnostics the diagnostics value to set + * @return the ServiceResourceDescriptionInner object itself. + */ + public ServiceResourceDescriptionInner withDiagnostics(DiagnosticsRef diagnostics) { + this.diagnostics = diagnostics; + return this; + } + + /** + * Get user readable description of the service. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set user readable description of the service. + * + * @param description the description value to set + * @return the ServiceResourceDescriptionInner object itself. + */ + public ServiceResourceDescriptionInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the number of replicas of the service to create. Defaults to 1 if not specified. + * + * @return the replicaCount value + */ + public Integer replicaCount() { + return this.replicaCount; + } + + /** + * Set the number of replicas of the service to create. Defaults to 1 if not specified. + * + * @param replicaCount the replicaCount value to set + * @return the ServiceResourceDescriptionInner object itself. + */ + public ServiceResourceDescriptionInner withReplicaCount(Integer replicaCount) { + this.replicaCount = replicaCount; + return this; + } + + /** + * Get 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'. + * + * @return the healthState value + */ + public HealthState healthState() { + return this.healthState; + } + + /** + * Set 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 healthState the healthState value to set + * @return the ServiceResourceDescriptionInner object itself. + */ + public ServiceResourceDescriptionInner withHealthState(HealthState healthState) { + this.healthState = healthState; + return this; + } + + /** + * Get represents the status of the service. Possible values include: 'Unknown', 'Active', 'Upgrading', 'Deleting', 'Creating', 'Failed'. + * + * @return the status value + */ + public ServiceResourceStatus status() { + return this.status; + } + + /** + * Get service resource name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set service resource name. + * + * @param name the name value to set + * @return the ServiceResourceDescriptionInner object itself. + */ + public ServiceResourceDescriptionInner withName(String name) { + this.name = name; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceResourceReplicaDescriptionInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceResourceReplicaDescriptionInner.java new file mode 100644 index 0000000000000..17d9fa0046960 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceResourceReplicaDescriptionInner.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.servicefabric.ServiceReplicaProperties; + +/** + * Describes a replica of a service resource. + */ +public class ServiceResourceReplicaDescriptionInner extends ServiceReplicaProperties { + /** + * Name of the replica. + */ + @JsonProperty(value = "replicaName", required = true) + private String replicaName; + + /** + * Get name of the replica. + * + * @return the replicaName value + */ + public String replicaName() { + return this.replicaName; + } + + /** + * Set name of the replica. + * + * @param replicaName the replicaName value to set + * @return the ServiceResourceReplicaDescriptionInner object itself. + */ + public ServiceResourceReplicaDescriptionInner withReplicaName(String replicaName) { + this.replicaName = replicaName; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceTypeInfoInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceTypeInfoInner.java new file mode 100644 index 0000000000000..b3b8eb783af00 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceTypeInfoInner.java @@ -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. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.microsoft.azure.servicefabric.ServiceTypeDescription; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about a service type that is defined in a service manifest of a + * provisioned application type. + */ +public class ServiceTypeInfoInner { + /** + * Describes a service type defined in the service manifest of a + * provisioned application type. The properties the ones defined in the + * service manifest. + */ + @JsonProperty(value = "ServiceTypeDescription") + private ServiceTypeDescription serviceTypeDescription; + + /** + * The name of the service manifest in which this service type is defined. + */ + @JsonProperty(value = "ServiceManifestName") + private String serviceManifestName; + + /** + * The version of the service manifest in which this service type is + * defined. + */ + @JsonProperty(value = "ServiceManifestVersion") + private String serviceManifestVersion; + + /** + * Indicates whether the service is a service group. If it is, the property + * value is true otherwise false. + */ + @JsonProperty(value = "IsServiceGroup") + private Boolean isServiceGroup; + + /** + * Get describes a service type defined in the service manifest of a provisioned application type. The properties the ones defined in the service manifest. + * + * @return the serviceTypeDescription value + */ + public ServiceTypeDescription serviceTypeDescription() { + return this.serviceTypeDescription; + } + + /** + * Set describes a service type defined in the service manifest of a provisioned application type. The properties the ones defined in the service manifest. + * + * @param serviceTypeDescription the serviceTypeDescription value to set + * @return the ServiceTypeInfoInner object itself. + */ + public ServiceTypeInfoInner withServiceTypeDescription(ServiceTypeDescription serviceTypeDescription) { + this.serviceTypeDescription = serviceTypeDescription; + return this; + } + + /** + * Get the name of the service manifest in which this service type is defined. + * + * @return the serviceManifestName value + */ + public String serviceManifestName() { + return this.serviceManifestName; + } + + /** + * Set the name of the service manifest in which this service type is defined. + * + * @param serviceManifestName the serviceManifestName value to set + * @return the ServiceTypeInfoInner object itself. + */ + public ServiceTypeInfoInner withServiceManifestName(String serviceManifestName) { + this.serviceManifestName = serviceManifestName; + return this; + } + + /** + * Get the version of the service manifest in which this service type is defined. + * + * @return the serviceManifestVersion value + */ + public String serviceManifestVersion() { + return this.serviceManifestVersion; + } + + /** + * Set the version of the service manifest in which this service type is defined. + * + * @param serviceManifestVersion the serviceManifestVersion value to set + * @return the ServiceTypeInfoInner object itself. + */ + public ServiceTypeInfoInner withServiceManifestVersion(String serviceManifestVersion) { + this.serviceManifestVersion = serviceManifestVersion; + return this; + } + + /** + * Get indicates whether the service is a service group. If it is, the property value is true otherwise false. + * + * @return the isServiceGroup value + */ + public Boolean isServiceGroup() { + return this.isServiceGroup; + } + + /** + * Set indicates whether the service is a service group. If it is, the property value is true otherwise false. + * + * @param isServiceGroup the isServiceGroup value to set + * @return the ServiceTypeInfoInner object itself. + */ + public ServiceTypeInfoInner withIsServiceGroup(Boolean isServiceGroup) { + this.isServiceGroup = isServiceGroup; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceTypeManifestInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceTypeManifestInner.java new file mode 100644 index 0000000000000..b49133fe4b30c --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceTypeManifestInner.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains the manifest describing a service type registered as part of an + * application in a Service Fabric cluster. + */ +public class ServiceTypeManifestInner { + /** + * The XML manifest as a string. + */ + @JsonProperty(value = "Manifest") + private String manifest; + + /** + * Get the XML manifest as a string. + * + * @return the manifest value + */ + public String manifest() { + return this.manifest; + } + + /** + * Set the XML manifest as a string. + * + * @param manifest the manifest value to set + * @return the ServiceTypeManifestInner object itself. + */ + public ServiceTypeManifestInner withManifest(String manifest) { + this.manifest = manifest; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/SuccessfulPropertyBatchInfoInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/SuccessfulPropertyBatchInfoInner.java new file mode 100644 index 0000000000000..0dc5d31252cae --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/SuccessfulPropertyBatchInfoInner.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.PropertyBatchInfo; + +/** + * Derived from PropertyBatchInfo. Represents the property batch succeeding. + * Contains the results of any "Get" operations in the batch. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("Successful") +public class SuccessfulPropertyBatchInfoInner extends PropertyBatchInfo { + /** + * 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. + */ + @JsonProperty(value = "Properties") + private Map properties; + + /** + * Get 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. + * + * @return the properties value + */ + public Map properties() { + return this.properties; + } + + /** + * Set 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. + * + * @param properties the properties value to set + * @return the SuccessfulPropertyBatchInfoInner object itself. + */ + public SuccessfulPropertyBatchInfoInner withProperties(Map properties) { + this.properties = properties; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/UpgradeOrchestrationServiceStateInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/UpgradeOrchestrationServiceStateInner.java new file mode 100644 index 0000000000000..1621d5d42a2d0 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/UpgradeOrchestrationServiceStateInner.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Service state of Service Fabric Upgrade Orchestration Service. + */ +public class UpgradeOrchestrationServiceStateInner { + /** + * The state of Service Fabric Upgrade Orchestration Service. + */ + @JsonProperty(value = "ServiceState") + private String serviceState; + + /** + * Get the state of Service Fabric Upgrade Orchestration Service. + * + * @return the serviceState value + */ + public String serviceState() { + return this.serviceState; + } + + /** + * Set the state of Service Fabric Upgrade Orchestration Service. + * + * @param serviceState the serviceState value to set + * @return the UpgradeOrchestrationServiceStateInner object itself. + */ + public UpgradeOrchestrationServiceStateInner withServiceState(String serviceState) { + this.serviceState = serviceState; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/UpgradeOrchestrationServiceStateSummaryInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/UpgradeOrchestrationServiceStateSummaryInner.java new file mode 100644 index 0000000000000..f88e24064cd20 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/UpgradeOrchestrationServiceStateSummaryInner.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Service state summary of Service Fabric Upgrade Orchestration Service. + */ +public class UpgradeOrchestrationServiceStateSummaryInner { + /** + * The current code version of the cluster. + */ + @JsonProperty(value = "CurrentCodeVersion") + private String currentCodeVersion; + + /** + * The current manifest version of the cluster. + */ + @JsonProperty(value = "CurrentManifestVersion") + private String currentManifestVersion; + + /** + * The target code version of the cluster. + */ + @JsonProperty(value = "TargetCodeVersion") + private String targetCodeVersion; + + /** + * The target manifest version of the cluster. + */ + @JsonProperty(value = "TargetManifestVersion") + private String targetManifestVersion; + + /** + * The type of the pending upgrade of the cluster. + */ + @JsonProperty(value = "PendingUpgradeType") + private String pendingUpgradeType; + + /** + * Get the current code version of the cluster. + * + * @return the currentCodeVersion value + */ + public String currentCodeVersion() { + return this.currentCodeVersion; + } + + /** + * Set the current code version of the cluster. + * + * @param currentCodeVersion the currentCodeVersion value to set + * @return the UpgradeOrchestrationServiceStateSummaryInner object itself. + */ + public UpgradeOrchestrationServiceStateSummaryInner withCurrentCodeVersion(String currentCodeVersion) { + this.currentCodeVersion = currentCodeVersion; + return this; + } + + /** + * Get the current manifest version of the cluster. + * + * @return the currentManifestVersion value + */ + public String currentManifestVersion() { + return this.currentManifestVersion; + } + + /** + * Set the current manifest version of the cluster. + * + * @param currentManifestVersion the currentManifestVersion value to set + * @return the UpgradeOrchestrationServiceStateSummaryInner object itself. + */ + public UpgradeOrchestrationServiceStateSummaryInner withCurrentManifestVersion(String currentManifestVersion) { + this.currentManifestVersion = currentManifestVersion; + return this; + } + + /** + * Get the target code version of the cluster. + * + * @return the targetCodeVersion value + */ + public String targetCodeVersion() { + return this.targetCodeVersion; + } + + /** + * Set the target code version of the cluster. + * + * @param targetCodeVersion the targetCodeVersion value to set + * @return the UpgradeOrchestrationServiceStateSummaryInner object itself. + */ + public UpgradeOrchestrationServiceStateSummaryInner withTargetCodeVersion(String targetCodeVersion) { + this.targetCodeVersion = targetCodeVersion; + return this; + } + + /** + * Get the target manifest version of the cluster. + * + * @return the targetManifestVersion value + */ + public String targetManifestVersion() { + return this.targetManifestVersion; + } + + /** + * Set the target manifest version of the cluster. + * + * @param targetManifestVersion the targetManifestVersion value to set + * @return the UpgradeOrchestrationServiceStateSummaryInner object itself. + */ + public UpgradeOrchestrationServiceStateSummaryInner withTargetManifestVersion(String targetManifestVersion) { + this.targetManifestVersion = targetManifestVersion; + return this; + } + + /** + * Get the type of the pending upgrade of the cluster. + * + * @return the pendingUpgradeType value + */ + public String pendingUpgradeType() { + return this.pendingUpgradeType; + } + + /** + * Set the type of the pending upgrade of the cluster. + * + * @param pendingUpgradeType the pendingUpgradeType value to set + * @return the UpgradeOrchestrationServiceStateSummaryInner object itself. + */ + public UpgradeOrchestrationServiceStateSummaryInner withPendingUpgradeType(String pendingUpgradeType) { + this.pendingUpgradeType = pendingUpgradeType; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/UploadSessionInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/UploadSessionInner.java new file mode 100644 index 0000000000000..beff8be20b478 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/UploadSessionInner.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import java.util.List; +import com.microsoft.azure.servicefabric.UploadSessionInfo; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about a image store upload session. + */ +public class UploadSessionInner { + /** + * 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. + */ + @JsonProperty(value = "UploadSessions") + private List uploadSessions; + + /** + * Get 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. + * + * @return the uploadSessions value + */ + public List uploadSessions() { + return this.uploadSessions; + } + + /** + * Set 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. + * + * @param uploadSessions the uploadSessions value to set + * @return the UploadSessionInner object itself. + */ + public UploadSessionInner withUploadSessions(List uploadSessions) { + this.uploadSessions = uploadSessions; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/VolumeResourceDescriptionInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/VolumeResourceDescriptionInner.java new file mode 100644 index 0000000000000..8e893700930be --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/VolumeResourceDescriptionInner.java @@ -0,0 +1,132 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.microsoft.azure.servicefabric.VolumeProviderParametersAzureFile; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Describes a service fabric volume resource. + */ +@JsonFlatten +public class VolumeResourceDescriptionInner { + /** + * User readable description of the volume. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * Provider of the volume. + */ + @JsonProperty(value = "properties.provider", required = true) + private String provider; + + /** + * This type describes a volume provided by an Azure Files file share. + */ + @JsonProperty(value = "properties.azureFileParameters") + private VolumeProviderParametersAzureFile azureFileParameters; + + /** + * Volume resource name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Creates an instance of VolumeResourceDescriptionInner class. + * @param name volume resource name. + */ + public VolumeResourceDescriptionInner() { + provider = "SFAzureFile"; + } + + /** + * Get user readable description of the volume. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set user readable description of the volume. + * + * @param description the description value to set + * @return the VolumeResourceDescriptionInner object itself. + */ + public VolumeResourceDescriptionInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get provider of the volume. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set provider of the volume. + * + * @param provider the provider value to set + * @return the VolumeResourceDescriptionInner object itself. + */ + public VolumeResourceDescriptionInner withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get this type describes a volume provided by an Azure Files file share. + * + * @return the azureFileParameters value + */ + public VolumeProviderParametersAzureFile azureFileParameters() { + return this.azureFileParameters; + } + + /** + * Set this type describes a volume provided by an Azure Files file share. + * + * @param azureFileParameters the azureFileParameters value to set + * @return the VolumeResourceDescriptionInner object itself. + */ + public VolumeResourceDescriptionInner withAzureFileParameters(VolumeProviderParametersAzureFile azureFileParameters) { + this.azureFileParameters = azureFileParameters; + return this; + } + + /** + * Get volume resource name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set volume resource name. + * + * @param name the name value to set + * @return the VolumeResourceDescriptionInner object itself. + */ + public VolumeResourceDescriptionInner withName(String name) { + this.name = name; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/package-info.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/package-info.java new file mode 100644 index 0000000000000..c0d3aeb6c5258 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for ServiceFabricClientAPIs. + * Service Fabric REST Client APIs allows management of Service Fabric clusters, applications and services. + */ +package com.microsoft.azure.servicefabric.implementation; diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/package-info.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/package-info.java new file mode 100644 index 0000000000000..660a326359085 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for ServiceFabricClientAPIs. + * Service Fabric REST Client APIs allows management of Service Fabric clusters, applications and services. + */ +package com.microsoft.azure.servicefabric; From 59cb0f6d810e280d2a0d454fe6deea8fe4a22a91 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 27 Jul 2018 10:26:01 -0700 Subject: [PATCH 2/7] Generated from b9a3d8f42ed43d826d45af0ae6c88b871546302e (#2278) Remove newline characters from the description property value. These extra characters are resulting in extra "." dot character in the python_sdk. --- .../servicefabric/ApplicationTypeInfo.java | 22 +++++++----------- .../BackupConfigurationInfo.java | 11 ++++----- .../azure/servicefabric/BackupInfo.java | 10 ++++---- .../servicefabric/BackupSuspensionInfo.java | 11 ++++----- .../DeactivationIntentDescription.java | 10 ++++---- .../azure/servicefabric/EntityHealth.java | 11 ++++----- .../azure/servicefabric/FabricErrorError.java | 10 ++++---- .../MonitoringPolicyDescription.java | 9 +++----- .../RollingUpgradeUpdateDescription.java | 9 +++----- .../ServiceReplicaProperties.java | 10 ++++---- .../TimeBasedBackupScheduleDescription.java | 9 +++----- .../implementation/ApplicationInfoInner.java | 23 ++++++++----------- .../BackupProgressInfoInner.java | 12 ++++------ .../implementation/ChaosInner.java | 21 +++++++---------- .../ClusterHealthChunkInner.java | 11 ++++----- ...oseDeploymentUpgradeProgressInfoInner.java | 17 ++++++-------- .../DeployedApplicationInfoInner.java | 11 ++++----- .../DeployedCodePackageInfoInner.java | 11 ++++----- .../DeployedServicePackageInfoInner.java | 11 ++++----- .../RestoreProgressInfoInner.java | 8 +++---- .../ServiceFabricClientAPIsImpl.java | 12 ++++------ .../ServiceResourceDescriptionInner.java | 10 ++++---- 22 files changed, 101 insertions(+), 168 deletions(-) diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationTypeInfo.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationTypeInfo.java index c9d3307489ed5..de8758f1fd4c3 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationTypeInfo.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationTypeInfo.java @@ -36,9 +36,8 @@ public class ApplicationTypeInfo { private List defaultParameterList; /** - * The status of the application type. - * . Possible values include: 'Invalid', 'Provisioning', 'Available', - * 'Unprovisioning', 'Failed'. + * The status of the application type. Possible values include: 'Invalid', + * 'Provisioning', 'Available', 'Unprovisioning', 'Failed'. */ @JsonProperty(value = "Status") private ApplicationTypeStatus status; @@ -51,9 +50,8 @@ public class ApplicationTypeInfo { private String statusDetails; /** - * The mechanism used to define a Service Fabric application type. - * . Possible values include: 'Invalid', 'ServiceFabricApplicationPackage', - * 'Compose'. + * The mechanism used to define a Service Fabric application type. Possible + * values include: 'Invalid', 'ServiceFabricApplicationPackage', 'Compose'. */ @JsonProperty(value = "ApplicationTypeDefinitionKind") private ApplicationTypeDefinitionKind applicationTypeDefinitionKind; @@ -119,8 +117,7 @@ public ApplicationTypeInfo withDefaultParameterList(List d } /** - * Get the status of the application type. - . Possible values include: 'Invalid', 'Provisioning', 'Available', 'Unprovisioning', 'Failed'. + * Get the status of the application type. Possible values include: 'Invalid', 'Provisioning', 'Available', 'Unprovisioning', 'Failed'. * * @return the status value */ @@ -129,8 +126,7 @@ public ApplicationTypeStatus status() { } /** - * Set the status of the application type. - . Possible values include: 'Invalid', 'Provisioning', 'Available', 'Unprovisioning', 'Failed'. + * Set the status of the application type. Possible values include: 'Invalid', 'Provisioning', 'Available', 'Unprovisioning', 'Failed'. * * @param status the status value to set * @return the ApplicationTypeInfo object itself. @@ -161,8 +157,7 @@ public ApplicationTypeInfo withStatusDetails(String statusDetails) { } /** - * Get the mechanism used to define a Service Fabric application type. - . Possible values include: 'Invalid', 'ServiceFabricApplicationPackage', 'Compose'. + * Get the mechanism used to define a Service Fabric application type. Possible values include: 'Invalid', 'ServiceFabricApplicationPackage', 'Compose'. * * @return the applicationTypeDefinitionKind value */ @@ -171,8 +166,7 @@ public ApplicationTypeDefinitionKind applicationTypeDefinitionKind() { } /** - * Set the mechanism used to define a Service Fabric application type. - . Possible values include: 'Invalid', 'ServiceFabricApplicationPackage', 'Compose'. + * Set the mechanism used to define a Service Fabric application type. Possible values include: 'Invalid', 'ServiceFabricApplicationPackage', 'Compose'. * * @param applicationTypeDefinitionKind the applicationTypeDefinitionKind value to set * @return the ApplicationTypeInfo object itself. diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupConfigurationInfo.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupConfigurationInfo.java index 2fbfc477ce5ff..03598335e5b08 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupConfigurationInfo.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupConfigurationInfo.java @@ -32,9 +32,8 @@ public class BackupConfigurationInfo { private String policyName; /** - * Specifies the scope at which the backup policy is applied. - * . Possible values include: 'Invalid', 'Partition', 'Service', - * 'Application'. + * Specifies the scope at which the backup policy is applied. Possible + * values include: 'Invalid', 'Partition', 'Service', 'Application'. */ @JsonProperty(value = "PolicyInheritedFrom") private BackupPolicyScope policyInheritedFrom; @@ -66,8 +65,7 @@ public BackupConfigurationInfo withPolicyName(String policyName) { } /** - * Get specifies the scope at which the backup policy is applied. - . Possible values include: 'Invalid', 'Partition', 'Service', 'Application'. + * Get specifies the scope at which the backup policy is applied. Possible values include: 'Invalid', 'Partition', 'Service', 'Application'. * * @return the policyInheritedFrom value */ @@ -76,8 +74,7 @@ public BackupPolicyScope policyInheritedFrom() { } /** - * Set specifies the scope at which the backup policy is applied. - . Possible values include: 'Invalid', 'Partition', 'Service', 'Application'. + * Set specifies the scope at which the backup policy is applied. Possible values include: 'Invalid', 'Partition', 'Service', 'Application'. * * @param policyInheritedFrom the policyInheritedFrom value to set * @return the BackupConfigurationInfo object itself. diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupInfo.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupInfo.java index 2cbd8c1763791..b555577803026 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupInfo.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupInfo.java @@ -55,8 +55,8 @@ public class BackupInfo { private String backupLocation; /** - * Describes the type of backup, whether its full or incremental. - * . Possible values include: 'Invalid', 'Full', 'Incremental'. + * Describes the type of backup, whether its full or incremental. Possible + * values include: 'Invalid', 'Full', 'Incremental'. */ @JsonProperty(value = "BackupType") private BackupType backupType; @@ -206,8 +206,7 @@ public BackupInfo withBackupLocation(String backupLocation) { } /** - * Get describes the type of backup, whether its full or incremental. - . Possible values include: 'Invalid', 'Full', 'Incremental'. + * Get describes the type of backup, whether its full or incremental. Possible values include: 'Invalid', 'Full', 'Incremental'. * * @return the backupType value */ @@ -216,8 +215,7 @@ public BackupType backupType() { } /** - * Set describes the type of backup, whether its full or incremental. - . Possible values include: 'Invalid', 'Full', 'Incremental'. + * Set describes the type of backup, whether its full or incremental. Possible values include: 'Invalid', 'Full', 'Incremental'. * * @param backupType the backupType value to set * @return the BackupInfo object itself. diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupSuspensionInfo.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupSuspensionInfo.java index 2f77343c86076..ec100e796d778 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupSuspensionInfo.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupSuspensionInfo.java @@ -21,9 +21,8 @@ public class BackupSuspensionInfo { private Boolean isSuspended; /** - * Specifies the scope at which the backup suspension was applied. - * . Possible values include: 'Invalid', 'Partition', 'Service', - * 'Application'. + * Specifies the scope at which the backup suspension was applied. Possible + * values include: 'Invalid', 'Partition', 'Service', 'Application'. */ @JsonProperty(value = "SuspensionInheritedFrom") private BackupSuspensionScope suspensionInheritedFrom; @@ -49,8 +48,7 @@ public BackupSuspensionInfo withIsSuspended(Boolean isSuspended) { } /** - * Get specifies the scope at which the backup suspension was applied. - . Possible values include: 'Invalid', 'Partition', 'Service', 'Application'. + * Get specifies the scope at which the backup suspension was applied. Possible values include: 'Invalid', 'Partition', 'Service', 'Application'. * * @return the suspensionInheritedFrom value */ @@ -59,8 +57,7 @@ public BackupSuspensionScope suspensionInheritedFrom() { } /** - * Set specifies the scope at which the backup suspension was applied. - . Possible values include: 'Invalid', 'Partition', 'Service', 'Application'. + * Set specifies the scope at which the backup suspension was applied. Possible values include: 'Invalid', 'Partition', 'Service', 'Application'. * * @param suspensionInheritedFrom the suspensionInheritedFrom value to set * @return the BackupSuspensionInfo object itself. diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeactivationIntentDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeactivationIntentDescription.java index 2bbebfeef8917..6c56e7cefde50 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeactivationIntentDescription.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeactivationIntentDescription.java @@ -16,15 +16,14 @@ public class DeactivationIntentDescription { /** * Describes the intent or reason for deactivating the node. The possible - * values are following. - * . Possible values include: 'Pause', 'Restart', 'RemoveData'. + * values are following. Possible values include: 'Pause', 'Restart', + * 'RemoveData'. */ @JsonProperty(value = "DeactivationIntent") private DeactivationIntent deactivationIntent; /** - * Get describes the intent or reason for deactivating the node. The possible values are following. - . Possible values include: 'Pause', 'Restart', 'RemoveData'. + * Get describes the intent or reason for deactivating the node. The possible values are following. Possible values include: 'Pause', 'Restart', 'RemoveData'. * * @return the deactivationIntent value */ @@ -33,8 +32,7 @@ public DeactivationIntent deactivationIntent() { } /** - * Set describes the intent or reason for deactivating the node. The possible values are following. - . Possible values include: 'Pause', 'Restart', 'RemoveData'. + * Set describes the intent or reason for deactivating the node. The possible values are following. Possible values include: 'Pause', 'Restart', 'RemoveData'. * * @param deactivationIntent the deactivationIntent value to set * @return the DeactivationIntentDescription object itself. diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EntityHealth.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EntityHealth.java index cd39c5870ffb0..46e343e3eacce 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EntityHealth.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EntityHealth.java @@ -21,9 +21,8 @@ public class EntityHealth { * 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'. + * The aggregation is done by applying the desired health policy. Possible + * values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown'. */ @JsonProperty(value = "AggregatedHealthState") private HealthState aggregatedHealthState; @@ -51,8 +50,7 @@ public class EntityHealth { /** * Get 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'. + The aggregation is done by applying the desired health policy. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown'. * * @return the aggregatedHealthState value */ @@ -63,8 +61,7 @@ public HealthState aggregatedHealthState() { /** * Set 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'. + The aggregation is done by applying the desired health policy. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown'. * * @param aggregatedHealthState the aggregatedHealthState value to set * @return the EntityHealth object itself. diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FabricErrorError.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FabricErrorError.java index 2e76f9c2364c1..619b3e8fea212 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FabricErrorError.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FabricErrorError.java @@ -121,8 +121,8 @@ public class FabricErrorError { * Timeout) * - "FABRIC_E_COMMUNICATION_ERROR" * - "FABRIC_E_OPERATION_NOT_COMPLETE" - * - "FABRIC_E_TIMEOUT" - * . Possible values include: 'FABRIC_E_INVALID_PARTITION_KEY', + * - "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', @@ -280,8 +280,7 @@ public class FabricErrorError { - 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_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'. * * @return the code value */ @@ -381,8 +380,7 @@ public FabricErrorCodes 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'. + - "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'. * * @param code the code value to set * @return the FabricErrorError object itself. diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/MonitoringPolicyDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/MonitoringPolicyDescription.java index 414c57a2766a9..d04ec82cdd7cd 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/MonitoringPolicyDescription.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/MonitoringPolicyDescription.java @@ -20,8 +20,7 @@ public class MonitoringPolicyDescription { * 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'. + * upgrade mode. Possible values include: 'Invalid', 'Rollback', 'Manual'. */ @JsonProperty(value = "FailureAction") private FailureAction failureAction; @@ -76,8 +75,7 @@ public class MonitoringPolicyDescription { /** * Get 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'. + Manual indicates that the upgrade will switch to UnmonitoredManual upgrade mode. Possible values include: 'Invalid', 'Rollback', 'Manual'. * * @return the failureAction value */ @@ -88,8 +86,7 @@ public FailureAction failureAction() { /** * Set 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'. + Manual indicates that the upgrade will switch to UnmonitoredManual upgrade mode. Possible values include: 'Invalid', 'Rollback', 'Manual'. * * @param failureAction the failureAction value to set * @return the MonitoringPolicyDescription object itself. diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RollingUpgradeUpdateDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RollingUpgradeUpdateDescription.java index 2c5ae3b1eb7ad..ee26dbfc977bc 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RollingUpgradeUpdateDescription.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RollingUpgradeUpdateDescription.java @@ -48,8 +48,7 @@ public class RollingUpgradeUpdateDescription { * 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'. + * upgrade mode. Possible values include: 'Invalid', 'Rollback', 'Manual'. */ @JsonProperty(value = "FailureAction") private FailureAction failureAction; @@ -164,8 +163,7 @@ public RollingUpgradeUpdateDescription withReplicaSetCheckTimeoutInMilliseconds( /** * Get 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'. + Manual indicates that the upgrade will switch to UnmonitoredManual upgrade mode. Possible values include: 'Invalid', 'Rollback', 'Manual'. * * @return the failureAction value */ @@ -176,8 +174,7 @@ public FailureAction failureAction() { /** * Set 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'. + Manual indicates that the upgrade will switch to UnmonitoredManual upgrade mode. Possible values include: 'Invalid', 'Rollback', 'Manual'. * * @param failureAction the failureAction value to set * @return the RollingUpgradeUpdateDescription object itself. diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceReplicaProperties.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceReplicaProperties.java index 51cfdcf394199..13470b75a2157 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceReplicaProperties.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceReplicaProperties.java @@ -16,8 +16,8 @@ */ public class ServiceReplicaProperties { /** - * The Operating system type required by the code in service. - * . Possible values include: 'Linux', 'Windows'. + * The Operating system type required by the code in service. Possible + * values include: 'Linux', 'Windows'. */ @JsonProperty(value = "osType", required = true) private OperatingSystemTypes osType; @@ -44,8 +44,7 @@ public class ServiceReplicaProperties { private DiagnosticsRef diagnostics; /** - * Get the Operating system type required by the code in service. - . Possible values include: 'Linux', 'Windows'. + * Get the Operating system type required by the code in service. Possible values include: 'Linux', 'Windows'. * * @return the osType value */ @@ -54,8 +53,7 @@ public OperatingSystemTypes osType() { } /** - * Set the Operating system type required by the code in service. - . Possible values include: 'Linux', 'Windows'. + * Set the Operating system type required by the code in service. Possible values include: 'Linux', 'Windows'. * * @param osType the osType value to set * @return the ServiceReplicaProperties object itself. diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/TimeBasedBackupScheduleDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/TimeBasedBackupScheduleDescription.java index 1c878bf15ea40..26fc74b7cc0d8 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/TimeBasedBackupScheduleDescription.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/TimeBasedBackupScheduleDescription.java @@ -22,8 +22,7 @@ public class TimeBasedBackupScheduleDescription extends BackupScheduleDescription { /** * Describes the frequency with which to run the time based backup - * schedule. - * . Possible values include: 'Invalid', 'Daily', 'Weekly'. + * schedule. Possible values include: 'Invalid', 'Daily', 'Weekly'. */ @JsonProperty(value = "ScheduleFrequencyType", required = true) private BackupScheduleFrequencyType scheduleFrequencyType; @@ -44,8 +43,7 @@ public class TimeBasedBackupScheduleDescription extends BackupScheduleDescriptio private List runTimes; /** - * Get describes the frequency with which to run the time based backup schedule. - . Possible values include: 'Invalid', 'Daily', 'Weekly'. + * Get describes the frequency with which to run the time based backup schedule. Possible values include: 'Invalid', 'Daily', 'Weekly'. * * @return the scheduleFrequencyType value */ @@ -54,8 +52,7 @@ public BackupScheduleFrequencyType scheduleFrequencyType() { } /** - * Set describes the frequency with which to run the time based backup schedule. - . Possible values include: 'Invalid', 'Daily', 'Weekly'. + * Set describes the frequency with which to run the time based backup schedule. Possible values include: 'Invalid', 'Daily', 'Weekly'. * * @param scheduleFrequencyType the scheduleFrequencyType value to set * @return the TimeBasedBackupScheduleDescription object itself. diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ApplicationInfoInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ApplicationInfoInner.java index 224c773a3630c..1f8f88fc53aa0 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ApplicationInfoInner.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ApplicationInfoInner.java @@ -51,9 +51,8 @@ public class ApplicationInfoInner { private String typeVersion; /** - * The status of the application. - * . Possible values include: 'Invalid', 'Ready', 'Upgrading', 'Creating', - * 'Deleting', 'Failed'. + * The status of the application. Possible values include: 'Invalid', + * 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed'. */ @JsonProperty(value = "Status") private ApplicationStatus status; @@ -74,9 +73,9 @@ public class ApplicationInfoInner { private HealthState healthState; /** - * The mechanism used to define a Service Fabric application. - * . Possible values include: 'Invalid', - * 'ServiceFabricApplicationDescription', 'Compose'. + * The mechanism used to define a Service Fabric application. Possible + * values include: 'Invalid', 'ServiceFabricApplicationDescription', + * 'Compose'. */ @JsonProperty(value = "ApplicationDefinitionKind") private ApplicationDefinitionKind applicationDefinitionKind; @@ -166,8 +165,7 @@ public ApplicationInfoInner withTypeVersion(String typeVersion) { } /** - * Get the status of the application. - . Possible values include: 'Invalid', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed'. + * Get the status of the application. Possible values include: 'Invalid', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed'. * * @return the status value */ @@ -176,8 +174,7 @@ public ApplicationStatus status() { } /** - * Set the status of the application. - . Possible values include: 'Invalid', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed'. + * Set the status of the application. Possible values include: 'Invalid', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed'. * * @param status the status value to set * @return the ApplicationInfoInner object itself. @@ -228,8 +225,7 @@ public ApplicationInfoInner withHealthState(HealthState healthState) { } /** - * Get the mechanism used to define a Service Fabric application. - . Possible values include: 'Invalid', 'ServiceFabricApplicationDescription', 'Compose'. + * Get the mechanism used to define a Service Fabric application. Possible values include: 'Invalid', 'ServiceFabricApplicationDescription', 'Compose'. * * @return the applicationDefinitionKind value */ @@ -238,8 +234,7 @@ public ApplicationDefinitionKind applicationDefinitionKind() { } /** - * Set the mechanism used to define a Service Fabric application. - . Possible values include: 'Invalid', 'ServiceFabricApplicationDescription', 'Compose'. + * Set the mechanism used to define a Service Fabric application. Possible values include: 'Invalid', 'ServiceFabricApplicationDescription', 'Compose'. * * @param applicationDefinitionKind the applicationDefinitionKind value to set * @return the ApplicationInfoInner object itself. diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/BackupProgressInfoInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/BackupProgressInfoInner.java index ed297f0b65f1d..a2b3109e072fa 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/BackupProgressInfoInner.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/BackupProgressInfoInner.java @@ -20,9 +20,9 @@ */ public class BackupProgressInfoInner { /** - * Represents the current state of the partition backup operation. - * . Possible values include: 'Invalid', 'Accepted', 'BackupInProgress', - * 'Success', 'Failure', 'Timeout'. + * Represents the current state of the partition backup operation. Possible + * values include: 'Invalid', 'Accepted', 'BackupInProgress', 'Success', + * 'Failure', 'Timeout'. */ @JsonProperty(value = "BackupState") private BackupState backupState; @@ -64,8 +64,7 @@ public class BackupProgressInfoInner { private FabricErrorError failureError; /** - * Get represents the current state of the partition backup operation. - . Possible values include: 'Invalid', 'Accepted', 'BackupInProgress', 'Success', 'Failure', 'Timeout'. + * Get represents the current state of the partition backup operation. Possible values include: 'Invalid', 'Accepted', 'BackupInProgress', 'Success', 'Failure', 'Timeout'. * * @return the backupState value */ @@ -74,8 +73,7 @@ public BackupState backupState() { } /** - * Set represents the current state of the partition backup operation. - . Possible values include: 'Invalid', 'Accepted', 'BackupInProgress', 'Success', 'Failure', 'Timeout'. + * Set represents the current state of the partition backup operation. Possible values include: 'Invalid', 'Accepted', 'BackupInProgress', 'Success', 'Failure', 'Timeout'. * * @param backupState the backupState value to set * @return the BackupProgressInfoInner object itself. diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ChaosInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ChaosInner.java index 42f95992edd61..8d9b2bd931d5d 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ChaosInner.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ChaosInner.java @@ -24,16 +24,15 @@ public class ChaosInner { private ChaosParameters chaosParameters; /** - * Current status of the Chaos run. - * . Possible values include: 'Invalid', 'Running', 'Stopped'. + * Current status of the Chaos run. Possible values include: 'Invalid', + * 'Running', 'Stopped'. */ @JsonProperty(value = "Status") private ChaosStatus status; /** - * Current status of the schedule. - * . Possible values include: 'Invalid', 'Stopped', 'Active', 'Expired', - * 'Pending'. + * Current status of the schedule. Possible values include: 'Invalid', + * 'Stopped', 'Active', 'Expired', 'Pending'. */ @JsonProperty(value = "ScheduleStatus") private ChaosScheduleStatus scheduleStatus; @@ -59,8 +58,7 @@ public ChaosInner withChaosParameters(ChaosParameters chaosParameters) { } /** - * Get current status of the Chaos run. - . Possible values include: 'Invalid', 'Running', 'Stopped'. + * Get current status of the Chaos run. Possible values include: 'Invalid', 'Running', 'Stopped'. * * @return the status value */ @@ -69,8 +67,7 @@ public ChaosStatus status() { } /** - * Set current status of the Chaos run. - . Possible values include: 'Invalid', 'Running', 'Stopped'. + * Set current status of the Chaos run. Possible values include: 'Invalid', 'Running', 'Stopped'. * * @param status the status value to set * @return the ChaosInner object itself. @@ -81,8 +78,7 @@ public ChaosInner withStatus(ChaosStatus status) { } /** - * Get current status of the schedule. - . Possible values include: 'Invalid', 'Stopped', 'Active', 'Expired', 'Pending'. + * Get current status of the schedule. Possible values include: 'Invalid', 'Stopped', 'Active', 'Expired', 'Pending'. * * @return the scheduleStatus value */ @@ -91,8 +87,7 @@ public ChaosScheduleStatus scheduleStatus() { } /** - * Set current status of the schedule. - . Possible values include: 'Invalid', 'Stopped', 'Active', 'Expired', 'Pending'. + * Set current status of the schedule. Possible values include: 'Invalid', 'Stopped', 'Active', 'Expired', 'Pending'. * * @param scheduleStatus the scheduleStatus value to set * @return the ChaosInner object itself. diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ClusterHealthChunkInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ClusterHealthChunkInner.java index a0386fda04349..0f03e0809c0b5 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ClusterHealthChunkInner.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ClusterHealthChunkInner.java @@ -25,9 +25,8 @@ public class ClusterHealthChunkInner { * The health evaluation of the entity reflects all events reported on the * entity and its children (if any). * The aggregation is done by applying the desired cluster health policy - * and the application health policies. - * . Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', - * 'Unknown'. + * and the application health policies. Possible values include: 'Invalid', + * 'Ok', 'Warning', 'Error', 'Unknown'. */ @JsonProperty(value = "HealthState") private HealthState healthState; @@ -49,8 +48,7 @@ public class ClusterHealthChunkInner { /** * Get the HealthState representing the aggregated health state of the cluster computed by Health Manager. The health evaluation of the entity reflects all events reported on the entity and its children (if any). - The aggregation is done by applying the desired cluster health policy and the application health policies. - . Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown'. + The aggregation is done by applying the desired cluster health policy and the application health policies. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown'. * * @return the healthState value */ @@ -61,8 +59,7 @@ public HealthState healthState() { /** * Set the HealthState representing the aggregated health state of the cluster computed by Health Manager. The health evaluation of the entity reflects all events reported on the entity and its children (if any). - The aggregation is done by applying the desired cluster health policy and the application health policies. - . Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown'. + The aggregation is done by applying the desired cluster health policy and the application health policies. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown'. * * @param healthState the healthState value to set * @return the ClusterHealthChunkInner object itself. diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ComposeDeploymentUpgradeProgressInfoInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ComposeDeploymentUpgradeProgressInfoInner.java index 0bdcf55465447..e3723be04bc99 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ComposeDeploymentUpgradeProgressInfoInner.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ComposeDeploymentUpgradeProgressInfoInner.java @@ -37,12 +37,11 @@ public class ComposeDeploymentUpgradeProgressInfoInner { private String applicationName; /** - * The state of the compose deployment upgrade. - * . Possible values include: 'Invalid', 'ProvisioningTarget', - * 'RollingForwardInProgress', 'RollingForwardPending', - * 'UnprovisioningCurrent', 'RollingForwardCompleted', - * 'RollingBackInProgress', 'UnprovisioningTarget', 'RollingBackCompleted', - * 'Failed'. + * The state of the compose deployment upgrade. Possible values include: + * 'Invalid', 'ProvisioningTarget', 'RollingForwardInProgress', + * 'RollingForwardPending', 'UnprovisioningCurrent', + * 'RollingForwardCompleted', 'RollingBackInProgress', + * 'UnprovisioningTarget', 'RollingBackCompleted', 'Failed'. */ @JsonProperty(value = "UpgradeState") private ComposeDeploymentUpgradeState upgradeState; @@ -213,8 +212,7 @@ public ComposeDeploymentUpgradeProgressInfoInner withApplicationName(String appl } /** - * Get the state of the compose deployment upgrade. - . Possible values include: 'Invalid', 'ProvisioningTarget', 'RollingForwardInProgress', 'RollingForwardPending', 'UnprovisioningCurrent', 'RollingForwardCompleted', 'RollingBackInProgress', 'UnprovisioningTarget', 'RollingBackCompleted', 'Failed'. + * Get the state of the compose deployment upgrade. Possible values include: 'Invalid', 'ProvisioningTarget', 'RollingForwardInProgress', 'RollingForwardPending', 'UnprovisioningCurrent', 'RollingForwardCompleted', 'RollingBackInProgress', 'UnprovisioningTarget', 'RollingBackCompleted', 'Failed'. * * @return the upgradeState value */ @@ -223,8 +221,7 @@ public ComposeDeploymentUpgradeState upgradeState() { } /** - * Set the state of the compose deployment upgrade. - . Possible values include: 'Invalid', 'ProvisioningTarget', 'RollingForwardInProgress', 'RollingForwardPending', 'UnprovisioningCurrent', 'RollingForwardCompleted', 'RollingBackInProgress', 'UnprovisioningTarget', 'RollingBackCompleted', 'Failed'. + * Set the state of the compose deployment upgrade. Possible values include: 'Invalid', 'ProvisioningTarget', 'RollingForwardInProgress', 'RollingForwardPending', 'UnprovisioningCurrent', 'RollingForwardCompleted', 'RollingBackInProgress', 'UnprovisioningTarget', 'RollingBackCompleted', 'Failed'. * * @param upgradeState the upgradeState value to set * @return the ComposeDeploymentUpgradeProgressInfoInner object itself. diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/DeployedApplicationInfoInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/DeployedApplicationInfoInner.java index c4a1f0707b420..c311596c84b47 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/DeployedApplicationInfoInner.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/DeployedApplicationInfoInner.java @@ -42,9 +42,8 @@ public class DeployedApplicationInfoInner { /** * The status of the application deployed on the node. Following are the - * possible values. - * . Possible values include: 'Invalid', 'Downloading', 'Activating', - * 'Active', 'Upgrading', 'Deactivating'. + * possible values. Possible values include: 'Invalid', 'Downloading', + * 'Activating', 'Active', 'Upgrading', 'Deactivating'. */ @JsonProperty(value = "Status") private DeployedApplicationStatus status; @@ -144,8 +143,7 @@ public DeployedApplicationInfoInner withTypeName(String typeName) { } /** - * Get the status of the application deployed on the node. Following are the possible values. - . Possible values include: 'Invalid', 'Downloading', 'Activating', 'Active', 'Upgrading', 'Deactivating'. + * Get the status of the application deployed on the node. Following are the possible values. Possible values include: 'Invalid', 'Downloading', 'Activating', 'Active', 'Upgrading', 'Deactivating'. * * @return the status value */ @@ -154,8 +152,7 @@ public DeployedApplicationStatus status() { } /** - * Set the status of the application deployed on the node. Following are the possible values. - . Possible values include: 'Invalid', 'Downloading', 'Activating', 'Active', 'Upgrading', 'Deactivating'. + * Set the status of the application deployed on the node. Following are the possible values. Possible values include: 'Invalid', 'Downloading', 'Activating', 'Active', 'Upgrading', 'Deactivating'. * * @param status the status value to set * @return the DeployedApplicationInfoInner object itself. diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/DeployedCodePackageInfoInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/DeployedCodePackageInfoInner.java index d97341e661c9d..68cf533982ef9 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/DeployedCodePackageInfoInner.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/DeployedCodePackageInfoInner.java @@ -66,9 +66,8 @@ public class DeployedCodePackageInfoInner { /** * Specifies the status of a deployed application or service package on a - * Service Fabric node. - * . Possible values include: 'Invalid', 'Downloading', 'Activating', - * 'Active', 'Upgrading', 'Deactivating'. + * Service Fabric node. Possible values include: 'Invalid', 'Downloading', + * 'Activating', 'Active', 'Upgrading', 'Deactivating'. */ @JsonProperty(value = "Status") private DeploymentStatus status; @@ -219,8 +218,7 @@ public DeployedCodePackageInfoInner withHostIsolationMode(HostIsolationMode host } /** - * Get specifies the status of a deployed application or service package on a Service Fabric node. - . Possible values include: 'Invalid', 'Downloading', 'Activating', 'Active', 'Upgrading', 'Deactivating'. + * Get specifies the status of a deployed application or service package on a Service Fabric node. Possible values include: 'Invalid', 'Downloading', 'Activating', 'Active', 'Upgrading', 'Deactivating'. * * @return the status value */ @@ -229,8 +227,7 @@ public DeploymentStatus status() { } /** - * Set specifies the status of a deployed application or service package on a Service Fabric node. - . Possible values include: 'Invalid', 'Downloading', 'Activating', 'Active', 'Upgrading', 'Deactivating'. + * Set specifies the status of a deployed application or service package on a Service Fabric node. Possible values include: 'Invalid', 'Downloading', 'Activating', 'Active', 'Upgrading', 'Deactivating'. * * @param status the status value to set * @return the DeployedCodePackageInfoInner object itself. diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/DeployedServicePackageInfoInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/DeployedServicePackageInfoInner.java index dc598f4d4b975..6903dd728fec1 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/DeployedServicePackageInfoInner.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/DeployedServicePackageInfoInner.java @@ -29,9 +29,8 @@ public class DeployedServicePackageInfoInner { /** * Specifies the status of a deployed application or service package on a - * Service Fabric node. - * . Possible values include: 'Invalid', 'Downloading', 'Activating', - * 'Active', 'Upgrading', 'Deactivating'. + * Service Fabric node. Possible values include: 'Invalid', 'Downloading', + * 'Activating', 'Active', 'Upgrading', 'Deactivating'. */ @JsonProperty(value = "Status") private DeploymentStatus status; @@ -88,8 +87,7 @@ public DeployedServicePackageInfoInner withVersion(String version) { } /** - * Get specifies the status of a deployed application or service package on a Service Fabric node. - . Possible values include: 'Invalid', 'Downloading', 'Activating', 'Active', 'Upgrading', 'Deactivating'. + * Get specifies the status of a deployed application or service package on a Service Fabric node. Possible values include: 'Invalid', 'Downloading', 'Activating', 'Active', 'Upgrading', 'Deactivating'. * * @return the status value */ @@ -98,8 +96,7 @@ public DeploymentStatus status() { } /** - * Set specifies the status of a deployed application or service package on a Service Fabric node. - . Possible values include: 'Invalid', 'Downloading', 'Activating', 'Active', 'Upgrading', 'Deactivating'. + * Set specifies the status of a deployed application or service package on a Service Fabric node. Possible values include: 'Invalid', 'Downloading', 'Activating', 'Active', 'Upgrading', 'Deactivating'. * * @param status the status value to set * @return the DeployedServicePackageInfoInner object itself. diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/RestoreProgressInfoInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/RestoreProgressInfoInner.java index decd85afa0547..b04e3d8f1ae3f 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/RestoreProgressInfoInner.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/RestoreProgressInfoInner.java @@ -20,7 +20,7 @@ public class RestoreProgressInfoInner { /** * Represents the current state of the partition restore operation. - * . Possible values include: 'Invalid', 'Accepted', 'RestoreInProgress', + * Possible values include: 'Invalid', 'Accepted', 'RestoreInProgress', * 'Success', 'Failure', 'Timeout'. */ @JsonProperty(value = "RestoreState") @@ -51,8 +51,7 @@ public class RestoreProgressInfoInner { private FabricErrorError failureError; /** - * Get represents the current state of the partition restore operation. - . Possible values include: 'Invalid', 'Accepted', 'RestoreInProgress', 'Success', 'Failure', 'Timeout'. + * Get represents the current state of the partition restore operation. Possible values include: 'Invalid', 'Accepted', 'RestoreInProgress', 'Success', 'Failure', 'Timeout'. * * @return the restoreState value */ @@ -61,8 +60,7 @@ public RestoreState restoreState() { } /** - * Set represents the current state of the partition restore operation. - . Possible values include: 'Invalid', 'Accepted', 'RestoreInProgress', 'Success', 'Failure', 'Timeout'. + * Set represents the current state of the partition restore operation. Possible values include: 'Invalid', 'Accepted', 'RestoreInProgress', 'Success', 'Failure', 'Timeout'. * * @param restoreState the restoreState value to set * @return the RestoreProgressInfoInner object itself. diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceFabricClientAPIsImpl.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceFabricClientAPIsImpl.java index 620754a291d94..abc812dd901f8 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceFabricClientAPIsImpl.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceFabricClientAPIsImpl.java @@ -5866,8 +5866,7 @@ public Observable> call(Response response) { * * @param nodeName The name of the node. * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. - * @param deactivationIntent Describes the intent or reason for deactivating the node. The possible values are following. - . Possible values include: 'Pause', 'Restart', 'RemoveData' + * @param deactivationIntent Describes the intent or reason for deactivating the node. The possible values are following. Possible values include: 'Pause', 'Restart', 'RemoveData' * @throws IllegalArgumentException thrown if parameters fail the validation * @throws FabricErrorException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent @@ -5882,8 +5881,7 @@ public void disableNode(String nodeName, Long timeout, DeactivationIntent deacti * * @param nodeName The name of the node. * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. - * @param deactivationIntent Describes the intent or reason for deactivating the node. The possible values are following. - . Possible values include: 'Pause', 'Restart', 'RemoveData' + * @param deactivationIntent Describes the intent or reason for deactivating the node. The possible values are following. Possible values include: 'Pause', 'Restart', 'RemoveData' * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object @@ -5898,8 +5896,7 @@ public ServiceFuture disableNodeAsync(String nodeName, Long timeout, Deact * * @param nodeName The name of the node. * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. - * @param deactivationIntent Describes the intent or reason for deactivating the node. The possible values are following. - . Possible values include: 'Pause', 'Restart', 'RemoveData' + * @param deactivationIntent Describes the intent or reason for deactivating the node. The possible values are following. Possible values include: 'Pause', 'Restart', 'RemoveData' * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */ @@ -5918,8 +5915,7 @@ public Void call(ServiceResponse response) { * * @param nodeName The name of the node. * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. - * @param deactivationIntent Describes the intent or reason for deactivating the node. The possible values are following. - . Possible values include: 'Pause', 'Restart', 'RemoveData' + * @param deactivationIntent Describes the intent or reason for deactivating the node. The possible values are following. Possible values include: 'Pause', 'Restart', 'RemoveData' * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */ diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceResourceDescriptionInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceResourceDescriptionInner.java index 868950dcccfa1..69e009423ea0e 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceResourceDescriptionInner.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceResourceDescriptionInner.java @@ -24,8 +24,8 @@ @JsonFlatten public class ServiceResourceDescriptionInner { /** - * The Operating system type required by the code in service. - * . Possible values include: 'Linux', 'Windows'. + * The Operating system type required by the code in service. Possible + * values include: 'Linux', 'Windows'. */ @JsonProperty(value = "properties.osType", required = true) private OperatingSystemTypes osType; @@ -86,8 +86,7 @@ public class ServiceResourceDescriptionInner { private String name; /** - * Get the Operating system type required by the code in service. - . Possible values include: 'Linux', 'Windows'. + * Get the Operating system type required by the code in service. Possible values include: 'Linux', 'Windows'. * * @return the osType value */ @@ -96,8 +95,7 @@ public OperatingSystemTypes osType() { } /** - * Set the Operating system type required by the code in service. - . Possible values include: 'Linux', 'Windows'. + * Set the Operating system type required by the code in service. Possible values include: 'Linux', 'Windows'. * * @param osType the osType value to set * @return the ServiceResourceDescriptionInner object itself. From 2f7db904d6ae042e26474279af5d22810b10c0f9 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Sat, 24 Nov 2018 10:43:25 -0800 Subject: [PATCH 3/7] Generated from cebed9a01f5c0a1a57c6a8b4108d08e6ce853dd7 (#2632) typo: servicefabric/data-plane/Microsoft.ServiceFabric/stable/6.2/servicefabric - specificed -> specified - sucessful -> successful - resturns -> returns - commited -> committed - Double word "maximum" - Double word "with" --- ...tPreferPrimaryDomainPolicyDescription.java | 2 +- .../ServiceTypeHealthPolicy.java | 8 +++---- .../ServiceFabricClientAPIsImpl.java | 24 +++++++++---------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicePlacementPreferPrimaryDomainPolicyDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicePlacementPreferPrimaryDomainPolicyDescription.java index 013c41b30d4c2..2619ee30dd962 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicePlacementPreferPrimaryDomainPolicyDescription.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServicePlacementPreferPrimaryDomainPolicyDescription.java @@ -19,7 +19,7 @@ * * This placement policy is usually used with fault domains in scenarios where * the Service Fabric cluster is geographically distributed in order to - * indicate that a service�s primary replica should be located in a particular + * indicate that a service's primary replica should be located in a particular * fault domain, which in geo-distributed scenarios usually aligns with * regional or datacenter boundaries. Note that since this is an optimization * it is possible that the Primary replica may not end up located in this diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceTypeHealthPolicy.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceTypeHealthPolicy.java index c8c0f1978d254..f7acdc7ed897f 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceTypeHealthPolicy.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceTypeHealthPolicy.java @@ -48,8 +48,8 @@ public class ServiceTypeHealthPolicy { private Integer maxPercentUnhealthyReplicasPerPartition; /** - * The maximum maximum allowed percentage of unhealthy services. Allowed - * values are Byte values from zero to 100. + * 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. @@ -121,7 +121,7 @@ public ServiceTypeHealthPolicy withMaxPercentUnhealthyReplicasPerPartition(Integ } /** - * Get the maximum maximum allowed percentage of unhealthy services. Allowed values are Byte values from zero to 100. + * Get 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. @@ -134,7 +134,7 @@ public Integer maxPercentUnhealthyServices() { } /** - * Set the maximum maximum allowed percentage of unhealthy services. Allowed values are Byte values from zero to 100. + * Set 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. diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceFabricClientAPIsImpl.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceFabricClientAPIsImpl.java index abc812dd901f8..f603de19d55c6 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceFabricClientAPIsImpl.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceFabricClientAPIsImpl.java @@ -7271,7 +7271,7 @@ private ServiceResponse> getServiceTypeInfoListDelega /** * Gets the information about a specific service type that is supported by a provisioned application type in a Service Fabric cluster. - * Gets the information about a specific service type that is supported by a provisioned application type in a Service Fabric cluster. The provided application type must exist. Otherwise, a 404 status is returned. A 204 response is returned if the specificed service type is not found in the cluster. + * 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 applicationTypeName The name of the application type. * @param serviceTypeName Specifies the name of a Service Fabric service type. @@ -7287,7 +7287,7 @@ public ServiceTypeInfoInner getServiceTypeInfoByName(String applicationTypeName, /** * Gets the information about a specific service type that is supported by a provisioned application type in a Service Fabric cluster. - * Gets the information about a specific service type that is supported by a provisioned application type in a Service Fabric cluster. The provided application type must exist. Otherwise, a 404 status is returned. A 204 response is returned if the specificed service type is not found in the cluster. + * 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 applicationTypeName The name of the application type. * @param serviceTypeName Specifies the name of a Service Fabric service type. @@ -7302,7 +7302,7 @@ public ServiceFuture getServiceTypeInfoByNameAsync(String /** * Gets the information about a specific service type that is supported by a provisioned application type in a Service Fabric cluster. - * Gets the information about a specific service type that is supported by a provisioned application type in a Service Fabric cluster. The provided application type must exist. Otherwise, a 404 status is returned. A 204 response is returned if the specificed service type is not found in the cluster. + * 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 applicationTypeName The name of the application type. * @param serviceTypeName Specifies the name of a Service Fabric service type. @@ -7321,7 +7321,7 @@ public ServiceTypeInfoInner call(ServiceResponse response) /** * Gets the information about a specific service type that is supported by a provisioned application type in a Service Fabric cluster. - * Gets the information about a specific service type that is supported by a provisioned application type in a Service Fabric cluster. The provided application type must exist. Otherwise, a 404 status is returned. A 204 response is returned if the specificed service type is not found in the cluster. + * 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 applicationTypeName The name of the application type. * @param serviceTypeName Specifies the name of a Service Fabric service type. @@ -7357,7 +7357,7 @@ public Observable> call(Response getServiceTypeInfoByNameAsync(String /** * Gets the information about a specific service type that is supported by a provisioned application type in a Service Fabric cluster. - * Gets the information about a specific service type that is supported by a provisioned application type in a Service Fabric cluster. The provided application type must exist. Otherwise, a 404 status is returned. A 204 response is returned if the specificed service type is not found in the cluster. + * 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 applicationTypeName The name of the application type. * @param serviceTypeName Specifies the name of a Service Fabric service type. @@ -7410,7 +7410,7 @@ public ServiceTypeInfoInner call(ServiceResponse response) /** * Gets the information about a specific service type that is supported by a provisioned application type in a Service Fabric cluster. - * Gets the information about a specific service type that is supported by a provisioned application type in a Service Fabric cluster. The provided application type must exist. Otherwise, a 404 status is returned. A 204 response is returned if the specificed service type is not found in the cluster. + * 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 applicationTypeName The name of the application type. * @param serviceTypeName Specifies the name of a Service Fabric service type. @@ -36770,7 +36770,7 @@ private ServiceResponse getServiceDelegate(Resp } /** - * Gets replicas of a given service in an applciation resource. + * 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 applicationResourceName Service Fabric application resource name. @@ -36785,7 +36785,7 @@ public PagedServiceResourceReplicaDescriptionListInner getReplicas(String applic } /** - * Gets replicas of a given service in an applciation resource. + * 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 applicationResourceName Service Fabric application resource name. @@ -36799,7 +36799,7 @@ public ServiceFuture getReplica } /** - * Gets replicas of a given service in an applciation resource. + * 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 applicationResourceName Service Fabric application resource name. @@ -36817,7 +36817,7 @@ public PagedServiceResourceReplicaDescriptionListInner call(ServiceResponse Date: Tue, 4 Dec 2018 23:01:57 -0800 Subject: [PATCH 4/7] [AutoPR servicefabric/data-plane] Swagger specification for Service Fabric runtime version 6.4 (#2657) * Generated from 6415c5920fc51ac978815e71c12089643a219c49 Swagger specification for Service Fabric runtime version 6.4 * Generated from c69b3d22ae7f74ae4932d3fdce146ff567441664 fix typos specificed -> specified, sucessful -> successful, resturns -> returns, commited -> committed, Double word "maximum", Double word "with" * Generated from 494e01db96f17beb1d349ab74358274971b26d08 remove invalid character --- .../AddRemoveReplicaScalingMechanism.java | 103 + ...plicationContainerInstanceExitedEvent.java | 335 ++++ .../ApplicationNewHealthReportEvent.java | 257 +++ .../ApplicationProcessExitedEvent.java | 335 ++++ .../ApplicationScopedVolume.java | 43 + ...icationScopedVolumeCreationParameters.java | 51 + ...tionParametersServiceFabricVolumeDisk.java | 48 + .../ApplicationScopedVolumeKind.java | 38 + .../ApplicationUpgradeCompletedEvent.java | 100 + ...pplicationUpgradeDomainCompletedEvent.java | 178 ++ ...licationUpgradeRollbackCompletedEvent.java | 126 ++ ...pplicationUpgradeRollbackStartedEvent.java | 152 ++ .../ApplicationUpgradeStartedEvent.java | 178 ++ .../servicefabric/AutoScalingMechanism.java | 25 + .../AutoScalingMechanismKind.java | 38 + .../servicefabric/AutoScalingMetric.java | 25 + .../servicefabric/AutoScalingMetricKind.java | 38 + .../servicefabric/AutoScalingPolicy.java | 96 + .../AutoScalingResourceMetric.java | 47 + .../AutoScalingResourceMetricName.java | 41 + .../servicefabric/AutoScalingTrigger.java | 24 + .../servicefabric/AutoScalingTriggerKind.java | 38 + .../AverageLoadScalingTrigger.java | 127 ++ ...rnalMonitoringPipelineSinkDescription.java | 152 ++ .../azure/servicefabric/BackupInfo.java | 32 +- .../BasicRetentionPolicyDescription.java | 79 + ...ChaosCodePackageRestartScheduledEvent.java | 179 ++ .../ChaosNodeRestartScheduledEvent.java | 101 + ...aosPartitionPrimaryMoveScheduledEvent.java | 153 ++ ...sPartitionSecondaryMoveScheduledEvent.java | 179 ++ .../ChaosReplicaRemovalScheduledEvent.java | 101 + .../ChaosReplicaRestartScheduledEvent.java | 101 + ...lusterConfigurationUpgradeDescription.java | 22 +- .../ClusterNewHealthReportEvent.java | 231 +++ .../ClusterUpgradeCompletedEvent.java | 74 + .../ClusterUpgradeDomainCompletedEvent.java | 126 ++ .../ClusterUpgradeRollbackCompletedEvent.java | 100 + .../ClusterUpgradeRollbackStartedEvent.java | 100 + .../ClusterUpgradeStartedEvent.java | 152 ++ .../ContainerCodePackageProperties.java | 88 +- ...ployedApplicationNewHealthReportEvent.java | 283 +++ ...ervicePackageHealthReportExpiredEvent.java | 335 ++++ ...yedServicePackageNewHealthReportEvent.java | 335 ++++ .../DiagnosticsSinkProperties.java | 4 + .../DisableBackupDescription.java | 46 + .../azure/servicefabric/EndpointRef.java | 43 + .../azure/servicefabric/FabricErrorCodes.java | 3 + .../azure/servicefabric/FabricErrorError.java | 9 +- .../azure/servicefabric/FabricEventKind.java | 158 +- .../servicefabric/GatewayDestination.java | 95 + .../azure/servicefabric/HeaderMatchType.java | 38 + .../servicefabric/HealthInformation.java | 6 +- .../azure/servicefabric/HttpConfig.java | 97 + .../azure/servicefabric/HttpHostConfig.java | 72 + .../azure/servicefabric/HttpRouteConfig.java | 95 + .../servicefabric/HttpRouteMatchHeader.java | 95 + .../servicefabric/HttpRouteMatchPath.java | 103 + .../servicefabric/HttpRouteMatchRule.java | 70 + .../ImageRegistryCredential.java | 8 +- .../InlinedValueSecretResourceProperties.java | 24 + .../azure/servicefabric/LoadMetricReport.java | 33 +- .../servicefabric/LoadMetricReportInfo.java | 33 +- .../LocalNetworkResourceProperties.java | 48 + .../azure/servicefabric/NetworkKind.java | 38 + .../azure/servicefabric/NetworkRef.java | 27 + .../NetworkResourceProperties.java | 82 + .../NetworkResourcePropertiesBase.java | 25 + .../NodeAddedToClusterEvent.java | 178 ++ .../azure/servicefabric/NodeClosedEvent.java | 100 + .../NodeDeactivateCompletedEvent.java | 127 ++ .../NodeDeactivateStartedEvent.java | 100 + .../NodeNewHealthReportEvent.java | 257 +++ .../servicefabric/NodeOpenSucceededEvent.java | 230 +++ .../NodeRemovedFromClusterEvent.java | 178 ++ .../servicefabric/OperatingSystemType.java | 41 + .../servicefabric/PartitionBackupEntity.java | 10 +- .../PartitionNewHealthReportEvent.java | 231 +++ .../PartitionReconfiguredEvent.java | 360 ++++ .../servicefabric/ReliableCollectionsRef.java | 73 + .../azure/servicefabric/ResourceStatus.java | 53 + .../RetentionPolicyDescription.java | 24 + .../servicefabric/RetentionPolicyType.java | 41 + .../azure/servicefabric/SecretKind.java | 38 + .../SecretResourceProperties.java | 110 ++ .../SecretResourcePropertiesBase.java | 24 + .../servicefabric/SecretValueProperties.java | 43 + .../ServiceNewHealthReportEvent.java | 257 +++ .../servicefabric/ServiceProperties.java | 161 ++ .../ServiceReplicaProperties.java | 14 +- .../azure/servicefabric/Setting.java | 4 +- .../azure/servicefabric/SizeTypes.java | 44 + .../StatefulReplicaNewHealthReportEvent.java | 257 +++ .../StatefulServicePartitionInfo.java | 16 +- .../StatelessReplicaNewHealthReportEvent.java | 231 +++ .../azure/servicefabric/TcpConfig.java | 96 + .../azure/servicefabric/VolumeProvider.java | 38 + .../azure/servicefabric/VolumeReference.java | 96 + .../implementation/ApplicationEventInner.java | 25 +- .../ApplicationResourceDescriptionInner.java | 184 +- .../BackupPolicyDescriptionInner.java | 27 + .../BackupProgressInfoInner.java | 8 +- .../implementation/ClusterEventInner.java | 12 +- .../implementation/ClusterVersionInner.java | 43 + .../implementation/FabricEventInner.java | 26 + .../GatewayResourceDescriptionInner.java | 227 +++ .../implementation/MeshApplicationsInner.java | 392 ++++ .../implementation/MeshCodePackagesInner.java | 256 +++ .../implementation/MeshGatewaysInner.java | 392 ++++ .../implementation/MeshNetworksInner.java | 392 ++++ .../implementation/MeshSecretValuesInner.java | 511 +++++ .../implementation/MeshSecretsInner.java | 392 ++++ .../MeshServiceReplicasInner.java | 241 +++ .../implementation/MeshServicesInner.java | 227 +++ .../implementation/MeshVolumesInner.java | 392 ++++ .../NetworkResourceDescriptionInner.java | 70 + .../implementation/NodeEventInner.java | 20 +- ...plicationResourceDescriptionListInner.java | 77 + ...edGatewayResourceDescriptionListInner.java | 77 + ...edNetworkResourceDescriptionListInner.java | 77 + ...gedSecretResourceDescriptionListInner.java | 77 + ...cretValueResourceDescriptionListInner.java | 78 + ...gedServiceReplicaDescriptionListInner.java | 78 + ...edServiceResourceDescriptionListInner.java | 13 +- ...gedVolumeResourceDescriptionListInner.java | 77 + ...PartitionBackupConfigurationInfoInner.java | 10 +- .../implementation/PartitionEventInner.java | 8 +- .../implementation/ReplicaEventInner.java | 9 +- .../RestoreProgressInfoInner.java | 8 +- .../SecretResourceDescriptionInner.java | 70 + .../implementation/SecretValueInner.java | 43 + .../SecretValueResourceDescriptionInner.java | 72 + .../implementation/ServiceEventInner.java | 2 +- .../ServiceFabricClientAPIsImpl.java | 1700 +++++++---------- .../ServiceReplicaDescriptionInner.java | 44 + .../ServiceResourceDescriptionInner.java | 129 +- .../VolumeResourceDescriptionInner.java | 88 +- 136 files changed, 15201 insertions(+), 1423 deletions(-) create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AddRemoveReplicaScalingMechanism.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationContainerInstanceExitedEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationNewHealthReportEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationProcessExitedEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationScopedVolume.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationScopedVolumeCreationParameters.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationScopedVolumeKind.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeCompletedEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeDomainCompletedEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeRollbackCompletedEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeRollbackStartedEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeStartedEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AutoScalingMechanism.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AutoScalingMechanismKind.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AutoScalingMetric.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AutoScalingMetricKind.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AutoScalingPolicy.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AutoScalingResourceMetric.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AutoScalingResourceMetricName.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AutoScalingTrigger.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AutoScalingTriggerKind.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AverageLoadScalingTrigger.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AzureInternalMonitoringPipelineSinkDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BasicRetentionPolicyDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosCodePackageRestartScheduledEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosNodeRestartScheduledEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosPartitionPrimaryMoveScheduledEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosPartitionSecondaryMoveScheduledEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosReplicaRemovalScheduledEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosReplicaRestartScheduledEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterNewHealthReportEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeCompletedEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeDomainCompletedEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeRollbackCompletedEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeRollbackStartedEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeStartedEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedApplicationNewHealthReportEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedServicePackageHealthReportExpiredEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedServicePackageNewHealthReportEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DisableBackupDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EndpointRef.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/GatewayDestination.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HeaderMatchType.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HttpConfig.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HttpHostConfig.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HttpRouteConfig.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HttpRouteMatchHeader.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HttpRouteMatchPath.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HttpRouteMatchRule.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/InlinedValueSecretResourceProperties.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/LocalNetworkResourceProperties.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NetworkKind.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NetworkResourceProperties.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NetworkResourcePropertiesBase.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeAddedToClusterEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeClosedEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeDeactivateCompletedEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeDeactivateStartedEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeNewHealthReportEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeOpenSucceededEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeRemovedFromClusterEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/OperatingSystemType.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionNewHealthReportEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionReconfiguredEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReliableCollectionsRef.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ResourceStatus.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RetentionPolicyDescription.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RetentionPolicyType.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SecretKind.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SecretResourceProperties.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SecretResourcePropertiesBase.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SecretValueProperties.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceNewHealthReportEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceProperties.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SizeTypes.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulReplicaNewHealthReportEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatelessReplicaNewHealthReportEvent.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/TcpConfig.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/VolumeProvider.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/VolumeReference.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ClusterVersionInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/GatewayResourceDescriptionInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/MeshApplicationsInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/MeshCodePackagesInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/MeshGatewaysInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/MeshNetworksInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/MeshSecretValuesInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/MeshSecretsInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/MeshServiceReplicasInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/MeshServicesInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/MeshVolumesInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/NetworkResourceDescriptionInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedApplicationResourceDescriptionListInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedGatewayResourceDescriptionListInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedNetworkResourceDescriptionListInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedSecretResourceDescriptionListInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedSecretValueResourceDescriptionListInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedServiceReplicaDescriptionListInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedVolumeResourceDescriptionListInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/SecretResourceDescriptionInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/SecretValueInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/SecretValueResourceDescriptionInner.java create mode 100644 azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceReplicaDescriptionInner.java diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AddRemoveReplicaScalingMechanism.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AddRemoveReplicaScalingMechanism.java new file mode 100644 index 0000000000000..29029f063b811 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AddRemoveReplicaScalingMechanism.java @@ -0,0 +1,103 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the horizontal auto scaling mechanism that adds or removes + * replicas (containers or container groups). + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("AddRemoveReplica") +public class AddRemoveReplicaScalingMechanism extends AutoScalingMechanism { + /** + * Minimum number of containers (scale down won't be performed below this + * number). + */ + @JsonProperty(value = "minCount", required = true) + private int minCount; + + /** + * Maximum number of containers (scale up won't be performed above this + * number). + */ + @JsonProperty(value = "maxCount", required = true) + private int maxCount; + + /** + * Each time auto scaling is performed, this number of containers will be + * added or removed. + */ + @JsonProperty(value = "scaleIncrement", required = true) + private int scaleIncrement; + + /** + * Get minimum number of containers (scale down won't be performed below this number). + * + * @return the minCount value + */ + public int minCount() { + return this.minCount; + } + + /** + * Set minimum number of containers (scale down won't be performed below this number). + * + * @param minCount the minCount value to set + * @return the AddRemoveReplicaScalingMechanism object itself. + */ + public AddRemoveReplicaScalingMechanism withMinCount(int minCount) { + this.minCount = minCount; + return this; + } + + /** + * Get maximum number of containers (scale up won't be performed above this number). + * + * @return the maxCount value + */ + public int maxCount() { + return this.maxCount; + } + + /** + * Set maximum number of containers (scale up won't be performed above this number). + * + * @param maxCount the maxCount value to set + * @return the AddRemoveReplicaScalingMechanism object itself. + */ + public AddRemoveReplicaScalingMechanism withMaxCount(int maxCount) { + this.maxCount = maxCount; + return this; + } + + /** + * Get each time auto scaling is performed, this number of containers will be added or removed. + * + * @return the scaleIncrement value + */ + public int scaleIncrement() { + return this.scaleIncrement; + } + + /** + * Set each time auto scaling is performed, this number of containers will be added or removed. + * + * @param scaleIncrement the scaleIncrement value to set + * @return the AddRemoveReplicaScalingMechanism object itself. + */ + public AddRemoveReplicaScalingMechanism withScaleIncrement(int scaleIncrement) { + this.scaleIncrement = scaleIncrement; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationContainerInstanceExitedEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationContainerInstanceExitedEvent.java new file mode 100644 index 0000000000000..4b3b3f93ee83b --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationContainerInstanceExitedEvent.java @@ -0,0 +1,335 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ApplicationEventInner; + +/** + * Container Exited event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ApplicationContainerInstanceExited") +public class ApplicationContainerInstanceExitedEvent extends ApplicationEventInner { + /** + * Name of Service. + */ + @JsonProperty(value = "ServiceName", required = true) + private String serviceName; + + /** + * Name of Service package. + */ + @JsonProperty(value = "ServicePackageName", required = true) + private String servicePackageName; + + /** + * Activation Id of Service package. + */ + @JsonProperty(value = "ServicePackageActivationId", required = true) + private String servicePackageActivationId; + + /** + * Indicates IsExclusive flag. + */ + @JsonProperty(value = "IsExclusive", required = true) + private boolean isExclusive; + + /** + * Name of Code package. + */ + @JsonProperty(value = "CodePackageName", required = true) + private String codePackageName; + + /** + * Type of EntryPoint. + */ + @JsonProperty(value = "EntryPointType", required = true) + private String entryPointType; + + /** + * Name of Container image. + */ + @JsonProperty(value = "ImageName", required = true) + private String imageName; + + /** + * Name of Container. + */ + @JsonProperty(value = "ContainerName", required = true) + private String containerName; + + /** + * Host Id. + */ + @JsonProperty(value = "HostId", required = true) + private String hostId; + + /** + * Exit code of process. + */ + @JsonProperty(value = "ExitCode", required = true) + private long exitCode; + + /** + * Indicates if termination is unexpected. + */ + @JsonProperty(value = "UnexpectedTermination", required = true) + private boolean unexpectedTermination; + + /** + * Start time of process. + */ + @JsonProperty(value = "StartTime", required = true) + private DateTime startTime; + + /** + * Get name of Service. + * + * @return the serviceName value + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set name of Service. + * + * @param serviceName the serviceName value to set + * @return the ApplicationContainerInstanceExitedEvent object itself. + */ + public ApplicationContainerInstanceExitedEvent withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Get name of Service package. + * + * @return the servicePackageName value + */ + public String servicePackageName() { + return this.servicePackageName; + } + + /** + * Set name of Service package. + * + * @param servicePackageName the servicePackageName value to set + * @return the ApplicationContainerInstanceExitedEvent object itself. + */ + public ApplicationContainerInstanceExitedEvent withServicePackageName(String servicePackageName) { + this.servicePackageName = servicePackageName; + return this; + } + + /** + * Get activation Id of Service package. + * + * @return the servicePackageActivationId value + */ + public String servicePackageActivationId() { + return this.servicePackageActivationId; + } + + /** + * Set activation Id of Service package. + * + * @param servicePackageActivationId the servicePackageActivationId value to set + * @return the ApplicationContainerInstanceExitedEvent object itself. + */ + public ApplicationContainerInstanceExitedEvent withServicePackageActivationId(String servicePackageActivationId) { + this.servicePackageActivationId = servicePackageActivationId; + return this; + } + + /** + * Get indicates IsExclusive flag. + * + * @return the isExclusive value + */ + public boolean isExclusive() { + return this.isExclusive; + } + + /** + * Set indicates IsExclusive flag. + * + * @param isExclusive the isExclusive value to set + * @return the ApplicationContainerInstanceExitedEvent object itself. + */ + public ApplicationContainerInstanceExitedEvent withIsExclusive(boolean isExclusive) { + this.isExclusive = isExclusive; + return this; + } + + /** + * Get name of Code package. + * + * @return the codePackageName value + */ + public String codePackageName() { + return this.codePackageName; + } + + /** + * Set name of Code package. + * + * @param codePackageName the codePackageName value to set + * @return the ApplicationContainerInstanceExitedEvent object itself. + */ + public ApplicationContainerInstanceExitedEvent withCodePackageName(String codePackageName) { + this.codePackageName = codePackageName; + return this; + } + + /** + * Get type of EntryPoint. + * + * @return the entryPointType value + */ + public String entryPointType() { + return this.entryPointType; + } + + /** + * Set type of EntryPoint. + * + * @param entryPointType the entryPointType value to set + * @return the ApplicationContainerInstanceExitedEvent object itself. + */ + public ApplicationContainerInstanceExitedEvent withEntryPointType(String entryPointType) { + this.entryPointType = entryPointType; + return this; + } + + /** + * Get name of Container image. + * + * @return the imageName value + */ + public String imageName() { + return this.imageName; + } + + /** + * Set name of Container image. + * + * @param imageName the imageName value to set + * @return the ApplicationContainerInstanceExitedEvent object itself. + */ + public ApplicationContainerInstanceExitedEvent withImageName(String imageName) { + this.imageName = imageName; + return this; + } + + /** + * Get name of Container. + * + * @return the containerName value + */ + public String containerName() { + return this.containerName; + } + + /** + * Set name of Container. + * + * @param containerName the containerName value to set + * @return the ApplicationContainerInstanceExitedEvent object itself. + */ + public ApplicationContainerInstanceExitedEvent withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + + /** + * Get host Id. + * + * @return the hostId value + */ + public String hostId() { + return this.hostId; + } + + /** + * Set host Id. + * + * @param hostId the hostId value to set + * @return the ApplicationContainerInstanceExitedEvent object itself. + */ + public ApplicationContainerInstanceExitedEvent withHostId(String hostId) { + this.hostId = hostId; + return this; + } + + /** + * Get exit code of process. + * + * @return the exitCode value + */ + public long exitCode() { + return this.exitCode; + } + + /** + * Set exit code of process. + * + * @param exitCode the exitCode value to set + * @return the ApplicationContainerInstanceExitedEvent object itself. + */ + public ApplicationContainerInstanceExitedEvent withExitCode(long exitCode) { + this.exitCode = exitCode; + return this; + } + + /** + * Get indicates if termination is unexpected. + * + * @return the unexpectedTermination value + */ + public boolean unexpectedTermination() { + return this.unexpectedTermination; + } + + /** + * Set indicates if termination is unexpected. + * + * @param unexpectedTermination the unexpectedTermination value to set + * @return the ApplicationContainerInstanceExitedEvent object itself. + */ + public ApplicationContainerInstanceExitedEvent withUnexpectedTermination(boolean unexpectedTermination) { + this.unexpectedTermination = unexpectedTermination; + return this; + } + + /** + * Get start time of process. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set start time of process. + * + * @param startTime the startTime value to set + * @return the ApplicationContainerInstanceExitedEvent object itself. + */ + public ApplicationContainerInstanceExitedEvent withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationNewHealthReportEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationNewHealthReportEvent.java new file mode 100644 index 0000000000000..0e8ff30dbc5c5 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationNewHealthReportEvent.java @@ -0,0 +1,257 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ApplicationEventInner; + +/** + * Application Health Report Created event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ApplicationNewHealthReport") +public class ApplicationNewHealthReportEvent extends ApplicationEventInner { + /** + * Id of Application instance. + */ + @JsonProperty(value = "ApplicationInstanceId", required = true) + private long applicationInstanceId; + + /** + * Id of report source. + */ + @JsonProperty(value = "SourceId", required = true) + private String sourceId; + + /** + * Describes the property. + */ + @JsonProperty(value = "Property", required = true) + private String property; + + /** + * Describes the property health state. + */ + @JsonProperty(value = "HealthState", required = true) + private String healthState; + + /** + * Time to live in milli-seconds. + */ + @JsonProperty(value = "TimeToLiveMs", required = true) + private long timeToLiveMs; + + /** + * Sequence number of report. + */ + @JsonProperty(value = "SequenceNumber", required = true) + private long sequenceNumber; + + /** + * Description of report. + */ + @JsonProperty(value = "Description", required = true) + private String description; + + /** + * Indicates the removal when it expires. + */ + @JsonProperty(value = "RemoveWhenExpired", required = true) + private boolean removeWhenExpired; + + /** + * Source time. + */ + @JsonProperty(value = "SourceUtcTimestamp", required = true) + private DateTime sourceUtcTimestamp; + + /** + * Get id of Application instance. + * + * @return the applicationInstanceId value + */ + public long applicationInstanceId() { + return this.applicationInstanceId; + } + + /** + * Set id of Application instance. + * + * @param applicationInstanceId the applicationInstanceId value to set + * @return the ApplicationNewHealthReportEvent object itself. + */ + public ApplicationNewHealthReportEvent withApplicationInstanceId(long applicationInstanceId) { + this.applicationInstanceId = applicationInstanceId; + return this; + } + + /** + * Get id of report source. + * + * @return the sourceId value + */ + public String sourceId() { + return this.sourceId; + } + + /** + * Set id of report source. + * + * @param sourceId the sourceId value to set + * @return the ApplicationNewHealthReportEvent object itself. + */ + public ApplicationNewHealthReportEvent withSourceId(String sourceId) { + this.sourceId = sourceId; + return this; + } + + /** + * Get describes the property. + * + * @return the property value + */ + public String property() { + return this.property; + } + + /** + * Set describes the property. + * + * @param property the property value to set + * @return the ApplicationNewHealthReportEvent object itself. + */ + public ApplicationNewHealthReportEvent withProperty(String property) { + this.property = property; + return this; + } + + /** + * Get describes the property health state. + * + * @return the healthState value + */ + public String healthState() { + return this.healthState; + } + + /** + * Set describes the property health state. + * + * @param healthState the healthState value to set + * @return the ApplicationNewHealthReportEvent object itself. + */ + public ApplicationNewHealthReportEvent withHealthState(String healthState) { + this.healthState = healthState; + return this; + } + + /** + * Get time to live in milli-seconds. + * + * @return the timeToLiveMs value + */ + public long timeToLiveMs() { + return this.timeToLiveMs; + } + + /** + * Set time to live in milli-seconds. + * + * @param timeToLiveMs the timeToLiveMs value to set + * @return the ApplicationNewHealthReportEvent object itself. + */ + public ApplicationNewHealthReportEvent withTimeToLiveMs(long timeToLiveMs) { + this.timeToLiveMs = timeToLiveMs; + return this; + } + + /** + * Get sequence number of report. + * + * @return the sequenceNumber value + */ + public long sequenceNumber() { + return this.sequenceNumber; + } + + /** + * Set sequence number of report. + * + * @param sequenceNumber the sequenceNumber value to set + * @return the ApplicationNewHealthReportEvent object itself. + */ + public ApplicationNewHealthReportEvent withSequenceNumber(long sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get description of report. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of report. + * + * @param description the description value to set + * @return the ApplicationNewHealthReportEvent object itself. + */ + public ApplicationNewHealthReportEvent withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get indicates the removal when it expires. + * + * @return the removeWhenExpired value + */ + public boolean removeWhenExpired() { + return this.removeWhenExpired; + } + + /** + * Set indicates the removal when it expires. + * + * @param removeWhenExpired the removeWhenExpired value to set + * @return the ApplicationNewHealthReportEvent object itself. + */ + public ApplicationNewHealthReportEvent withRemoveWhenExpired(boolean removeWhenExpired) { + this.removeWhenExpired = removeWhenExpired; + return this; + } + + /** + * Get source time. + * + * @return the sourceUtcTimestamp value + */ + public DateTime sourceUtcTimestamp() { + return this.sourceUtcTimestamp; + } + + /** + * Set source time. + * + * @param sourceUtcTimestamp the sourceUtcTimestamp value to set + * @return the ApplicationNewHealthReportEvent object itself. + */ + public ApplicationNewHealthReportEvent withSourceUtcTimestamp(DateTime sourceUtcTimestamp) { + this.sourceUtcTimestamp = sourceUtcTimestamp; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationProcessExitedEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationProcessExitedEvent.java new file mode 100644 index 0000000000000..554245b6d1800 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationProcessExitedEvent.java @@ -0,0 +1,335 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ApplicationEventInner; + +/** + * Process Exited event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ApplicationProcessExited") +public class ApplicationProcessExitedEvent extends ApplicationEventInner { + /** + * Name of Service. + */ + @JsonProperty(value = "ServiceName", required = true) + private String serviceName; + + /** + * Name of Service package. + */ + @JsonProperty(value = "ServicePackageName", required = true) + private String servicePackageName; + + /** + * Activation Id of Service package. + */ + @JsonProperty(value = "ServicePackageActivationId", required = true) + private String servicePackageActivationId; + + /** + * Indicates IsExclusive flag. + */ + @JsonProperty(value = "IsExclusive", required = true) + private boolean isExclusive; + + /** + * Name of Code package. + */ + @JsonProperty(value = "CodePackageName", required = true) + private String codePackageName; + + /** + * Type of EntryPoint. + */ + @JsonProperty(value = "EntryPointType", required = true) + private String entryPointType; + + /** + * Name of executable. + */ + @JsonProperty(value = "ExeName", required = true) + private String exeName; + + /** + * Process Id. + */ + @JsonProperty(value = "ProcessId", required = true) + private long processId; + + /** + * Host Id. + */ + @JsonProperty(value = "HostId", required = true) + private String hostId; + + /** + * Exit code of process. + */ + @JsonProperty(value = "ExitCode", required = true) + private long exitCode; + + /** + * Indicates if termination is unexpected. + */ + @JsonProperty(value = "UnexpectedTermination", required = true) + private boolean unexpectedTermination; + + /** + * Start time of process. + */ + @JsonProperty(value = "StartTime", required = true) + private DateTime startTime; + + /** + * Get name of Service. + * + * @return the serviceName value + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set name of Service. + * + * @param serviceName the serviceName value to set + * @return the ApplicationProcessExitedEvent object itself. + */ + public ApplicationProcessExitedEvent withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Get name of Service package. + * + * @return the servicePackageName value + */ + public String servicePackageName() { + return this.servicePackageName; + } + + /** + * Set name of Service package. + * + * @param servicePackageName the servicePackageName value to set + * @return the ApplicationProcessExitedEvent object itself. + */ + public ApplicationProcessExitedEvent withServicePackageName(String servicePackageName) { + this.servicePackageName = servicePackageName; + return this; + } + + /** + * Get activation Id of Service package. + * + * @return the servicePackageActivationId value + */ + public String servicePackageActivationId() { + return this.servicePackageActivationId; + } + + /** + * Set activation Id of Service package. + * + * @param servicePackageActivationId the servicePackageActivationId value to set + * @return the ApplicationProcessExitedEvent object itself. + */ + public ApplicationProcessExitedEvent withServicePackageActivationId(String servicePackageActivationId) { + this.servicePackageActivationId = servicePackageActivationId; + return this; + } + + /** + * Get indicates IsExclusive flag. + * + * @return the isExclusive value + */ + public boolean isExclusive() { + return this.isExclusive; + } + + /** + * Set indicates IsExclusive flag. + * + * @param isExclusive the isExclusive value to set + * @return the ApplicationProcessExitedEvent object itself. + */ + public ApplicationProcessExitedEvent withIsExclusive(boolean isExclusive) { + this.isExclusive = isExclusive; + return this; + } + + /** + * Get name of Code package. + * + * @return the codePackageName value + */ + public String codePackageName() { + return this.codePackageName; + } + + /** + * Set name of Code package. + * + * @param codePackageName the codePackageName value to set + * @return the ApplicationProcessExitedEvent object itself. + */ + public ApplicationProcessExitedEvent withCodePackageName(String codePackageName) { + this.codePackageName = codePackageName; + return this; + } + + /** + * Get type of EntryPoint. + * + * @return the entryPointType value + */ + public String entryPointType() { + return this.entryPointType; + } + + /** + * Set type of EntryPoint. + * + * @param entryPointType the entryPointType value to set + * @return the ApplicationProcessExitedEvent object itself. + */ + public ApplicationProcessExitedEvent withEntryPointType(String entryPointType) { + this.entryPointType = entryPointType; + return this; + } + + /** + * Get name of executable. + * + * @return the exeName value + */ + public String exeName() { + return this.exeName; + } + + /** + * Set name of executable. + * + * @param exeName the exeName value to set + * @return the ApplicationProcessExitedEvent object itself. + */ + public ApplicationProcessExitedEvent withExeName(String exeName) { + this.exeName = exeName; + return this; + } + + /** + * Get process Id. + * + * @return the processId value + */ + public long processId() { + return this.processId; + } + + /** + * Set process Id. + * + * @param processId the processId value to set + * @return the ApplicationProcessExitedEvent object itself. + */ + public ApplicationProcessExitedEvent withProcessId(long processId) { + this.processId = processId; + return this; + } + + /** + * Get host Id. + * + * @return the hostId value + */ + public String hostId() { + return this.hostId; + } + + /** + * Set host Id. + * + * @param hostId the hostId value to set + * @return the ApplicationProcessExitedEvent object itself. + */ + public ApplicationProcessExitedEvent withHostId(String hostId) { + this.hostId = hostId; + return this; + } + + /** + * Get exit code of process. + * + * @return the exitCode value + */ + public long exitCode() { + return this.exitCode; + } + + /** + * Set exit code of process. + * + * @param exitCode the exitCode value to set + * @return the ApplicationProcessExitedEvent object itself. + */ + public ApplicationProcessExitedEvent withExitCode(long exitCode) { + this.exitCode = exitCode; + return this; + } + + /** + * Get indicates if termination is unexpected. + * + * @return the unexpectedTermination value + */ + public boolean unexpectedTermination() { + return this.unexpectedTermination; + } + + /** + * Set indicates if termination is unexpected. + * + * @param unexpectedTermination the unexpectedTermination value to set + * @return the ApplicationProcessExitedEvent object itself. + */ + public ApplicationProcessExitedEvent withUnexpectedTermination(boolean unexpectedTermination) { + this.unexpectedTermination = unexpectedTermination; + return this; + } + + /** + * Get start time of process. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set start time of process. + * + * @param startTime the startTime value to set + * @return the ApplicationProcessExitedEvent object itself. + */ + public ApplicationProcessExitedEvent withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationScopedVolume.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationScopedVolume.java new file mode 100644 index 0000000000000..f5c906f810f03 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationScopedVolume.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a volume whose lifetime is scoped to the application's lifetime. + */ +public class ApplicationScopedVolume extends VolumeReference { + /** + * Describes parameters for creating application-scoped volumes. + */ + @JsonProperty(value = "creationParameters", required = true) + private ApplicationScopedVolumeCreationParameters creationParameters; + + /** + * Get describes parameters for creating application-scoped volumes. + * + * @return the creationParameters value + */ + public ApplicationScopedVolumeCreationParameters creationParameters() { + return this.creationParameters; + } + + /** + * Set describes parameters for creating application-scoped volumes. + * + * @param creationParameters the creationParameters value to set + * @return the ApplicationScopedVolume object itself. + */ + public ApplicationScopedVolume withCreationParameters(ApplicationScopedVolumeCreationParameters creationParameters) { + this.creationParameters = creationParameters; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationScopedVolumeCreationParameters.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationScopedVolumeCreationParameters.java new file mode 100644 index 0000000000000..ec9b88efda287 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationScopedVolumeCreationParameters.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Describes parameters for creating application-scoped volumes. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("ApplicationScopedVolumeCreationParameters") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "ServiceFabricVolumeDisk", value = ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk.class) +}) +public class ApplicationScopedVolumeCreationParameters { + /** + * User readable description of the volume. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get user readable description of the volume. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set user readable description of the volume. + * + * @param description the description value to set + * @return the ApplicationScopedVolumeCreationParameters object itself. + */ + public ApplicationScopedVolumeCreationParameters withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk.java new file mode 100644 index 0000000000000..b59f83c6cbc5c --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes parameters for creating application-scoped volumes provided by + * Service Fabric Volume Disks. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("ServiceFabricVolumeDisk") +public class ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk extends ApplicationScopedVolumeCreationParameters { + /** + * Volume size. Possible values include: 'Small', 'Medium', 'Large'. + */ + @JsonProperty(value = "sizeDisk", required = true) + private SizeTypes sizeDisk; + + /** + * Get volume size. Possible values include: 'Small', 'Medium', 'Large'. + * + * @return the sizeDisk value + */ + public SizeTypes sizeDisk() { + return this.sizeDisk; + } + + /** + * Set volume size. Possible values include: 'Small', 'Medium', 'Large'. + * + * @param sizeDisk the sizeDisk value to set + * @return the ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk object itself. + */ + public ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk withSizeDisk(SizeTypes sizeDisk) { + this.sizeDisk = sizeDisk; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationScopedVolumeKind.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationScopedVolumeKind.java new file mode 100644 index 0000000000000..499cf274ecc84 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationScopedVolumeKind.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationScopedVolumeKind. + */ +public final class ApplicationScopedVolumeKind extends ExpandableStringEnum { + /** Static value ServiceFabricVolumeDisk for ApplicationScopedVolumeKind. */ + public static final ApplicationScopedVolumeKind SERVICE_FABRIC_VOLUME_DISK = fromString("ServiceFabricVolumeDisk"); + + /** + * Creates or finds a ApplicationScopedVolumeKind from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationScopedVolumeKind + */ + @JsonCreator + public static ApplicationScopedVolumeKind fromString(String name) { + return fromString(name, ApplicationScopedVolumeKind.class); + } + + /** + * @return known ApplicationScopedVolumeKind values + */ + public static Collection values() { + return values(ApplicationScopedVolumeKind.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeCompletedEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeCompletedEvent.java new file mode 100644 index 0000000000000..317c7def3310e --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeCompletedEvent.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ApplicationEventInner; + +/** + * Application Upgrade Completed event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ApplicationUpgradeCompleted") +public class ApplicationUpgradeCompletedEvent extends ApplicationEventInner { + /** + * Application type name. + */ + @JsonProperty(value = "ApplicationTypeName", required = true) + private String applicationTypeName; + + /** + * Application type version. + */ + @JsonProperty(value = "ApplicationTypeVersion", required = true) + private String applicationTypeVersion; + + /** + * Overall upgrade time in milli-seconds. + */ + @JsonProperty(value = "OverallUpgradeElapsedTimeInMs", required = true) + private double overallUpgradeElapsedTimeInMs; + + /** + * Get application type name. + * + * @return the applicationTypeName value + */ + public String applicationTypeName() { + return this.applicationTypeName; + } + + /** + * Set application type name. + * + * @param applicationTypeName the applicationTypeName value to set + * @return the ApplicationUpgradeCompletedEvent object itself. + */ + public ApplicationUpgradeCompletedEvent withApplicationTypeName(String applicationTypeName) { + this.applicationTypeName = applicationTypeName; + return this; + } + + /** + * Get application type version. + * + * @return the applicationTypeVersion value + */ + public String applicationTypeVersion() { + return this.applicationTypeVersion; + } + + /** + * Set application type version. + * + * @param applicationTypeVersion the applicationTypeVersion value to set + * @return the ApplicationUpgradeCompletedEvent object itself. + */ + public ApplicationUpgradeCompletedEvent withApplicationTypeVersion(String applicationTypeVersion) { + this.applicationTypeVersion = applicationTypeVersion; + return this; + } + + /** + * Get overall upgrade time in milli-seconds. + * + * @return the overallUpgradeElapsedTimeInMs value + */ + public double overallUpgradeElapsedTimeInMs() { + return this.overallUpgradeElapsedTimeInMs; + } + + /** + * Set overall upgrade time in milli-seconds. + * + * @param overallUpgradeElapsedTimeInMs the overallUpgradeElapsedTimeInMs value to set + * @return the ApplicationUpgradeCompletedEvent object itself. + */ + public ApplicationUpgradeCompletedEvent withOverallUpgradeElapsedTimeInMs(double overallUpgradeElapsedTimeInMs) { + this.overallUpgradeElapsedTimeInMs = overallUpgradeElapsedTimeInMs; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeDomainCompletedEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeDomainCompletedEvent.java new file mode 100644 index 0000000000000..8d51605e2f055 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeDomainCompletedEvent.java @@ -0,0 +1,178 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ApplicationEventInner; + +/** + * Application Upgrade Domain Completed event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ApplicationUpgradeDomainCompleted") +public class ApplicationUpgradeDomainCompletedEvent extends ApplicationEventInner { + /** + * Application type name. + */ + @JsonProperty(value = "ApplicationTypeName", required = true) + private String applicationTypeName; + + /** + * Current Application type version. + */ + @JsonProperty(value = "CurrentApplicationTypeVersion", required = true) + private String currentApplicationTypeVersion; + + /** + * Target Application type version. + */ + @JsonProperty(value = "ApplicationTypeVersion", required = true) + private String applicationTypeVersion; + + /** + * State of upgrade. + */ + @JsonProperty(value = "UpgradeState", required = true) + private String upgradeState; + + /** + * Upgrade domains. + */ + @JsonProperty(value = "UpgradeDomains", required = true) + private String upgradeDomains; + + /** + * Upgrade time of domain in milli-seconds. + */ + @JsonProperty(value = "UpgradeDomainElapsedTimeInMs", required = true) + private double upgradeDomainElapsedTimeInMs; + + /** + * Get application type name. + * + * @return the applicationTypeName value + */ + public String applicationTypeName() { + return this.applicationTypeName; + } + + /** + * Set application type name. + * + * @param applicationTypeName the applicationTypeName value to set + * @return the ApplicationUpgradeDomainCompletedEvent object itself. + */ + public ApplicationUpgradeDomainCompletedEvent withApplicationTypeName(String applicationTypeName) { + this.applicationTypeName = applicationTypeName; + return this; + } + + /** + * Get current Application type version. + * + * @return the currentApplicationTypeVersion value + */ + public String currentApplicationTypeVersion() { + return this.currentApplicationTypeVersion; + } + + /** + * Set current Application type version. + * + * @param currentApplicationTypeVersion the currentApplicationTypeVersion value to set + * @return the ApplicationUpgradeDomainCompletedEvent object itself. + */ + public ApplicationUpgradeDomainCompletedEvent withCurrentApplicationTypeVersion(String currentApplicationTypeVersion) { + this.currentApplicationTypeVersion = currentApplicationTypeVersion; + return this; + } + + /** + * Get target Application type version. + * + * @return the applicationTypeVersion value + */ + public String applicationTypeVersion() { + return this.applicationTypeVersion; + } + + /** + * Set target Application type version. + * + * @param applicationTypeVersion the applicationTypeVersion value to set + * @return the ApplicationUpgradeDomainCompletedEvent object itself. + */ + public ApplicationUpgradeDomainCompletedEvent withApplicationTypeVersion(String applicationTypeVersion) { + this.applicationTypeVersion = applicationTypeVersion; + return this; + } + + /** + * Get state of upgrade. + * + * @return the upgradeState value + */ + public String upgradeState() { + return this.upgradeState; + } + + /** + * Set state of upgrade. + * + * @param upgradeState the upgradeState value to set + * @return the ApplicationUpgradeDomainCompletedEvent object itself. + */ + public ApplicationUpgradeDomainCompletedEvent withUpgradeState(String upgradeState) { + this.upgradeState = upgradeState; + return this; + } + + /** + * Get upgrade domains. + * + * @return the upgradeDomains value + */ + public String upgradeDomains() { + return this.upgradeDomains; + } + + /** + * Set upgrade domains. + * + * @param upgradeDomains the upgradeDomains value to set + * @return the ApplicationUpgradeDomainCompletedEvent object itself. + */ + public ApplicationUpgradeDomainCompletedEvent withUpgradeDomains(String upgradeDomains) { + this.upgradeDomains = upgradeDomains; + return this; + } + + /** + * Get upgrade time of domain in milli-seconds. + * + * @return the upgradeDomainElapsedTimeInMs value + */ + public double upgradeDomainElapsedTimeInMs() { + return this.upgradeDomainElapsedTimeInMs; + } + + /** + * Set upgrade time of domain in milli-seconds. + * + * @param upgradeDomainElapsedTimeInMs the upgradeDomainElapsedTimeInMs value to set + * @return the ApplicationUpgradeDomainCompletedEvent object itself. + */ + public ApplicationUpgradeDomainCompletedEvent withUpgradeDomainElapsedTimeInMs(double upgradeDomainElapsedTimeInMs) { + this.upgradeDomainElapsedTimeInMs = upgradeDomainElapsedTimeInMs; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeRollbackCompletedEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeRollbackCompletedEvent.java new file mode 100644 index 0000000000000..6a68c9639f44c --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeRollbackCompletedEvent.java @@ -0,0 +1,126 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ApplicationEventInner; + +/** + * Application Upgrade Rollback Completed event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ApplicationUpgradeRollbackCompleted") +public class ApplicationUpgradeRollbackCompletedEvent extends ApplicationEventInner { + /** + * Application type name. + */ + @JsonProperty(value = "ApplicationTypeName", required = true) + private String applicationTypeName; + + /** + * Application type version. + */ + @JsonProperty(value = "ApplicationTypeVersion", required = true) + private String applicationTypeVersion; + + /** + * Describes reason of failure. + */ + @JsonProperty(value = "FailureReason", required = true) + private String failureReason; + + /** + * Overall upgrade time in milli-seconds. + */ + @JsonProperty(value = "OverallUpgradeElapsedTimeInMs", required = true) + private double overallUpgradeElapsedTimeInMs; + + /** + * Get application type name. + * + * @return the applicationTypeName value + */ + public String applicationTypeName() { + return this.applicationTypeName; + } + + /** + * Set application type name. + * + * @param applicationTypeName the applicationTypeName value to set + * @return the ApplicationUpgradeRollbackCompletedEvent object itself. + */ + public ApplicationUpgradeRollbackCompletedEvent withApplicationTypeName(String applicationTypeName) { + this.applicationTypeName = applicationTypeName; + return this; + } + + /** + * Get application type version. + * + * @return the applicationTypeVersion value + */ + public String applicationTypeVersion() { + return this.applicationTypeVersion; + } + + /** + * Set application type version. + * + * @param applicationTypeVersion the applicationTypeVersion value to set + * @return the ApplicationUpgradeRollbackCompletedEvent object itself. + */ + public ApplicationUpgradeRollbackCompletedEvent withApplicationTypeVersion(String applicationTypeVersion) { + this.applicationTypeVersion = applicationTypeVersion; + return this; + } + + /** + * Get describes reason of failure. + * + * @return the failureReason value + */ + public String failureReason() { + return this.failureReason; + } + + /** + * Set describes reason of failure. + * + * @param failureReason the failureReason value to set + * @return the ApplicationUpgradeRollbackCompletedEvent object itself. + */ + public ApplicationUpgradeRollbackCompletedEvent withFailureReason(String failureReason) { + this.failureReason = failureReason; + return this; + } + + /** + * Get overall upgrade time in milli-seconds. + * + * @return the overallUpgradeElapsedTimeInMs value + */ + public double overallUpgradeElapsedTimeInMs() { + return this.overallUpgradeElapsedTimeInMs; + } + + /** + * Set overall upgrade time in milli-seconds. + * + * @param overallUpgradeElapsedTimeInMs the overallUpgradeElapsedTimeInMs value to set + * @return the ApplicationUpgradeRollbackCompletedEvent object itself. + */ + public ApplicationUpgradeRollbackCompletedEvent withOverallUpgradeElapsedTimeInMs(double overallUpgradeElapsedTimeInMs) { + this.overallUpgradeElapsedTimeInMs = overallUpgradeElapsedTimeInMs; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeRollbackStartedEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeRollbackStartedEvent.java new file mode 100644 index 0000000000000..8df551021bbe3 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeRollbackStartedEvent.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ApplicationEventInner; + +/** + * Application Upgrade Rollback Started event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ApplicationUpgradeRollbackStarted") +public class ApplicationUpgradeRollbackStartedEvent extends ApplicationEventInner { + /** + * Application type name. + */ + @JsonProperty(value = "ApplicationTypeName", required = true) + private String applicationTypeName; + + /** + * Current Application type version. + */ + @JsonProperty(value = "CurrentApplicationTypeVersion", required = true) + private String currentApplicationTypeVersion; + + /** + * Target Application type version. + */ + @JsonProperty(value = "ApplicationTypeVersion", required = true) + private String applicationTypeVersion; + + /** + * Describes reason of failure. + */ + @JsonProperty(value = "FailureReason", required = true) + private String failureReason; + + /** + * Overall upgrade time in milli-seconds. + */ + @JsonProperty(value = "OverallUpgradeElapsedTimeInMs", required = true) + private double overallUpgradeElapsedTimeInMs; + + /** + * Get application type name. + * + * @return the applicationTypeName value + */ + public String applicationTypeName() { + return this.applicationTypeName; + } + + /** + * Set application type name. + * + * @param applicationTypeName the applicationTypeName value to set + * @return the ApplicationUpgradeRollbackStartedEvent object itself. + */ + public ApplicationUpgradeRollbackStartedEvent withApplicationTypeName(String applicationTypeName) { + this.applicationTypeName = applicationTypeName; + return this; + } + + /** + * Get current Application type version. + * + * @return the currentApplicationTypeVersion value + */ + public String currentApplicationTypeVersion() { + return this.currentApplicationTypeVersion; + } + + /** + * Set current Application type version. + * + * @param currentApplicationTypeVersion the currentApplicationTypeVersion value to set + * @return the ApplicationUpgradeRollbackStartedEvent object itself. + */ + public ApplicationUpgradeRollbackStartedEvent withCurrentApplicationTypeVersion(String currentApplicationTypeVersion) { + this.currentApplicationTypeVersion = currentApplicationTypeVersion; + return this; + } + + /** + * Get target Application type version. + * + * @return the applicationTypeVersion value + */ + public String applicationTypeVersion() { + return this.applicationTypeVersion; + } + + /** + * Set target Application type version. + * + * @param applicationTypeVersion the applicationTypeVersion value to set + * @return the ApplicationUpgradeRollbackStartedEvent object itself. + */ + public ApplicationUpgradeRollbackStartedEvent withApplicationTypeVersion(String applicationTypeVersion) { + this.applicationTypeVersion = applicationTypeVersion; + return this; + } + + /** + * Get describes reason of failure. + * + * @return the failureReason value + */ + public String failureReason() { + return this.failureReason; + } + + /** + * Set describes reason of failure. + * + * @param failureReason the failureReason value to set + * @return the ApplicationUpgradeRollbackStartedEvent object itself. + */ + public ApplicationUpgradeRollbackStartedEvent withFailureReason(String failureReason) { + this.failureReason = failureReason; + return this; + } + + /** + * Get overall upgrade time in milli-seconds. + * + * @return the overallUpgradeElapsedTimeInMs value + */ + public double overallUpgradeElapsedTimeInMs() { + return this.overallUpgradeElapsedTimeInMs; + } + + /** + * Set overall upgrade time in milli-seconds. + * + * @param overallUpgradeElapsedTimeInMs the overallUpgradeElapsedTimeInMs value to set + * @return the ApplicationUpgradeRollbackStartedEvent object itself. + */ + public ApplicationUpgradeRollbackStartedEvent withOverallUpgradeElapsedTimeInMs(double overallUpgradeElapsedTimeInMs) { + this.overallUpgradeElapsedTimeInMs = overallUpgradeElapsedTimeInMs; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeStartedEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeStartedEvent.java new file mode 100644 index 0000000000000..42bfa7e3ee6dc --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ApplicationUpgradeStartedEvent.java @@ -0,0 +1,178 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ApplicationEventInner; + +/** + * Application Upgrade Started event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ApplicationUpgradeStarted") +public class ApplicationUpgradeStartedEvent extends ApplicationEventInner { + /** + * Application type name. + */ + @JsonProperty(value = "ApplicationTypeName", required = true) + private String applicationTypeName; + + /** + * Current Application type version. + */ + @JsonProperty(value = "CurrentApplicationTypeVersion", required = true) + private String currentApplicationTypeVersion; + + /** + * Target Application type version. + */ + @JsonProperty(value = "ApplicationTypeVersion", required = true) + private String applicationTypeVersion; + + /** + * Type of upgrade. + */ + @JsonProperty(value = "UpgradeType", required = true) + private String upgradeType; + + /** + * Mode of upgrade. + */ + @JsonProperty(value = "RollingUpgradeMode", required = true) + private String rollingUpgradeMode; + + /** + * Action if failed. + */ + @JsonProperty(value = "FailureAction", required = true) + private String failureAction; + + /** + * Get application type name. + * + * @return the applicationTypeName value + */ + public String applicationTypeName() { + return this.applicationTypeName; + } + + /** + * Set application type name. + * + * @param applicationTypeName the applicationTypeName value to set + * @return the ApplicationUpgradeStartedEvent object itself. + */ + public ApplicationUpgradeStartedEvent withApplicationTypeName(String applicationTypeName) { + this.applicationTypeName = applicationTypeName; + return this; + } + + /** + * Get current Application type version. + * + * @return the currentApplicationTypeVersion value + */ + public String currentApplicationTypeVersion() { + return this.currentApplicationTypeVersion; + } + + /** + * Set current Application type version. + * + * @param currentApplicationTypeVersion the currentApplicationTypeVersion value to set + * @return the ApplicationUpgradeStartedEvent object itself. + */ + public ApplicationUpgradeStartedEvent withCurrentApplicationTypeVersion(String currentApplicationTypeVersion) { + this.currentApplicationTypeVersion = currentApplicationTypeVersion; + return this; + } + + /** + * Get target Application type version. + * + * @return the applicationTypeVersion value + */ + public String applicationTypeVersion() { + return this.applicationTypeVersion; + } + + /** + * Set target Application type version. + * + * @param applicationTypeVersion the applicationTypeVersion value to set + * @return the ApplicationUpgradeStartedEvent object itself. + */ + public ApplicationUpgradeStartedEvent withApplicationTypeVersion(String applicationTypeVersion) { + this.applicationTypeVersion = applicationTypeVersion; + return this; + } + + /** + * Get type of upgrade. + * + * @return the upgradeType value + */ + public String upgradeType() { + return this.upgradeType; + } + + /** + * Set type of upgrade. + * + * @param upgradeType the upgradeType value to set + * @return the ApplicationUpgradeStartedEvent object itself. + */ + public ApplicationUpgradeStartedEvent withUpgradeType(String upgradeType) { + this.upgradeType = upgradeType; + return this; + } + + /** + * Get mode of upgrade. + * + * @return the rollingUpgradeMode value + */ + public String rollingUpgradeMode() { + return this.rollingUpgradeMode; + } + + /** + * Set mode of upgrade. + * + * @param rollingUpgradeMode the rollingUpgradeMode value to set + * @return the ApplicationUpgradeStartedEvent object itself. + */ + public ApplicationUpgradeStartedEvent withRollingUpgradeMode(String rollingUpgradeMode) { + this.rollingUpgradeMode = rollingUpgradeMode; + return this; + } + + /** + * Get action if failed. + * + * @return the failureAction value + */ + public String failureAction() { + return this.failureAction; + } + + /** + * Set action if failed. + * + * @param failureAction the failureAction value to set + * @return the ApplicationUpgradeStartedEvent object itself. + */ + public ApplicationUpgradeStartedEvent withFailureAction(String failureAction) { + this.failureAction = failureAction; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AutoScalingMechanism.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AutoScalingMechanism.java new file mode 100644 index 0000000000000..bc35cfeaf5036 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AutoScalingMechanism.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Describes the mechanism for performing auto scaling operation. Derived + * classes will describe the actual mechanism. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("AutoScalingMechanism") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AddRemoveReplica", value = AddRemoveReplicaScalingMechanism.class) +}) +public class AutoScalingMechanism { +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AutoScalingMechanismKind.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AutoScalingMechanismKind.java new file mode 100644 index 0000000000000..1a3dea0238e4b --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AutoScalingMechanismKind.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for AutoScalingMechanismKind. + */ +public final class AutoScalingMechanismKind extends ExpandableStringEnum { + /** Static value AddRemoveReplica for AutoScalingMechanismKind. */ + public static final AutoScalingMechanismKind ADD_REMOVE_REPLICA = fromString("AddRemoveReplica"); + + /** + * Creates or finds a AutoScalingMechanismKind from its string representation. + * @param name a name to look for + * @return the corresponding AutoScalingMechanismKind + */ + @JsonCreator + public static AutoScalingMechanismKind fromString(String name) { + return fromString(name, AutoScalingMechanismKind.class); + } + + /** + * @return known AutoScalingMechanismKind values + */ + public static Collection values() { + return values(AutoScalingMechanismKind.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AutoScalingMetric.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AutoScalingMetric.java new file mode 100644 index 0000000000000..f2d5507a24675 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AutoScalingMetric.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Describes the metric that is used for triggering auto scaling operation. + * Derived classes will describe resources or metrics. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("AutoScalingMetric") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Resource", value = AutoScalingResourceMetric.class) +}) +public class AutoScalingMetric { +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AutoScalingMetricKind.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AutoScalingMetricKind.java new file mode 100644 index 0000000000000..df7e4ae92dc07 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AutoScalingMetricKind.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for AutoScalingMetricKind. + */ +public final class AutoScalingMetricKind extends ExpandableStringEnum { + /** Static value Resource for AutoScalingMetricKind. */ + public static final AutoScalingMetricKind RESOURCE = fromString("Resource"); + + /** + * Creates or finds a AutoScalingMetricKind from its string representation. + * @param name a name to look for + * @return the corresponding AutoScalingMetricKind + */ + @JsonCreator + public static AutoScalingMetricKind fromString(String name) { + return fromString(name, AutoScalingMetricKind.class); + } + + /** + * @return known AutoScalingMetricKind values + */ + public static Collection values() { + return values(AutoScalingMetricKind.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AutoScalingPolicy.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AutoScalingPolicy.java new file mode 100644 index 0000000000000..07bdbdb2f2a4b --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AutoScalingPolicy.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the auto scaling policy. + */ +public class AutoScalingPolicy { + /** + * The name of the auto scaling policy. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Determines when auto scaling operation will be invoked. + */ + @JsonProperty(value = "trigger", required = true) + private AutoScalingTrigger trigger; + + /** + * The mechanism that is used to scale when auto scaling operation is + * invoked. + */ + @JsonProperty(value = "mechanism", required = true) + private AutoScalingMechanism mechanism; + + /** + * Get the name of the auto scaling policy. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the auto scaling policy. + * + * @param name the name value to set + * @return the AutoScalingPolicy object itself. + */ + public AutoScalingPolicy withName(String name) { + this.name = name; + return this; + } + + /** + * Get determines when auto scaling operation will be invoked. + * + * @return the trigger value + */ + public AutoScalingTrigger trigger() { + return this.trigger; + } + + /** + * Set determines when auto scaling operation will be invoked. + * + * @param trigger the trigger value to set + * @return the AutoScalingPolicy object itself. + */ + public AutoScalingPolicy withTrigger(AutoScalingTrigger trigger) { + this.trigger = trigger; + return this; + } + + /** + * Get the mechanism that is used to scale when auto scaling operation is invoked. + * + * @return the mechanism value + */ + public AutoScalingMechanism mechanism() { + return this.mechanism; + } + + /** + * Set the mechanism that is used to scale when auto scaling operation is invoked. + * + * @param mechanism the mechanism value to set + * @return the AutoScalingPolicy object itself. + */ + public AutoScalingPolicy withMechanism(AutoScalingMechanism mechanism) { + this.mechanism = mechanism; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AutoScalingResourceMetric.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AutoScalingResourceMetric.java new file mode 100644 index 0000000000000..190a22dac543c --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AutoScalingResourceMetric.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the resource that is used for triggering auto scaling. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("Resource") +public class AutoScalingResourceMetric extends AutoScalingMetric { + /** + * Name of the resource. Possible values include: 'cpu', 'memoryInGB'. + */ + @JsonProperty(value = "name", required = true) + private AutoScalingResourceMetricName name; + + /** + * Get name of the resource. Possible values include: 'cpu', 'memoryInGB'. + * + * @return the name value + */ + public AutoScalingResourceMetricName name() { + return this.name; + } + + /** + * Set name of the resource. Possible values include: 'cpu', 'memoryInGB'. + * + * @param name the name value to set + * @return the AutoScalingResourceMetric object itself. + */ + public AutoScalingResourceMetric withName(AutoScalingResourceMetricName name) { + this.name = name; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AutoScalingResourceMetricName.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AutoScalingResourceMetricName.java new file mode 100644 index 0000000000000..e445505167afb --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AutoScalingResourceMetricName.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for AutoScalingResourceMetricName. + */ +public final class AutoScalingResourceMetricName extends ExpandableStringEnum { + /** Static value cpu for AutoScalingResourceMetricName. */ + public static final AutoScalingResourceMetricName CPU = fromString("cpu"); + + /** Static value memoryInGB for AutoScalingResourceMetricName. */ + public static final AutoScalingResourceMetricName MEMORY_IN_GB = fromString("memoryInGB"); + + /** + * Creates or finds a AutoScalingResourceMetricName from its string representation. + * @param name a name to look for + * @return the corresponding AutoScalingResourceMetricName + */ + @JsonCreator + public static AutoScalingResourceMetricName fromString(String name) { + return fromString(name, AutoScalingResourceMetricName.class); + } + + /** + * @return known AutoScalingResourceMetricName values + */ + public static Collection values() { + return values(AutoScalingResourceMetricName.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AutoScalingTrigger.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AutoScalingTrigger.java new file mode 100644 index 0000000000000..97772a7949873 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AutoScalingTrigger.java @@ -0,0 +1,24 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Describes the trigger for performing auto scaling operation. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("AutoScalingTrigger") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AverageLoad", value = AverageLoadScalingTrigger.class) +}) +public class AutoScalingTrigger { +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AutoScalingTriggerKind.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AutoScalingTriggerKind.java new file mode 100644 index 0000000000000..f0456b2f52e0a --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AutoScalingTriggerKind.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for AutoScalingTriggerKind. + */ +public final class AutoScalingTriggerKind extends ExpandableStringEnum { + /** Static value AverageLoad for AutoScalingTriggerKind. */ + public static final AutoScalingTriggerKind AVERAGE_LOAD = fromString("AverageLoad"); + + /** + * Creates or finds a AutoScalingTriggerKind from its string representation. + * @param name a name to look for + * @return the corresponding AutoScalingTriggerKind + */ + @JsonCreator + public static AutoScalingTriggerKind fromString(String name) { + return fromString(name, AutoScalingTriggerKind.class); + } + + /** + * @return known AutoScalingTriggerKind values + */ + public static Collection values() { + return values(AutoScalingTriggerKind.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AverageLoadScalingTrigger.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AverageLoadScalingTrigger.java new file mode 100644 index 0000000000000..ba6072abfe816 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AverageLoadScalingTrigger.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the average load trigger used for auto scaling. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("AverageLoad") +public class AverageLoadScalingTrigger extends AutoScalingTrigger { + /** + * Description of the metric that is used for scaling. + */ + @JsonProperty(value = "metric", required = true) + private AutoScalingMetric metric; + + /** + * Lower load threshold (if average load is below this threshold, service + * will scale down). + */ + @JsonProperty(value = "lowerLoadThreshold", required = true) + private double lowerLoadThreshold; + + /** + * Upper load threshold (if average load is above this threshold, service + * will scale up). + */ + @JsonProperty(value = "upperLoadThreshold", required = true) + private double upperLoadThreshold; + + /** + * Scale interval that indicates how often will this trigger be checked. + */ + @JsonProperty(value = "scaleIntervalInSeconds", required = true) + private int scaleIntervalInSeconds; + + /** + * Get description of the metric that is used for scaling. + * + * @return the metric value + */ + public AutoScalingMetric metric() { + return this.metric; + } + + /** + * Set description of the metric that is used for scaling. + * + * @param metric the metric value to set + * @return the AverageLoadScalingTrigger object itself. + */ + public AverageLoadScalingTrigger withMetric(AutoScalingMetric metric) { + this.metric = metric; + return this; + } + + /** + * Get lower load threshold (if average load is below this threshold, service will scale down). + * + * @return the lowerLoadThreshold value + */ + public double lowerLoadThreshold() { + return this.lowerLoadThreshold; + } + + /** + * Set lower load threshold (if average load is below this threshold, service will scale down). + * + * @param lowerLoadThreshold the lowerLoadThreshold value to set + * @return the AverageLoadScalingTrigger object itself. + */ + public AverageLoadScalingTrigger withLowerLoadThreshold(double lowerLoadThreshold) { + this.lowerLoadThreshold = lowerLoadThreshold; + return this; + } + + /** + * Get upper load threshold (if average load is above this threshold, service will scale up). + * + * @return the upperLoadThreshold value + */ + public double upperLoadThreshold() { + return this.upperLoadThreshold; + } + + /** + * Set upper load threshold (if average load is above this threshold, service will scale up). + * + * @param upperLoadThreshold the upperLoadThreshold value to set + * @return the AverageLoadScalingTrigger object itself. + */ + public AverageLoadScalingTrigger withUpperLoadThreshold(double upperLoadThreshold) { + this.upperLoadThreshold = upperLoadThreshold; + return this; + } + + /** + * Get scale interval that indicates how often will this trigger be checked. + * + * @return the scaleIntervalInSeconds value + */ + public int scaleIntervalInSeconds() { + return this.scaleIntervalInSeconds; + } + + /** + * Set scale interval that indicates how often will this trigger be checked. + * + * @param scaleIntervalInSeconds the scaleIntervalInSeconds value to set + * @return the AverageLoadScalingTrigger object itself. + */ + public AverageLoadScalingTrigger withScaleIntervalInSeconds(int scaleIntervalInSeconds) { + this.scaleIntervalInSeconds = scaleIntervalInSeconds; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AzureInternalMonitoringPipelineSinkDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AzureInternalMonitoringPipelineSinkDescription.java new file mode 100644 index 0000000000000..0ef7a9f6436e6 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/AzureInternalMonitoringPipelineSinkDescription.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Diagnostics settings for Geneva. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("AzureInternalMonitoringPipeline") +public class AzureInternalMonitoringPipelineSinkDescription extends DiagnosticsSinkProperties { + /** + * Azure Internal monitoring pipeline account. + */ + @JsonProperty(value = "accountName") + private String accountName; + + /** + * Azure Internal monitoring pipeline account namespace. + */ + @JsonProperty(value = "namespace") + private String namespace; + + /** + * Azure Internal monitoring agent configuration. + */ + @JsonProperty(value = "maConfigUrl") + private String maConfigUrl; + + /** + * Azure Internal monitoring agent fluentd configuration. + */ + @JsonProperty(value = "fluentdConfigUrl") + private Object fluentdConfigUrl; + + /** + * Azure Internal monitoring pipeline autokey associated with the + * certificate. + */ + @JsonProperty(value = "autoKeyConfigUrl") + private String autoKeyConfigUrl; + + /** + * Get azure Internal monitoring pipeline account. + * + * @return the accountName value + */ + public String accountName() { + return this.accountName; + } + + /** + * Set azure Internal monitoring pipeline account. + * + * @param accountName the accountName value to set + * @return the AzureInternalMonitoringPipelineSinkDescription object itself. + */ + public AzureInternalMonitoringPipelineSinkDescription withAccountName(String accountName) { + this.accountName = accountName; + return this; + } + + /** + * Get azure Internal monitoring pipeline account namespace. + * + * @return the namespace value + */ + public String namespace() { + return this.namespace; + } + + /** + * Set azure Internal monitoring pipeline account namespace. + * + * @param namespace the namespace value to set + * @return the AzureInternalMonitoringPipelineSinkDescription object itself. + */ + public AzureInternalMonitoringPipelineSinkDescription withNamespace(String namespace) { + this.namespace = namespace; + return this; + } + + /** + * Get azure Internal monitoring agent configuration. + * + * @return the maConfigUrl value + */ + public String maConfigUrl() { + return this.maConfigUrl; + } + + /** + * Set azure Internal monitoring agent configuration. + * + * @param maConfigUrl the maConfigUrl value to set + * @return the AzureInternalMonitoringPipelineSinkDescription object itself. + */ + public AzureInternalMonitoringPipelineSinkDescription withMaConfigUrl(String maConfigUrl) { + this.maConfigUrl = maConfigUrl; + return this; + } + + /** + * Get azure Internal monitoring agent fluentd configuration. + * + * @return the fluentdConfigUrl value + */ + public Object fluentdConfigUrl() { + return this.fluentdConfigUrl; + } + + /** + * Set azure Internal monitoring agent fluentd configuration. + * + * @param fluentdConfigUrl the fluentdConfigUrl value to set + * @return the AzureInternalMonitoringPipelineSinkDescription object itself. + */ + public AzureInternalMonitoringPipelineSinkDescription withFluentdConfigUrl(Object fluentdConfigUrl) { + this.fluentdConfigUrl = fluentdConfigUrl; + return this; + } + + /** + * Get azure Internal monitoring pipeline autokey associated with the certificate. + * + * @return the autoKeyConfigUrl value + */ + public String autoKeyConfigUrl() { + return this.autoKeyConfigUrl; + } + + /** + * Set azure Internal monitoring pipeline autokey associated with the certificate. + * + * @param autoKeyConfigUrl the autoKeyConfigUrl value to set + * @return the AzureInternalMonitoringPipelineSinkDescription object itself. + */ + public AzureInternalMonitoringPipelineSinkDescription withAutoKeyConfigUrl(String autoKeyConfigUrl) { + this.autoKeyConfigUrl = autoKeyConfigUrl; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupInfo.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupInfo.java index b555577803026..e6f66775fc71a 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupInfo.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupInfo.java @@ -65,7 +65,7 @@ public class BackupInfo { * Epoch of the last record in this backup. */ @JsonProperty(value = "EpochOfLastBackupRecord") - private BackupEpoch epochOfLastBackupRecord; + private Epoch epochOfLastBackupRecord; /** * LSN of the last record in this backup. @@ -79,6 +79,12 @@ public class BackupInfo { @JsonProperty(value = "CreationTimeUtc") private DateTime creationTimeUtc; + /** + * Manifest Version of the service this partition backup belongs to. + */ + @JsonProperty(value = "ServiceManifestVersion") + private String serviceManifestVersion; + /** * Denotes the failure encountered in getting backup point information. */ @@ -230,7 +236,7 @@ public BackupInfo withBackupType(BackupType backupType) { * * @return the epochOfLastBackupRecord value */ - public BackupEpoch epochOfLastBackupRecord() { + public Epoch epochOfLastBackupRecord() { return this.epochOfLastBackupRecord; } @@ -240,7 +246,7 @@ public BackupEpoch epochOfLastBackupRecord() { * @param epochOfLastBackupRecord the epochOfLastBackupRecord value to set * @return the BackupInfo object itself. */ - public BackupInfo withEpochOfLastBackupRecord(BackupEpoch epochOfLastBackupRecord) { + public BackupInfo withEpochOfLastBackupRecord(Epoch epochOfLastBackupRecord) { this.epochOfLastBackupRecord = epochOfLastBackupRecord; return this; } @@ -285,6 +291,26 @@ public BackupInfo withCreationTimeUtc(DateTime creationTimeUtc) { return this; } + /** + * Get manifest Version of the service this partition backup belongs to. + * + * @return the serviceManifestVersion value + */ + public String serviceManifestVersion() { + return this.serviceManifestVersion; + } + + /** + * Set manifest Version of the service this partition backup belongs to. + * + * @param serviceManifestVersion the serviceManifestVersion value to set + * @return the BackupInfo object itself. + */ + public BackupInfo withServiceManifestVersion(String serviceManifestVersion) { + this.serviceManifestVersion = serviceManifestVersion; + return this; + } + /** * Get denotes the failure encountered in getting backup point information. * diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BasicRetentionPolicyDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BasicRetentionPolicyDescription.java new file mode 100644 index 0000000000000..fe1e90d1b46b7 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BasicRetentionPolicyDescription.java @@ -0,0 +1,79 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.Period; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes basic retention policy. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "RetentionPolicyType") +@JsonTypeName("Basic") +public class BasicRetentionPolicyDescription extends RetentionPolicyDescription { + /** + * 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. + */ + @JsonProperty(value = "RetentionDuration", required = true) + private Period retentionDuration; + + /** + * 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. + */ + @JsonProperty(value = "MinimumNumberOfBackups") + private Integer minimumNumberOfBackups; + + /** + * Get 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. + * + * @return the retentionDuration value + */ + public Period retentionDuration() { + return this.retentionDuration; + } + + /** + * Set 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. + * + * @param retentionDuration the retentionDuration value to set + * @return the BasicRetentionPolicyDescription object itself. + */ + public BasicRetentionPolicyDescription withRetentionDuration(Period retentionDuration) { + this.retentionDuration = retentionDuration; + return this; + } + + /** + * Get 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. + * + * @return the minimumNumberOfBackups value + */ + public Integer minimumNumberOfBackups() { + return this.minimumNumberOfBackups; + } + + /** + * Set 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. + * + * @param minimumNumberOfBackups the minimumNumberOfBackups value to set + * @return the BasicRetentionPolicyDescription object itself. + */ + public BasicRetentionPolicyDescription withMinimumNumberOfBackups(Integer minimumNumberOfBackups) { + this.minimumNumberOfBackups = minimumNumberOfBackups; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosCodePackageRestartScheduledEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosCodePackageRestartScheduledEvent.java new file mode 100644 index 0000000000000..1207055c2ff7f --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosCodePackageRestartScheduledEvent.java @@ -0,0 +1,179 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ApplicationEventInner; + +/** + * Chaos Restart Code Package Fault Scheduled event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ChaosCodePackageRestartScheduled") +public class ChaosCodePackageRestartScheduledEvent extends ApplicationEventInner { + /** + * Id of fault group. + */ + @JsonProperty(value = "FaultGroupId", required = true) + private UUID faultGroupId; + + /** + * Id of fault. + */ + @JsonProperty(value = "FaultId", required = true) + private UUID faultId; + + /** + * The name of a Service Fabric node. + */ + @JsonProperty(value = "NodeName", required = true) + private String nodeName; + + /** + * Service manifest name. + */ + @JsonProperty(value = "ServiceManifestName", required = true) + private String serviceManifestName; + + /** + * Code package name. + */ + @JsonProperty(value = "CodePackageName", required = true) + private String codePackageName; + + /** + * Id of Service package activation. + */ + @JsonProperty(value = "ServicePackageActivationId", required = true) + private String servicePackageActivationId; + + /** + * Get id of fault group. + * + * @return the faultGroupId value + */ + public UUID faultGroupId() { + return this.faultGroupId; + } + + /** + * Set id of fault group. + * + * @param faultGroupId the faultGroupId value to set + * @return the ChaosCodePackageRestartScheduledEvent object itself. + */ + public ChaosCodePackageRestartScheduledEvent withFaultGroupId(UUID faultGroupId) { + this.faultGroupId = faultGroupId; + return this; + } + + /** + * Get id of fault. + * + * @return the faultId value + */ + public UUID faultId() { + return this.faultId; + } + + /** + * Set id of fault. + * + * @param faultId the faultId value to set + * @return the ChaosCodePackageRestartScheduledEvent object itself. + */ + public ChaosCodePackageRestartScheduledEvent withFaultId(UUID faultId) { + this.faultId = faultId; + return this; + } + + /** + * Get the name of a Service Fabric node. + * + * @return the nodeName value + */ + public String nodeName() { + return this.nodeName; + } + + /** + * Set the name of a Service Fabric node. + * + * @param nodeName the nodeName value to set + * @return the ChaosCodePackageRestartScheduledEvent object itself. + */ + public ChaosCodePackageRestartScheduledEvent withNodeName(String nodeName) { + this.nodeName = nodeName; + return this; + } + + /** + * Get service manifest name. + * + * @return the serviceManifestName value + */ + public String serviceManifestName() { + return this.serviceManifestName; + } + + /** + * Set service manifest name. + * + * @param serviceManifestName the serviceManifestName value to set + * @return the ChaosCodePackageRestartScheduledEvent object itself. + */ + public ChaosCodePackageRestartScheduledEvent withServiceManifestName(String serviceManifestName) { + this.serviceManifestName = serviceManifestName; + return this; + } + + /** + * Get code package name. + * + * @return the codePackageName value + */ + public String codePackageName() { + return this.codePackageName; + } + + /** + * Set code package name. + * + * @param codePackageName the codePackageName value to set + * @return the ChaosCodePackageRestartScheduledEvent object itself. + */ + public ChaosCodePackageRestartScheduledEvent withCodePackageName(String codePackageName) { + this.codePackageName = codePackageName; + return this; + } + + /** + * Get id of Service package activation. + * + * @return the servicePackageActivationId value + */ + public String servicePackageActivationId() { + return this.servicePackageActivationId; + } + + /** + * Set id of Service package activation. + * + * @param servicePackageActivationId the servicePackageActivationId value to set + * @return the ChaosCodePackageRestartScheduledEvent object itself. + */ + public ChaosCodePackageRestartScheduledEvent withServicePackageActivationId(String servicePackageActivationId) { + this.servicePackageActivationId = servicePackageActivationId; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosNodeRestartScheduledEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosNodeRestartScheduledEvent.java new file mode 100644 index 0000000000000..c3d5ca6af9a51 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosNodeRestartScheduledEvent.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.NodeEventInner; + +/** + * Chaos Restart Node Fault Scheduled event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ChaosNodeRestartScheduled") +public class ChaosNodeRestartScheduledEvent extends NodeEventInner { + /** + * Id of Node instance. + */ + @JsonProperty(value = "NodeInstanceId", required = true) + private long nodeInstanceId; + + /** + * Id of fault group. + */ + @JsonProperty(value = "FaultGroupId", required = true) + private UUID faultGroupId; + + /** + * Id of fault. + */ + @JsonProperty(value = "FaultId", required = true) + private UUID faultId; + + /** + * Get id of Node instance. + * + * @return the nodeInstanceId value + */ + public long nodeInstanceId() { + return this.nodeInstanceId; + } + + /** + * Set id of Node instance. + * + * @param nodeInstanceId the nodeInstanceId value to set + * @return the ChaosNodeRestartScheduledEvent object itself. + */ + public ChaosNodeRestartScheduledEvent withNodeInstanceId(long nodeInstanceId) { + this.nodeInstanceId = nodeInstanceId; + return this; + } + + /** + * Get id of fault group. + * + * @return the faultGroupId value + */ + public UUID faultGroupId() { + return this.faultGroupId; + } + + /** + * Set id of fault group. + * + * @param faultGroupId the faultGroupId value to set + * @return the ChaosNodeRestartScheduledEvent object itself. + */ + public ChaosNodeRestartScheduledEvent withFaultGroupId(UUID faultGroupId) { + this.faultGroupId = faultGroupId; + return this; + } + + /** + * Get id of fault. + * + * @return the faultId value + */ + public UUID faultId() { + return this.faultId; + } + + /** + * Set id of fault. + * + * @param faultId the faultId value to set + * @return the ChaosNodeRestartScheduledEvent object itself. + */ + public ChaosNodeRestartScheduledEvent withFaultId(UUID faultId) { + this.faultId = faultId; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosPartitionPrimaryMoveScheduledEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosPartitionPrimaryMoveScheduledEvent.java new file mode 100644 index 0000000000000..6898739434bf1 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosPartitionPrimaryMoveScheduledEvent.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.PartitionEventInner; + +/** + * Chaos Move Primary Fault Scheduled event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ChaosPartitionPrimaryMoveScheduled") +public class ChaosPartitionPrimaryMoveScheduledEvent extends PartitionEventInner { + /** + * Id of fault group. + */ + @JsonProperty(value = "FaultGroupId", required = true) + private UUID faultGroupId; + + /** + * Id of fault. + */ + @JsonProperty(value = "FaultId", required = true) + private UUID faultId; + + /** + * Service name. + */ + @JsonProperty(value = "ServiceName", required = true) + private String serviceName; + + /** + * The name of a Service Fabric node. + */ + @JsonProperty(value = "NodeTo", required = true) + private String nodeTo; + + /** + * Indicates a forced move. + */ + @JsonProperty(value = "ForcedMove", required = true) + private boolean forcedMove; + + /** + * Get id of fault group. + * + * @return the faultGroupId value + */ + public UUID faultGroupId() { + return this.faultGroupId; + } + + /** + * Set id of fault group. + * + * @param faultGroupId the faultGroupId value to set + * @return the ChaosPartitionPrimaryMoveScheduledEvent object itself. + */ + public ChaosPartitionPrimaryMoveScheduledEvent withFaultGroupId(UUID faultGroupId) { + this.faultGroupId = faultGroupId; + return this; + } + + /** + * Get id of fault. + * + * @return the faultId value + */ + public UUID faultId() { + return this.faultId; + } + + /** + * Set id of fault. + * + * @param faultId the faultId value to set + * @return the ChaosPartitionPrimaryMoveScheduledEvent object itself. + */ + public ChaosPartitionPrimaryMoveScheduledEvent withFaultId(UUID faultId) { + this.faultId = faultId; + return this; + } + + /** + * Get service name. + * + * @return the serviceName value + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set service name. + * + * @param serviceName the serviceName value to set + * @return the ChaosPartitionPrimaryMoveScheduledEvent object itself. + */ + public ChaosPartitionPrimaryMoveScheduledEvent withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Get the name of a Service Fabric node. + * + * @return the nodeTo value + */ + public String nodeTo() { + return this.nodeTo; + } + + /** + * Set the name of a Service Fabric node. + * + * @param nodeTo the nodeTo value to set + * @return the ChaosPartitionPrimaryMoveScheduledEvent object itself. + */ + public ChaosPartitionPrimaryMoveScheduledEvent withNodeTo(String nodeTo) { + this.nodeTo = nodeTo; + return this; + } + + /** + * Get indicates a forced move. + * + * @return the forcedMove value + */ + public boolean forcedMove() { + return this.forcedMove; + } + + /** + * Set indicates a forced move. + * + * @param forcedMove the forcedMove value to set + * @return the ChaosPartitionPrimaryMoveScheduledEvent object itself. + */ + public ChaosPartitionPrimaryMoveScheduledEvent withForcedMove(boolean forcedMove) { + this.forcedMove = forcedMove; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosPartitionSecondaryMoveScheduledEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosPartitionSecondaryMoveScheduledEvent.java new file mode 100644 index 0000000000000..3613101e6e1d8 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosPartitionSecondaryMoveScheduledEvent.java @@ -0,0 +1,179 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.PartitionEventInner; + +/** + * Chaos Move Secondary Fault Scheduled event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ChaosPartitionSecondaryMoveScheduled") +public class ChaosPartitionSecondaryMoveScheduledEvent extends PartitionEventInner { + /** + * Id of fault group. + */ + @JsonProperty(value = "FaultGroupId", required = true) + private UUID faultGroupId; + + /** + * Id of fault. + */ + @JsonProperty(value = "FaultId", required = true) + private UUID faultId; + + /** + * Service name. + */ + @JsonProperty(value = "ServiceName", required = true) + private String serviceName; + + /** + * The name of a Service Fabric node. + */ + @JsonProperty(value = "SourceNode", required = true) + private String sourceNode; + + /** + * The name of a Service Fabric node. + */ + @JsonProperty(value = "DestinationNode", required = true) + private String destinationNode; + + /** + * Indicates a forced move. + */ + @JsonProperty(value = "ForcedMove", required = true) + private boolean forcedMove; + + /** + * Get id of fault group. + * + * @return the faultGroupId value + */ + public UUID faultGroupId() { + return this.faultGroupId; + } + + /** + * Set id of fault group. + * + * @param faultGroupId the faultGroupId value to set + * @return the ChaosPartitionSecondaryMoveScheduledEvent object itself. + */ + public ChaosPartitionSecondaryMoveScheduledEvent withFaultGroupId(UUID faultGroupId) { + this.faultGroupId = faultGroupId; + return this; + } + + /** + * Get id of fault. + * + * @return the faultId value + */ + public UUID faultId() { + return this.faultId; + } + + /** + * Set id of fault. + * + * @param faultId the faultId value to set + * @return the ChaosPartitionSecondaryMoveScheduledEvent object itself. + */ + public ChaosPartitionSecondaryMoveScheduledEvent withFaultId(UUID faultId) { + this.faultId = faultId; + return this; + } + + /** + * Get service name. + * + * @return the serviceName value + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set service name. + * + * @param serviceName the serviceName value to set + * @return the ChaosPartitionSecondaryMoveScheduledEvent object itself. + */ + public ChaosPartitionSecondaryMoveScheduledEvent withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Get the name of a Service Fabric node. + * + * @return the sourceNode value + */ + public String sourceNode() { + return this.sourceNode; + } + + /** + * Set the name of a Service Fabric node. + * + * @param sourceNode the sourceNode value to set + * @return the ChaosPartitionSecondaryMoveScheduledEvent object itself. + */ + public ChaosPartitionSecondaryMoveScheduledEvent withSourceNode(String sourceNode) { + this.sourceNode = sourceNode; + return this; + } + + /** + * Get the name of a Service Fabric node. + * + * @return the destinationNode value + */ + public String destinationNode() { + return this.destinationNode; + } + + /** + * Set the name of a Service Fabric node. + * + * @param destinationNode the destinationNode value to set + * @return the ChaosPartitionSecondaryMoveScheduledEvent object itself. + */ + public ChaosPartitionSecondaryMoveScheduledEvent withDestinationNode(String destinationNode) { + this.destinationNode = destinationNode; + return this; + } + + /** + * Get indicates a forced move. + * + * @return the forcedMove value + */ + public boolean forcedMove() { + return this.forcedMove; + } + + /** + * Set indicates a forced move. + * + * @param forcedMove the forcedMove value to set + * @return the ChaosPartitionSecondaryMoveScheduledEvent object itself. + */ + public ChaosPartitionSecondaryMoveScheduledEvent withForcedMove(boolean forcedMove) { + this.forcedMove = forcedMove; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosReplicaRemovalScheduledEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosReplicaRemovalScheduledEvent.java new file mode 100644 index 0000000000000..9903b9b2e590c --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosReplicaRemovalScheduledEvent.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ReplicaEventInner; + +/** + * Chaos Remove Replica Fault Scheduled event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ChaosReplicaRemovalScheduled") +public class ChaosReplicaRemovalScheduledEvent extends ReplicaEventInner { + /** + * Id of fault group. + */ + @JsonProperty(value = "FaultGroupId", required = true) + private UUID faultGroupId; + + /** + * Id of fault. + */ + @JsonProperty(value = "FaultId", required = true) + private UUID faultId; + + /** + * Service name. + */ + @JsonProperty(value = "ServiceUri", required = true) + private String serviceUri; + + /** + * Get id of fault group. + * + * @return the faultGroupId value + */ + public UUID faultGroupId() { + return this.faultGroupId; + } + + /** + * Set id of fault group. + * + * @param faultGroupId the faultGroupId value to set + * @return the ChaosReplicaRemovalScheduledEvent object itself. + */ + public ChaosReplicaRemovalScheduledEvent withFaultGroupId(UUID faultGroupId) { + this.faultGroupId = faultGroupId; + return this; + } + + /** + * Get id of fault. + * + * @return the faultId value + */ + public UUID faultId() { + return this.faultId; + } + + /** + * Set id of fault. + * + * @param faultId the faultId value to set + * @return the ChaosReplicaRemovalScheduledEvent object itself. + */ + public ChaosReplicaRemovalScheduledEvent withFaultId(UUID faultId) { + this.faultId = faultId; + return this; + } + + /** + * Get service name. + * + * @return the serviceUri value + */ + public String serviceUri() { + return this.serviceUri; + } + + /** + * Set service name. + * + * @param serviceUri the serviceUri value to set + * @return the ChaosReplicaRemovalScheduledEvent object itself. + */ + public ChaosReplicaRemovalScheduledEvent withServiceUri(String serviceUri) { + this.serviceUri = serviceUri; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosReplicaRestartScheduledEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosReplicaRestartScheduledEvent.java new file mode 100644 index 0000000000000..65cb4d98ad132 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosReplicaRestartScheduledEvent.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ReplicaEventInner; + +/** + * Chaos Restart Replica Fault Scheduled event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ChaosReplicaRestartScheduled") +public class ChaosReplicaRestartScheduledEvent extends ReplicaEventInner { + /** + * Id of fault group. + */ + @JsonProperty(value = "FaultGroupId", required = true) + private UUID faultGroupId; + + /** + * Id of fault. + */ + @JsonProperty(value = "FaultId", required = true) + private UUID faultId; + + /** + * Service name. + */ + @JsonProperty(value = "ServiceUri", required = true) + private String serviceUri; + + /** + * Get id of fault group. + * + * @return the faultGroupId value + */ + public UUID faultGroupId() { + return this.faultGroupId; + } + + /** + * Set id of fault group. + * + * @param faultGroupId the faultGroupId value to set + * @return the ChaosReplicaRestartScheduledEvent object itself. + */ + public ChaosReplicaRestartScheduledEvent withFaultGroupId(UUID faultGroupId) { + this.faultGroupId = faultGroupId; + return this; + } + + /** + * Get id of fault. + * + * @return the faultId value + */ + public UUID faultId() { + return this.faultId; + } + + /** + * Set id of fault. + * + * @param faultId the faultId value to set + * @return the ChaosReplicaRestartScheduledEvent object itself. + */ + public ChaosReplicaRestartScheduledEvent withFaultId(UUID faultId) { + this.faultId = faultId; + return this; + } + + /** + * Get service name. + * + * @return the serviceUri value + */ + public String serviceUri() { + return this.serviceUri; + } + + /** + * Set service name. + * + * @param serviceUri the serviceUri value to set + * @return the ChaosReplicaRestartScheduledEvent object itself. + */ + public ChaosReplicaRestartScheduledEvent withServiceUri(String serviceUri) { + this.serviceUri = serviceUri; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterConfigurationUpgradeDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterConfigurationUpgradeDescription.java index 44dff11288c0d..1c83c932df832 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterConfigurationUpgradeDescription.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterConfigurationUpgradeDescription.java @@ -16,13 +16,16 @@ */ public class ClusterConfigurationUpgradeDescription { /** - * The cluster configuration. + * 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). */ @JsonProperty(value = "ClusterConfig", required = true) private String clusterConfig; /** - * The length of time between attempts to perform a health checks if the + * The length of time between attempts to perform health checks if the * application or cluster is not healthy. */ @JsonProperty(value = "HealthCheckRetryTimeout") @@ -36,7 +39,8 @@ public class ClusterConfigurationUpgradeDescription { private Period healthCheckWaitDurationInSeconds; /** - * 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. */ @JsonProperty(value = "HealthCheckStableDurationInSeconds") private Period healthCheckStableDurationInSeconds; @@ -90,7 +94,7 @@ public class ClusterConfigurationUpgradeDescription { private ApplicationHealthPolicies applicationHealthPolicies; /** - * Get the cluster configuration. + * Get 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). * * @return the clusterConfig value */ @@ -99,7 +103,7 @@ public String clusterConfig() { } /** - * Set the cluster configuration. + * Set 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 clusterConfig the clusterConfig value to set * @return the ClusterConfigurationUpgradeDescription object itself. @@ -110,7 +114,7 @@ public ClusterConfigurationUpgradeDescription withClusterConfig(String clusterCo } /** - * Get the length of time between attempts to perform a health checks if the application or cluster is not healthy. + * Get the length of time between attempts to perform health checks if the application or cluster is not healthy. * * @return the healthCheckRetryTimeout value */ @@ -119,7 +123,7 @@ public Period healthCheckRetryTimeout() { } /** - * Set the length of time between attempts to perform a health checks if the application or cluster is not healthy. + * Set the length of time between attempts to perform health checks if the application or cluster is not healthy. * * @param healthCheckRetryTimeout the healthCheckRetryTimeout value to set * @return the ClusterConfigurationUpgradeDescription object itself. @@ -150,7 +154,7 @@ public ClusterConfigurationUpgradeDescription withHealthCheckWaitDurationInSecon } /** - * Get the length of time that the application or cluster must remain healthy. + * Get the length of time that the application or cluster must remain healthy before the upgrade proceeds to the next upgrade domain. * * @return the healthCheckStableDurationInSeconds value */ @@ -159,7 +163,7 @@ public Period healthCheckStableDurationInSeconds() { } /** - * Set the length of time that the application or cluster must remain healthy. + * Set the length of time that the application or cluster must remain healthy before the upgrade proceeds to the next upgrade domain. * * @param healthCheckStableDurationInSeconds the healthCheckStableDurationInSeconds value to set * @return the ClusterConfigurationUpgradeDescription object itself. diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterNewHealthReportEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterNewHealthReportEvent.java new file mode 100644 index 0000000000000..b85dde79c03db --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterNewHealthReportEvent.java @@ -0,0 +1,231 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ClusterEventInner; + +/** + * Cluster Health Report Created event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ClusterNewHealthReport") +public class ClusterNewHealthReportEvent extends ClusterEventInner { + /** + * Id of report source. + */ + @JsonProperty(value = "SourceId", required = true) + private String sourceId; + + /** + * Describes the property. + */ + @JsonProperty(value = "Property", required = true) + private String property; + + /** + * Describes the property health state. + */ + @JsonProperty(value = "HealthState", required = true) + private String healthState; + + /** + * Time to live in milli-seconds. + */ + @JsonProperty(value = "TimeToLiveMs", required = true) + private long timeToLiveMs; + + /** + * Sequence number of report. + */ + @JsonProperty(value = "SequenceNumber", required = true) + private long sequenceNumber; + + /** + * Description of report. + */ + @JsonProperty(value = "Description", required = true) + private String description; + + /** + * Indicates the removal when it expires. + */ + @JsonProperty(value = "RemoveWhenExpired", required = true) + private boolean removeWhenExpired; + + /** + * Source time. + */ + @JsonProperty(value = "SourceUtcTimestamp", required = true) + private DateTime sourceUtcTimestamp; + + /** + * Get id of report source. + * + * @return the sourceId value + */ + public String sourceId() { + return this.sourceId; + } + + /** + * Set id of report source. + * + * @param sourceId the sourceId value to set + * @return the ClusterNewHealthReportEvent object itself. + */ + public ClusterNewHealthReportEvent withSourceId(String sourceId) { + this.sourceId = sourceId; + return this; + } + + /** + * Get describes the property. + * + * @return the property value + */ + public String property() { + return this.property; + } + + /** + * Set describes the property. + * + * @param property the property value to set + * @return the ClusterNewHealthReportEvent object itself. + */ + public ClusterNewHealthReportEvent withProperty(String property) { + this.property = property; + return this; + } + + /** + * Get describes the property health state. + * + * @return the healthState value + */ + public String healthState() { + return this.healthState; + } + + /** + * Set describes the property health state. + * + * @param healthState the healthState value to set + * @return the ClusterNewHealthReportEvent object itself. + */ + public ClusterNewHealthReportEvent withHealthState(String healthState) { + this.healthState = healthState; + return this; + } + + /** + * Get time to live in milli-seconds. + * + * @return the timeToLiveMs value + */ + public long timeToLiveMs() { + return this.timeToLiveMs; + } + + /** + * Set time to live in milli-seconds. + * + * @param timeToLiveMs the timeToLiveMs value to set + * @return the ClusterNewHealthReportEvent object itself. + */ + public ClusterNewHealthReportEvent withTimeToLiveMs(long timeToLiveMs) { + this.timeToLiveMs = timeToLiveMs; + return this; + } + + /** + * Get sequence number of report. + * + * @return the sequenceNumber value + */ + public long sequenceNumber() { + return this.sequenceNumber; + } + + /** + * Set sequence number of report. + * + * @param sequenceNumber the sequenceNumber value to set + * @return the ClusterNewHealthReportEvent object itself. + */ + public ClusterNewHealthReportEvent withSequenceNumber(long sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get description of report. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of report. + * + * @param description the description value to set + * @return the ClusterNewHealthReportEvent object itself. + */ + public ClusterNewHealthReportEvent withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get indicates the removal when it expires. + * + * @return the removeWhenExpired value + */ + public boolean removeWhenExpired() { + return this.removeWhenExpired; + } + + /** + * Set indicates the removal when it expires. + * + * @param removeWhenExpired the removeWhenExpired value to set + * @return the ClusterNewHealthReportEvent object itself. + */ + public ClusterNewHealthReportEvent withRemoveWhenExpired(boolean removeWhenExpired) { + this.removeWhenExpired = removeWhenExpired; + return this; + } + + /** + * Get source time. + * + * @return the sourceUtcTimestamp value + */ + public DateTime sourceUtcTimestamp() { + return this.sourceUtcTimestamp; + } + + /** + * Set source time. + * + * @param sourceUtcTimestamp the sourceUtcTimestamp value to set + * @return the ClusterNewHealthReportEvent object itself. + */ + public ClusterNewHealthReportEvent withSourceUtcTimestamp(DateTime sourceUtcTimestamp) { + this.sourceUtcTimestamp = sourceUtcTimestamp; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeCompletedEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeCompletedEvent.java new file mode 100644 index 0000000000000..b6a9aa0363072 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeCompletedEvent.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ClusterEventInner; + +/** + * Cluster Upgrade Completed event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ClusterUpgradeCompleted") +public class ClusterUpgradeCompletedEvent extends ClusterEventInner { + /** + * Target Cluster version. + */ + @JsonProperty(value = "TargetClusterVersion", required = true) + private String targetClusterVersion; + + /** + * Overall duration of upgrade in milli-seconds. + */ + @JsonProperty(value = "OverallUpgradeElapsedTimeInMs", required = true) + private double overallUpgradeElapsedTimeInMs; + + /** + * Get target Cluster version. + * + * @return the targetClusterVersion value + */ + public String targetClusterVersion() { + return this.targetClusterVersion; + } + + /** + * Set target Cluster version. + * + * @param targetClusterVersion the targetClusterVersion value to set + * @return the ClusterUpgradeCompletedEvent object itself. + */ + public ClusterUpgradeCompletedEvent withTargetClusterVersion(String targetClusterVersion) { + this.targetClusterVersion = targetClusterVersion; + return this; + } + + /** + * Get overall duration of upgrade in milli-seconds. + * + * @return the overallUpgradeElapsedTimeInMs value + */ + public double overallUpgradeElapsedTimeInMs() { + return this.overallUpgradeElapsedTimeInMs; + } + + /** + * Set overall duration of upgrade in milli-seconds. + * + * @param overallUpgradeElapsedTimeInMs the overallUpgradeElapsedTimeInMs value to set + * @return the ClusterUpgradeCompletedEvent object itself. + */ + public ClusterUpgradeCompletedEvent withOverallUpgradeElapsedTimeInMs(double overallUpgradeElapsedTimeInMs) { + this.overallUpgradeElapsedTimeInMs = overallUpgradeElapsedTimeInMs; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeDomainCompletedEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeDomainCompletedEvent.java new file mode 100644 index 0000000000000..c1397d9dad825 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeDomainCompletedEvent.java @@ -0,0 +1,126 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ClusterEventInner; + +/** + * Cluster Upgrade Domain Completed event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ClusterUpgradeDomainCompleted") +public class ClusterUpgradeDomainCompletedEvent extends ClusterEventInner { + /** + * Target Cluster version. + */ + @JsonProperty(value = "TargetClusterVersion", required = true) + private String targetClusterVersion; + + /** + * State of upgrade. + */ + @JsonProperty(value = "UpgradeState", required = true) + private String upgradeState; + + /** + * Upgrade domains. + */ + @JsonProperty(value = "UpgradeDomains", required = true) + private String upgradeDomains; + + /** + * Duration of domain upgrade in milli-seconds. + */ + @JsonProperty(value = "UpgradeDomainElapsedTimeInMs", required = true) + private double upgradeDomainElapsedTimeInMs; + + /** + * Get target Cluster version. + * + * @return the targetClusterVersion value + */ + public String targetClusterVersion() { + return this.targetClusterVersion; + } + + /** + * Set target Cluster version. + * + * @param targetClusterVersion the targetClusterVersion value to set + * @return the ClusterUpgradeDomainCompletedEvent object itself. + */ + public ClusterUpgradeDomainCompletedEvent withTargetClusterVersion(String targetClusterVersion) { + this.targetClusterVersion = targetClusterVersion; + return this; + } + + /** + * Get state of upgrade. + * + * @return the upgradeState value + */ + public String upgradeState() { + return this.upgradeState; + } + + /** + * Set state of upgrade. + * + * @param upgradeState the upgradeState value to set + * @return the ClusterUpgradeDomainCompletedEvent object itself. + */ + public ClusterUpgradeDomainCompletedEvent withUpgradeState(String upgradeState) { + this.upgradeState = upgradeState; + return this; + } + + /** + * Get upgrade domains. + * + * @return the upgradeDomains value + */ + public String upgradeDomains() { + return this.upgradeDomains; + } + + /** + * Set upgrade domains. + * + * @param upgradeDomains the upgradeDomains value to set + * @return the ClusterUpgradeDomainCompletedEvent object itself. + */ + public ClusterUpgradeDomainCompletedEvent withUpgradeDomains(String upgradeDomains) { + this.upgradeDomains = upgradeDomains; + return this; + } + + /** + * Get duration of domain upgrade in milli-seconds. + * + * @return the upgradeDomainElapsedTimeInMs value + */ + public double upgradeDomainElapsedTimeInMs() { + return this.upgradeDomainElapsedTimeInMs; + } + + /** + * Set duration of domain upgrade in milli-seconds. + * + * @param upgradeDomainElapsedTimeInMs the upgradeDomainElapsedTimeInMs value to set + * @return the ClusterUpgradeDomainCompletedEvent object itself. + */ + public ClusterUpgradeDomainCompletedEvent withUpgradeDomainElapsedTimeInMs(double upgradeDomainElapsedTimeInMs) { + this.upgradeDomainElapsedTimeInMs = upgradeDomainElapsedTimeInMs; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeRollbackCompletedEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeRollbackCompletedEvent.java new file mode 100644 index 0000000000000..8ed713a4a2aa1 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeRollbackCompletedEvent.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ClusterEventInner; + +/** + * Cluster Upgrade Rollback Completed event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ClusterUpgradeRollbackCompleted") +public class ClusterUpgradeRollbackCompletedEvent extends ClusterEventInner { + /** + * Target Cluster version. + */ + @JsonProperty(value = "TargetClusterVersion", required = true) + private String targetClusterVersion; + + /** + * Describes failure. + */ + @JsonProperty(value = "FailureReason", required = true) + private String failureReason; + + /** + * Overall duration of upgrade in milli-seconds. + */ + @JsonProperty(value = "OverallUpgradeElapsedTimeInMs", required = true) + private double overallUpgradeElapsedTimeInMs; + + /** + * Get target Cluster version. + * + * @return the targetClusterVersion value + */ + public String targetClusterVersion() { + return this.targetClusterVersion; + } + + /** + * Set target Cluster version. + * + * @param targetClusterVersion the targetClusterVersion value to set + * @return the ClusterUpgradeRollbackCompletedEvent object itself. + */ + public ClusterUpgradeRollbackCompletedEvent withTargetClusterVersion(String targetClusterVersion) { + this.targetClusterVersion = targetClusterVersion; + return this; + } + + /** + * Get describes failure. + * + * @return the failureReason value + */ + public String failureReason() { + return this.failureReason; + } + + /** + * Set describes failure. + * + * @param failureReason the failureReason value to set + * @return the ClusterUpgradeRollbackCompletedEvent object itself. + */ + public ClusterUpgradeRollbackCompletedEvent withFailureReason(String failureReason) { + this.failureReason = failureReason; + return this; + } + + /** + * Get overall duration of upgrade in milli-seconds. + * + * @return the overallUpgradeElapsedTimeInMs value + */ + public double overallUpgradeElapsedTimeInMs() { + return this.overallUpgradeElapsedTimeInMs; + } + + /** + * Set overall duration of upgrade in milli-seconds. + * + * @param overallUpgradeElapsedTimeInMs the overallUpgradeElapsedTimeInMs value to set + * @return the ClusterUpgradeRollbackCompletedEvent object itself. + */ + public ClusterUpgradeRollbackCompletedEvent withOverallUpgradeElapsedTimeInMs(double overallUpgradeElapsedTimeInMs) { + this.overallUpgradeElapsedTimeInMs = overallUpgradeElapsedTimeInMs; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeRollbackStartedEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeRollbackStartedEvent.java new file mode 100644 index 0000000000000..be9a6c6500330 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeRollbackStartedEvent.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ClusterEventInner; + +/** + * Cluster Upgrade Rollback Started event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ClusterUpgradeRollbackStarted") +public class ClusterUpgradeRollbackStartedEvent extends ClusterEventInner { + /** + * Target Cluster version. + */ + @JsonProperty(value = "TargetClusterVersion", required = true) + private String targetClusterVersion; + + /** + * Describes failure. + */ + @JsonProperty(value = "FailureReason", required = true) + private String failureReason; + + /** + * Overall duration of upgrade in milli-seconds. + */ + @JsonProperty(value = "OverallUpgradeElapsedTimeInMs", required = true) + private double overallUpgradeElapsedTimeInMs; + + /** + * Get target Cluster version. + * + * @return the targetClusterVersion value + */ + public String targetClusterVersion() { + return this.targetClusterVersion; + } + + /** + * Set target Cluster version. + * + * @param targetClusterVersion the targetClusterVersion value to set + * @return the ClusterUpgradeRollbackStartedEvent object itself. + */ + public ClusterUpgradeRollbackStartedEvent withTargetClusterVersion(String targetClusterVersion) { + this.targetClusterVersion = targetClusterVersion; + return this; + } + + /** + * Get describes failure. + * + * @return the failureReason value + */ + public String failureReason() { + return this.failureReason; + } + + /** + * Set describes failure. + * + * @param failureReason the failureReason value to set + * @return the ClusterUpgradeRollbackStartedEvent object itself. + */ + public ClusterUpgradeRollbackStartedEvent withFailureReason(String failureReason) { + this.failureReason = failureReason; + return this; + } + + /** + * Get overall duration of upgrade in milli-seconds. + * + * @return the overallUpgradeElapsedTimeInMs value + */ + public double overallUpgradeElapsedTimeInMs() { + return this.overallUpgradeElapsedTimeInMs; + } + + /** + * Set overall duration of upgrade in milli-seconds. + * + * @param overallUpgradeElapsedTimeInMs the overallUpgradeElapsedTimeInMs value to set + * @return the ClusterUpgradeRollbackStartedEvent object itself. + */ + public ClusterUpgradeRollbackStartedEvent withOverallUpgradeElapsedTimeInMs(double overallUpgradeElapsedTimeInMs) { + this.overallUpgradeElapsedTimeInMs = overallUpgradeElapsedTimeInMs; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeStartedEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeStartedEvent.java new file mode 100644 index 0000000000000..daace77daa2c2 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ClusterUpgradeStartedEvent.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ClusterEventInner; + +/** + * Cluster Upgrade Started event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ClusterUpgradeStarted") +public class ClusterUpgradeStartedEvent extends ClusterEventInner { + /** + * Current Cluster version. + */ + @JsonProperty(value = "CurrentClusterVersion", required = true) + private String currentClusterVersion; + + /** + * Target Cluster version. + */ + @JsonProperty(value = "TargetClusterVersion", required = true) + private String targetClusterVersion; + + /** + * Type of upgrade. + */ + @JsonProperty(value = "UpgradeType", required = true) + private String upgradeType; + + /** + * Mode of upgrade. + */ + @JsonProperty(value = "RollingUpgradeMode", required = true) + private String rollingUpgradeMode; + + /** + * Action if failed. + */ + @JsonProperty(value = "FailureAction", required = true) + private String failureAction; + + /** + * Get current Cluster version. + * + * @return the currentClusterVersion value + */ + public String currentClusterVersion() { + return this.currentClusterVersion; + } + + /** + * Set current Cluster version. + * + * @param currentClusterVersion the currentClusterVersion value to set + * @return the ClusterUpgradeStartedEvent object itself. + */ + public ClusterUpgradeStartedEvent withCurrentClusterVersion(String currentClusterVersion) { + this.currentClusterVersion = currentClusterVersion; + return this; + } + + /** + * Get target Cluster version. + * + * @return the targetClusterVersion value + */ + public String targetClusterVersion() { + return this.targetClusterVersion; + } + + /** + * Set target Cluster version. + * + * @param targetClusterVersion the targetClusterVersion value to set + * @return the ClusterUpgradeStartedEvent object itself. + */ + public ClusterUpgradeStartedEvent withTargetClusterVersion(String targetClusterVersion) { + this.targetClusterVersion = targetClusterVersion; + return this; + } + + /** + * Get type of upgrade. + * + * @return the upgradeType value + */ + public String upgradeType() { + return this.upgradeType; + } + + /** + * Set type of upgrade. + * + * @param upgradeType the upgradeType value to set + * @return the ClusterUpgradeStartedEvent object itself. + */ + public ClusterUpgradeStartedEvent withUpgradeType(String upgradeType) { + this.upgradeType = upgradeType; + return this; + } + + /** + * Get mode of upgrade. + * + * @return the rollingUpgradeMode value + */ + public String rollingUpgradeMode() { + return this.rollingUpgradeMode; + } + + /** + * Set mode of upgrade. + * + * @param rollingUpgradeMode the rollingUpgradeMode value to set + * @return the ClusterUpgradeStartedEvent object itself. + */ + public ClusterUpgradeStartedEvent withRollingUpgradeMode(String rollingUpgradeMode) { + this.rollingUpgradeMode = rollingUpgradeMode; + return this; + } + + /** + * Get action if failed. + * + * @return the failureAction value + */ + public String failureAction() { + return this.failureAction; + } + + /** + * Set action if failed. + * + * @param failureAction the failureAction value to set + * @return the ClusterUpgradeStartedEvent object itself. + */ + public ClusterUpgradeStartedEvent withFailureAction(String failureAction) { + this.failureAction = failureAction; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ContainerCodePackageProperties.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ContainerCodePackageProperties.java index 9030324328116..a9c01150e0c83 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ContainerCodePackageProperties.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ContainerCodePackageProperties.java @@ -73,23 +73,24 @@ public class ContainerCodePackageProperties { private List endpoints; /** - * This type describes the resource requirements for a container or a - * service. + * The resources required by this container. */ @JsonProperty(value = "resources", required = true) private ResourceRequirements resources; /** - * The volumes to be attached to the container. + * Volumes to be attached to the container. The lifetime of these volumes + * is independent of the application's lifetime. */ @JsonProperty(value = "volumeRefs") - private List volumeRefs; + private List volumeRefs; /** - * Runtime information of a container instance. + * Volumes to be attached to the container. The lifetime of these volumes + * is scoped to the application's lifetime. */ - @JsonProperty(value = "instanceView", access = JsonProperty.Access.WRITE_ONLY) - private ContainerInstanceView instanceView; + @JsonProperty(value = "volumes") + private List volumes; /** * Reference to sinks in DiagnosticsDescription. @@ -97,6 +98,19 @@ public class ContainerCodePackageProperties { @JsonProperty(value = "diagnostics") private DiagnosticsRef diagnostics; + /** + * A list of ReliableCollection resources used by this particular code + * package. Please refer to ReliablecollectionsRef for more details. + */ + @JsonProperty(value = "reliableCollectionsRefs") + private List reliableCollectionsRefs; + + /** + * Runtime information of a container instance. + */ + @JsonProperty(value = "instanceView", access = JsonProperty.Access.WRITE_ONLY) + private ContainerInstanceView instanceView; + /** * Get the name of the code package. * @@ -278,7 +292,7 @@ public ContainerCodePackageProperties withEndpoints(List end } /** - * Get this type describes the resource requirements for a container or a service. + * Get the resources required by this container. * * @return the resources value */ @@ -287,7 +301,7 @@ public ResourceRequirements resources() { } /** - * Set this type describes the resource requirements for a container or a service. + * Set the resources required by this container. * * @param resources the resources value to set * @return the ContainerCodePackageProperties object itself. @@ -298,32 +312,43 @@ public ContainerCodePackageProperties withResources(ResourceRequirements resourc } /** - * Get the volumes to be attached to the container. + * Get volumes to be attached to the container. The lifetime of these volumes is independent of the application's lifetime. * * @return the volumeRefs value */ - public List volumeRefs() { + public List volumeRefs() { return this.volumeRefs; } /** - * Set the volumes to be attached to the container. + * Set volumes to be attached to the container. The lifetime of these volumes is independent of the application's lifetime. * * @param volumeRefs the volumeRefs value to set * @return the ContainerCodePackageProperties object itself. */ - public ContainerCodePackageProperties withVolumeRefs(List volumeRefs) { + public ContainerCodePackageProperties withVolumeRefs(List volumeRefs) { this.volumeRefs = volumeRefs; return this; } /** - * Get runtime information of a container instance. + * Get volumes to be attached to the container. The lifetime of these volumes is scoped to the application's lifetime. * - * @return the instanceView value + * @return the volumes value */ - public ContainerInstanceView instanceView() { - return this.instanceView; + public List volumes() { + return this.volumes; + } + + /** + * Set volumes to be attached to the container. The lifetime of these volumes is scoped to the application's lifetime. + * + * @param volumes the volumes value to set + * @return the ContainerCodePackageProperties object itself. + */ + public ContainerCodePackageProperties withVolumes(List volumes) { + this.volumes = volumes; + return this; } /** @@ -346,4 +371,33 @@ public ContainerCodePackageProperties withDiagnostics(DiagnosticsRef diagnostics return this; } + /** + * Get a list of ReliableCollection resources used by this particular code package. Please refer to ReliablecollectionsRef for more details. + * + * @return the reliableCollectionsRefs value + */ + public List reliableCollectionsRefs() { + return this.reliableCollectionsRefs; + } + + /** + * Set a list of ReliableCollection resources used by this particular code package. Please refer to ReliablecollectionsRef for more details. + * + * @param reliableCollectionsRefs the reliableCollectionsRefs value to set + * @return the ContainerCodePackageProperties object itself. + */ + public ContainerCodePackageProperties withReliableCollectionsRefs(List reliableCollectionsRefs) { + this.reliableCollectionsRefs = reliableCollectionsRefs; + return this; + } + + /** + * Get runtime information of a container instance. + * + * @return the instanceView value + */ + public ContainerInstanceView instanceView() { + return this.instanceView; + } + } diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedApplicationNewHealthReportEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedApplicationNewHealthReportEvent.java new file mode 100644 index 0000000000000..1833fa431a0bd --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedApplicationNewHealthReportEvent.java @@ -0,0 +1,283 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ApplicationEventInner; + +/** + * Deployed Application Health Report Created event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("DeployedApplicationNewHealthReport") +public class DeployedApplicationNewHealthReportEvent extends ApplicationEventInner { + /** + * Id of Application instance. + */ + @JsonProperty(value = "ApplicationInstanceId", required = true) + private long applicationInstanceId; + + /** + * The name of a Service Fabric node. + */ + @JsonProperty(value = "NodeName", required = true) + private String nodeName; + + /** + * Id of report source. + */ + @JsonProperty(value = "SourceId", required = true) + private String sourceId; + + /** + * Describes the property. + */ + @JsonProperty(value = "Property", required = true) + private String property; + + /** + * Describes the property health state. + */ + @JsonProperty(value = "HealthState", required = true) + private String healthState; + + /** + * Time to live in milli-seconds. + */ + @JsonProperty(value = "TimeToLiveMs", required = true) + private long timeToLiveMs; + + /** + * Sequence number of report. + */ + @JsonProperty(value = "SequenceNumber", required = true) + private long sequenceNumber; + + /** + * Description of report. + */ + @JsonProperty(value = "Description", required = true) + private String description; + + /** + * Indicates the removal when it expires. + */ + @JsonProperty(value = "RemoveWhenExpired", required = true) + private boolean removeWhenExpired; + + /** + * Source time. + */ + @JsonProperty(value = "SourceUtcTimestamp", required = true) + private DateTime sourceUtcTimestamp; + + /** + * Get id of Application instance. + * + * @return the applicationInstanceId value + */ + public long applicationInstanceId() { + return this.applicationInstanceId; + } + + /** + * Set id of Application instance. + * + * @param applicationInstanceId the applicationInstanceId value to set + * @return the DeployedApplicationNewHealthReportEvent object itself. + */ + public DeployedApplicationNewHealthReportEvent withApplicationInstanceId(long applicationInstanceId) { + this.applicationInstanceId = applicationInstanceId; + return this; + } + + /** + * Get the name of a Service Fabric node. + * + * @return the nodeName value + */ + public String nodeName() { + return this.nodeName; + } + + /** + * Set the name of a Service Fabric node. + * + * @param nodeName the nodeName value to set + * @return the DeployedApplicationNewHealthReportEvent object itself. + */ + public DeployedApplicationNewHealthReportEvent withNodeName(String nodeName) { + this.nodeName = nodeName; + return this; + } + + /** + * Get id of report source. + * + * @return the sourceId value + */ + public String sourceId() { + return this.sourceId; + } + + /** + * Set id of report source. + * + * @param sourceId the sourceId value to set + * @return the DeployedApplicationNewHealthReportEvent object itself. + */ + public DeployedApplicationNewHealthReportEvent withSourceId(String sourceId) { + this.sourceId = sourceId; + return this; + } + + /** + * Get describes the property. + * + * @return the property value + */ + public String property() { + return this.property; + } + + /** + * Set describes the property. + * + * @param property the property value to set + * @return the DeployedApplicationNewHealthReportEvent object itself. + */ + public DeployedApplicationNewHealthReportEvent withProperty(String property) { + this.property = property; + return this; + } + + /** + * Get describes the property health state. + * + * @return the healthState value + */ + public String healthState() { + return this.healthState; + } + + /** + * Set describes the property health state. + * + * @param healthState the healthState value to set + * @return the DeployedApplicationNewHealthReportEvent object itself. + */ + public DeployedApplicationNewHealthReportEvent withHealthState(String healthState) { + this.healthState = healthState; + return this; + } + + /** + * Get time to live in milli-seconds. + * + * @return the timeToLiveMs value + */ + public long timeToLiveMs() { + return this.timeToLiveMs; + } + + /** + * Set time to live in milli-seconds. + * + * @param timeToLiveMs the timeToLiveMs value to set + * @return the DeployedApplicationNewHealthReportEvent object itself. + */ + public DeployedApplicationNewHealthReportEvent withTimeToLiveMs(long timeToLiveMs) { + this.timeToLiveMs = timeToLiveMs; + return this; + } + + /** + * Get sequence number of report. + * + * @return the sequenceNumber value + */ + public long sequenceNumber() { + return this.sequenceNumber; + } + + /** + * Set sequence number of report. + * + * @param sequenceNumber the sequenceNumber value to set + * @return the DeployedApplicationNewHealthReportEvent object itself. + */ + public DeployedApplicationNewHealthReportEvent withSequenceNumber(long sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get description of report. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of report. + * + * @param description the description value to set + * @return the DeployedApplicationNewHealthReportEvent object itself. + */ + public DeployedApplicationNewHealthReportEvent withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get indicates the removal when it expires. + * + * @return the removeWhenExpired value + */ + public boolean removeWhenExpired() { + return this.removeWhenExpired; + } + + /** + * Set indicates the removal when it expires. + * + * @param removeWhenExpired the removeWhenExpired value to set + * @return the DeployedApplicationNewHealthReportEvent object itself. + */ + public DeployedApplicationNewHealthReportEvent withRemoveWhenExpired(boolean removeWhenExpired) { + this.removeWhenExpired = removeWhenExpired; + return this; + } + + /** + * Get source time. + * + * @return the sourceUtcTimestamp value + */ + public DateTime sourceUtcTimestamp() { + return this.sourceUtcTimestamp; + } + + /** + * Set source time. + * + * @param sourceUtcTimestamp the sourceUtcTimestamp value to set + * @return the DeployedApplicationNewHealthReportEvent object itself. + */ + public DeployedApplicationNewHealthReportEvent withSourceUtcTimestamp(DateTime sourceUtcTimestamp) { + this.sourceUtcTimestamp = sourceUtcTimestamp; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedServicePackageHealthReportExpiredEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedServicePackageHealthReportExpiredEvent.java new file mode 100644 index 0000000000000..06c7e3ed6351d --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedServicePackageHealthReportExpiredEvent.java @@ -0,0 +1,335 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ApplicationEventInner; + +/** + * Deployed Service Health Report Expired event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("DeployedServicePackageHealthReportExpired") +public class DeployedServicePackageHealthReportExpiredEvent extends ApplicationEventInner { + /** + * Service manifest name. + */ + @JsonProperty(value = "ServiceManifest", required = true) + private String serviceManifest; + + /** + * Id of Service package instance. + */ + @JsonProperty(value = "ServicePackageInstanceId", required = true) + private long servicePackageInstanceId; + + /** + * Id of Service package activation. + */ + @JsonProperty(value = "ServicePackageActivationId", required = true) + private String servicePackageActivationId; + + /** + * The name of a Service Fabric node. + */ + @JsonProperty(value = "NodeName", required = true) + private String nodeName; + + /** + * Id of report source. + */ + @JsonProperty(value = "SourceId", required = true) + private String sourceId; + + /** + * Describes the property. + */ + @JsonProperty(value = "Property", required = true) + private String property; + + /** + * Describes the property health state. + */ + @JsonProperty(value = "HealthState", required = true) + private String healthState; + + /** + * Time to live in milli-seconds. + */ + @JsonProperty(value = "TimeToLiveMs", required = true) + private long timeToLiveMs; + + /** + * Sequence number of report. + */ + @JsonProperty(value = "SequenceNumber", required = true) + private long sequenceNumber; + + /** + * Description of report. + */ + @JsonProperty(value = "Description", required = true) + private String description; + + /** + * Indicates the removal when it expires. + */ + @JsonProperty(value = "RemoveWhenExpired", required = true) + private boolean removeWhenExpired; + + /** + * Source time. + */ + @JsonProperty(value = "SourceUtcTimestamp", required = true) + private DateTime sourceUtcTimestamp; + + /** + * Get service manifest name. + * + * @return the serviceManifest value + */ + public String serviceManifest() { + return this.serviceManifest; + } + + /** + * Set service manifest name. + * + * @param serviceManifest the serviceManifest value to set + * @return the DeployedServicePackageHealthReportExpiredEvent object itself. + */ + public DeployedServicePackageHealthReportExpiredEvent withServiceManifest(String serviceManifest) { + this.serviceManifest = serviceManifest; + return this; + } + + /** + * Get id of Service package instance. + * + * @return the servicePackageInstanceId value + */ + public long servicePackageInstanceId() { + return this.servicePackageInstanceId; + } + + /** + * Set id of Service package instance. + * + * @param servicePackageInstanceId the servicePackageInstanceId value to set + * @return the DeployedServicePackageHealthReportExpiredEvent object itself. + */ + public DeployedServicePackageHealthReportExpiredEvent withServicePackageInstanceId(long servicePackageInstanceId) { + this.servicePackageInstanceId = servicePackageInstanceId; + return this; + } + + /** + * Get id of Service package activation. + * + * @return the servicePackageActivationId value + */ + public String servicePackageActivationId() { + return this.servicePackageActivationId; + } + + /** + * Set id of Service package activation. + * + * @param servicePackageActivationId the servicePackageActivationId value to set + * @return the DeployedServicePackageHealthReportExpiredEvent object itself. + */ + public DeployedServicePackageHealthReportExpiredEvent withServicePackageActivationId(String servicePackageActivationId) { + this.servicePackageActivationId = servicePackageActivationId; + return this; + } + + /** + * Get the name of a Service Fabric node. + * + * @return the nodeName value + */ + public String nodeName() { + return this.nodeName; + } + + /** + * Set the name of a Service Fabric node. + * + * @param nodeName the nodeName value to set + * @return the DeployedServicePackageHealthReportExpiredEvent object itself. + */ + public DeployedServicePackageHealthReportExpiredEvent withNodeName(String nodeName) { + this.nodeName = nodeName; + return this; + } + + /** + * Get id of report source. + * + * @return the sourceId value + */ + public String sourceId() { + return this.sourceId; + } + + /** + * Set id of report source. + * + * @param sourceId the sourceId value to set + * @return the DeployedServicePackageHealthReportExpiredEvent object itself. + */ + public DeployedServicePackageHealthReportExpiredEvent withSourceId(String sourceId) { + this.sourceId = sourceId; + return this; + } + + /** + * Get describes the property. + * + * @return the property value + */ + public String property() { + return this.property; + } + + /** + * Set describes the property. + * + * @param property the property value to set + * @return the DeployedServicePackageHealthReportExpiredEvent object itself. + */ + public DeployedServicePackageHealthReportExpiredEvent withProperty(String property) { + this.property = property; + return this; + } + + /** + * Get describes the property health state. + * + * @return the healthState value + */ + public String healthState() { + return this.healthState; + } + + /** + * Set describes the property health state. + * + * @param healthState the healthState value to set + * @return the DeployedServicePackageHealthReportExpiredEvent object itself. + */ + public DeployedServicePackageHealthReportExpiredEvent withHealthState(String healthState) { + this.healthState = healthState; + return this; + } + + /** + * Get time to live in milli-seconds. + * + * @return the timeToLiveMs value + */ + public long timeToLiveMs() { + return this.timeToLiveMs; + } + + /** + * Set time to live in milli-seconds. + * + * @param timeToLiveMs the timeToLiveMs value to set + * @return the DeployedServicePackageHealthReportExpiredEvent object itself. + */ + public DeployedServicePackageHealthReportExpiredEvent withTimeToLiveMs(long timeToLiveMs) { + this.timeToLiveMs = timeToLiveMs; + return this; + } + + /** + * Get sequence number of report. + * + * @return the sequenceNumber value + */ + public long sequenceNumber() { + return this.sequenceNumber; + } + + /** + * Set sequence number of report. + * + * @param sequenceNumber the sequenceNumber value to set + * @return the DeployedServicePackageHealthReportExpiredEvent object itself. + */ + public DeployedServicePackageHealthReportExpiredEvent withSequenceNumber(long sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get description of report. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of report. + * + * @param description the description value to set + * @return the DeployedServicePackageHealthReportExpiredEvent object itself. + */ + public DeployedServicePackageHealthReportExpiredEvent withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get indicates the removal when it expires. + * + * @return the removeWhenExpired value + */ + public boolean removeWhenExpired() { + return this.removeWhenExpired; + } + + /** + * Set indicates the removal when it expires. + * + * @param removeWhenExpired the removeWhenExpired value to set + * @return the DeployedServicePackageHealthReportExpiredEvent object itself. + */ + public DeployedServicePackageHealthReportExpiredEvent withRemoveWhenExpired(boolean removeWhenExpired) { + this.removeWhenExpired = removeWhenExpired; + return this; + } + + /** + * Get source time. + * + * @return the sourceUtcTimestamp value + */ + public DateTime sourceUtcTimestamp() { + return this.sourceUtcTimestamp; + } + + /** + * Set source time. + * + * @param sourceUtcTimestamp the sourceUtcTimestamp value to set + * @return the DeployedServicePackageHealthReportExpiredEvent object itself. + */ + public DeployedServicePackageHealthReportExpiredEvent withSourceUtcTimestamp(DateTime sourceUtcTimestamp) { + this.sourceUtcTimestamp = sourceUtcTimestamp; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedServicePackageNewHealthReportEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedServicePackageNewHealthReportEvent.java new file mode 100644 index 0000000000000..8bf7038556783 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DeployedServicePackageNewHealthReportEvent.java @@ -0,0 +1,335 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ApplicationEventInner; + +/** + * Deployed Service Health Report Created event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("DeployedServicePackageNewHealthReport") +public class DeployedServicePackageNewHealthReportEvent extends ApplicationEventInner { + /** + * Service manifest name. + */ + @JsonProperty(value = "ServiceManifestName", required = true) + private String serviceManifestName; + + /** + * Id of Service package instance. + */ + @JsonProperty(value = "ServicePackageInstanceId", required = true) + private long servicePackageInstanceId; + + /** + * Id of Service package activation. + */ + @JsonProperty(value = "ServicePackageActivationId", required = true) + private String servicePackageActivationId; + + /** + * The name of a Service Fabric node. + */ + @JsonProperty(value = "NodeName", required = true) + private String nodeName; + + /** + * Id of report source. + */ + @JsonProperty(value = "SourceId", required = true) + private String sourceId; + + /** + * Describes the property. + */ + @JsonProperty(value = "Property", required = true) + private String property; + + /** + * Describes the property health state. + */ + @JsonProperty(value = "HealthState", required = true) + private String healthState; + + /** + * Time to live in milli-seconds. + */ + @JsonProperty(value = "TimeToLiveMs", required = true) + private long timeToLiveMs; + + /** + * Sequence number of report. + */ + @JsonProperty(value = "SequenceNumber", required = true) + private long sequenceNumber; + + /** + * Description of report. + */ + @JsonProperty(value = "Description", required = true) + private String description; + + /** + * Indicates the removal when it expires. + */ + @JsonProperty(value = "RemoveWhenExpired", required = true) + private boolean removeWhenExpired; + + /** + * Source time. + */ + @JsonProperty(value = "SourceUtcTimestamp", required = true) + private DateTime sourceUtcTimestamp; + + /** + * Get service manifest name. + * + * @return the serviceManifestName value + */ + public String serviceManifestName() { + return this.serviceManifestName; + } + + /** + * Set service manifest name. + * + * @param serviceManifestName the serviceManifestName value to set + * @return the DeployedServicePackageNewHealthReportEvent object itself. + */ + public DeployedServicePackageNewHealthReportEvent withServiceManifestName(String serviceManifestName) { + this.serviceManifestName = serviceManifestName; + return this; + } + + /** + * Get id of Service package instance. + * + * @return the servicePackageInstanceId value + */ + public long servicePackageInstanceId() { + return this.servicePackageInstanceId; + } + + /** + * Set id of Service package instance. + * + * @param servicePackageInstanceId the servicePackageInstanceId value to set + * @return the DeployedServicePackageNewHealthReportEvent object itself. + */ + public DeployedServicePackageNewHealthReportEvent withServicePackageInstanceId(long servicePackageInstanceId) { + this.servicePackageInstanceId = servicePackageInstanceId; + return this; + } + + /** + * Get id of Service package activation. + * + * @return the servicePackageActivationId value + */ + public String servicePackageActivationId() { + return this.servicePackageActivationId; + } + + /** + * Set id of Service package activation. + * + * @param servicePackageActivationId the servicePackageActivationId value to set + * @return the DeployedServicePackageNewHealthReportEvent object itself. + */ + public DeployedServicePackageNewHealthReportEvent withServicePackageActivationId(String servicePackageActivationId) { + this.servicePackageActivationId = servicePackageActivationId; + return this; + } + + /** + * Get the name of a Service Fabric node. + * + * @return the nodeName value + */ + public String nodeName() { + return this.nodeName; + } + + /** + * Set the name of a Service Fabric node. + * + * @param nodeName the nodeName value to set + * @return the DeployedServicePackageNewHealthReportEvent object itself. + */ + public DeployedServicePackageNewHealthReportEvent withNodeName(String nodeName) { + this.nodeName = nodeName; + return this; + } + + /** + * Get id of report source. + * + * @return the sourceId value + */ + public String sourceId() { + return this.sourceId; + } + + /** + * Set id of report source. + * + * @param sourceId the sourceId value to set + * @return the DeployedServicePackageNewHealthReportEvent object itself. + */ + public DeployedServicePackageNewHealthReportEvent withSourceId(String sourceId) { + this.sourceId = sourceId; + return this; + } + + /** + * Get describes the property. + * + * @return the property value + */ + public String property() { + return this.property; + } + + /** + * Set describes the property. + * + * @param property the property value to set + * @return the DeployedServicePackageNewHealthReportEvent object itself. + */ + public DeployedServicePackageNewHealthReportEvent withProperty(String property) { + this.property = property; + return this; + } + + /** + * Get describes the property health state. + * + * @return the healthState value + */ + public String healthState() { + return this.healthState; + } + + /** + * Set describes the property health state. + * + * @param healthState the healthState value to set + * @return the DeployedServicePackageNewHealthReportEvent object itself. + */ + public DeployedServicePackageNewHealthReportEvent withHealthState(String healthState) { + this.healthState = healthState; + return this; + } + + /** + * Get time to live in milli-seconds. + * + * @return the timeToLiveMs value + */ + public long timeToLiveMs() { + return this.timeToLiveMs; + } + + /** + * Set time to live in milli-seconds. + * + * @param timeToLiveMs the timeToLiveMs value to set + * @return the DeployedServicePackageNewHealthReportEvent object itself. + */ + public DeployedServicePackageNewHealthReportEvent withTimeToLiveMs(long timeToLiveMs) { + this.timeToLiveMs = timeToLiveMs; + return this; + } + + /** + * Get sequence number of report. + * + * @return the sequenceNumber value + */ + public long sequenceNumber() { + return this.sequenceNumber; + } + + /** + * Set sequence number of report. + * + * @param sequenceNumber the sequenceNumber value to set + * @return the DeployedServicePackageNewHealthReportEvent object itself. + */ + public DeployedServicePackageNewHealthReportEvent withSequenceNumber(long sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get description of report. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of report. + * + * @param description the description value to set + * @return the DeployedServicePackageNewHealthReportEvent object itself. + */ + public DeployedServicePackageNewHealthReportEvent withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get indicates the removal when it expires. + * + * @return the removeWhenExpired value + */ + public boolean removeWhenExpired() { + return this.removeWhenExpired; + } + + /** + * Set indicates the removal when it expires. + * + * @param removeWhenExpired the removeWhenExpired value to set + * @return the DeployedServicePackageNewHealthReportEvent object itself. + */ + public DeployedServicePackageNewHealthReportEvent withRemoveWhenExpired(boolean removeWhenExpired) { + this.removeWhenExpired = removeWhenExpired; + return this; + } + + /** + * Get source time. + * + * @return the sourceUtcTimestamp value + */ + public DateTime sourceUtcTimestamp() { + return this.sourceUtcTimestamp; + } + + /** + * Set source time. + * + * @param sourceUtcTimestamp the sourceUtcTimestamp value to set + * @return the DeployedServicePackageNewHealthReportEvent object itself. + */ + public DeployedServicePackageNewHealthReportEvent withSourceUtcTimestamp(DateTime sourceUtcTimestamp) { + this.sourceUtcTimestamp = sourceUtcTimestamp; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DiagnosticsSinkProperties.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DiagnosticsSinkProperties.java index 7770c6ac40345..a0f84455f5518 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DiagnosticsSinkProperties.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DiagnosticsSinkProperties.java @@ -11,12 +11,16 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; /** * Properties of a DiagnosticsSink. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("DiagnosticsSinkProperties") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureInternalMonitoringPipeline", value = AzureInternalMonitoringPipelineSinkDescription.class) +}) public class DiagnosticsSinkProperties { /** * Name of the sink. This value is referenced by diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DisableBackupDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DisableBackupDescription.java new file mode 100644 index 0000000000000..b10c496755025 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/DisableBackupDescription.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * It describes the body parameters while disabling backup of a backup + * entity(Application/Service/Partition). + */ +public class DisableBackupDescription { + /** + * 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. + */ + @JsonProperty(value = "CleanBackup", required = true) + private boolean cleanBackup; + + /** + * Get 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. + * + * @return the cleanBackup value + */ + public boolean cleanBackup() { + return this.cleanBackup; + } + + /** + * Set 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 cleanBackup the cleanBackup value to set + * @return the DisableBackupDescription object itself. + */ + public DisableBackupDescription withCleanBackup(boolean cleanBackup) { + this.cleanBackup = cleanBackup; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EndpointRef.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EndpointRef.java new file mode 100644 index 0000000000000..596c26e975439 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/EndpointRef.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a reference to a service endpoint. + */ +public class EndpointRef { + /** + * Name of the endpoint. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get name of the endpoint. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the endpoint. + * + * @param name the name value to set + * @return the EndpointRef object itself. + */ + public EndpointRef withName(String name) { + this.name = name; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FabricErrorCodes.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FabricErrorCodes.java index 533453189cb6e..1ddcc42f084dd 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FabricErrorCodes.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FabricErrorCodes.java @@ -265,6 +265,9 @@ public final class FabricErrorCodes extends ExpandableStringEnum /** Static value ApplicationDeleted for FabricEventKind. */ public static final FabricEventKind APPLICATION_DELETED = fromString("ApplicationDeleted"); - /** Static value ApplicationHealthReportCreated for FabricEventKind. */ - public static final FabricEventKind APPLICATION_HEALTH_REPORT_CREATED = fromString("ApplicationHealthReportCreated"); + /** Static value ApplicationNewHealthReport for FabricEventKind. */ + public static final FabricEventKind APPLICATION_NEW_HEALTH_REPORT = fromString("ApplicationNewHealthReport"); /** Static value ApplicationHealthReportExpired for FabricEventKind. */ public static final FabricEventKind APPLICATION_HEALTH_REPORT_EXPIRED = fromString("ApplicationHealthReportExpired"); - /** Static value ApplicationUpgradeComplete for FabricEventKind. */ - public static final FabricEventKind APPLICATION_UPGRADE_COMPLETE = fromString("ApplicationUpgradeComplete"); + /** Static value ApplicationUpgradeCompleted for FabricEventKind. */ + public static final FabricEventKind APPLICATION_UPGRADE_COMPLETED = fromString("ApplicationUpgradeCompleted"); - /** Static value ApplicationUpgradeDomainComplete for FabricEventKind. */ - public static final FabricEventKind APPLICATION_UPGRADE_DOMAIN_COMPLETE = fromString("ApplicationUpgradeDomainComplete"); + /** Static value ApplicationUpgradeDomainCompleted for FabricEventKind. */ + public static final FabricEventKind APPLICATION_UPGRADE_DOMAIN_COMPLETED = fromString("ApplicationUpgradeDomainCompleted"); - /** Static value ApplicationUpgradeRollbackComplete for FabricEventKind. */ - public static final FabricEventKind APPLICATION_UPGRADE_ROLLBACK_COMPLETE = fromString("ApplicationUpgradeRollbackComplete"); + /** Static value ApplicationUpgradeRollbackCompleted for FabricEventKind. */ + public static final FabricEventKind APPLICATION_UPGRADE_ROLLBACK_COMPLETED = fromString("ApplicationUpgradeRollbackCompleted"); - /** Static value ApplicationUpgradeRollbackStart for FabricEventKind. */ - public static final FabricEventKind APPLICATION_UPGRADE_ROLLBACK_START = fromString("ApplicationUpgradeRollbackStart"); + /** Static value ApplicationUpgradeRollbackStarted for FabricEventKind. */ + public static final FabricEventKind APPLICATION_UPGRADE_ROLLBACK_STARTED = fromString("ApplicationUpgradeRollbackStarted"); - /** Static value ApplicationUpgradeStart for FabricEventKind. */ - public static final FabricEventKind APPLICATION_UPGRADE_START = fromString("ApplicationUpgradeStart"); + /** Static value ApplicationUpgradeStarted for FabricEventKind. */ + public static final FabricEventKind APPLICATION_UPGRADE_STARTED = fromString("ApplicationUpgradeStarted"); - /** Static value DeployedApplicationHealthReportCreated for FabricEventKind. */ - public static final FabricEventKind DEPLOYED_APPLICATION_HEALTH_REPORT_CREATED = fromString("DeployedApplicationHealthReportCreated"); + /** Static value DeployedApplicationNewHealthReport for FabricEventKind. */ + public static final FabricEventKind DEPLOYED_APPLICATION_NEW_HEALTH_REPORT = fromString("DeployedApplicationNewHealthReport"); /** Static value DeployedApplicationHealthReportExpired for FabricEventKind. */ public static final FabricEventKind DEPLOYED_APPLICATION_HEALTH_REPORT_EXPIRED = fromString("DeployedApplicationHealthReportExpired"); - /** Static value ProcessDeactivated for FabricEventKind. */ - public static final FabricEventKind PROCESS_DEACTIVATED = fromString("ProcessDeactivated"); + /** Static value ApplicationProcessExited for FabricEventKind. */ + public static final FabricEventKind APPLICATION_PROCESS_EXITED = fromString("ApplicationProcessExited"); - /** Static value ContainerDeactivated for FabricEventKind. */ - public static final FabricEventKind CONTAINER_DEACTIVATED = fromString("ContainerDeactivated"); + /** Static value ApplicationContainerInstanceExited for FabricEventKind. */ + public static final FabricEventKind APPLICATION_CONTAINER_INSTANCE_EXITED = fromString("ApplicationContainerInstanceExited"); /** Static value NodeAborted for FabricEventKind. */ public static final FabricEventKind NODE_ABORTED = fromString("NodeAborted"); - /** Static value NodeAborting for FabricEventKind. */ - public static final FabricEventKind NODE_ABORTING = fromString("NodeAborting"); + /** Static value NodeAddedToCluster for FabricEventKind. */ + public static final FabricEventKind NODE_ADDED_TO_CLUSTER = fromString("NodeAddedToCluster"); - /** Static value NodeAdded for FabricEventKind. */ - public static final FabricEventKind NODE_ADDED = fromString("NodeAdded"); + /** Static value NodeClosed for FabricEventKind. */ + public static final FabricEventKind NODE_CLOSED = fromString("NodeClosed"); - /** Static value NodeClose for FabricEventKind. */ - public static final FabricEventKind NODE_CLOSE = fromString("NodeClose"); + /** Static value NodeDeactivateCompleted for FabricEventKind. */ + public static final FabricEventKind NODE_DEACTIVATE_COMPLETED = fromString("NodeDeactivateCompleted"); - /** Static value NodeClosing for FabricEventKind. */ - public static final FabricEventKind NODE_CLOSING = fromString("NodeClosing"); - - /** Static value NodeDeactivateComplete for FabricEventKind. */ - public static final FabricEventKind NODE_DEACTIVATE_COMPLETE = fromString("NodeDeactivateComplete"); - - /** Static value NodeDeactivateStart for FabricEventKind. */ - public static final FabricEventKind NODE_DEACTIVATE_START = fromString("NodeDeactivateStart"); + /** Static value NodeDeactivateStarted for FabricEventKind. */ + public static final FabricEventKind NODE_DEACTIVATE_STARTED = fromString("NodeDeactivateStarted"); /** Static value NodeDown for FabricEventKind. */ public static final FabricEventKind NODE_DOWN = fromString("NodeDown"); - /** Static value NodeHealthReportCreated for FabricEventKind. */ - public static final FabricEventKind NODE_HEALTH_REPORT_CREATED = fromString("NodeHealthReportCreated"); + /** Static value NodeNewHealthReport for FabricEventKind. */ + public static final FabricEventKind NODE_NEW_HEALTH_REPORT = fromString("NodeNewHealthReport"); /** Static value NodeHealthReportExpired for FabricEventKind. */ public static final FabricEventKind NODE_HEALTH_REPORT_EXPIRED = fromString("NodeHealthReportExpired"); - /** Static value NodeOpenedSuccess for FabricEventKind. */ - public static final FabricEventKind NODE_OPENED_SUCCESS = fromString("NodeOpenedSuccess"); + /** Static value NodeOpenSucceeded for FabricEventKind. */ + public static final FabricEventKind NODE_OPEN_SUCCEEDED = fromString("NodeOpenSucceeded"); /** Static value NodeOpenFailed for FabricEventKind. */ public static final FabricEventKind NODE_OPEN_FAILED = fromString("NodeOpenFailed"); - /** Static value NodeOpening for FabricEventKind. */ - public static final FabricEventKind NODE_OPENING = fromString("NodeOpening"); - - /** Static value NodeRemoved for FabricEventKind. */ - public static final FabricEventKind NODE_REMOVED = fromString("NodeRemoved"); + /** Static value NodeRemovedFromCluster for FabricEventKind. */ + public static final FabricEventKind NODE_REMOVED_FROM_CLUSTER = fromString("NodeRemovedFromCluster"); /** Static value NodeUp for FabricEventKind. */ public static final FabricEventKind NODE_UP = fromString("NodeUp"); - /** Static value PartitionHealthReportCreated for FabricEventKind. */ - public static final FabricEventKind PARTITION_HEALTH_REPORT_CREATED = fromString("PartitionHealthReportCreated"); + /** Static value PartitionNewHealthReport for FabricEventKind. */ + public static final FabricEventKind PARTITION_NEW_HEALTH_REPORT = fromString("PartitionNewHealthReport"); /** Static value PartitionHealthReportExpired for FabricEventKind. */ public static final FabricEventKind PARTITION_HEALTH_REPORT_EXPIRED = fromString("PartitionHealthReportExpired"); - /** Static value PartitionReconfigurationCompleted for FabricEventKind. */ - public static final FabricEventKind PARTITION_RECONFIGURATION_COMPLETED = fromString("PartitionReconfigurationCompleted"); + /** Static value PartitionReconfigured for FabricEventKind. */ + public static final FabricEventKind PARTITION_RECONFIGURED = fromString("PartitionReconfigured"); /** Static value PartitionPrimaryMoveAnalysis for FabricEventKind. */ public static final FabricEventKind PARTITION_PRIMARY_MOVE_ANALYSIS = fromString("PartitionPrimaryMoveAnalysis"); @@ -142,50 +133,50 @@ public final class FabricEventKind extends ExpandableStringEnum /** Static value ServiceDeleted for FabricEventKind. */ public static final FabricEventKind SERVICE_DELETED = fromString("ServiceDeleted"); - /** Static value ServiceHealthReportCreated for FabricEventKind. */ - public static final FabricEventKind SERVICE_HEALTH_REPORT_CREATED = fromString("ServiceHealthReportCreated"); + /** Static value ServiceNewHealthReport for FabricEventKind. */ + public static final FabricEventKind SERVICE_NEW_HEALTH_REPORT = fromString("ServiceNewHealthReport"); /** Static value ServiceHealthReportExpired for FabricEventKind. */ public static final FabricEventKind SERVICE_HEALTH_REPORT_EXPIRED = fromString("ServiceHealthReportExpired"); - /** Static value DeployedServiceHealthReportCreated for FabricEventKind. */ - public static final FabricEventKind DEPLOYED_SERVICE_HEALTH_REPORT_CREATED = fromString("DeployedServiceHealthReportCreated"); + /** Static value DeployedServicePackageNewHealthReport for FabricEventKind. */ + public static final FabricEventKind DEPLOYED_SERVICE_PACKAGE_NEW_HEALTH_REPORT = fromString("DeployedServicePackageNewHealthReport"); - /** Static value DeployedServiceHealthReportExpired for FabricEventKind. */ - public static final FabricEventKind DEPLOYED_SERVICE_HEALTH_REPORT_EXPIRED = fromString("DeployedServiceHealthReportExpired"); + /** Static value DeployedServicePackageHealthReportExpired for FabricEventKind. */ + public static final FabricEventKind DEPLOYED_SERVICE_PACKAGE_HEALTH_REPORT_EXPIRED = fromString("DeployedServicePackageHealthReportExpired"); - /** Static value StatefulReplicaHealthReportCreated for FabricEventKind. */ - public static final FabricEventKind STATEFUL_REPLICA_HEALTH_REPORT_CREATED = fromString("StatefulReplicaHealthReportCreated"); + /** Static value StatefulReplicaNewHealthReport for FabricEventKind. */ + public static final FabricEventKind STATEFUL_REPLICA_NEW_HEALTH_REPORT = fromString("StatefulReplicaNewHealthReport"); /** Static value StatefulReplicaHealthReportExpired for FabricEventKind. */ public static final FabricEventKind STATEFUL_REPLICA_HEALTH_REPORT_EXPIRED = fromString("StatefulReplicaHealthReportExpired"); - /** Static value StatelessReplicaHealthReportCreated for FabricEventKind. */ - public static final FabricEventKind STATELESS_REPLICA_HEALTH_REPORT_CREATED = fromString("StatelessReplicaHealthReportCreated"); + /** Static value StatelessReplicaNewHealthReport for FabricEventKind. */ + public static final FabricEventKind STATELESS_REPLICA_NEW_HEALTH_REPORT = fromString("StatelessReplicaNewHealthReport"); /** Static value StatelessReplicaHealthReportExpired for FabricEventKind. */ public static final FabricEventKind STATELESS_REPLICA_HEALTH_REPORT_EXPIRED = fromString("StatelessReplicaHealthReportExpired"); - /** Static value ClusterHealthReportCreated for FabricEventKind. */ - public static final FabricEventKind CLUSTER_HEALTH_REPORT_CREATED = fromString("ClusterHealthReportCreated"); + /** Static value ClusterNewHealthReport for FabricEventKind. */ + public static final FabricEventKind CLUSTER_NEW_HEALTH_REPORT = fromString("ClusterNewHealthReport"); /** Static value ClusterHealthReportExpired for FabricEventKind. */ public static final FabricEventKind CLUSTER_HEALTH_REPORT_EXPIRED = fromString("ClusterHealthReportExpired"); - /** Static value ClusterUpgradeComplete for FabricEventKind. */ - public static final FabricEventKind CLUSTER_UPGRADE_COMPLETE = fromString("ClusterUpgradeComplete"); + /** Static value ClusterUpgradeCompleted for FabricEventKind. */ + public static final FabricEventKind CLUSTER_UPGRADE_COMPLETED = fromString("ClusterUpgradeCompleted"); - /** Static value ClusterUpgradeDomainComplete for FabricEventKind. */ - public static final FabricEventKind CLUSTER_UPGRADE_DOMAIN_COMPLETE = fromString("ClusterUpgradeDomainComplete"); + /** Static value ClusterUpgradeDomainCompleted for FabricEventKind. */ + public static final FabricEventKind CLUSTER_UPGRADE_DOMAIN_COMPLETED = fromString("ClusterUpgradeDomainCompleted"); - /** Static value ClusterUpgradeRollbackComplete for FabricEventKind. */ - public static final FabricEventKind CLUSTER_UPGRADE_ROLLBACK_COMPLETE = fromString("ClusterUpgradeRollbackComplete"); + /** Static value ClusterUpgradeRollbackCompleted for FabricEventKind. */ + public static final FabricEventKind CLUSTER_UPGRADE_ROLLBACK_COMPLETED = fromString("ClusterUpgradeRollbackCompleted"); - /** Static value ClusterUpgradeRollbackStart for FabricEventKind. */ - public static final FabricEventKind CLUSTER_UPGRADE_ROLLBACK_START = fromString("ClusterUpgradeRollbackStart"); + /** Static value ClusterUpgradeRollbackStarted for FabricEventKind. */ + public static final FabricEventKind CLUSTER_UPGRADE_ROLLBACK_STARTED = fromString("ClusterUpgradeRollbackStarted"); - /** Static value ClusterUpgradeStart for FabricEventKind. */ - public static final FabricEventKind CLUSTER_UPGRADE_START = fromString("ClusterUpgradeStart"); + /** Static value ClusterUpgradeStarted for FabricEventKind. */ + public static final FabricEventKind CLUSTER_UPGRADE_STARTED = fromString("ClusterUpgradeStarted"); /** Static value ChaosStopped for FabricEventKind. */ public static final FabricEventKind CHAOS_STOPPED = fromString("ChaosStopped"); @@ -193,32 +184,23 @@ public final class FabricEventKind extends ExpandableStringEnum /** Static value ChaosStarted for FabricEventKind. */ public static final FabricEventKind CHAOS_STARTED = fromString("ChaosStarted"); - /** Static value ChaosRestartNodeFaultCompleted for FabricEventKind. */ - public static final FabricEventKind CHAOS_RESTART_NODE_FAULT_COMPLETED = fromString("ChaosRestartNodeFaultCompleted"); - - /** Static value ChaosRestartCodePackageFaultScheduled for FabricEventKind. */ - public static final FabricEventKind CHAOS_RESTART_CODE_PACKAGE_FAULT_SCHEDULED = fromString("ChaosRestartCodePackageFaultScheduled"); - - /** Static value ChaosRestartCodePackageFaultCompleted for FabricEventKind. */ - public static final FabricEventKind CHAOS_RESTART_CODE_PACKAGE_FAULT_COMPLETED = fromString("ChaosRestartCodePackageFaultCompleted"); - - /** Static value ChaosRemoveReplicaFaultScheduled for FabricEventKind. */ - public static final FabricEventKind CHAOS_REMOVE_REPLICA_FAULT_SCHEDULED = fromString("ChaosRemoveReplicaFaultScheduled"); + /** Static value ChaosCodePackageRestartScheduled for FabricEventKind. */ + public static final FabricEventKind CHAOS_CODE_PACKAGE_RESTART_SCHEDULED = fromString("ChaosCodePackageRestartScheduled"); - /** Static value ChaosRemoveReplicaFaultCompleted for FabricEventKind. */ - public static final FabricEventKind CHAOS_REMOVE_REPLICA_FAULT_COMPLETED = fromString("ChaosRemoveReplicaFaultCompleted"); + /** Static value ChaosReplicaRemovalScheduled for FabricEventKind. */ + public static final FabricEventKind CHAOS_REPLICA_REMOVAL_SCHEDULED = fromString("ChaosReplicaRemovalScheduled"); - /** Static value ChaosMoveSecondaryFaultScheduled for FabricEventKind. */ - public static final FabricEventKind CHAOS_MOVE_SECONDARY_FAULT_SCHEDULED = fromString("ChaosMoveSecondaryFaultScheduled"); + /** Static value ChaosPartitionSecondaryMoveScheduled for FabricEventKind. */ + public static final FabricEventKind CHAOS_PARTITION_SECONDARY_MOVE_SCHEDULED = fromString("ChaosPartitionSecondaryMoveScheduled"); - /** Static value ChaosMovePrimaryFaultScheduled for FabricEventKind. */ - public static final FabricEventKind CHAOS_MOVE_PRIMARY_FAULT_SCHEDULED = fromString("ChaosMovePrimaryFaultScheduled"); + /** Static value ChaosPartitionPrimaryMoveScheduled for FabricEventKind. */ + public static final FabricEventKind CHAOS_PARTITION_PRIMARY_MOVE_SCHEDULED = fromString("ChaosPartitionPrimaryMoveScheduled"); - /** Static value ChaosRestartReplicaFaultScheduled for FabricEventKind. */ - public static final FabricEventKind CHAOS_RESTART_REPLICA_FAULT_SCHEDULED = fromString("ChaosRestartReplicaFaultScheduled"); + /** Static value ChaosReplicaRestartScheduled for FabricEventKind. */ + public static final FabricEventKind CHAOS_REPLICA_RESTART_SCHEDULED = fromString("ChaosReplicaRestartScheduled"); - /** Static value ChaosRestartNodeFaultScheduled for FabricEventKind. */ - public static final FabricEventKind CHAOS_RESTART_NODE_FAULT_SCHEDULED = fromString("ChaosRestartNodeFaultScheduled"); + /** Static value ChaosNodeRestartScheduled for FabricEventKind. */ + public static final FabricEventKind CHAOS_NODE_RESTART_SCHEDULED = fromString("ChaosNodeRestartScheduled"); /** * Creates or finds a FabricEventKind from its string representation. diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/GatewayDestination.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/GatewayDestination.java new file mode 100644 index 0000000000000..1d39e80225bde --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/GatewayDestination.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes destination endpoint for routing traffic. + */ +public class GatewayDestination { + /** + * Name of the service fabric Mesh application. + */ + @JsonProperty(value = "applicationName", required = true) + private String applicationName; + + /** + * service that contains the endpoint. + */ + @JsonProperty(value = "serviceName", required = true) + private String serviceName; + + /** + * name of the endpoint in the service. + */ + @JsonProperty(value = "endpointName", required = true) + private String endpointName; + + /** + * Get name of the service fabric Mesh application. + * + * @return the applicationName value + */ + public String applicationName() { + return this.applicationName; + } + + /** + * Set name of the service fabric Mesh application. + * + * @param applicationName the applicationName value to set + * @return the GatewayDestination object itself. + */ + public GatewayDestination withApplicationName(String applicationName) { + this.applicationName = applicationName; + return this; + } + + /** + * Get service that contains the endpoint. + * + * @return the serviceName value + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set service that contains the endpoint. + * + * @param serviceName the serviceName value to set + * @return the GatewayDestination object itself. + */ + public GatewayDestination withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Get name of the endpoint in the service. + * + * @return the endpointName value + */ + public String endpointName() { + return this.endpointName; + } + + /** + * Set name of the endpoint in the service. + * + * @param endpointName the endpointName value to set + * @return the GatewayDestination object itself. + */ + public GatewayDestination withEndpointName(String endpointName) { + this.endpointName = endpointName; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HeaderMatchType.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HeaderMatchType.java new file mode 100644 index 0000000000000..548765033f88f --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HeaderMatchType.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for HeaderMatchType. + */ +public final class HeaderMatchType extends ExpandableStringEnum { + /** Static value exact for HeaderMatchType. */ + public static final HeaderMatchType EXACT = fromString("exact"); + + /** + * Creates or finds a HeaderMatchType from its string representation. + * @param name a name to look for + * @return the corresponding HeaderMatchType + */ + @JsonCreator + public static HeaderMatchType fromString(String name) { + return fromString(name, HeaderMatchType.class); + } + + /** + * @return known HeaderMatchType values + */ + public static Collection values() { + return values(HeaderMatchType.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HealthInformation.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HealthInformation.java index 819f86d7dfb01..669ab550be09b 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HealthInformation.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HealthInformation.java @@ -102,7 +102,7 @@ public class HealthInformation { * 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, + * 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. */ @@ -270,7 +270,7 @@ public HealthInformation withSequenceNumber(String sequenceNumber) { 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 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. * * @return the removeWhenExpired value @@ -284,7 +284,7 @@ public Boolean removeWhenExpired() { 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 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 removeWhenExpired the removeWhenExpired value to set diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HttpConfig.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HttpConfig.java new file mode 100644 index 0000000000000..4ad28b789de46 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HttpConfig.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the http configuration for external connectivity for this network. + */ +public class HttpConfig { + /** + * http gateway config name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Specifies the port at which the service endpoint below needs to be + * exposed. + */ + @JsonProperty(value = "port", required = true) + private int port; + + /** + * description for routing. + */ + @JsonProperty(value = "hosts", required = true) + private List hosts; + + /** + * Get http gateway config name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set http gateway config name. + * + * @param name the name value to set + * @return the HttpConfig object itself. + */ + public HttpConfig withName(String name) { + this.name = name; + return this; + } + + /** + * Get specifies the port at which the service endpoint below needs to be exposed. + * + * @return the port value + */ + public int port() { + return this.port; + } + + /** + * Set specifies the port at which the service endpoint below needs to be exposed. + * + * @param port the port value to set + * @return the HttpConfig object itself. + */ + public HttpConfig withPort(int port) { + this.port = port; + return this; + } + + /** + * Get description for routing. + * + * @return the hosts value + */ + public List hosts() { + return this.hosts; + } + + /** + * Set description for routing. + * + * @param hosts the hosts value to set + * @return the HttpConfig object itself. + */ + public HttpConfig withHosts(List hosts) { + this.hosts = hosts; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HttpHostConfig.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HttpHostConfig.java new file mode 100644 index 0000000000000..486de76695a68 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HttpHostConfig.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the hostname properties for http routing. + */ +public class HttpHostConfig { + /** + * http hostname config name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * 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. + */ + @JsonProperty(value = "routes", required = true) + private List routes; + + /** + * Get http hostname config name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set http hostname config name. + * + * @param name the name value to set + * @return the HttpHostConfig object itself. + */ + public HttpHostConfig withName(String name) { + this.name = name; + return this; + } + + /** + * Get 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. + * + * @return the routes value + */ + public List routes() { + return this.routes; + } + + /** + * Set 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. + * + * @param routes the routes value to set + * @return the HttpHostConfig object itself. + */ + public HttpHostConfig withRoutes(List routes) { + this.routes = routes; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HttpRouteConfig.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HttpRouteConfig.java new file mode 100644 index 0000000000000..c08089098a037 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HttpRouteConfig.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the hostname properties for http routing. + */ +public class HttpRouteConfig { + /** + * http route name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Describes a rule for http route matching. + */ + @JsonProperty(value = "match", required = true) + private HttpRouteMatchRule match; + + /** + * Describes destination endpoint for routing traffic. + */ + @JsonProperty(value = "destination", required = true) + private GatewayDestination destination; + + /** + * Get http route name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set http route name. + * + * @param name the name value to set + * @return the HttpRouteConfig object itself. + */ + public HttpRouteConfig withName(String name) { + this.name = name; + return this; + } + + /** + * Get describes a rule for http route matching. + * + * @return the match value + */ + public HttpRouteMatchRule match() { + return this.match; + } + + /** + * Set describes a rule for http route matching. + * + * @param match the match value to set + * @return the HttpRouteConfig object itself. + */ + public HttpRouteConfig withMatch(HttpRouteMatchRule match) { + this.match = match; + return this; + } + + /** + * Get describes destination endpoint for routing traffic. + * + * @return the destination value + */ + public GatewayDestination destination() { + return this.destination; + } + + /** + * Set describes destination endpoint for routing traffic. + * + * @param destination the destination value to set + * @return the HttpRouteConfig object itself. + */ + public HttpRouteConfig withDestination(GatewayDestination destination) { + this.destination = destination; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HttpRouteMatchHeader.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HttpRouteMatchHeader.java new file mode 100644 index 0000000000000..b4726ed59a5f2 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HttpRouteMatchHeader.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes header information for http route matching. + */ +public class HttpRouteMatchHeader { + /** + * Name of header to match in request. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Value of header to match in request. + */ + @JsonProperty(value = "value") + private String value; + + /** + * how to match header value. Possible values include: 'exact'. + */ + @JsonProperty(value = "type") + private HeaderMatchType type; + + /** + * Get name of header to match in request. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of header to match in request. + * + * @param name the name value to set + * @return the HttpRouteMatchHeader object itself. + */ + public HttpRouteMatchHeader withName(String name) { + this.name = name; + return this; + } + + /** + * Get value of header to match in request. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set value of header to match in request. + * + * @param value the value value to set + * @return the HttpRouteMatchHeader object itself. + */ + public HttpRouteMatchHeader withValue(String value) { + this.value = value; + return this; + } + + /** + * Get how to match header value. Possible values include: 'exact'. + * + * @return the type value + */ + public HeaderMatchType type() { + return this.type; + } + + /** + * Set how to match header value. Possible values include: 'exact'. + * + * @param type the type value to set + * @return the HttpRouteMatchHeader object itself. + */ + public HttpRouteMatchHeader withType(HeaderMatchType type) { + this.type = type; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HttpRouteMatchPath.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HttpRouteMatchPath.java new file mode 100644 index 0000000000000..abd94fb5a926f --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HttpRouteMatchPath.java @@ -0,0 +1,103 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Path to match for routing. + */ +public class HttpRouteMatchPath { + /** + * Uri path to match for request. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /** + * replacement string for matched part of the Uri. + */ + @JsonProperty(value = "rewrite") + private String rewrite; + + /** + * how to match value in the Uri. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * Creates an instance of HttpRouteMatchPath class. + * @param value uri path to match for request. + */ + public HttpRouteMatchPath() { + type = "prefix"; + } + + /** + * Get uri path to match for request. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set uri path to match for request. + * + * @param value the value value to set + * @return the HttpRouteMatchPath object itself. + */ + public HttpRouteMatchPath withValue(String value) { + this.value = value; + return this; + } + + /** + * Get replacement string for matched part of the Uri. + * + * @return the rewrite value + */ + public String rewrite() { + return this.rewrite; + } + + /** + * Set replacement string for matched part of the Uri. + * + * @param rewrite the rewrite value to set + * @return the HttpRouteMatchPath object itself. + */ + public HttpRouteMatchPath withRewrite(String rewrite) { + this.rewrite = rewrite; + return this; + } + + /** + * Get how to match value in the Uri. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set how to match value in the Uri. + * + * @param type the type value to set + * @return the HttpRouteMatchPath object itself. + */ + public HttpRouteMatchPath withType(String type) { + this.type = type; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HttpRouteMatchRule.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HttpRouteMatchRule.java new file mode 100644 index 0000000000000..6ac8eb0d2cfce --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HttpRouteMatchRule.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a rule for http route matching. + */ +public class HttpRouteMatchRule { + /** + * Path to match for routing. + */ + @JsonProperty(value = "path", required = true) + private HttpRouteMatchPath path; + + /** + * headers and their values to match in request. + */ + @JsonProperty(value = "headers") + private List headers; + + /** + * Get path to match for routing. + * + * @return the path value + */ + public HttpRouteMatchPath path() { + return this.path; + } + + /** + * Set path to match for routing. + * + * @param path the path value to set + * @return the HttpRouteMatchRule object itself. + */ + public HttpRouteMatchRule withPath(HttpRouteMatchPath path) { + this.path = path; + return this; + } + + /** + * Get headers and their values to match in request. + * + * @return the headers value + */ + public List headers() { + return this.headers; + } + + /** + * Set headers and their values to match in request. + * + * @param headers the headers value to set + * @return the HttpRouteMatchRule object itself. + */ + public HttpRouteMatchRule withHeaders(List headers) { + this.headers = headers; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ImageRegistryCredential.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ImageRegistryCredential.java index 981d485e04338..ca5187e47ee12 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ImageRegistryCredential.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ImageRegistryCredential.java @@ -28,7 +28,9 @@ public class ImageRegistryCredential { private String username; /** - * The password for the private registry. + * 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. */ @JsonProperty(value = "password") private String password; @@ -74,7 +76,7 @@ public ImageRegistryCredential withUsername(String username) { } /** - * Get the password for the private registry. + * Get 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. * * @return the password value */ @@ -83,7 +85,7 @@ public String password() { } /** - * Set the password for the private registry. + * Set 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. * * @param password the password value to set * @return the ImageRegistryCredential object itself. diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/InlinedValueSecretResourceProperties.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/InlinedValueSecretResourceProperties.java new file mode 100644 index 0000000000000..22af6c2cfe3a2 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/InlinedValueSecretResourceProperties.java @@ -0,0 +1,24 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * 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. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("inlinedValue") +public class InlinedValueSecretResourceProperties extends SecretResourceProperties { +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/LoadMetricReport.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/LoadMetricReport.java index 39903421dffa0..f147e1b522b60 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/LoadMetricReport.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/LoadMetricReport.java @@ -29,11 +29,18 @@ public class LoadMetricReport { private String name; /** - * The value of the load metric. + * The value of the load metric. In future releases of Service Fabric this + * parameter will be deprecated in favor of CurrentValue. */ @JsonProperty(value = "Value") private String value; + /** + * The value of the load metric. + */ + @JsonProperty(value = "CurrentValue") + private String currentValue; + /** * Get gets the UTC time when the load was reported. * @@ -75,7 +82,7 @@ public LoadMetricReport withName(String name) { } /** - * Get the value of the load metric. + * Get the value of the load metric. In future releases of Service Fabric this parameter will be deprecated in favor of CurrentValue. * * @return the value value */ @@ -84,7 +91,7 @@ public String value() { } /** - * Set the value of the load metric. + * Set the value of the load metric. In future releases of Service Fabric this parameter will be deprecated in favor of CurrentValue. * * @param value the value value to set * @return the LoadMetricReport object itself. @@ -94,4 +101,24 @@ public LoadMetricReport withValue(String value) { return this; } + /** + * Get the value of the load metric. + * + * @return the currentValue value + */ + public String currentValue() { + return this.currentValue; + } + + /** + * Set the value of the load metric. + * + * @param currentValue the currentValue value to set + * @return the LoadMetricReport object itself. + */ + public LoadMetricReport withCurrentValue(String currentValue) { + this.currentValue = currentValue; + return this; + } + } diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/LoadMetricReportInfo.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/LoadMetricReportInfo.java index 2e152d1d58513..d52178ac3faec 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/LoadMetricReportInfo.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/LoadMetricReportInfo.java @@ -22,11 +22,18 @@ public class LoadMetricReportInfo { private String name; /** - * The value of the load for the metric.. + * The value of the load for the metric. In future releases of Service + * Fabric this parameter will be deprecated in favor of CurrentValue. */ @JsonProperty(value = "Value") private Integer value; + /** + * The double value of the load for the metric. + */ + @JsonProperty(value = "CurrentValue") + private String currentValue; + /** * The UTC time when the load is reported. */ @@ -54,7 +61,7 @@ public LoadMetricReportInfo withName(String name) { } /** - * Get the value of the load for the metric.. + * Get the value of the load for the metric. In future releases of Service Fabric this parameter will be deprecated in favor of CurrentValue. * * @return the value value */ @@ -63,7 +70,7 @@ public Integer value() { } /** - * Set the value of the load for the metric.. + * Set the value of the load for the metric. In future releases of Service Fabric this parameter will be deprecated in favor of CurrentValue. * * @param value the value value to set * @return the LoadMetricReportInfo object itself. @@ -73,6 +80,26 @@ public LoadMetricReportInfo withValue(Integer value) { return this; } + /** + * Get the double value of the load for the metric. + * + * @return the currentValue value + */ + public String currentValue() { + return this.currentValue; + } + + /** + * Set the double value of the load for the metric. + * + * @param currentValue the currentValue value to set + * @return the LoadMetricReportInfo object itself. + */ + public LoadMetricReportInfo withCurrentValue(String currentValue) { + this.currentValue = currentValue; + return this; + } + /** * Get the UTC time when the load is reported. * diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/LocalNetworkResourceProperties.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/LocalNetworkResourceProperties.java new file mode 100644 index 0000000000000..ae2c099b1e7c5 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/LocalNetworkResourceProperties.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Information about a Service Fabric container network local to a single + * Service Fabric cluster. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("Local") +public class LocalNetworkResourceProperties extends NetworkResourceProperties { + /** + * Address space for the local container network. + */ + @JsonProperty(value = "networkAddressPrefix") + private String networkAddressPrefix; + + /** + * Get address space for the local container network. + * + * @return the networkAddressPrefix value + */ + public String networkAddressPrefix() { + return this.networkAddressPrefix; + } + + /** + * Set address space for the local container network. + * + * @param networkAddressPrefix the networkAddressPrefix value to set + * @return the LocalNetworkResourceProperties object itself. + */ + public LocalNetworkResourceProperties withNetworkAddressPrefix(String networkAddressPrefix) { + this.networkAddressPrefix = networkAddressPrefix; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NetworkKind.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NetworkKind.java new file mode 100644 index 0000000000000..bf131d1c2f3ff --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NetworkKind.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for NetworkKind. + */ +public final class NetworkKind extends ExpandableStringEnum { + /** Static value Local for NetworkKind. */ + public static final NetworkKind LOCAL = fromString("Local"); + + /** + * Creates or finds a NetworkKind from its string representation. + * @param name a name to look for + * @return the corresponding NetworkKind + */ + @JsonCreator + public static NetworkKind fromString(String name) { + return fromString(name, NetworkKind.class); + } + + /** + * @return known NetworkKind values + */ + public static Collection values() { + return values(NetworkKind.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NetworkRef.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NetworkRef.java index 441a63282b5c3..9dde47cc18d4a 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NetworkRef.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NetworkRef.java @@ -8,6 +8,7 @@ package com.microsoft.azure.servicefabric; +import java.util.List; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -20,6 +21,12 @@ public class NetworkRef { @JsonProperty(value = "name") private String name; + /** + * A list of endpoints that are exposed on this network. + */ + @JsonProperty(value = "endpointRefs") + private List endpointRefs; + /** * Get name of the network. * @@ -40,4 +47,24 @@ public NetworkRef withName(String name) { return this; } + /** + * Get a list of endpoints that are exposed on this network. + * + * @return the endpointRefs value + */ + public List endpointRefs() { + return this.endpointRefs; + } + + /** + * Set a list of endpoints that are exposed on this network. + * + * @param endpointRefs the endpointRefs value to set + * @return the NetworkRef object itself. + */ + public NetworkRef withEndpointRefs(List endpointRefs) { + this.endpointRefs = endpointRefs; + return this; + } + } diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NetworkResourceProperties.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NetworkResourceProperties.java new file mode 100644 index 0000000000000..01c2244b1d4e6 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NetworkResourceProperties.java @@ -0,0 +1,82 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Describes properties of a network resource. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("NetworkResourceProperties") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Local", value = LocalNetworkResourceProperties.class) +}) +public class NetworkResourceProperties extends NetworkResourcePropertiesBase { + /** + * User readable description of the network. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Status of the network. Possible values include: 'Unknown', 'Ready', + * 'Upgrading', 'Creating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private ResourceStatus status; + + /** + * Gives additional information about the current status of the network. + */ + @JsonProperty(value = "statusDetails", access = JsonProperty.Access.WRITE_ONLY) + private String statusDetails; + + /** + * Get user readable description of the network. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set user readable description of the network. + * + * @param description the description value to set + * @return the NetworkResourceProperties object itself. + */ + public NetworkResourceProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get status of the network. Possible values include: 'Unknown', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed'. + * + * @return the status value + */ + public ResourceStatus status() { + return this.status; + } + + /** + * Get gives additional information about the current status of the network. + * + * @return the statusDetails value + */ + public String statusDetails() { + return this.statusDetails; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NetworkResourcePropertiesBase.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NetworkResourcePropertiesBase.java new file mode 100644 index 0000000000000..fc74fcb6f82f1 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NetworkResourcePropertiesBase.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * This type describes the properties of a network resource, including its + * kind. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("NetworkResourcePropertiesBase") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "NetworkResourceProperties", value = NetworkResourceProperties.class) +}) +public class NetworkResourcePropertiesBase { +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeAddedToClusterEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeAddedToClusterEvent.java new file mode 100644 index 0000000000000..8f74f33354cbb --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeAddedToClusterEvent.java @@ -0,0 +1,178 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.NodeEventInner; + +/** + * Node Added event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("NodeAddedToCluster") +public class NodeAddedToClusterEvent extends NodeEventInner { + /** + * Id of Node. + */ + @JsonProperty(value = "NodeId", required = true) + private String nodeId; + + /** + * Id of Node instance. + */ + @JsonProperty(value = "NodeInstance", required = true) + private long nodeInstance; + + /** + * Type of Node. + */ + @JsonProperty(value = "NodeType", required = true) + private String nodeType; + + /** + * Fabric version. + */ + @JsonProperty(value = "FabricVersion", required = true) + private String fabricVersion; + + /** + * IP address or FQDN. + */ + @JsonProperty(value = "IpAddressOrFQDN", required = true) + private String ipAddressOrFQDN; + + /** + * Capacities. + */ + @JsonProperty(value = "NodeCapacities", required = true) + private String nodeCapacities; + + /** + * Get id of Node. + * + * @return the nodeId value + */ + public String nodeId() { + return this.nodeId; + } + + /** + * Set id of Node. + * + * @param nodeId the nodeId value to set + * @return the NodeAddedToClusterEvent object itself. + */ + public NodeAddedToClusterEvent withNodeId(String nodeId) { + this.nodeId = nodeId; + return this; + } + + /** + * Get id of Node instance. + * + * @return the nodeInstance value + */ + public long nodeInstance() { + return this.nodeInstance; + } + + /** + * Set id of Node instance. + * + * @param nodeInstance the nodeInstance value to set + * @return the NodeAddedToClusterEvent object itself. + */ + public NodeAddedToClusterEvent withNodeInstance(long nodeInstance) { + this.nodeInstance = nodeInstance; + return this; + } + + /** + * Get type of Node. + * + * @return the nodeType value + */ + public String nodeType() { + return this.nodeType; + } + + /** + * Set type of Node. + * + * @param nodeType the nodeType value to set + * @return the NodeAddedToClusterEvent object itself. + */ + public NodeAddedToClusterEvent withNodeType(String nodeType) { + this.nodeType = nodeType; + return this; + } + + /** + * Get fabric version. + * + * @return the fabricVersion value + */ + public String fabricVersion() { + return this.fabricVersion; + } + + /** + * Set fabric version. + * + * @param fabricVersion the fabricVersion value to set + * @return the NodeAddedToClusterEvent object itself. + */ + public NodeAddedToClusterEvent withFabricVersion(String fabricVersion) { + this.fabricVersion = fabricVersion; + return this; + } + + /** + * Get iP address or FQDN. + * + * @return the ipAddressOrFQDN value + */ + public String ipAddressOrFQDN() { + return this.ipAddressOrFQDN; + } + + /** + * Set iP address or FQDN. + * + * @param ipAddressOrFQDN the ipAddressOrFQDN value to set + * @return the NodeAddedToClusterEvent object itself. + */ + public NodeAddedToClusterEvent withIpAddressOrFQDN(String ipAddressOrFQDN) { + this.ipAddressOrFQDN = ipAddressOrFQDN; + return this; + } + + /** + * Get capacities. + * + * @return the nodeCapacities value + */ + public String nodeCapacities() { + return this.nodeCapacities; + } + + /** + * Set capacities. + * + * @param nodeCapacities the nodeCapacities value to set + * @return the NodeAddedToClusterEvent object itself. + */ + public NodeAddedToClusterEvent withNodeCapacities(String nodeCapacities) { + this.nodeCapacities = nodeCapacities; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeClosedEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeClosedEvent.java new file mode 100644 index 0000000000000..a20cb6f33e215 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeClosedEvent.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.NodeEventInner; + +/** + * Node Closed event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("NodeClosed") +public class NodeClosedEvent extends NodeEventInner { + /** + * Id of Node. + */ + @JsonProperty(value = "NodeId", required = true) + private String nodeId; + + /** + * Id of Node instance. + */ + @JsonProperty(value = "NodeInstance", required = true) + private long nodeInstance; + + /** + * Describes error. + */ + @JsonProperty(value = "Error", required = true) + private String error; + + /** + * Get id of Node. + * + * @return the nodeId value + */ + public String nodeId() { + return this.nodeId; + } + + /** + * Set id of Node. + * + * @param nodeId the nodeId value to set + * @return the NodeClosedEvent object itself. + */ + public NodeClosedEvent withNodeId(String nodeId) { + this.nodeId = nodeId; + return this; + } + + /** + * Get id of Node instance. + * + * @return the nodeInstance value + */ + public long nodeInstance() { + return this.nodeInstance; + } + + /** + * Set id of Node instance. + * + * @param nodeInstance the nodeInstance value to set + * @return the NodeClosedEvent object itself. + */ + public NodeClosedEvent withNodeInstance(long nodeInstance) { + this.nodeInstance = nodeInstance; + return this; + } + + /** + * Get describes error. + * + * @return the error value + */ + public String error() { + return this.error; + } + + /** + * Set describes error. + * + * @param error the error value to set + * @return the NodeClosedEvent object itself. + */ + public NodeClosedEvent withError(String error) { + this.error = error; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeDeactivateCompletedEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeDeactivateCompletedEvent.java new file mode 100644 index 0000000000000..2fa93e3f801e8 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeDeactivateCompletedEvent.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.NodeEventInner; + +/** + * Node Deactivate Completed event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("NodeDeactivateCompleted") +public class NodeDeactivateCompletedEvent extends NodeEventInner { + /** + * Id of Node instance. + */ + @JsonProperty(value = "NodeInstance", required = true) + private long nodeInstance; + + /** + * Describes deactivate intent. + */ + @JsonProperty(value = "EffectiveDeactivateIntent", required = true) + private String effectiveDeactivateIntent; + + /** + * Batch Ids. + */ + @JsonProperty(value = "BatchIdsWithDeactivateIntent", required = true) + private String batchIdsWithDeactivateIntent; + + /** + * Start time. + */ + @JsonProperty(value = "StartTime", required = true) + private DateTime startTime; + + /** + * Get id of Node instance. + * + * @return the nodeInstance value + */ + public long nodeInstance() { + return this.nodeInstance; + } + + /** + * Set id of Node instance. + * + * @param nodeInstance the nodeInstance value to set + * @return the NodeDeactivateCompletedEvent object itself. + */ + public NodeDeactivateCompletedEvent withNodeInstance(long nodeInstance) { + this.nodeInstance = nodeInstance; + return this; + } + + /** + * Get describes deactivate intent. + * + * @return the effectiveDeactivateIntent value + */ + public String effectiveDeactivateIntent() { + return this.effectiveDeactivateIntent; + } + + /** + * Set describes deactivate intent. + * + * @param effectiveDeactivateIntent the effectiveDeactivateIntent value to set + * @return the NodeDeactivateCompletedEvent object itself. + */ + public NodeDeactivateCompletedEvent withEffectiveDeactivateIntent(String effectiveDeactivateIntent) { + this.effectiveDeactivateIntent = effectiveDeactivateIntent; + return this; + } + + /** + * Get batch Ids. + * + * @return the batchIdsWithDeactivateIntent value + */ + public String batchIdsWithDeactivateIntent() { + return this.batchIdsWithDeactivateIntent; + } + + /** + * Set batch Ids. + * + * @param batchIdsWithDeactivateIntent the batchIdsWithDeactivateIntent value to set + * @return the NodeDeactivateCompletedEvent object itself. + */ + public NodeDeactivateCompletedEvent withBatchIdsWithDeactivateIntent(String batchIdsWithDeactivateIntent) { + this.batchIdsWithDeactivateIntent = batchIdsWithDeactivateIntent; + return this; + } + + /** + * Get start time. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set start time. + * + * @param startTime the startTime value to set + * @return the NodeDeactivateCompletedEvent object itself. + */ + public NodeDeactivateCompletedEvent withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeDeactivateStartedEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeDeactivateStartedEvent.java new file mode 100644 index 0000000000000..a3fdbb98211fc --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeDeactivateStartedEvent.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.NodeEventInner; + +/** + * Node Deactivate Started event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("NodeDeactivateStarted") +public class NodeDeactivateStartedEvent extends NodeEventInner { + /** + * Id of Node instance. + */ + @JsonProperty(value = "NodeInstance", required = true) + private long nodeInstance; + + /** + * Batch Id. + */ + @JsonProperty(value = "BatchId", required = true) + private String batchId; + + /** + * Describes deactivate intent. + */ + @JsonProperty(value = "DeactivateIntent", required = true) + private String deactivateIntent; + + /** + * Get id of Node instance. + * + * @return the nodeInstance value + */ + public long nodeInstance() { + return this.nodeInstance; + } + + /** + * Set id of Node instance. + * + * @param nodeInstance the nodeInstance value to set + * @return the NodeDeactivateStartedEvent object itself. + */ + public NodeDeactivateStartedEvent withNodeInstance(long nodeInstance) { + this.nodeInstance = nodeInstance; + return this; + } + + /** + * Get batch Id. + * + * @return the batchId value + */ + public String batchId() { + return this.batchId; + } + + /** + * Set batch Id. + * + * @param batchId the batchId value to set + * @return the NodeDeactivateStartedEvent object itself. + */ + public NodeDeactivateStartedEvent withBatchId(String batchId) { + this.batchId = batchId; + return this; + } + + /** + * Get describes deactivate intent. + * + * @return the deactivateIntent value + */ + public String deactivateIntent() { + return this.deactivateIntent; + } + + /** + * Set describes deactivate intent. + * + * @param deactivateIntent the deactivateIntent value to set + * @return the NodeDeactivateStartedEvent object itself. + */ + public NodeDeactivateStartedEvent withDeactivateIntent(String deactivateIntent) { + this.deactivateIntent = deactivateIntent; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeNewHealthReportEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeNewHealthReportEvent.java new file mode 100644 index 0000000000000..8713959777784 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeNewHealthReportEvent.java @@ -0,0 +1,257 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.NodeEventInner; + +/** + * Node Health Report Created event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("NodeNewHealthReport") +public class NodeNewHealthReportEvent extends NodeEventInner { + /** + * Id of Node instance. + */ + @JsonProperty(value = "NodeInstanceId", required = true) + private long nodeInstanceId; + + /** + * Id of report source. + */ + @JsonProperty(value = "SourceId", required = true) + private String sourceId; + + /** + * Describes the property. + */ + @JsonProperty(value = "Property", required = true) + private String property; + + /** + * Describes the property health state. + */ + @JsonProperty(value = "HealthState", required = true) + private String healthState; + + /** + * Time to live in milli-seconds. + */ + @JsonProperty(value = "TimeToLiveMs", required = true) + private long timeToLiveMs; + + /** + * Sequence number of report. + */ + @JsonProperty(value = "SequenceNumber", required = true) + private long sequenceNumber; + + /** + * Description of report. + */ + @JsonProperty(value = "Description", required = true) + private String description; + + /** + * Indicates the removal when it expires. + */ + @JsonProperty(value = "RemoveWhenExpired", required = true) + private boolean removeWhenExpired; + + /** + * Source time. + */ + @JsonProperty(value = "SourceUtcTimestamp", required = true) + private DateTime sourceUtcTimestamp; + + /** + * Get id of Node instance. + * + * @return the nodeInstanceId value + */ + public long nodeInstanceId() { + return this.nodeInstanceId; + } + + /** + * Set id of Node instance. + * + * @param nodeInstanceId the nodeInstanceId value to set + * @return the NodeNewHealthReportEvent object itself. + */ + public NodeNewHealthReportEvent withNodeInstanceId(long nodeInstanceId) { + this.nodeInstanceId = nodeInstanceId; + return this; + } + + /** + * Get id of report source. + * + * @return the sourceId value + */ + public String sourceId() { + return this.sourceId; + } + + /** + * Set id of report source. + * + * @param sourceId the sourceId value to set + * @return the NodeNewHealthReportEvent object itself. + */ + public NodeNewHealthReportEvent withSourceId(String sourceId) { + this.sourceId = sourceId; + return this; + } + + /** + * Get describes the property. + * + * @return the property value + */ + public String property() { + return this.property; + } + + /** + * Set describes the property. + * + * @param property the property value to set + * @return the NodeNewHealthReportEvent object itself. + */ + public NodeNewHealthReportEvent withProperty(String property) { + this.property = property; + return this; + } + + /** + * Get describes the property health state. + * + * @return the healthState value + */ + public String healthState() { + return this.healthState; + } + + /** + * Set describes the property health state. + * + * @param healthState the healthState value to set + * @return the NodeNewHealthReportEvent object itself. + */ + public NodeNewHealthReportEvent withHealthState(String healthState) { + this.healthState = healthState; + return this; + } + + /** + * Get time to live in milli-seconds. + * + * @return the timeToLiveMs value + */ + public long timeToLiveMs() { + return this.timeToLiveMs; + } + + /** + * Set time to live in milli-seconds. + * + * @param timeToLiveMs the timeToLiveMs value to set + * @return the NodeNewHealthReportEvent object itself. + */ + public NodeNewHealthReportEvent withTimeToLiveMs(long timeToLiveMs) { + this.timeToLiveMs = timeToLiveMs; + return this; + } + + /** + * Get sequence number of report. + * + * @return the sequenceNumber value + */ + public long sequenceNumber() { + return this.sequenceNumber; + } + + /** + * Set sequence number of report. + * + * @param sequenceNumber the sequenceNumber value to set + * @return the NodeNewHealthReportEvent object itself. + */ + public NodeNewHealthReportEvent withSequenceNumber(long sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get description of report. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of report. + * + * @param description the description value to set + * @return the NodeNewHealthReportEvent object itself. + */ + public NodeNewHealthReportEvent withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get indicates the removal when it expires. + * + * @return the removeWhenExpired value + */ + public boolean removeWhenExpired() { + return this.removeWhenExpired; + } + + /** + * Set indicates the removal when it expires. + * + * @param removeWhenExpired the removeWhenExpired value to set + * @return the NodeNewHealthReportEvent object itself. + */ + public NodeNewHealthReportEvent withRemoveWhenExpired(boolean removeWhenExpired) { + this.removeWhenExpired = removeWhenExpired; + return this; + } + + /** + * Get source time. + * + * @return the sourceUtcTimestamp value + */ + public DateTime sourceUtcTimestamp() { + return this.sourceUtcTimestamp; + } + + /** + * Set source time. + * + * @param sourceUtcTimestamp the sourceUtcTimestamp value to set + * @return the NodeNewHealthReportEvent object itself. + */ + public NodeNewHealthReportEvent withSourceUtcTimestamp(DateTime sourceUtcTimestamp) { + this.sourceUtcTimestamp = sourceUtcTimestamp; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeOpenSucceededEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeOpenSucceededEvent.java new file mode 100644 index 0000000000000..7af9e670a297d --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeOpenSucceededEvent.java @@ -0,0 +1,230 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.NodeEventInner; + +/** + * Node Opened Succeeded event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("NodeOpenSucceeded") +public class NodeOpenSucceededEvent extends NodeEventInner { + /** + * Id of Node instance. + */ + @JsonProperty(value = "NodeInstance", required = true) + private long nodeInstance; + + /** + * Id of Node. + */ + @JsonProperty(value = "NodeId", required = true) + private String nodeId; + + /** + * Upgrade domain of Node. + */ + @JsonProperty(value = "UpgradeDomain", required = true) + private String upgradeDomain; + + /** + * Fault domain of Node. + */ + @JsonProperty(value = "FaultDomain", required = true) + private String faultDomain; + + /** + * IP address or FQDN. + */ + @JsonProperty(value = "IpAddressOrFQDN", required = true) + private String ipAddressOrFQDN; + + /** + * Name of Host. + */ + @JsonProperty(value = "Hostname", required = true) + private String hostname; + + /** + * Indicates if it is seed node. + */ + @JsonProperty(value = "IsSeedNode", required = true) + private boolean isSeedNode; + + /** + * Version of Node. + */ + @JsonProperty(value = "NodeVersion", required = true) + private String nodeVersion; + + /** + * Get id of Node instance. + * + * @return the nodeInstance value + */ + public long nodeInstance() { + return this.nodeInstance; + } + + /** + * Set id of Node instance. + * + * @param nodeInstance the nodeInstance value to set + * @return the NodeOpenSucceededEvent object itself. + */ + public NodeOpenSucceededEvent withNodeInstance(long nodeInstance) { + this.nodeInstance = nodeInstance; + return this; + } + + /** + * Get id of Node. + * + * @return the nodeId value + */ + public String nodeId() { + return this.nodeId; + } + + /** + * Set id of Node. + * + * @param nodeId the nodeId value to set + * @return the NodeOpenSucceededEvent object itself. + */ + public NodeOpenSucceededEvent withNodeId(String nodeId) { + this.nodeId = nodeId; + return this; + } + + /** + * Get upgrade domain of Node. + * + * @return the upgradeDomain value + */ + public String upgradeDomain() { + return this.upgradeDomain; + } + + /** + * Set upgrade domain of Node. + * + * @param upgradeDomain the upgradeDomain value to set + * @return the NodeOpenSucceededEvent object itself. + */ + public NodeOpenSucceededEvent withUpgradeDomain(String upgradeDomain) { + this.upgradeDomain = upgradeDomain; + return this; + } + + /** + * Get fault domain of Node. + * + * @return the faultDomain value + */ + public String faultDomain() { + return this.faultDomain; + } + + /** + * Set fault domain of Node. + * + * @param faultDomain the faultDomain value to set + * @return the NodeOpenSucceededEvent object itself. + */ + public NodeOpenSucceededEvent withFaultDomain(String faultDomain) { + this.faultDomain = faultDomain; + return this; + } + + /** + * Get iP address or FQDN. + * + * @return the ipAddressOrFQDN value + */ + public String ipAddressOrFQDN() { + return this.ipAddressOrFQDN; + } + + /** + * Set iP address or FQDN. + * + * @param ipAddressOrFQDN the ipAddressOrFQDN value to set + * @return the NodeOpenSucceededEvent object itself. + */ + public NodeOpenSucceededEvent withIpAddressOrFQDN(String ipAddressOrFQDN) { + this.ipAddressOrFQDN = ipAddressOrFQDN; + return this; + } + + /** + * Get name of Host. + * + * @return the hostname value + */ + public String hostname() { + return this.hostname; + } + + /** + * Set name of Host. + * + * @param hostname the hostname value to set + * @return the NodeOpenSucceededEvent object itself. + */ + public NodeOpenSucceededEvent withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Get indicates if it is seed node. + * + * @return the isSeedNode value + */ + public boolean isSeedNode() { + return this.isSeedNode; + } + + /** + * Set indicates if it is seed node. + * + * @param isSeedNode the isSeedNode value to set + * @return the NodeOpenSucceededEvent object itself. + */ + public NodeOpenSucceededEvent withIsSeedNode(boolean isSeedNode) { + this.isSeedNode = isSeedNode; + return this; + } + + /** + * Get version of Node. + * + * @return the nodeVersion value + */ + public String nodeVersion() { + return this.nodeVersion; + } + + /** + * Set version of Node. + * + * @param nodeVersion the nodeVersion value to set + * @return the NodeOpenSucceededEvent object itself. + */ + public NodeOpenSucceededEvent withNodeVersion(String nodeVersion) { + this.nodeVersion = nodeVersion; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeRemovedFromClusterEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeRemovedFromClusterEvent.java new file mode 100644 index 0000000000000..123c39b1164b8 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/NodeRemovedFromClusterEvent.java @@ -0,0 +1,178 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.NodeEventInner; + +/** + * Node Removed event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("NodeRemovedFromCluster") +public class NodeRemovedFromClusterEvent extends NodeEventInner { + /** + * Id of Node. + */ + @JsonProperty(value = "NodeId", required = true) + private String nodeId; + + /** + * Id of Node instance. + */ + @JsonProperty(value = "NodeInstance", required = true) + private long nodeInstance; + + /** + * Type of Node. + */ + @JsonProperty(value = "NodeType", required = true) + private String nodeType; + + /** + * Fabric version. + */ + @JsonProperty(value = "FabricVersion", required = true) + private String fabricVersion; + + /** + * IP address or FQDN. + */ + @JsonProperty(value = "IpAddressOrFQDN", required = true) + private String ipAddressOrFQDN; + + /** + * Capacities. + */ + @JsonProperty(value = "NodeCapacities", required = true) + private String nodeCapacities; + + /** + * Get id of Node. + * + * @return the nodeId value + */ + public String nodeId() { + return this.nodeId; + } + + /** + * Set id of Node. + * + * @param nodeId the nodeId value to set + * @return the NodeRemovedFromClusterEvent object itself. + */ + public NodeRemovedFromClusterEvent withNodeId(String nodeId) { + this.nodeId = nodeId; + return this; + } + + /** + * Get id of Node instance. + * + * @return the nodeInstance value + */ + public long nodeInstance() { + return this.nodeInstance; + } + + /** + * Set id of Node instance. + * + * @param nodeInstance the nodeInstance value to set + * @return the NodeRemovedFromClusterEvent object itself. + */ + public NodeRemovedFromClusterEvent withNodeInstance(long nodeInstance) { + this.nodeInstance = nodeInstance; + return this; + } + + /** + * Get type of Node. + * + * @return the nodeType value + */ + public String nodeType() { + return this.nodeType; + } + + /** + * Set type of Node. + * + * @param nodeType the nodeType value to set + * @return the NodeRemovedFromClusterEvent object itself. + */ + public NodeRemovedFromClusterEvent withNodeType(String nodeType) { + this.nodeType = nodeType; + return this; + } + + /** + * Get fabric version. + * + * @return the fabricVersion value + */ + public String fabricVersion() { + return this.fabricVersion; + } + + /** + * Set fabric version. + * + * @param fabricVersion the fabricVersion value to set + * @return the NodeRemovedFromClusterEvent object itself. + */ + public NodeRemovedFromClusterEvent withFabricVersion(String fabricVersion) { + this.fabricVersion = fabricVersion; + return this; + } + + /** + * Get iP address or FQDN. + * + * @return the ipAddressOrFQDN value + */ + public String ipAddressOrFQDN() { + return this.ipAddressOrFQDN; + } + + /** + * Set iP address or FQDN. + * + * @param ipAddressOrFQDN the ipAddressOrFQDN value to set + * @return the NodeRemovedFromClusterEvent object itself. + */ + public NodeRemovedFromClusterEvent withIpAddressOrFQDN(String ipAddressOrFQDN) { + this.ipAddressOrFQDN = ipAddressOrFQDN; + return this; + } + + /** + * Get capacities. + * + * @return the nodeCapacities value + */ + public String nodeCapacities() { + return this.nodeCapacities; + } + + /** + * Set capacities. + * + * @param nodeCapacities the nodeCapacities value to set + * @return the NodeRemovedFromClusterEvent object itself. + */ + public NodeRemovedFromClusterEvent withNodeCapacities(String nodeCapacities) { + this.nodeCapacities = nodeCapacities; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/OperatingSystemType.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/OperatingSystemType.java new file mode 100644 index 0000000000000..0a48ad44ca057 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/OperatingSystemType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for OperatingSystemType. + */ +public final class OperatingSystemType extends ExpandableStringEnum { + /** Static value Linux for OperatingSystemType. */ + public static final OperatingSystemType LINUX = fromString("Linux"); + + /** Static value Windows for OperatingSystemType. */ + public static final OperatingSystemType WINDOWS = fromString("Windows"); + + /** + * Creates or finds a OperatingSystemType from its string representation. + * @param name a name to look for + * @return the corresponding OperatingSystemType + */ + @JsonCreator + public static OperatingSystemType fromString(String name) { + return fromString(name, OperatingSystemType.class); + } + + /** + * @return known OperatingSystemType values + */ + public static Collection values() { + return values(OperatingSystemType.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionBackupEntity.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionBackupEntity.java index e9d4be26766bb..673423b74939c 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionBackupEntity.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionBackupEntity.java @@ -26,11 +26,7 @@ public class PartitionBackupEntity extends BackupEntity { private String serviceName; /** - * 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. + * The partition ID indentifying the partition. */ @JsonProperty(value = "PartitionId") private UUID partitionId; @@ -56,7 +52,7 @@ public PartitionBackupEntity withServiceName(String serviceName) { } /** - * Get 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. + * Get the partition ID indentifying the partition. * * @return the partitionId value */ @@ -65,7 +61,7 @@ public UUID partitionId() { } /** - * Set 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. + * Set the partition ID indentifying the partition. * * @param partitionId the partitionId value to set * @return the PartitionBackupEntity object itself. diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionNewHealthReportEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionNewHealthReportEvent.java new file mode 100644 index 0000000000000..6963136511e8b --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionNewHealthReportEvent.java @@ -0,0 +1,231 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.PartitionEventInner; + +/** + * Partition Health Report Created event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("PartitionNewHealthReport") +public class PartitionNewHealthReportEvent extends PartitionEventInner { + /** + * Id of report source. + */ + @JsonProperty(value = "SourceId", required = true) + private String sourceId; + + /** + * Describes the property. + */ + @JsonProperty(value = "Property", required = true) + private String property; + + /** + * Describes the property health state. + */ + @JsonProperty(value = "HealthState", required = true) + private String healthState; + + /** + * Time to live in milli-seconds. + */ + @JsonProperty(value = "TimeToLiveMs", required = true) + private long timeToLiveMs; + + /** + * Sequence number of report. + */ + @JsonProperty(value = "SequenceNumber", required = true) + private long sequenceNumber; + + /** + * Description of report. + */ + @JsonProperty(value = "Description", required = true) + private String description; + + /** + * Indicates the removal when it expires. + */ + @JsonProperty(value = "RemoveWhenExpired", required = true) + private boolean removeWhenExpired; + + /** + * Source time. + */ + @JsonProperty(value = "SourceUtcTimestamp", required = true) + private DateTime sourceUtcTimestamp; + + /** + * Get id of report source. + * + * @return the sourceId value + */ + public String sourceId() { + return this.sourceId; + } + + /** + * Set id of report source. + * + * @param sourceId the sourceId value to set + * @return the PartitionNewHealthReportEvent object itself. + */ + public PartitionNewHealthReportEvent withSourceId(String sourceId) { + this.sourceId = sourceId; + return this; + } + + /** + * Get describes the property. + * + * @return the property value + */ + public String property() { + return this.property; + } + + /** + * Set describes the property. + * + * @param property the property value to set + * @return the PartitionNewHealthReportEvent object itself. + */ + public PartitionNewHealthReportEvent withProperty(String property) { + this.property = property; + return this; + } + + /** + * Get describes the property health state. + * + * @return the healthState value + */ + public String healthState() { + return this.healthState; + } + + /** + * Set describes the property health state. + * + * @param healthState the healthState value to set + * @return the PartitionNewHealthReportEvent object itself. + */ + public PartitionNewHealthReportEvent withHealthState(String healthState) { + this.healthState = healthState; + return this; + } + + /** + * Get time to live in milli-seconds. + * + * @return the timeToLiveMs value + */ + public long timeToLiveMs() { + return this.timeToLiveMs; + } + + /** + * Set time to live in milli-seconds. + * + * @param timeToLiveMs the timeToLiveMs value to set + * @return the PartitionNewHealthReportEvent object itself. + */ + public PartitionNewHealthReportEvent withTimeToLiveMs(long timeToLiveMs) { + this.timeToLiveMs = timeToLiveMs; + return this; + } + + /** + * Get sequence number of report. + * + * @return the sequenceNumber value + */ + public long sequenceNumber() { + return this.sequenceNumber; + } + + /** + * Set sequence number of report. + * + * @param sequenceNumber the sequenceNumber value to set + * @return the PartitionNewHealthReportEvent object itself. + */ + public PartitionNewHealthReportEvent withSequenceNumber(long sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get description of report. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of report. + * + * @param description the description value to set + * @return the PartitionNewHealthReportEvent object itself. + */ + public PartitionNewHealthReportEvent withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get indicates the removal when it expires. + * + * @return the removeWhenExpired value + */ + public boolean removeWhenExpired() { + return this.removeWhenExpired; + } + + /** + * Set indicates the removal when it expires. + * + * @param removeWhenExpired the removeWhenExpired value to set + * @return the PartitionNewHealthReportEvent object itself. + */ + public PartitionNewHealthReportEvent withRemoveWhenExpired(boolean removeWhenExpired) { + this.removeWhenExpired = removeWhenExpired; + return this; + } + + /** + * Get source time. + * + * @return the sourceUtcTimestamp value + */ + public DateTime sourceUtcTimestamp() { + return this.sourceUtcTimestamp; + } + + /** + * Set source time. + * + * @param sourceUtcTimestamp the sourceUtcTimestamp value to set + * @return the PartitionNewHealthReportEvent object itself. + */ + public PartitionNewHealthReportEvent withSourceUtcTimestamp(DateTime sourceUtcTimestamp) { + this.sourceUtcTimestamp = sourceUtcTimestamp; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionReconfiguredEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionReconfiguredEvent.java new file mode 100644 index 0000000000000..c22bf7df234db --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionReconfiguredEvent.java @@ -0,0 +1,360 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.PartitionEventInner; + +/** + * Partition Reconfiguration event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("PartitionReconfigured") +public class PartitionReconfiguredEvent extends PartitionEventInner { + /** + * The name of a Service Fabric node. + */ + @JsonProperty(value = "NodeName", required = true) + private String nodeName; + + /** + * Id of Node instance. + */ + @JsonProperty(value = "NodeInstanceId", required = true) + private String nodeInstanceId; + + /** + * Type of Service. + */ + @JsonProperty(value = "ServiceType", required = true) + private String serviceType; + + /** + * CcEpochDataLoss version. + */ + @JsonProperty(value = "CcEpochDataLossVersion", required = true) + private long ccEpochDataLossVersion; + + /** + * CcEpochConfig version. + */ + @JsonProperty(value = "CcEpochConfigVersion", required = true) + private long ccEpochConfigVersion; + + /** + * Type of reconfiguration. + */ + @JsonProperty(value = "ReconfigType", required = true) + private String reconfigType; + + /** + * Describes reconfiguration result. + */ + @JsonProperty(value = "Result", required = true) + private String result; + + /** + * Duration of Phase0 in milli-seconds. + */ + @JsonProperty(value = "Phase0DurationMs", required = true) + private double phase0DurationMs; + + /** + * Duration of Phase1 in milli-seconds. + */ + @JsonProperty(value = "Phase1DurationMs", required = true) + private double phase1DurationMs; + + /** + * Duration of Phase2 in milli-seconds. + */ + @JsonProperty(value = "Phase2DurationMs", required = true) + private double phase2DurationMs; + + /** + * Duration of Phase3 in milli-seconds. + */ + @JsonProperty(value = "Phase3DurationMs", required = true) + private double phase3DurationMs; + + /** + * Duration of Phase4 in milli-seconds. + */ + @JsonProperty(value = "Phase4DurationMs", required = true) + private double phase4DurationMs; + + /** + * Total duration in milli-seconds. + */ + @JsonProperty(value = "TotalDurationMs", required = true) + private double totalDurationMs; + + /** + * Get the name of a Service Fabric node. + * + * @return the nodeName value + */ + public String nodeName() { + return this.nodeName; + } + + /** + * Set the name of a Service Fabric node. + * + * @param nodeName the nodeName value to set + * @return the PartitionReconfiguredEvent object itself. + */ + public PartitionReconfiguredEvent withNodeName(String nodeName) { + this.nodeName = nodeName; + return this; + } + + /** + * Get id of Node instance. + * + * @return the nodeInstanceId value + */ + public String nodeInstanceId() { + return this.nodeInstanceId; + } + + /** + * Set id of Node instance. + * + * @param nodeInstanceId the nodeInstanceId value to set + * @return the PartitionReconfiguredEvent object itself. + */ + public PartitionReconfiguredEvent withNodeInstanceId(String nodeInstanceId) { + this.nodeInstanceId = nodeInstanceId; + return this; + } + + /** + * Get type of Service. + * + * @return the serviceType value + */ + public String serviceType() { + return this.serviceType; + } + + /** + * Set type of Service. + * + * @param serviceType the serviceType value to set + * @return the PartitionReconfiguredEvent object itself. + */ + public PartitionReconfiguredEvent withServiceType(String serviceType) { + this.serviceType = serviceType; + return this; + } + + /** + * Get ccEpochDataLoss version. + * + * @return the ccEpochDataLossVersion value + */ + public long ccEpochDataLossVersion() { + return this.ccEpochDataLossVersion; + } + + /** + * Set ccEpochDataLoss version. + * + * @param ccEpochDataLossVersion the ccEpochDataLossVersion value to set + * @return the PartitionReconfiguredEvent object itself. + */ + public PartitionReconfiguredEvent withCcEpochDataLossVersion(long ccEpochDataLossVersion) { + this.ccEpochDataLossVersion = ccEpochDataLossVersion; + return this; + } + + /** + * Get ccEpochConfig version. + * + * @return the ccEpochConfigVersion value + */ + public long ccEpochConfigVersion() { + return this.ccEpochConfigVersion; + } + + /** + * Set ccEpochConfig version. + * + * @param ccEpochConfigVersion the ccEpochConfigVersion value to set + * @return the PartitionReconfiguredEvent object itself. + */ + public PartitionReconfiguredEvent withCcEpochConfigVersion(long ccEpochConfigVersion) { + this.ccEpochConfigVersion = ccEpochConfigVersion; + return this; + } + + /** + * Get type of reconfiguration. + * + * @return the reconfigType value + */ + public String reconfigType() { + return this.reconfigType; + } + + /** + * Set type of reconfiguration. + * + * @param reconfigType the reconfigType value to set + * @return the PartitionReconfiguredEvent object itself. + */ + public PartitionReconfiguredEvent withReconfigType(String reconfigType) { + this.reconfigType = reconfigType; + return this; + } + + /** + * Get describes reconfiguration result. + * + * @return the result value + */ + public String result() { + return this.result; + } + + /** + * Set describes reconfiguration result. + * + * @param result the result value to set + * @return the PartitionReconfiguredEvent object itself. + */ + public PartitionReconfiguredEvent withResult(String result) { + this.result = result; + return this; + } + + /** + * Get duration of Phase0 in milli-seconds. + * + * @return the phase0DurationMs value + */ + public double phase0DurationMs() { + return this.phase0DurationMs; + } + + /** + * Set duration of Phase0 in milli-seconds. + * + * @param phase0DurationMs the phase0DurationMs value to set + * @return the PartitionReconfiguredEvent object itself. + */ + public PartitionReconfiguredEvent withPhase0DurationMs(double phase0DurationMs) { + this.phase0DurationMs = phase0DurationMs; + return this; + } + + /** + * Get duration of Phase1 in milli-seconds. + * + * @return the phase1DurationMs value + */ + public double phase1DurationMs() { + return this.phase1DurationMs; + } + + /** + * Set duration of Phase1 in milli-seconds. + * + * @param phase1DurationMs the phase1DurationMs value to set + * @return the PartitionReconfiguredEvent object itself. + */ + public PartitionReconfiguredEvent withPhase1DurationMs(double phase1DurationMs) { + this.phase1DurationMs = phase1DurationMs; + return this; + } + + /** + * Get duration of Phase2 in milli-seconds. + * + * @return the phase2DurationMs value + */ + public double phase2DurationMs() { + return this.phase2DurationMs; + } + + /** + * Set duration of Phase2 in milli-seconds. + * + * @param phase2DurationMs the phase2DurationMs value to set + * @return the PartitionReconfiguredEvent object itself. + */ + public PartitionReconfiguredEvent withPhase2DurationMs(double phase2DurationMs) { + this.phase2DurationMs = phase2DurationMs; + return this; + } + + /** + * Get duration of Phase3 in milli-seconds. + * + * @return the phase3DurationMs value + */ + public double phase3DurationMs() { + return this.phase3DurationMs; + } + + /** + * Set duration of Phase3 in milli-seconds. + * + * @param phase3DurationMs the phase3DurationMs value to set + * @return the PartitionReconfiguredEvent object itself. + */ + public PartitionReconfiguredEvent withPhase3DurationMs(double phase3DurationMs) { + this.phase3DurationMs = phase3DurationMs; + return this; + } + + /** + * Get duration of Phase4 in milli-seconds. + * + * @return the phase4DurationMs value + */ + public double phase4DurationMs() { + return this.phase4DurationMs; + } + + /** + * Set duration of Phase4 in milli-seconds. + * + * @param phase4DurationMs the phase4DurationMs value to set + * @return the PartitionReconfiguredEvent object itself. + */ + public PartitionReconfiguredEvent withPhase4DurationMs(double phase4DurationMs) { + this.phase4DurationMs = phase4DurationMs; + return this; + } + + /** + * Get total duration in milli-seconds. + * + * @return the totalDurationMs value + */ + public double totalDurationMs() { + return this.totalDurationMs; + } + + /** + * Set total duration in milli-seconds. + * + * @param totalDurationMs the totalDurationMs value to set + * @return the PartitionReconfiguredEvent object itself. + */ + public PartitionReconfiguredEvent withTotalDurationMs(double totalDurationMs) { + this.totalDurationMs = totalDurationMs; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReliableCollectionsRef.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReliableCollectionsRef.java new file mode 100644 index 0000000000000..d854031665294 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ReliableCollectionsRef.java @@ -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. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifying this parameter adds support for reliable collections. + */ +public class ReliableCollectionsRef { + /** + * Name of ReliableCollection resource. Right now it's not used and you can + * use any string. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * 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. + */ + @JsonProperty(value = "doNotPersistState") + private Boolean doNotPersistState; + + /** + * Get name of ReliableCollection resource. Right now it's not used and you can use any string. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of ReliableCollection resource. Right now it's not used and you can use any string. + * + * @param name the name value to set + * @return the ReliableCollectionsRef object itself. + */ + public ReliableCollectionsRef withName(String name) { + this.name = name; + return this; + } + + /** + * Get 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. + * + * @return the doNotPersistState value + */ + public Boolean doNotPersistState() { + return this.doNotPersistState; + } + + /** + * Set 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. + * + * @param doNotPersistState the doNotPersistState value to set + * @return the ReliableCollectionsRef object itself. + */ + public ReliableCollectionsRef withDoNotPersistState(Boolean doNotPersistState) { + this.doNotPersistState = doNotPersistState; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ResourceStatus.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ResourceStatus.java new file mode 100644 index 0000000000000..f075015aeede8 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ResourceStatus.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ResourceStatus. + */ +public final class ResourceStatus extends ExpandableStringEnum { + /** Static value Unknown for ResourceStatus. */ + public static final ResourceStatus UNKNOWN = fromString("Unknown"); + + /** Static value Ready for ResourceStatus. */ + public static final ResourceStatus READY = fromString("Ready"); + + /** Static value Upgrading for ResourceStatus. */ + public static final ResourceStatus UPGRADING = fromString("Upgrading"); + + /** Static value Creating for ResourceStatus. */ + public static final ResourceStatus CREATING = fromString("Creating"); + + /** Static value Deleting for ResourceStatus. */ + public static final ResourceStatus DELETING = fromString("Deleting"); + + /** Static value Failed for ResourceStatus. */ + public static final ResourceStatus FAILED = fromString("Failed"); + + /** + * Creates or finds a ResourceStatus from its string representation. + * @param name a name to look for + * @return the corresponding ResourceStatus + */ + @JsonCreator + public static ResourceStatus fromString(String name) { + return fromString(name, ResourceStatus.class); + } + + /** + * @return known ResourceStatus values + */ + public static Collection values() { + return values(ResourceStatus.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RetentionPolicyDescription.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RetentionPolicyDescription.java new file mode 100644 index 0000000000000..690c7e27a941c --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RetentionPolicyDescription.java @@ -0,0 +1,24 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Describes the retention policy configured. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "RetentionPolicyType") +@JsonTypeName("RetentionPolicyDescription") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Basic", value = BasicRetentionPolicyDescription.class) +}) +public class RetentionPolicyDescription { +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RetentionPolicyType.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RetentionPolicyType.java new file mode 100644 index 0000000000000..72a3e32ab7bd5 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/RetentionPolicyType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for RetentionPolicyType. + */ +public final class RetentionPolicyType extends ExpandableStringEnum { + /** Static value Basic for RetentionPolicyType. */ + public static final RetentionPolicyType BASIC = fromString("Basic"); + + /** Static value Invalid for RetentionPolicyType. */ + public static final RetentionPolicyType INVALID = fromString("Invalid"); + + /** + * Creates or finds a RetentionPolicyType from its string representation. + * @param name a name to look for + * @return the corresponding RetentionPolicyType + */ + @JsonCreator + public static RetentionPolicyType fromString(String name) { + return fromString(name, RetentionPolicyType.class); + } + + /** + * @return known RetentionPolicyType values + */ + public static Collection values() { + return values(RetentionPolicyType.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SecretKind.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SecretKind.java new file mode 100644 index 0000000000000..dd0d341749d15 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SecretKind.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SecretKind. + */ +public final class SecretKind extends ExpandableStringEnum { + /** Static value inlinedValue for SecretKind. */ + public static final SecretKind INLINED_VALUE = fromString("inlinedValue"); + + /** + * Creates or finds a SecretKind from its string representation. + * @param name a name to look for + * @return the corresponding SecretKind + */ + @JsonCreator + public static SecretKind fromString(String name) { + return fromString(name, SecretKind.class); + } + + /** + * @return known SecretKind values + */ + public static Collection values() { + return values(SecretKind.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SecretResourceProperties.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SecretResourceProperties.java new file mode 100644 index 0000000000000..ac81c3ab689d6 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SecretResourceProperties.java @@ -0,0 +1,110 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Describes the properties of a secret resource. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("SecretResourceProperties") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "inlinedValue", value = InlinedValueSecretResourceProperties.class) +}) +public class SecretResourceProperties extends SecretResourcePropertiesBase { + /** + * User readable description of the secret. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Status of the resource. Possible values include: 'Unknown', 'Ready', + * 'Upgrading', 'Creating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private ResourceStatus status; + + /** + * Gives additional information about the current status of the secret. + */ + @JsonProperty(value = "statusDetails", access = JsonProperty.Access.WRITE_ONLY) + private String statusDetails; + + /** + * 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. + */ + @JsonProperty(value = "contentType") + private String contentType; + + /** + * Get user readable description of the secret. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set user readable description of the secret. + * + * @param description the description value to set + * @return the SecretResourceProperties object itself. + */ + public SecretResourceProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get status of the resource. Possible values include: 'Unknown', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed'. + * + * @return the status value + */ + public ResourceStatus status() { + return this.status; + } + + /** + * Get gives additional information about the current status of the secret. + * + * @return the statusDetails value + */ + public String statusDetails() { + return this.statusDetails; + } + + /** + * Get 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. + * + * @return the contentType value + */ + public String contentType() { + return this.contentType; + } + + /** + * Set 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 contentType the contentType value to set + * @return the SecretResourceProperties object itself. + */ + public SecretResourceProperties withContentType(String contentType) { + this.contentType = contentType; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SecretResourcePropertiesBase.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SecretResourcePropertiesBase.java new file mode 100644 index 0000000000000..66db7bd99cf2e --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SecretResourcePropertiesBase.java @@ -0,0 +1,24 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * This type describes the properties of a secret resource, including its kind. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("SecretResourcePropertiesBase") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "SecretResourceProperties", value = SecretResourceProperties.class) +}) +public class SecretResourcePropertiesBase { +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SecretValueProperties.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SecretValueProperties.java new file mode 100644 index 0000000000000..68bc159184cc0 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SecretValueProperties.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * This type describes properties of secret value resource. + */ +public class SecretValueProperties { + /** + * The actual value of the secret. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the actual value of the secret. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the actual value of the secret. + * + * @param value the value value to set + * @return the SecretValueProperties object itself. + */ + public SecretValueProperties withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceNewHealthReportEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceNewHealthReportEvent.java new file mode 100644 index 0000000000000..41fa487e79ee2 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceNewHealthReportEvent.java @@ -0,0 +1,257 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ServiceEventInner; + +/** + * Service Health Report Created event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("ServiceNewHealthReport") +public class ServiceNewHealthReportEvent extends ServiceEventInner { + /** + * Id of Service instance. + */ + @JsonProperty(value = "InstanceId", required = true) + private long instanceId; + + /** + * Id of report source. + */ + @JsonProperty(value = "SourceId", required = true) + private String sourceId; + + /** + * Describes the property. + */ + @JsonProperty(value = "Property", required = true) + private String property; + + /** + * Describes the property health state. + */ + @JsonProperty(value = "HealthState", required = true) + private String healthState; + + /** + * Time to live in milli-seconds. + */ + @JsonProperty(value = "TimeToLiveMs", required = true) + private long timeToLiveMs; + + /** + * Sequence number of report. + */ + @JsonProperty(value = "SequenceNumber", required = true) + private long sequenceNumber; + + /** + * Description of report. + */ + @JsonProperty(value = "Description", required = true) + private String description; + + /** + * Indicates the removal when it expires. + */ + @JsonProperty(value = "RemoveWhenExpired", required = true) + private boolean removeWhenExpired; + + /** + * Source time. + */ + @JsonProperty(value = "SourceUtcTimestamp", required = true) + private DateTime sourceUtcTimestamp; + + /** + * Get id of Service instance. + * + * @return the instanceId value + */ + public long instanceId() { + return this.instanceId; + } + + /** + * Set id of Service instance. + * + * @param instanceId the instanceId value to set + * @return the ServiceNewHealthReportEvent object itself. + */ + public ServiceNewHealthReportEvent withInstanceId(long instanceId) { + this.instanceId = instanceId; + return this; + } + + /** + * Get id of report source. + * + * @return the sourceId value + */ + public String sourceId() { + return this.sourceId; + } + + /** + * Set id of report source. + * + * @param sourceId the sourceId value to set + * @return the ServiceNewHealthReportEvent object itself. + */ + public ServiceNewHealthReportEvent withSourceId(String sourceId) { + this.sourceId = sourceId; + return this; + } + + /** + * Get describes the property. + * + * @return the property value + */ + public String property() { + return this.property; + } + + /** + * Set describes the property. + * + * @param property the property value to set + * @return the ServiceNewHealthReportEvent object itself. + */ + public ServiceNewHealthReportEvent withProperty(String property) { + this.property = property; + return this; + } + + /** + * Get describes the property health state. + * + * @return the healthState value + */ + public String healthState() { + return this.healthState; + } + + /** + * Set describes the property health state. + * + * @param healthState the healthState value to set + * @return the ServiceNewHealthReportEvent object itself. + */ + public ServiceNewHealthReportEvent withHealthState(String healthState) { + this.healthState = healthState; + return this; + } + + /** + * Get time to live in milli-seconds. + * + * @return the timeToLiveMs value + */ + public long timeToLiveMs() { + return this.timeToLiveMs; + } + + /** + * Set time to live in milli-seconds. + * + * @param timeToLiveMs the timeToLiveMs value to set + * @return the ServiceNewHealthReportEvent object itself. + */ + public ServiceNewHealthReportEvent withTimeToLiveMs(long timeToLiveMs) { + this.timeToLiveMs = timeToLiveMs; + return this; + } + + /** + * Get sequence number of report. + * + * @return the sequenceNumber value + */ + public long sequenceNumber() { + return this.sequenceNumber; + } + + /** + * Set sequence number of report. + * + * @param sequenceNumber the sequenceNumber value to set + * @return the ServiceNewHealthReportEvent object itself. + */ + public ServiceNewHealthReportEvent withSequenceNumber(long sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get description of report. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of report. + * + * @param description the description value to set + * @return the ServiceNewHealthReportEvent object itself. + */ + public ServiceNewHealthReportEvent withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get indicates the removal when it expires. + * + * @return the removeWhenExpired value + */ + public boolean removeWhenExpired() { + return this.removeWhenExpired; + } + + /** + * Set indicates the removal when it expires. + * + * @param removeWhenExpired the removeWhenExpired value to set + * @return the ServiceNewHealthReportEvent object itself. + */ + public ServiceNewHealthReportEvent withRemoveWhenExpired(boolean removeWhenExpired) { + this.removeWhenExpired = removeWhenExpired; + return this; + } + + /** + * Get source time. + * + * @return the sourceUtcTimestamp value + */ + public DateTime sourceUtcTimestamp() { + return this.sourceUtcTimestamp; + } + + /** + * Set source time. + * + * @param sourceUtcTimestamp the sourceUtcTimestamp value to set + * @return the ServiceNewHealthReportEvent object itself. + */ + public ServiceNewHealthReportEvent withSourceUtcTimestamp(DateTime sourceUtcTimestamp) { + this.sourceUtcTimestamp = sourceUtcTimestamp; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceProperties.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceProperties.java new file mode 100644 index 0000000000000..43da3fb58d83e --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceProperties.java @@ -0,0 +1,161 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes properties of a service resource. + */ +public class ServiceProperties { + /** + * User readable description of the service. + */ + @JsonProperty(value = "description") + private String description; + + /** + * The number of replicas of the service to create. Defaults to 1 if not + * specified. + */ + @JsonProperty(value = "replicaCount") + private Integer replicaCount; + + /** + * Auto scaling policies. + */ + @JsonProperty(value = "autoScalingPolicies") + private List autoScalingPolicies; + + /** + * Status of the service. Possible values include: 'Unknown', 'Ready', + * 'Upgrading', 'Creating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private ResourceStatus status; + + /** + * Gives additional information about the current status of the service. + */ + @JsonProperty(value = "statusDetails", access = JsonProperty.Access.WRITE_ONLY) + private String statusDetails; + + /** + * Describes the health state of an application resource. Possible values + * include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown'. + */ + @JsonProperty(value = "healthState", access = JsonProperty.Access.WRITE_ONLY) + private HealthState healthState; + + /** + * 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. + */ + @JsonProperty(value = "unhealthyEvaluation", access = JsonProperty.Access.WRITE_ONLY) + private String unhealthyEvaluation; + + /** + * Get user readable description of the service. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set user readable description of the service. + * + * @param description the description value to set + * @return the ServiceProperties object itself. + */ + public ServiceProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the number of replicas of the service to create. Defaults to 1 if not specified. + * + * @return the replicaCount value + */ + public Integer replicaCount() { + return this.replicaCount; + } + + /** + * Set the number of replicas of the service to create. Defaults to 1 if not specified. + * + * @param replicaCount the replicaCount value to set + * @return the ServiceProperties object itself. + */ + public ServiceProperties withReplicaCount(Integer replicaCount) { + this.replicaCount = replicaCount; + return this; + } + + /** + * Get auto scaling policies. + * + * @return the autoScalingPolicies value + */ + public List autoScalingPolicies() { + return this.autoScalingPolicies; + } + + /** + * Set auto scaling policies. + * + * @param autoScalingPolicies the autoScalingPolicies value to set + * @return the ServiceProperties object itself. + */ + public ServiceProperties withAutoScalingPolicies(List autoScalingPolicies) { + this.autoScalingPolicies = autoScalingPolicies; + return this; + } + + /** + * Get status of the service. Possible values include: 'Unknown', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed'. + * + * @return the status value + */ + public ResourceStatus status() { + return this.status; + } + + /** + * Get gives additional information about the current status of the service. + * + * @return the statusDetails value + */ + public String statusDetails() { + return this.statusDetails; + } + + /** + * Get describes the health state of an application resource. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown'. + * + * @return the healthState value + */ + public HealthState healthState() { + return this.healthState; + } + + /** + * Get 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. + * + * @return the unhealthyEvaluation value + */ + public String unhealthyEvaluation() { + return this.unhealthyEvaluation; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceReplicaProperties.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceReplicaProperties.java index 13470b75a2157..24fd9c79eee31 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceReplicaProperties.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ServiceReplicaProperties.java @@ -16,11 +16,11 @@ */ public class ServiceReplicaProperties { /** - * The Operating system type required by the code in service. Possible - * values include: 'Linux', 'Windows'. + * The operation system required by the code in service. Possible values + * include: 'Linux', 'Windows'. */ @JsonProperty(value = "osType", required = true) - private OperatingSystemTypes osType; + private OperatingSystemType osType; /** * Describes the set of code packages that forms the service. A code @@ -44,21 +44,21 @@ public class ServiceReplicaProperties { private DiagnosticsRef diagnostics; /** - * Get the Operating system type required by the code in service. Possible values include: 'Linux', 'Windows'. + * Get the operation system required by the code in service. Possible values include: 'Linux', 'Windows'. * * @return the osType value */ - public OperatingSystemTypes osType() { + public OperatingSystemType osType() { return this.osType; } /** - * Set the Operating system type required by the code in service. Possible values include: 'Linux', 'Windows'. + * Set the operation system required by the code in service. Possible values include: 'Linux', 'Windows'. * * @param osType the osType value to set * @return the ServiceReplicaProperties object itself. */ - public ServiceReplicaProperties withOsType(OperatingSystemTypes osType) { + public ServiceReplicaProperties withOsType(OperatingSystemType osType) { this.osType = osType; return this; } diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/Setting.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/Setting.java index d97b8ae4336f8..cc042ae1a2284 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/Setting.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/Setting.java @@ -11,7 +11,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * 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". */ public class Setting { /** diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SizeTypes.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SizeTypes.java new file mode 100644 index 0000000000000..b286307c30577 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/SizeTypes.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SizeTypes. + */ +public final class SizeTypes extends ExpandableStringEnum { + /** Static value Small for SizeTypes. */ + public static final SizeTypes SMALL = fromString("Small"); + + /** Static value Medium for SizeTypes. */ + public static final SizeTypes MEDIUM = fromString("Medium"); + + /** Static value Large for SizeTypes. */ + public static final SizeTypes LARGE = fromString("Large"); + + /** + * Creates or finds a SizeTypes from its string representation. + * @param name a name to look for + * @return the corresponding SizeTypes + */ + @JsonCreator + public static SizeTypes fromString(String name) { + return fromString(name, SizeTypes.class); + } + + /** + * @return known SizeTypes values + */ + public static Collection values() { + return values(SizeTypes.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulReplicaNewHealthReportEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulReplicaNewHealthReportEvent.java new file mode 100644 index 0000000000000..a4e4fc98d6257 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulReplicaNewHealthReportEvent.java @@ -0,0 +1,257 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ReplicaEventInner; + +/** + * Stateful Replica Health Report Created event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("StatefulReplicaNewHealthReport") +public class StatefulReplicaNewHealthReportEvent extends ReplicaEventInner { + /** + * Id of Replica instance. + */ + @JsonProperty(value = "ReplicaInstanceId", required = true) + private long replicaInstanceId; + + /** + * Id of report source. + */ + @JsonProperty(value = "SourceId", required = true) + private String sourceId; + + /** + * Describes the property. + */ + @JsonProperty(value = "Property", required = true) + private String property; + + /** + * Describes the property health state. + */ + @JsonProperty(value = "HealthState", required = true) + private String healthState; + + /** + * Time to live in milli-seconds. + */ + @JsonProperty(value = "TimeToLiveMs", required = true) + private long timeToLiveMs; + + /** + * Sequence number of report. + */ + @JsonProperty(value = "SequenceNumber", required = true) + private long sequenceNumber; + + /** + * Description of report. + */ + @JsonProperty(value = "Description", required = true) + private String description; + + /** + * Indicates the removal when it expires. + */ + @JsonProperty(value = "RemoveWhenExpired", required = true) + private boolean removeWhenExpired; + + /** + * Source time. + */ + @JsonProperty(value = "SourceUtcTimestamp", required = true) + private DateTime sourceUtcTimestamp; + + /** + * Get id of Replica instance. + * + * @return the replicaInstanceId value + */ + public long replicaInstanceId() { + return this.replicaInstanceId; + } + + /** + * Set id of Replica instance. + * + * @param replicaInstanceId the replicaInstanceId value to set + * @return the StatefulReplicaNewHealthReportEvent object itself. + */ + public StatefulReplicaNewHealthReportEvent withReplicaInstanceId(long replicaInstanceId) { + this.replicaInstanceId = replicaInstanceId; + return this; + } + + /** + * Get id of report source. + * + * @return the sourceId value + */ + public String sourceId() { + return this.sourceId; + } + + /** + * Set id of report source. + * + * @param sourceId the sourceId value to set + * @return the StatefulReplicaNewHealthReportEvent object itself. + */ + public StatefulReplicaNewHealthReportEvent withSourceId(String sourceId) { + this.sourceId = sourceId; + return this; + } + + /** + * Get describes the property. + * + * @return the property value + */ + public String property() { + return this.property; + } + + /** + * Set describes the property. + * + * @param property the property value to set + * @return the StatefulReplicaNewHealthReportEvent object itself. + */ + public StatefulReplicaNewHealthReportEvent withProperty(String property) { + this.property = property; + return this; + } + + /** + * Get describes the property health state. + * + * @return the healthState value + */ + public String healthState() { + return this.healthState; + } + + /** + * Set describes the property health state. + * + * @param healthState the healthState value to set + * @return the StatefulReplicaNewHealthReportEvent object itself. + */ + public StatefulReplicaNewHealthReportEvent withHealthState(String healthState) { + this.healthState = healthState; + return this; + } + + /** + * Get time to live in milli-seconds. + * + * @return the timeToLiveMs value + */ + public long timeToLiveMs() { + return this.timeToLiveMs; + } + + /** + * Set time to live in milli-seconds. + * + * @param timeToLiveMs the timeToLiveMs value to set + * @return the StatefulReplicaNewHealthReportEvent object itself. + */ + public StatefulReplicaNewHealthReportEvent withTimeToLiveMs(long timeToLiveMs) { + this.timeToLiveMs = timeToLiveMs; + return this; + } + + /** + * Get sequence number of report. + * + * @return the sequenceNumber value + */ + public long sequenceNumber() { + return this.sequenceNumber; + } + + /** + * Set sequence number of report. + * + * @param sequenceNumber the sequenceNumber value to set + * @return the StatefulReplicaNewHealthReportEvent object itself. + */ + public StatefulReplicaNewHealthReportEvent withSequenceNumber(long sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get description of report. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of report. + * + * @param description the description value to set + * @return the StatefulReplicaNewHealthReportEvent object itself. + */ + public StatefulReplicaNewHealthReportEvent withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get indicates the removal when it expires. + * + * @return the removeWhenExpired value + */ + public boolean removeWhenExpired() { + return this.removeWhenExpired; + } + + /** + * Set indicates the removal when it expires. + * + * @param removeWhenExpired the removeWhenExpired value to set + * @return the StatefulReplicaNewHealthReportEvent object itself. + */ + public StatefulReplicaNewHealthReportEvent withRemoveWhenExpired(boolean removeWhenExpired) { + this.removeWhenExpired = removeWhenExpired; + return this; + } + + /** + * Get source time. + * + * @return the sourceUtcTimestamp value + */ + public DateTime sourceUtcTimestamp() { + return this.sourceUtcTimestamp; + } + + /** + * Set source time. + * + * @param sourceUtcTimestamp the sourceUtcTimestamp value to set + * @return the StatefulReplicaNewHealthReportEvent object itself. + */ + public StatefulReplicaNewHealthReportEvent withSourceUtcTimestamp(DateTime sourceUtcTimestamp) { + this.sourceUtcTimestamp = sourceUtcTimestamp; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulServicePartitionInfo.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulServicePartitionInfo.java index 07821770f3efc..0c7e9b769f498 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulServicePartitionInfo.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatefulServicePartitionInfo.java @@ -48,8 +48,8 @@ public class StatefulServicePartitionInfo extends ServicePartitionInfoInner { * Primary replica are said to be a new Epoch from the ones which were sent * by the old Primary replica. */ - @JsonProperty(value = "CurrentConfigurationEpoch") - private Epoch currentConfigurationEpoch; + @JsonProperty(value = "PrimaryEpoch") + private Epoch primaryEpoch; /** * Get the target replica set size as a number. @@ -114,20 +114,20 @@ public StatefulServicePartitionInfo withLastQuorumLossDuration(Period lastQuorum /** * Get 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. * - * @return the currentConfigurationEpoch value + * @return the primaryEpoch value */ - public Epoch currentConfigurationEpoch() { - return this.currentConfigurationEpoch; + public Epoch primaryEpoch() { + return this.primaryEpoch; } /** * Set 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. * - * @param currentConfigurationEpoch the currentConfigurationEpoch value to set + * @param primaryEpoch the primaryEpoch value to set * @return the StatefulServicePartitionInfo object itself. */ - public StatefulServicePartitionInfo withCurrentConfigurationEpoch(Epoch currentConfigurationEpoch) { - this.currentConfigurationEpoch = currentConfigurationEpoch; + public StatefulServicePartitionInfo withPrimaryEpoch(Epoch primaryEpoch) { + this.primaryEpoch = primaryEpoch; return this; } diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatelessReplicaNewHealthReportEvent.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatelessReplicaNewHealthReportEvent.java new file mode 100644 index 0000000000000..ccb649eafa7a1 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/StatelessReplicaNewHealthReportEvent.java @@ -0,0 +1,231 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.servicefabric.implementation.ReplicaEventInner; + +/** + * Stateless Replica Health Report Created event. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") +@JsonTypeName("StatelessReplicaNewHealthReport") +public class StatelessReplicaNewHealthReportEvent extends ReplicaEventInner { + /** + * Id of report source. + */ + @JsonProperty(value = "SourceId", required = true) + private String sourceId; + + /** + * Describes the property. + */ + @JsonProperty(value = "Property", required = true) + private String property; + + /** + * Describes the property health state. + */ + @JsonProperty(value = "HealthState", required = true) + private String healthState; + + /** + * Time to live in milli-seconds. + */ + @JsonProperty(value = "TimeToLiveMs", required = true) + private long timeToLiveMs; + + /** + * Sequence number of report. + */ + @JsonProperty(value = "SequenceNumber", required = true) + private long sequenceNumber; + + /** + * Description of report. + */ + @JsonProperty(value = "Description", required = true) + private String description; + + /** + * Indicates the removal when it expires. + */ + @JsonProperty(value = "RemoveWhenExpired", required = true) + private boolean removeWhenExpired; + + /** + * Source time. + */ + @JsonProperty(value = "SourceUtcTimestamp", required = true) + private DateTime sourceUtcTimestamp; + + /** + * Get id of report source. + * + * @return the sourceId value + */ + public String sourceId() { + return this.sourceId; + } + + /** + * Set id of report source. + * + * @param sourceId the sourceId value to set + * @return the StatelessReplicaNewHealthReportEvent object itself. + */ + public StatelessReplicaNewHealthReportEvent withSourceId(String sourceId) { + this.sourceId = sourceId; + return this; + } + + /** + * Get describes the property. + * + * @return the property value + */ + public String property() { + return this.property; + } + + /** + * Set describes the property. + * + * @param property the property value to set + * @return the StatelessReplicaNewHealthReportEvent object itself. + */ + public StatelessReplicaNewHealthReportEvent withProperty(String property) { + this.property = property; + return this; + } + + /** + * Get describes the property health state. + * + * @return the healthState value + */ + public String healthState() { + return this.healthState; + } + + /** + * Set describes the property health state. + * + * @param healthState the healthState value to set + * @return the StatelessReplicaNewHealthReportEvent object itself. + */ + public StatelessReplicaNewHealthReportEvent withHealthState(String healthState) { + this.healthState = healthState; + return this; + } + + /** + * Get time to live in milli-seconds. + * + * @return the timeToLiveMs value + */ + public long timeToLiveMs() { + return this.timeToLiveMs; + } + + /** + * Set time to live in milli-seconds. + * + * @param timeToLiveMs the timeToLiveMs value to set + * @return the StatelessReplicaNewHealthReportEvent object itself. + */ + public StatelessReplicaNewHealthReportEvent withTimeToLiveMs(long timeToLiveMs) { + this.timeToLiveMs = timeToLiveMs; + return this; + } + + /** + * Get sequence number of report. + * + * @return the sequenceNumber value + */ + public long sequenceNumber() { + return this.sequenceNumber; + } + + /** + * Set sequence number of report. + * + * @param sequenceNumber the sequenceNumber value to set + * @return the StatelessReplicaNewHealthReportEvent object itself. + */ + public StatelessReplicaNewHealthReportEvent withSequenceNumber(long sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get description of report. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of report. + * + * @param description the description value to set + * @return the StatelessReplicaNewHealthReportEvent object itself. + */ + public StatelessReplicaNewHealthReportEvent withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get indicates the removal when it expires. + * + * @return the removeWhenExpired value + */ + public boolean removeWhenExpired() { + return this.removeWhenExpired; + } + + /** + * Set indicates the removal when it expires. + * + * @param removeWhenExpired the removeWhenExpired value to set + * @return the StatelessReplicaNewHealthReportEvent object itself. + */ + public StatelessReplicaNewHealthReportEvent withRemoveWhenExpired(boolean removeWhenExpired) { + this.removeWhenExpired = removeWhenExpired; + return this; + } + + /** + * Get source time. + * + * @return the sourceUtcTimestamp value + */ + public DateTime sourceUtcTimestamp() { + return this.sourceUtcTimestamp; + } + + /** + * Set source time. + * + * @param sourceUtcTimestamp the sourceUtcTimestamp value to set + * @return the StatelessReplicaNewHealthReportEvent object itself. + */ + public StatelessReplicaNewHealthReportEvent withSourceUtcTimestamp(DateTime sourceUtcTimestamp) { + this.sourceUtcTimestamp = sourceUtcTimestamp; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/TcpConfig.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/TcpConfig.java new file mode 100644 index 0000000000000..4b79dc5e287fb --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/TcpConfig.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the tcp configuration for external connectivity for this network. + */ +public class TcpConfig { + /** + * tcp gateway config name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Specifies the port at which the service endpoint below needs to be + * exposed. + */ + @JsonProperty(value = "port", required = true) + private int port; + + /** + * Describes destination endpoint for routing traffic. + */ + @JsonProperty(value = "destination", required = true) + private GatewayDestination destination; + + /** + * Get tcp gateway config name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set tcp gateway config name. + * + * @param name the name value to set + * @return the TcpConfig object itself. + */ + public TcpConfig withName(String name) { + this.name = name; + return this; + } + + /** + * Get specifies the port at which the service endpoint below needs to be exposed. + * + * @return the port value + */ + public int port() { + return this.port; + } + + /** + * Set specifies the port at which the service endpoint below needs to be exposed. + * + * @param port the port value to set + * @return the TcpConfig object itself. + */ + public TcpConfig withPort(int port) { + this.port = port; + return this; + } + + /** + * Get describes destination endpoint for routing traffic. + * + * @return the destination value + */ + public GatewayDestination destination() { + return this.destination; + } + + /** + * Set describes destination endpoint for routing traffic. + * + * @param destination the destination value to set + * @return the TcpConfig object itself. + */ + public TcpConfig withDestination(GatewayDestination destination) { + this.destination = destination; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/VolumeProvider.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/VolumeProvider.java new file mode 100644 index 0000000000000..c1bcaf071a040 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/VolumeProvider.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for VolumeProvider. + */ +public final class VolumeProvider extends ExpandableStringEnum { + /** Static value SFAzureFile for VolumeProvider. */ + public static final VolumeProvider SFAZURE_FILE = fromString("SFAzureFile"); + + /** + * Creates or finds a VolumeProvider from its string representation. + * @param name a name to look for + * @return the corresponding VolumeProvider + */ + @JsonCreator + public static VolumeProvider fromString(String name) { + return fromString(name, VolumeProvider.class); + } + + /** + * @return known VolumeProvider values + */ + public static Collection values() { + return values(VolumeProvider.class); + } +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/VolumeReference.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/VolumeReference.java new file mode 100644 index 0000000000000..ed91c22aa2c5f --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/VolumeReference.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a reference to a volume resource. + */ +public class VolumeReference { + /** + * Name of the volume being referenced. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The flag indicating whether the volume is read only. Default is 'false'. + */ + @JsonProperty(value = "readOnly") + private Boolean readOnly; + + /** + * The path within the container at which the volume should be mounted. + * Only valid path characters are allowed. + */ + @JsonProperty(value = "destinationPath", required = true) + private String destinationPath; + + /** + * Get name of the volume being referenced. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the volume being referenced. + * + * @param name the name value to set + * @return the VolumeReference object itself. + */ + public VolumeReference withName(String name) { + this.name = name; + return this; + } + + /** + * Get the flag indicating whether the volume is read only. Default is 'false'. + * + * @return the readOnly value + */ + public Boolean readOnly() { + return this.readOnly; + } + + /** + * Set the flag indicating whether the volume is read only. Default is 'false'. + * + * @param readOnly the readOnly value to set + * @return the VolumeReference object itself. + */ + public VolumeReference withReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + return this; + } + + /** + * Get the path within the container at which the volume should be mounted. Only valid path characters are allowed. + * + * @return the destinationPath value + */ + public String destinationPath() { + return this.destinationPath; + } + + /** + * Set the path within the container at which the volume should be mounted. Only valid path characters are allowed. + * + * @param destinationPath the destinationPath value to set + * @return the VolumeReference object itself. + */ + public VolumeReference withDestinationPath(String destinationPath) { + this.destinationPath = destinationPath; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ApplicationEventInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ApplicationEventInner.java index 58aa9f10fd743..52b44afd2bea6 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ApplicationEventInner.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ApplicationEventInner.java @@ -21,21 +21,20 @@ @JsonSubTypes({ @JsonSubTypes.Type(name = "ApplicationCreated", value = ApplicationCreatedEvent.class), @JsonSubTypes.Type(name = "ApplicationDeleted", value = ApplicationDeletedEvent.class), - @JsonSubTypes.Type(name = "ApplicationHealthReportCreated", value = ApplicationHealthReportCreatedEvent.class), + @JsonSubTypes.Type(name = "ApplicationNewHealthReport", value = ApplicationNewHealthReportEvent.class), @JsonSubTypes.Type(name = "ApplicationHealthReportExpired", value = ApplicationHealthReportExpiredEvent.class), - @JsonSubTypes.Type(name = "ApplicationUpgradeComplete", value = ApplicationUpgradeCompleteEvent.class), - @JsonSubTypes.Type(name = "ApplicationUpgradeDomainComplete", value = ApplicationUpgradeDomainCompleteEvent.class), - @JsonSubTypes.Type(name = "ApplicationUpgradeRollbackComplete", value = ApplicationUpgradeRollbackCompleteEvent.class), - @JsonSubTypes.Type(name = "ApplicationUpgradeRollbackStart", value = ApplicationUpgradeRollbackStartEvent.class), - @JsonSubTypes.Type(name = "ApplicationUpgradeStart", value = ApplicationUpgradeStartEvent.class), - @JsonSubTypes.Type(name = "DeployedApplicationHealthReportCreated", value = DeployedApplicationHealthReportCreatedEvent.class), + @JsonSubTypes.Type(name = "ApplicationUpgradeCompleted", value = ApplicationUpgradeCompletedEvent.class), + @JsonSubTypes.Type(name = "ApplicationUpgradeDomainCompleted", value = ApplicationUpgradeDomainCompletedEvent.class), + @JsonSubTypes.Type(name = "ApplicationUpgradeRollbackCompleted", value = ApplicationUpgradeRollbackCompletedEvent.class), + @JsonSubTypes.Type(name = "ApplicationUpgradeRollbackStarted", value = ApplicationUpgradeRollbackStartedEvent.class), + @JsonSubTypes.Type(name = "ApplicationUpgradeStarted", value = ApplicationUpgradeStartedEvent.class), + @JsonSubTypes.Type(name = "DeployedApplicationNewHealthReport", value = DeployedApplicationNewHealthReportEvent.class), @JsonSubTypes.Type(name = "DeployedApplicationHealthReportExpired", value = DeployedApplicationHealthReportExpiredEvent.class), - @JsonSubTypes.Type(name = "ProcessDeactivated", value = ProcessDeactivatedEvent.class), - @JsonSubTypes.Type(name = "ContainerDeactivated", value = ContainerDeactivatedEvent.class), - @JsonSubTypes.Type(name = "DeployedServiceHealthReportCreated", value = DeployedServiceHealthReportCreatedEvent.class), - @JsonSubTypes.Type(name = "DeployedServiceHealthReportExpired", value = DeployedServiceHealthReportExpiredEvent.class), - @JsonSubTypes.Type(name = "ChaosRestartCodePackageFaultScheduled", value = ChaosRestartCodePackageFaultScheduledEvent.class), - @JsonSubTypes.Type(name = "ChaosRestartCodePackageFaultCompleted", value = ChaosRestartCodePackageFaultCompletedEvent.class) + @JsonSubTypes.Type(name = "ApplicationProcessExited", value = ApplicationProcessExitedEvent.class), + @JsonSubTypes.Type(name = "ApplicationContainerInstanceExited", value = ApplicationContainerInstanceExitedEvent.class), + @JsonSubTypes.Type(name = "DeployedServicePackageNewHealthReport", value = DeployedServicePackageNewHealthReportEvent.class), + @JsonSubTypes.Type(name = "DeployedServicePackageHealthReportExpired", value = DeployedServicePackageHealthReportExpiredEvent.class), + @JsonSubTypes.Type(name = "ChaosCodePackageRestartScheduled", value = ChaosCodePackageRestartScheduledEvent.class) }) public class ApplicationEventInner extends FabricEventInner { /** diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ApplicationResourceDescriptionInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ApplicationResourceDescriptionInner.java index 9877fdc5ae8c7..e7add0045b4ad 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ApplicationResourceDescriptionInner.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ApplicationResourceDescriptionInner.java @@ -9,17 +9,23 @@ package com.microsoft.azure.servicefabric.implementation; import java.util.List; -import com.microsoft.azure.servicefabric.HealthState; -import com.microsoft.azure.servicefabric.ApplicationResourceStatus; import com.microsoft.azure.servicefabric.DiagnosticsDescription; +import com.microsoft.azure.servicefabric.ResourceStatus; +import com.microsoft.azure.servicefabric.HealthState; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; /** - * Describes a service fabric application resource. + * This type describes a application resource. */ @JsonFlatten public class ApplicationResourceDescriptionInner { + /** + * Name of the Application resource. + */ + @JsonProperty(value = "name", required = true) + private String name; + /** * User readable description of the application. */ @@ -27,107 +33,105 @@ public class ApplicationResourceDescriptionInner { private String description; /** - * Internal use. + * 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. */ - @JsonProperty(value = "properties.debugParams") - private String debugParams; + @JsonProperty(value = "properties.services") + private List services; /** - * describes the services in the application. + * Describes the diagnostics definition and usage for an application + * resource. */ - @JsonProperty(value = "properties.services") - private List services; + @JsonProperty(value = "properties.diagnostics") + private DiagnosticsDescription diagnostics; /** - * Describes the health state of an application resource. Possible values - * include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown'. + * Internal - used by Visual Studio to setup the debugging session on the + * local development environment. */ - @JsonProperty(value = "properties.healthState", access = JsonProperty.Access.WRITE_ONLY) - private HealthState healthState; + @JsonProperty(value = "properties.debugParams") + private String debugParams; /** - * 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. + * Names of the services in the application. */ - @JsonProperty(value = "properties.unhealthyEvaluation", access = JsonProperty.Access.WRITE_ONLY) - private String unhealthyEvaluation; + @JsonProperty(value = "properties.serviceNames", access = JsonProperty.Access.WRITE_ONLY) + private List serviceNames; /** - * Status of the application resource. Possible values include: 'Invalid', - * 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed'. + * Status of the application. Possible values include: 'Unknown', 'Ready', + * 'Upgrading', 'Creating', 'Deleting', 'Failed'. */ @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) - private ApplicationResourceStatus status; + private ResourceStatus status; /** - * Gives additional information about the current status of the application - * deployment. + * Gives additional information about the current status of the + * application. */ @JsonProperty(value = "properties.statusDetails", access = JsonProperty.Access.WRITE_ONLY) private String statusDetails; /** - * Names of the services in the application. - */ - @JsonProperty(value = "properties.serviceNames", access = JsonProperty.Access.WRITE_ONLY) - private List serviceNames; - - /** - * Describes the diagnostics definition and usage for an application - * resource. + * Describes the health state of an application resource. Possible values + * include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown'. */ - @JsonProperty(value = "properties.diagnostics") - private DiagnosticsDescription diagnostics; + @JsonProperty(value = "properties.healthState", access = JsonProperty.Access.WRITE_ONLY) + private HealthState healthState; /** - * Application resource name. + * 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. */ - @JsonProperty(value = "name", required = true) - private String name; + @JsonProperty(value = "properties.unhealthyEvaluation", access = JsonProperty.Access.WRITE_ONLY) + private String unhealthyEvaluation; /** - * Get user readable description of the application. + * Get name of the Application resource. * - * @return the description value + * @return the name value */ - public String description() { - return this.description; + public String name() { + return this.name; } /** - * Set user readable description of the application. + * Set name of the Application resource. * - * @param description the description value to set + * @param name the name value to set * @return the ApplicationResourceDescriptionInner object itself. */ - public ApplicationResourceDescriptionInner withDescription(String description) { - this.description = description; + public ApplicationResourceDescriptionInner withName(String name) { + this.name = name; return this; } /** - * Get internal use. + * Get user readable description of the application. * - * @return the debugParams value + * @return the description value */ - public String debugParams() { - return this.debugParams; + public String description() { + return this.description; } /** - * Set internal use. + * Set user readable description of the application. * - * @param debugParams the debugParams value to set + * @param description the description value to set * @return the ApplicationResourceDescriptionInner object itself. */ - public ApplicationResourceDescriptionInner withDebugParams(String debugParams) { - this.debugParams = debugParams; + public ApplicationResourceDescriptionInner withDescription(String description) { + this.description = description; return this; } /** - * Get describes the services in the application. + * Get 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. * * @return the services value */ @@ -136,7 +140,7 @@ public List services() { } /** - * Set describes the services in the application. + * Set 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 services the services value to set * @return the ApplicationResourceDescriptionInner object itself. @@ -147,39 +151,43 @@ public ApplicationResourceDescriptionInner withServices(List serviceNames() { } /** - * Get describes the diagnostics definition and usage for an application resource. + * Get status of the application. Possible values include: 'Unknown', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed'. * - * @return the diagnostics value + * @return the status value */ - public DiagnosticsDescription diagnostics() { - return this.diagnostics; + public ResourceStatus status() { + return this.status; } /** - * Set describes the diagnostics definition and usage for an application resource. + * Get gives additional information about the current status of the application. * - * @param diagnostics the diagnostics value to set - * @return the ApplicationResourceDescriptionInner object itself. + * @return the statusDetails value */ - public ApplicationResourceDescriptionInner withDiagnostics(DiagnosticsDescription diagnostics) { - this.diagnostics = diagnostics; - return this; + public String statusDetails() { + return this.statusDetails; } /** - * Get application resource name. + * Get describes the health state of an application resource. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown'. * - * @return the name value + * @return the healthState value */ - public String name() { - return this.name; + public HealthState healthState() { + return this.healthState; } /** - * Set application resource name. + * Get 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. * - * @param name the name value to set - * @return the ApplicationResourceDescriptionInner object itself. + * @return the unhealthyEvaluation value */ - public ApplicationResourceDescriptionInner withName(String name) { - this.name = name; - return this; + public String unhealthyEvaluation() { + return this.unhealthyEvaluation; } } diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/BackupPolicyDescriptionInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/BackupPolicyDescriptionInner.java index a438c29ff08a5..72d281897c8c7 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/BackupPolicyDescriptionInner.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/BackupPolicyDescriptionInner.java @@ -10,6 +10,7 @@ import com.microsoft.azure.servicefabric.BackupScheduleDescription; import com.microsoft.azure.servicefabric.BackupStorageDescription; +import com.microsoft.azure.servicefabric.RetentionPolicyDescription; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -54,6 +55,12 @@ public class BackupPolicyDescriptionInner { @JsonProperty(value = "Storage", required = true) private BackupStorageDescription storage; + /** + * Describes the policy to retain backups in storage. + */ + @JsonProperty(value = "RetentionPolicy") + private RetentionPolicyDescription retentionPolicy; + /** * Get the unique name identifying this backup policy. * @@ -160,4 +167,24 @@ public BackupPolicyDescriptionInner withStorage(BackupStorageDescription storage return this; } + /** + * Get describes the policy to retain backups in storage. + * + * @return the retentionPolicy value + */ + public RetentionPolicyDescription retentionPolicy() { + return this.retentionPolicy; + } + + /** + * Set describes the policy to retain backups in storage. + * + * @param retentionPolicy the retentionPolicy value to set + * @return the BackupPolicyDescriptionInner object itself. + */ + public BackupPolicyDescriptionInner withRetentionPolicy(RetentionPolicyDescription retentionPolicy) { + this.retentionPolicy = retentionPolicy; + return this; + } + } diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/BackupProgressInfoInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/BackupProgressInfoInner.java index a2b3109e072fa..0f85c354ee47c 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/BackupProgressInfoInner.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/BackupProgressInfoInner.java @@ -11,7 +11,7 @@ import com.microsoft.azure.servicefabric.BackupState; import org.joda.time.DateTime; import java.util.UUID; -import com.microsoft.azure.servicefabric.BackupEpoch; +import com.microsoft.azure.servicefabric.Epoch; import com.microsoft.azure.servicefabric.FabricErrorError; import com.fasterxml.jackson.annotation.JsonProperty; @@ -49,7 +49,7 @@ public class BackupProgressInfoInner { * Specifies the epoch of the last record included in backup. */ @JsonProperty(value = "EpochOfLastBackupRecord") - private BackupEpoch epochOfLastBackupRecord; + private Epoch epochOfLastBackupRecord; /** * The LSN of last record included in backup. @@ -148,7 +148,7 @@ public BackupProgressInfoInner withBackupLocation(String backupLocation) { * * @return the epochOfLastBackupRecord value */ - public BackupEpoch epochOfLastBackupRecord() { + public Epoch epochOfLastBackupRecord() { return this.epochOfLastBackupRecord; } @@ -158,7 +158,7 @@ public BackupEpoch epochOfLastBackupRecord() { * @param epochOfLastBackupRecord the epochOfLastBackupRecord value to set * @return the BackupProgressInfoInner object itself. */ - public BackupProgressInfoInner withEpochOfLastBackupRecord(BackupEpoch epochOfLastBackupRecord) { + public BackupProgressInfoInner withEpochOfLastBackupRecord(Epoch epochOfLastBackupRecord) { this.epochOfLastBackupRecord = epochOfLastBackupRecord; return this; } diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ClusterEventInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ClusterEventInner.java index db95730519c91..6a4919bb88cfb 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ClusterEventInner.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ClusterEventInner.java @@ -18,13 +18,13 @@ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") @JsonTypeName("ClusterEvent") @JsonSubTypes({ - @JsonSubTypes.Type(name = "ClusterHealthReportCreated", value = ClusterHealthReportCreatedEvent.class), + @JsonSubTypes.Type(name = "ClusterNewHealthReport", value = ClusterNewHealthReportEvent.class), @JsonSubTypes.Type(name = "ClusterHealthReportExpired", value = ClusterHealthReportExpiredEvent.class), - @JsonSubTypes.Type(name = "ClusterUpgradeComplete", value = ClusterUpgradeCompleteEvent.class), - @JsonSubTypes.Type(name = "ClusterUpgradeDomainComplete", value = ClusterUpgradeDomainCompleteEvent.class), - @JsonSubTypes.Type(name = "ClusterUpgradeRollbackComplete", value = ClusterUpgradeRollbackCompleteEvent.class), - @JsonSubTypes.Type(name = "ClusterUpgradeRollbackStart", value = ClusterUpgradeRollbackStartEvent.class), - @JsonSubTypes.Type(name = "ClusterUpgradeStart", value = ClusterUpgradeStartEvent.class), + @JsonSubTypes.Type(name = "ClusterUpgradeCompleted", value = ClusterUpgradeCompletedEvent.class), + @JsonSubTypes.Type(name = "ClusterUpgradeDomainCompleted", value = ClusterUpgradeDomainCompletedEvent.class), + @JsonSubTypes.Type(name = "ClusterUpgradeRollbackCompleted", value = ClusterUpgradeRollbackCompletedEvent.class), + @JsonSubTypes.Type(name = "ClusterUpgradeRollbackStarted", value = ClusterUpgradeRollbackStartedEvent.class), + @JsonSubTypes.Type(name = "ClusterUpgradeStarted", value = ClusterUpgradeStartedEvent.class), @JsonSubTypes.Type(name = "ChaosStopped", value = ChaosStoppedEvent.class), @JsonSubTypes.Type(name = "ChaosStarted", value = ChaosStartedEvent.class) }) diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ClusterVersionInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ClusterVersionInner.java new file mode 100644 index 0000000000000..4ffcda738a0fb --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ClusterVersionInner.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The cluster version. + */ +public class ClusterVersionInner { + /** + * The Service Fabric cluster runtime version. + */ + @JsonProperty(value = "Version") + private String version; + + /** + * Get the Service Fabric cluster runtime version. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Set the Service Fabric cluster runtime version. + * + * @param version the version value to set + * @return the ClusterVersionInner object itself. + */ + public ClusterVersionInner withVersion(String version) { + this.version = version; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/FabricEventInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/FabricEventInner.java index f53e08e34d341..55ed2d8593e3b 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/FabricEventInner.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/FabricEventInner.java @@ -36,6 +36,12 @@ public class FabricEventInner { @JsonProperty(value = "EventInstanceId", required = true) private UUID eventInstanceId; + /** + * The category of event. + */ + @JsonProperty(value = "Category") + private String category; + /** * The time event was logged. */ @@ -68,6 +74,26 @@ public FabricEventInner withEventInstanceId(UUID eventInstanceId) { return this; } + /** + * Get the category of event. + * + * @return the category value + */ + public String category() { + return this.category; + } + + /** + * Set the category of event. + * + * @param category the category value to set + * @return the FabricEventInner object itself. + */ + public FabricEventInner withCategory(String category) { + this.category = category; + return this; + } + /** * Get the time event was logged. * diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/GatewayResourceDescriptionInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/GatewayResourceDescriptionInner.java new file mode 100644 index 0000000000000..eded09f5f1d77 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/GatewayResourceDescriptionInner.java @@ -0,0 +1,227 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.microsoft.azure.servicefabric.NetworkRef; +import java.util.List; +import com.microsoft.azure.servicefabric.TcpConfig; +import com.microsoft.azure.servicefabric.HttpConfig; +import com.microsoft.azure.servicefabric.ResourceStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * This type describes a gateway resource. + */ +@JsonFlatten +public class GatewayResourceDescriptionInner { + /** + * Name of the Gateway resource. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * User readable description of the gateway. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * Network the gateway should listen on for requests. + */ + @JsonProperty(value = "properties.sourceNetwork", required = true) + private NetworkRef sourceNetwork; + + /** + * Network that the Application is using. + */ + @JsonProperty(value = "properties.destinationNetwork", required = true) + private NetworkRef destinationNetwork; + + /** + * Configuration for tcp connectivity for this gateway. + */ + @JsonProperty(value = "properties.tcp") + private List tcp; + + /** + * Configuration for http connectivity for this gateway. + */ + @JsonProperty(value = "properties.http") + private List http; + + /** + * Status of the resource. Possible values include: 'Unknown', 'Ready', + * 'Upgrading', 'Creating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private ResourceStatus status; + + /** + * Gives additional information about the current status of the gateway. + */ + @JsonProperty(value = "properties.statusDetails", access = JsonProperty.Access.WRITE_ONLY) + private String statusDetails; + + /** + * IP address of the gateway. This is populated in the response and is + * ignored for incoming requests. + */ + @JsonProperty(value = "properties.ipAddress", access = JsonProperty.Access.WRITE_ONLY) + private String ipAddress; + + /** + * Get name of the Gateway resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the Gateway resource. + * + * @param name the name value to set + * @return the GatewayResourceDescriptionInner object itself. + */ + public GatewayResourceDescriptionInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get user readable description of the gateway. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set user readable description of the gateway. + * + * @param description the description value to set + * @return the GatewayResourceDescriptionInner object itself. + */ + public GatewayResourceDescriptionInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get network the gateway should listen on for requests. + * + * @return the sourceNetwork value + */ + public NetworkRef sourceNetwork() { + return this.sourceNetwork; + } + + /** + * Set network the gateway should listen on for requests. + * + * @param sourceNetwork the sourceNetwork value to set + * @return the GatewayResourceDescriptionInner object itself. + */ + public GatewayResourceDescriptionInner withSourceNetwork(NetworkRef sourceNetwork) { + this.sourceNetwork = sourceNetwork; + return this; + } + + /** + * Get network that the Application is using. + * + * @return the destinationNetwork value + */ + public NetworkRef destinationNetwork() { + return this.destinationNetwork; + } + + /** + * Set network that the Application is using. + * + * @param destinationNetwork the destinationNetwork value to set + * @return the GatewayResourceDescriptionInner object itself. + */ + public GatewayResourceDescriptionInner withDestinationNetwork(NetworkRef destinationNetwork) { + this.destinationNetwork = destinationNetwork; + return this; + } + + /** + * Get configuration for tcp connectivity for this gateway. + * + * @return the tcp value + */ + public List tcp() { + return this.tcp; + } + + /** + * Set configuration for tcp connectivity for this gateway. + * + * @param tcp the tcp value to set + * @return the GatewayResourceDescriptionInner object itself. + */ + public GatewayResourceDescriptionInner withTcp(List tcp) { + this.tcp = tcp; + return this; + } + + /** + * Get configuration for http connectivity for this gateway. + * + * @return the http value + */ + public List http() { + return this.http; + } + + /** + * Set configuration for http connectivity for this gateway. + * + * @param http the http value to set + * @return the GatewayResourceDescriptionInner object itself. + */ + public GatewayResourceDescriptionInner withHttp(List http) { + this.http = http; + return this; + } + + /** + * Get status of the resource. Possible values include: 'Unknown', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed'. + * + * @return the status value + */ + public ResourceStatus status() { + return this.status; + } + + /** + * Get gives additional information about the current status of the gateway. + * + * @return the statusDetails value + */ + public String statusDetails() { + return this.statusDetails; + } + + /** + * Get iP address of the gateway. This is populated in the response and is ignored for incoming requests. + * + * @return the ipAddress value + */ + public String ipAddress() { + return this.ipAddress; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/MeshApplicationsInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/MeshApplicationsInner.java new file mode 100644 index 0000000000000..17398b7e26c5d --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/MeshApplicationsInner.java @@ -0,0 +1,392 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.servicefabric.FabricErrorException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in MeshApplications. + */ +public class MeshApplicationsInner { + /** The Retrofit service to perform REST calls. */ + private MeshApplicationsService service; + /** The service client containing this operation class. */ + private ServiceFabricClientAPIsImpl client; + + /** + * Initializes an instance of MeshApplicationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public MeshApplicationsInner(Retrofit retrofit, ServiceFabricClientAPIsImpl client) { + this.service = retrofit.create(MeshApplicationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for MeshApplications to be + * used by Retrofit to perform actually REST calls. + */ + interface MeshApplicationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.MeshApplications createOrUpdate" }) + @PUT("Resources/Applications/{applicationResourceName}") + Observable> createOrUpdate(@Path(value = "applicationResourceName", encoded = true) String applicationResourceName, @Query("api-version") String apiVersion, @Body ApplicationResourceDescriptionInner applicationResourceDescription, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.MeshApplications get" }) + @GET("Resources/Applications/{applicationResourceName}") + Observable> get(@Path(value = "applicationResourceName", encoded = true) String applicationResourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.MeshApplications delete" }) + @HTTP(path = "Resources/Applications/{applicationResourceName}", method = "DELETE", hasBody = true) + Observable> delete(@Path(value = "applicationResourceName", encoded = true) String applicationResourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.MeshApplications list" }) + @GET("Resources/Applications") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 applicationResourceName The identity of the application. + * @param applicationResourceDescription Description for creating a Application resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationResourceDescriptionInner object if successful. + */ + public ApplicationResourceDescriptionInner createOrUpdate(String applicationResourceName, ApplicationResourceDescriptionInner applicationResourceDescription) { + return createOrUpdateWithServiceResponseAsync(applicationResourceName, applicationResourceDescription).toBlocking().single().body(); + } + + /** + * 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 applicationResourceName The identity of the application. + * @param applicationResourceDescription Description for creating a Application resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String applicationResourceName, ApplicationResourceDescriptionInner applicationResourceDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(applicationResourceName, applicationResourceDescription), serviceCallback); + } + + /** + * 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 applicationResourceName The identity of the application. + * @param applicationResourceDescription Description for creating a Application resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationResourceDescriptionInner object + */ + public Observable createOrUpdateAsync(String applicationResourceName, ApplicationResourceDescriptionInner applicationResourceDescription) { + return createOrUpdateWithServiceResponseAsync(applicationResourceName, applicationResourceDescription).map(new Func1, ApplicationResourceDescriptionInner>() { + @Override + public ApplicationResourceDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 applicationResourceName The identity of the application. + * @param applicationResourceDescription Description for creating a Application resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationResourceDescriptionInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String applicationResourceName, ApplicationResourceDescriptionInner applicationResourceDescription) { + if (applicationResourceName == null) { + throw new IllegalArgumentException("Parameter applicationResourceName is required and cannot be null."); + } + if (applicationResourceDescription == null) { + throw new IllegalArgumentException("Parameter applicationResourceDescription is required and cannot be null."); + } + Validator.validate(applicationResourceDescription); + final String apiVersion = "6.4-preview"; + return service.createOrUpdate(applicationResourceName, apiVersion, applicationResourceDescription, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 applicationResourceName The identity of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationResourceDescriptionInner object if successful. + */ + public ApplicationResourceDescriptionInner get(String applicationResourceName) { + return getWithServiceResponseAsync(applicationResourceName).toBlocking().single().body(); + } + + /** + * 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 applicationResourceName The identity of the application. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String applicationResourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(applicationResourceName), serviceCallback); + } + + /** + * 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 applicationResourceName The identity of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationResourceDescriptionInner object + */ + public Observable getAsync(String applicationResourceName) { + return getWithServiceResponseAsync(applicationResourceName).map(new Func1, ApplicationResourceDescriptionInner>() { + @Override + public ApplicationResourceDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 applicationResourceName The identity of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationResourceDescriptionInner object + */ + public Observable> getWithServiceResponseAsync(String applicationResourceName) { + if (applicationResourceName == null) { + throw new IllegalArgumentException("Parameter applicationResourceName is required and cannot be null."); + } + final String apiVersion = "6.4-preview"; + return service.get(applicationResourceName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Deletes the Application resource. + * Deletes the Application resource identified by the name. + * + * @param applicationResourceName The identity of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String applicationResourceName) { + deleteWithServiceResponseAsync(applicationResourceName).toBlocking().single().body(); + } + + /** + * Deletes the Application resource. + * Deletes the Application resource identified by the name. + * + * @param applicationResourceName The identity of the application. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String applicationResourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(applicationResourceName), serviceCallback); + } + + /** + * Deletes the Application resource. + * Deletes the Application resource identified by the name. + * + * @param applicationResourceName The identity of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String applicationResourceName) { + return deleteWithServiceResponseAsync(applicationResourceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the Application resource. + * Deletes the Application resource identified by the name. + * + * @param applicationResourceName The identity of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String applicationResourceName) { + if (applicationResourceName == null) { + throw new IllegalArgumentException("Parameter applicationResourceName is required and cannot be null."); + } + final String apiVersion = "6.4-preview"; + return service.delete(applicationResourceName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedApplicationResourceDescriptionListInner object if successful. + */ + public PagedApplicationResourceDescriptionListInner list() { + return listWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedApplicationResourceDescriptionListInner object + */ + public Observable listAsync() { + return listWithServiceResponseAsync().map(new Func1, PagedApplicationResourceDescriptionListInner>() { + @Override + public PagedApplicationResourceDescriptionListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedApplicationResourceDescriptionListInner object + */ + public Observable> listWithServiceResponseAsync() { + final String apiVersion = "6.4-preview"; + return service.list(apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws FabricErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/MeshCodePackagesInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/MeshCodePackagesInner.java new file mode 100644 index 0000000000000..5cd573f0dc284 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/MeshCodePackagesInner.java @@ -0,0 +1,256 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.servicefabric.FabricErrorException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in MeshCodePackages. + */ +public class MeshCodePackagesInner { + /** The Retrofit service to perform REST calls. */ + private MeshCodePackagesService service; + /** The service client containing this operation class. */ + private ServiceFabricClientAPIsImpl client; + + /** + * Initializes an instance of MeshCodePackagesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public MeshCodePackagesInner(Retrofit retrofit, ServiceFabricClientAPIsImpl client) { + this.service = retrofit.create(MeshCodePackagesService.class); + this.client = client; + } + + /** + * The interface defining all the services for MeshCodePackages to be + * used by Retrofit to perform actually REST calls. + */ + interface MeshCodePackagesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.MeshCodePackages getContainerLogs" }) + @GET("Resources/Applications/{applicationResourceName}/Services/{serviceResourceName}/Replicas/{replicaName}/CodePackages/{codePackageName}/Logs") + Observable> getContainerLogs(@Path(value = "applicationResourceName", encoded = true) String applicationResourceName, @Path(value = "serviceResourceName", encoded = true) String serviceResourceName, @Path(value = "replicaName", encoded = true) String replicaName, @Path("codePackageName") String codePackageName, @Query("api-version") String apiVersion, @Query("Tail") String tail, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the logs from the container. + * Gets the logs for the container of the specified code package of the service replica. + * + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @param replicaName Service Fabric replica name. + * @param codePackageName The name of code package of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerLogsInner object if successful. + */ + public ContainerLogsInner getContainerLogs(String applicationResourceName, String serviceResourceName, String replicaName, String codePackageName) { + return getContainerLogsWithServiceResponseAsync(applicationResourceName, serviceResourceName, replicaName, codePackageName).toBlocking().single().body(); + } + + /** + * Gets the logs from the container. + * Gets the logs for the container of the specified code package of the service replica. + * + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @param replicaName Service Fabric replica name. + * @param codePackageName The name of code package of the service. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getContainerLogsAsync(String applicationResourceName, String serviceResourceName, String replicaName, String codePackageName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getContainerLogsWithServiceResponseAsync(applicationResourceName, serviceResourceName, replicaName, codePackageName), serviceCallback); + } + + /** + * Gets the logs from the container. + * Gets the logs for the container of the specified code package of the service replica. + * + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @param replicaName Service Fabric replica name. + * @param codePackageName The name of code package of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerLogsInner object + */ + public Observable getContainerLogsAsync(String applicationResourceName, String serviceResourceName, String replicaName, String codePackageName) { + return getContainerLogsWithServiceResponseAsync(applicationResourceName, serviceResourceName, replicaName, codePackageName).map(new Func1, ContainerLogsInner>() { + @Override + public ContainerLogsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the logs from the container. + * Gets the logs for the container of the specified code package of the service replica. + * + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @param replicaName Service Fabric replica name. + * @param codePackageName The name of code package of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerLogsInner object + */ + public Observable> getContainerLogsWithServiceResponseAsync(String applicationResourceName, String serviceResourceName, String replicaName, String codePackageName) { + if (applicationResourceName == null) { + throw new IllegalArgumentException("Parameter applicationResourceName is required and cannot be null."); + } + if (serviceResourceName == null) { + throw new IllegalArgumentException("Parameter serviceResourceName is required and cannot be null."); + } + if (replicaName == null) { + throw new IllegalArgumentException("Parameter replicaName is required and cannot be null."); + } + if (codePackageName == null) { + throw new IllegalArgumentException("Parameter codePackageName is required and cannot be null."); + } + final String apiVersion = "6.4-preview"; + final String tail = null; + return service.getContainerLogs(applicationResourceName, serviceResourceName, replicaName, codePackageName, apiVersion, tail, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getContainerLogsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the logs from the container. + * Gets the logs for the container of the specified code package of the service replica. + * + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @param replicaName Service Fabric replica name. + * @param codePackageName The name of code package of the service. + * @param tail Number of lines to show from the end of the logs. Default is 100. 'all' to show the complete logs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerLogsInner object if successful. + */ + public ContainerLogsInner getContainerLogs(String applicationResourceName, String serviceResourceName, String replicaName, String codePackageName, String tail) { + return getContainerLogsWithServiceResponseAsync(applicationResourceName, serviceResourceName, replicaName, codePackageName, tail).toBlocking().single().body(); + } + + /** + * Gets the logs from the container. + * Gets the logs for the container of the specified code package of the service replica. + * + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @param replicaName Service Fabric replica name. + * @param codePackageName The name of code package of the service. + * @param tail Number of lines to show from the end of the logs. Default is 100. 'all' to show the complete logs. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getContainerLogsAsync(String applicationResourceName, String serviceResourceName, String replicaName, String codePackageName, String tail, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getContainerLogsWithServiceResponseAsync(applicationResourceName, serviceResourceName, replicaName, codePackageName, tail), serviceCallback); + } + + /** + * Gets the logs from the container. + * Gets the logs for the container of the specified code package of the service replica. + * + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @param replicaName Service Fabric replica name. + * @param codePackageName The name of code package of the service. + * @param tail Number of lines to show from the end of the logs. Default is 100. 'all' to show the complete logs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerLogsInner object + */ + public Observable getContainerLogsAsync(String applicationResourceName, String serviceResourceName, String replicaName, String codePackageName, String tail) { + return getContainerLogsWithServiceResponseAsync(applicationResourceName, serviceResourceName, replicaName, codePackageName, tail).map(new Func1, ContainerLogsInner>() { + @Override + public ContainerLogsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the logs from the container. + * Gets the logs for the container of the specified code package of the service replica. + * + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @param replicaName Service Fabric replica name. + * @param codePackageName The name of code package of the service. + * @param tail Number of lines to show from the end of the logs. Default is 100. 'all' to show the complete logs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerLogsInner object + */ + public Observable> getContainerLogsWithServiceResponseAsync(String applicationResourceName, String serviceResourceName, String replicaName, String codePackageName, String tail) { + if (applicationResourceName == null) { + throw new IllegalArgumentException("Parameter applicationResourceName is required and cannot be null."); + } + if (serviceResourceName == null) { + throw new IllegalArgumentException("Parameter serviceResourceName is required and cannot be null."); + } + if (replicaName == null) { + throw new IllegalArgumentException("Parameter replicaName is required and cannot be null."); + } + if (codePackageName == null) { + throw new IllegalArgumentException("Parameter codePackageName is required and cannot be null."); + } + final String apiVersion = "6.4-preview"; + return service.getContainerLogs(applicationResourceName, serviceResourceName, replicaName, codePackageName, apiVersion, tail, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getContainerLogsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getContainerLogsDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/MeshGatewaysInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/MeshGatewaysInner.java new file mode 100644 index 0000000000000..68970f4d9238e --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/MeshGatewaysInner.java @@ -0,0 +1,392 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.servicefabric.FabricErrorException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in MeshGateways. + */ +public class MeshGatewaysInner { + /** The Retrofit service to perform REST calls. */ + private MeshGatewaysService service; + /** The service client containing this operation class. */ + private ServiceFabricClientAPIsImpl client; + + /** + * Initializes an instance of MeshGatewaysInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public MeshGatewaysInner(Retrofit retrofit, ServiceFabricClientAPIsImpl client) { + this.service = retrofit.create(MeshGatewaysService.class); + this.client = client; + } + + /** + * The interface defining all the services for MeshGateways to be + * used by Retrofit to perform actually REST calls. + */ + interface MeshGatewaysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.MeshGateways createOrUpdate" }) + @PUT("Resources/Gateways/{gatewayResourceName}") + Observable> createOrUpdate(@Path(value = "gatewayResourceName", encoded = true) String gatewayResourceName, @Query("api-version") String apiVersion, @Body GatewayResourceDescriptionInner gatewayResourceDescription, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.MeshGateways get" }) + @GET("Resources/Gateways/{gatewayResourceName}") + Observable> get(@Path(value = "gatewayResourceName", encoded = true) String gatewayResourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.MeshGateways delete" }) + @HTTP(path = "Resources/Gateways/{gatewayResourceName}", method = "DELETE", hasBody = true) + Observable> delete(@Path(value = "gatewayResourceName", encoded = true) String gatewayResourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.MeshGateways list" }) + @GET("Resources/Gateways") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 gatewayResourceName The identity of the gateway. + * @param gatewayResourceDescription Description for creating a Gateway resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the GatewayResourceDescriptionInner object if successful. + */ + public GatewayResourceDescriptionInner createOrUpdate(String gatewayResourceName, GatewayResourceDescriptionInner gatewayResourceDescription) { + return createOrUpdateWithServiceResponseAsync(gatewayResourceName, gatewayResourceDescription).toBlocking().single().body(); + } + + /** + * 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 gatewayResourceName The identity of the gateway. + * @param gatewayResourceDescription Description for creating a Gateway resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String gatewayResourceName, GatewayResourceDescriptionInner gatewayResourceDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(gatewayResourceName, gatewayResourceDescription), serviceCallback); + } + + /** + * 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 gatewayResourceName The identity of the gateway. + * @param gatewayResourceDescription Description for creating a Gateway resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GatewayResourceDescriptionInner object + */ + public Observable createOrUpdateAsync(String gatewayResourceName, GatewayResourceDescriptionInner gatewayResourceDescription) { + return createOrUpdateWithServiceResponseAsync(gatewayResourceName, gatewayResourceDescription).map(new Func1, GatewayResourceDescriptionInner>() { + @Override + public GatewayResourceDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 gatewayResourceName The identity of the gateway. + * @param gatewayResourceDescription Description for creating a Gateway resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GatewayResourceDescriptionInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String gatewayResourceName, GatewayResourceDescriptionInner gatewayResourceDescription) { + if (gatewayResourceName == null) { + throw new IllegalArgumentException("Parameter gatewayResourceName is required and cannot be null."); + } + if (gatewayResourceDescription == null) { + throw new IllegalArgumentException("Parameter gatewayResourceDescription is required and cannot be null."); + } + Validator.validate(gatewayResourceDescription); + final String apiVersion = "6.4-preview"; + return service.createOrUpdate(gatewayResourceName, apiVersion, gatewayResourceDescription, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 gatewayResourceName The identity of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the GatewayResourceDescriptionInner object if successful. + */ + public GatewayResourceDescriptionInner get(String gatewayResourceName) { + return getWithServiceResponseAsync(gatewayResourceName).toBlocking().single().body(); + } + + /** + * 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 gatewayResourceName The identity of the gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String gatewayResourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(gatewayResourceName), serviceCallback); + } + + /** + * 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 gatewayResourceName The identity of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GatewayResourceDescriptionInner object + */ + public Observable getAsync(String gatewayResourceName) { + return getWithServiceResponseAsync(gatewayResourceName).map(new Func1, GatewayResourceDescriptionInner>() { + @Override + public GatewayResourceDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 gatewayResourceName The identity of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GatewayResourceDescriptionInner object + */ + public Observable> getWithServiceResponseAsync(String gatewayResourceName) { + if (gatewayResourceName == null) { + throw new IllegalArgumentException("Parameter gatewayResourceName is required and cannot be null."); + } + final String apiVersion = "6.4-preview"; + return service.get(gatewayResourceName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Deletes the Gateway resource. + * Deletes the Gateway resource identified by the name. + * + * @param gatewayResourceName The identity of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String gatewayResourceName) { + deleteWithServiceResponseAsync(gatewayResourceName).toBlocking().single().body(); + } + + /** + * Deletes the Gateway resource. + * Deletes the Gateway resource identified by the name. + * + * @param gatewayResourceName The identity of the gateway. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String gatewayResourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(gatewayResourceName), serviceCallback); + } + + /** + * Deletes the Gateway resource. + * Deletes the Gateway resource identified by the name. + * + * @param gatewayResourceName The identity of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String gatewayResourceName) { + return deleteWithServiceResponseAsync(gatewayResourceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the Gateway resource. + * Deletes the Gateway resource identified by the name. + * + * @param gatewayResourceName The identity of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String gatewayResourceName) { + if (gatewayResourceName == null) { + throw new IllegalArgumentException("Parameter gatewayResourceName is required and cannot be null."); + } + final String apiVersion = "6.4-preview"; + return service.delete(gatewayResourceName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedGatewayResourceDescriptionListInner object if successful. + */ + public PagedGatewayResourceDescriptionListInner list() { + return listWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedGatewayResourceDescriptionListInner object + */ + public Observable listAsync() { + return listWithServiceResponseAsync().map(new Func1, PagedGatewayResourceDescriptionListInner>() { + @Override + public PagedGatewayResourceDescriptionListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedGatewayResourceDescriptionListInner object + */ + public Observable> listWithServiceResponseAsync() { + final String apiVersion = "6.4-preview"; + return service.list(apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws FabricErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/MeshNetworksInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/MeshNetworksInner.java new file mode 100644 index 0000000000000..294b8d7d1e7ac --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/MeshNetworksInner.java @@ -0,0 +1,392 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.servicefabric.FabricErrorException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in MeshNetworks. + */ +public class MeshNetworksInner { + /** The Retrofit service to perform REST calls. */ + private MeshNetworksService service; + /** The service client containing this operation class. */ + private ServiceFabricClientAPIsImpl client; + + /** + * Initializes an instance of MeshNetworksInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public MeshNetworksInner(Retrofit retrofit, ServiceFabricClientAPIsImpl client) { + this.service = retrofit.create(MeshNetworksService.class); + this.client = client; + } + + /** + * The interface defining all the services for MeshNetworks to be + * used by Retrofit to perform actually REST calls. + */ + interface MeshNetworksService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.MeshNetworks createOrUpdate" }) + @PUT("Resources/Networks/{networkResourceName}") + Observable> createOrUpdate(@Path(value = "networkResourceName", encoded = true) String networkResourceName, @Query("api-version") String apiVersion, @Body NetworkResourceDescriptionInner networkResourceDescription, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.MeshNetworks get" }) + @GET("Resources/Networks/{networkResourceName}") + Observable> get(@Path(value = "networkResourceName", encoded = true) String networkResourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.MeshNetworks delete" }) + @HTTP(path = "Resources/Networks/{networkResourceName}", method = "DELETE", hasBody = true) + Observable> delete(@Path(value = "networkResourceName", encoded = true) String networkResourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.MeshNetworks list" }) + @GET("Resources/Networks") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 networkResourceName The identity of the network. + * @param networkResourceDescription Description for creating a Network resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkResourceDescriptionInner object if successful. + */ + public NetworkResourceDescriptionInner createOrUpdate(String networkResourceName, NetworkResourceDescriptionInner networkResourceDescription) { + return createOrUpdateWithServiceResponseAsync(networkResourceName, networkResourceDescription).toBlocking().single().body(); + } + + /** + * 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 networkResourceName The identity of the network. + * @param networkResourceDescription Description for creating a Network resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String networkResourceName, NetworkResourceDescriptionInner networkResourceDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(networkResourceName, networkResourceDescription), serviceCallback); + } + + /** + * 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 networkResourceName The identity of the network. + * @param networkResourceDescription Description for creating a Network resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkResourceDescriptionInner object + */ + public Observable createOrUpdateAsync(String networkResourceName, NetworkResourceDescriptionInner networkResourceDescription) { + return createOrUpdateWithServiceResponseAsync(networkResourceName, networkResourceDescription).map(new Func1, NetworkResourceDescriptionInner>() { + @Override + public NetworkResourceDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 networkResourceName The identity of the network. + * @param networkResourceDescription Description for creating a Network resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkResourceDescriptionInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String networkResourceName, NetworkResourceDescriptionInner networkResourceDescription) { + if (networkResourceName == null) { + throw new IllegalArgumentException("Parameter networkResourceName is required and cannot be null."); + } + if (networkResourceDescription == null) { + throw new IllegalArgumentException("Parameter networkResourceDescription is required and cannot be null."); + } + Validator.validate(networkResourceDescription); + final String apiVersion = "6.4-preview"; + return service.createOrUpdate(networkResourceName, apiVersion, networkResourceDescription, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 networkResourceName The identity of the network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkResourceDescriptionInner object if successful. + */ + public NetworkResourceDescriptionInner get(String networkResourceName) { + return getWithServiceResponseAsync(networkResourceName).toBlocking().single().body(); + } + + /** + * 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 networkResourceName The identity of the network. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String networkResourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(networkResourceName), serviceCallback); + } + + /** + * 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 networkResourceName The identity of the network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkResourceDescriptionInner object + */ + public Observable getAsync(String networkResourceName) { + return getWithServiceResponseAsync(networkResourceName).map(new Func1, NetworkResourceDescriptionInner>() { + @Override + public NetworkResourceDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 networkResourceName The identity of the network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkResourceDescriptionInner object + */ + public Observable> getWithServiceResponseAsync(String networkResourceName) { + if (networkResourceName == null) { + throw new IllegalArgumentException("Parameter networkResourceName is required and cannot be null."); + } + final String apiVersion = "6.4-preview"; + return service.get(networkResourceName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Deletes the Network resource. + * Deletes the Network resource identified by the name. + * + * @param networkResourceName The identity of the network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String networkResourceName) { + deleteWithServiceResponseAsync(networkResourceName).toBlocking().single().body(); + } + + /** + * Deletes the Network resource. + * Deletes the Network resource identified by the name. + * + * @param networkResourceName The identity of the network. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String networkResourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(networkResourceName), serviceCallback); + } + + /** + * Deletes the Network resource. + * Deletes the Network resource identified by the name. + * + * @param networkResourceName The identity of the network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String networkResourceName) { + return deleteWithServiceResponseAsync(networkResourceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the Network resource. + * Deletes the Network resource identified by the name. + * + * @param networkResourceName The identity of the network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String networkResourceName) { + if (networkResourceName == null) { + throw new IllegalArgumentException("Parameter networkResourceName is required and cannot be null."); + } + final String apiVersion = "6.4-preview"; + return service.delete(networkResourceName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedNetworkResourceDescriptionListInner object if successful. + */ + public PagedNetworkResourceDescriptionListInner list() { + return listWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedNetworkResourceDescriptionListInner object + */ + public Observable listAsync() { + return listWithServiceResponseAsync().map(new Func1, PagedNetworkResourceDescriptionListInner>() { + @Override + public PagedNetworkResourceDescriptionListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedNetworkResourceDescriptionListInner object + */ + public Observable> listWithServiceResponseAsync() { + final String apiVersion = "6.4-preview"; + return service.list(apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws FabricErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/MeshSecretValuesInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/MeshSecretValuesInner.java new file mode 100644 index 0000000000000..d5993db292e52 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/MeshSecretValuesInner.java @@ -0,0 +1,511 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.servicefabric.FabricErrorException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in MeshSecretValues. + */ +public class MeshSecretValuesInner implements InnerSupportsDelete { + /** The Retrofit service to perform REST calls. */ + private MeshSecretValuesService service; + /** The service client containing this operation class. */ + private ServiceFabricClientAPIsImpl client; + + /** + * Initializes an instance of MeshSecretValuesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public MeshSecretValuesInner(Retrofit retrofit, ServiceFabricClientAPIsImpl client) { + this.service = retrofit.create(MeshSecretValuesService.class); + this.client = client; + } + + /** + * The interface defining all the services for MeshSecretValues to be + * used by Retrofit to perform actually REST calls. + */ + interface MeshSecretValuesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.MeshSecretValues addValue" }) + @PUT("Resources/Secrets/{secretResourceName}/values/{secretValueResourceName}") + Observable> addValue(@Path(value = "secretResourceName", encoded = true) String secretResourceName, @Path(value = "secretValueResourceName", encoded = true) String secretValueResourceName, @Query("api-version") String apiVersion, @Body SecretValueResourceDescriptionInner secretValueResourceDescription, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.MeshSecretValues get" }) + @GET("Resources/Secrets/{secretResourceName}/values/{secretValueResourceName}") + Observable> get(@Path(value = "secretResourceName", encoded = true) String secretResourceName, @Path(value = "secretValueResourceName", encoded = true) String secretValueResourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.MeshSecretValues delete" }) + @HTTP(path = "Resources/Secrets/{secretResourceName}/values/{secretValueResourceName}", method = "DELETE", hasBody = true) + Observable> delete(@Path(value = "secretResourceName", encoded = true) String secretResourceName, @Path(value = "secretValueResourceName", encoded = true) String secretValueResourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.MeshSecretValues list" }) + @GET("Resources/Secrets/{secretResourceName}/values") + Observable> list(@Path(value = "secretResourceName", encoded = true) String secretResourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.MeshSecretValues show" }) + @POST("Resources/Secrets/{secretResourceName}/values/{secretValueResourceName}/list_value") + Observable> show(@Path(value = "secretResourceName", encoded = true) String secretResourceName, @Path(value = "secretValueResourceName", encoded = true) String secretValueResourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier for the value. + * @param secretValueResourceDescription Description for creating a value of a secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SecretValueResourceDescriptionInner object if successful. + */ + public SecretValueResourceDescriptionInner addValue(String secretResourceName, String secretValueResourceName, SecretValueResourceDescriptionInner secretValueResourceDescription) { + return addValueWithServiceResponseAsync(secretResourceName, secretValueResourceName, secretValueResourceDescription).toBlocking().single().body(); + } + + /** + * 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 secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier for the value. + * @param secretValueResourceDescription Description for creating a value of a secret resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture addValueAsync(String secretResourceName, String secretValueResourceName, SecretValueResourceDescriptionInner secretValueResourceDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(addValueWithServiceResponseAsync(secretResourceName, secretValueResourceName, secretValueResourceDescription), serviceCallback); + } + + /** + * 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 secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier for the value. + * @param secretValueResourceDescription Description for creating a value of a secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretValueResourceDescriptionInner object + */ + public Observable addValueAsync(String secretResourceName, String secretValueResourceName, SecretValueResourceDescriptionInner secretValueResourceDescription) { + return addValueWithServiceResponseAsync(secretResourceName, secretValueResourceName, secretValueResourceDescription).map(new Func1, SecretValueResourceDescriptionInner>() { + @Override + public SecretValueResourceDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier for the value. + * @param secretValueResourceDescription Description for creating a value of a secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretValueResourceDescriptionInner object + */ + public Observable> addValueWithServiceResponseAsync(String secretResourceName, String secretValueResourceName, SecretValueResourceDescriptionInner secretValueResourceDescription) { + if (secretResourceName == null) { + throw new IllegalArgumentException("Parameter secretResourceName is required and cannot be null."); + } + if (secretValueResourceName == null) { + throw new IllegalArgumentException("Parameter secretValueResourceName is required and cannot be null."); + } + if (secretValueResourceDescription == null) { + throw new IllegalArgumentException("Parameter secretValueResourceDescription is required and cannot be null."); + } + Validator.validate(secretValueResourceDescription); + final String apiVersion = "6.4-preview"; + return service.addValue(secretResourceName, secretValueResourceName, apiVersion, secretValueResourceDescription, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = addValueDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse addValueDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier for the value. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SecretValueResourceDescriptionInner object if successful. + */ + public SecretValueResourceDescriptionInner get(String secretResourceName, String secretValueResourceName) { + return getWithServiceResponseAsync(secretResourceName, secretValueResourceName).toBlocking().single().body(); + } + + /** + * 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 secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier for the value. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String secretResourceName, String secretValueResourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(secretResourceName, secretValueResourceName), serviceCallback); + } + + /** + * 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 secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier for the value. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretValueResourceDescriptionInner object + */ + public Observable getAsync(String secretResourceName, String secretValueResourceName) { + return getWithServiceResponseAsync(secretResourceName, secretValueResourceName).map(new Func1, SecretValueResourceDescriptionInner>() { + @Override + public SecretValueResourceDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier for the value. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretValueResourceDescriptionInner object + */ + public Observable> getWithServiceResponseAsync(String secretResourceName, String secretValueResourceName) { + if (secretResourceName == null) { + throw new IllegalArgumentException("Parameter secretResourceName is required and cannot be null."); + } + if (secretValueResourceName == null) { + throw new IllegalArgumentException("Parameter secretValueResourceName is required and cannot be null."); + } + final String apiVersion = "6.4-preview"; + return service.get(secretResourceName, secretValueResourceName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier for the value. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String secretResourceName, String secretValueResourceName) { + deleteWithServiceResponseAsync(secretResourceName, secretValueResourceName).toBlocking().single().body(); + } + + /** + * 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 secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier for the value. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String secretResourceName, String secretValueResourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(secretResourceName, secretValueResourceName), serviceCallback); + } + + /** + * 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 secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier for the value. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String secretResourceName, String secretValueResourceName) { + return deleteWithServiceResponseAsync(secretResourceName, secretValueResourceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier for the value. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String secretResourceName, String secretValueResourceName) { + if (secretResourceName == null) { + throw new IllegalArgumentException("Parameter secretResourceName is required and cannot be null."); + } + if (secretValueResourceName == null) { + throw new IllegalArgumentException("Parameter secretValueResourceName is required and cannot be null."); + } + final String apiVersion = "6.4-preview"; + return service.delete(secretResourceName, secretValueResourceName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 secretResourceName The name of the secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedSecretValueResourceDescriptionListInner object if successful. + */ + public PagedSecretValueResourceDescriptionListInner list(String secretResourceName) { + return listWithServiceResponseAsync(secretResourceName).toBlocking().single().body(); + } + + /** + * 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 secretResourceName The name of the secret resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(String secretResourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(secretResourceName), serviceCallback); + } + + /** + * 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 secretResourceName The name of the secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedSecretValueResourceDescriptionListInner object + */ + public Observable listAsync(String secretResourceName) { + return listWithServiceResponseAsync(secretResourceName).map(new Func1, PagedSecretValueResourceDescriptionListInner>() { + @Override + public PagedSecretValueResourceDescriptionListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 secretResourceName The name of the secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedSecretValueResourceDescriptionListInner object + */ + public Observable> listWithServiceResponseAsync(String secretResourceName) { + if (secretResourceName == null) { + throw new IllegalArgumentException("Parameter secretResourceName is required and cannot be null."); + } + final String apiVersion = "6.4-preview"; + return service.list(secretResourceName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier for the value. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SecretValueInner object if successful. + */ + public SecretValueInner show(String secretResourceName, String secretValueResourceName) { + return showWithServiceResponseAsync(secretResourceName, secretValueResourceName).toBlocking().single().body(); + } + + /** + * 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 secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier for the value. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture showAsync(String secretResourceName, String secretValueResourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(showWithServiceResponseAsync(secretResourceName, secretValueResourceName), serviceCallback); + } + + /** + * 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 secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier for the value. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretValueInner object + */ + public Observable showAsync(String secretResourceName, String secretValueResourceName) { + return showWithServiceResponseAsync(secretResourceName, secretValueResourceName).map(new Func1, SecretValueInner>() { + @Override + public SecretValueInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier for the value. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretValueInner object + */ + public Observable> showWithServiceResponseAsync(String secretResourceName, String secretValueResourceName) { + if (secretResourceName == null) { + throw new IllegalArgumentException("Parameter secretResourceName is required and cannot be null."); + } + if (secretValueResourceName == null) { + throw new IllegalArgumentException("Parameter secretValueResourceName is required and cannot be null."); + } + final String apiVersion = "6.4-preview"; + return service.show(secretResourceName, secretValueResourceName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = showDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse showDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/MeshSecretsInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/MeshSecretsInner.java new file mode 100644 index 0000000000000..bd67171382e46 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/MeshSecretsInner.java @@ -0,0 +1,392 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.servicefabric.FabricErrorException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in MeshSecrets. + */ +public class MeshSecretsInner { + /** The Retrofit service to perform REST calls. */ + private MeshSecretsService service; + /** The service client containing this operation class. */ + private ServiceFabricClientAPIsImpl client; + + /** + * Initializes an instance of MeshSecretsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public MeshSecretsInner(Retrofit retrofit, ServiceFabricClientAPIsImpl client) { + this.service = retrofit.create(MeshSecretsService.class); + this.client = client; + } + + /** + * The interface defining all the services for MeshSecrets to be + * used by Retrofit to perform actually REST calls. + */ + interface MeshSecretsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.MeshSecrets createOrUpdate" }) + @PUT("Resources/Secrets/{secretResourceName}") + Observable> createOrUpdate(@Path(value = "secretResourceName", encoded = true) String secretResourceName, @Query("api-version") String apiVersion, @Body SecretResourceDescriptionInner secretResourceDescription, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.MeshSecrets get" }) + @GET("Resources/Secrets/{secretResourceName}") + Observable> get(@Path(value = "secretResourceName", encoded = true) String secretResourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.MeshSecrets delete" }) + @HTTP(path = "Resources/Secrets/{secretResourceName}", method = "DELETE", hasBody = true) + Observable> delete(@Path(value = "secretResourceName", encoded = true) String secretResourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.MeshSecrets list" }) + @GET("Resources/Secrets") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 secretResourceName The name of the secret resource. + * @param secretResourceDescription Description for creating a secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SecretResourceDescriptionInner object if successful. + */ + public SecretResourceDescriptionInner createOrUpdate(String secretResourceName, SecretResourceDescriptionInner secretResourceDescription) { + return createOrUpdateWithServiceResponseAsync(secretResourceName, secretResourceDescription).toBlocking().single().body(); + } + + /** + * 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 secretResourceName The name of the secret resource. + * @param secretResourceDescription Description for creating a secret resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String secretResourceName, SecretResourceDescriptionInner secretResourceDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(secretResourceName, secretResourceDescription), serviceCallback); + } + + /** + * 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 secretResourceName The name of the secret resource. + * @param secretResourceDescription Description for creating a secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretResourceDescriptionInner object + */ + public Observable createOrUpdateAsync(String secretResourceName, SecretResourceDescriptionInner secretResourceDescription) { + return createOrUpdateWithServiceResponseAsync(secretResourceName, secretResourceDescription).map(new Func1, SecretResourceDescriptionInner>() { + @Override + public SecretResourceDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 secretResourceName The name of the secret resource. + * @param secretResourceDescription Description for creating a secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretResourceDescriptionInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String secretResourceName, SecretResourceDescriptionInner secretResourceDescription) { + if (secretResourceName == null) { + throw new IllegalArgumentException("Parameter secretResourceName is required and cannot be null."); + } + if (secretResourceDescription == null) { + throw new IllegalArgumentException("Parameter secretResourceDescription is required and cannot be null."); + } + Validator.validate(secretResourceDescription); + final String apiVersion = "6.4-preview"; + return service.createOrUpdate(secretResourceName, apiVersion, secretResourceDescription, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 secretResourceName The name of the secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SecretResourceDescriptionInner object if successful. + */ + public SecretResourceDescriptionInner get(String secretResourceName) { + return getWithServiceResponseAsync(secretResourceName).toBlocking().single().body(); + } + + /** + * 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 secretResourceName The name of the secret resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String secretResourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(secretResourceName), serviceCallback); + } + + /** + * 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 secretResourceName The name of the secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretResourceDescriptionInner object + */ + public Observable getAsync(String secretResourceName) { + return getWithServiceResponseAsync(secretResourceName).map(new Func1, SecretResourceDescriptionInner>() { + @Override + public SecretResourceDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 secretResourceName The name of the secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretResourceDescriptionInner object + */ + public Observable> getWithServiceResponseAsync(String secretResourceName) { + if (secretResourceName == null) { + throw new IllegalArgumentException("Parameter secretResourceName is required and cannot be null."); + } + final String apiVersion = "6.4-preview"; + return service.get(secretResourceName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Deletes the Secret resource. + * Deletes the specified Secret resource and all of its named values. + * + * @param secretResourceName The name of the secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String secretResourceName) { + deleteWithServiceResponseAsync(secretResourceName).toBlocking().single().body(); + } + + /** + * Deletes the Secret resource. + * Deletes the specified Secret resource and all of its named values. + * + * @param secretResourceName The name of the secret resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String secretResourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(secretResourceName), serviceCallback); + } + + /** + * Deletes the Secret resource. + * Deletes the specified Secret resource and all of its named values. + * + * @param secretResourceName The name of the secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String secretResourceName) { + return deleteWithServiceResponseAsync(secretResourceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the Secret resource. + * Deletes the specified Secret resource and all of its named values. + * + * @param secretResourceName The name of the secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String secretResourceName) { + if (secretResourceName == null) { + throw new IllegalArgumentException("Parameter secretResourceName is required and cannot be null."); + } + final String apiVersion = "6.4-preview"; + return service.delete(secretResourceName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedSecretResourceDescriptionListInner object if successful. + */ + public PagedSecretResourceDescriptionListInner list() { + return listWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedSecretResourceDescriptionListInner object + */ + public Observable listAsync() { + return listWithServiceResponseAsync().map(new Func1, PagedSecretResourceDescriptionListInner>() { + @Override + public PagedSecretResourceDescriptionListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedSecretResourceDescriptionListInner object + */ + public Observable> listWithServiceResponseAsync() { + final String apiVersion = "6.4-preview"; + return service.list(apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws FabricErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/MeshServiceReplicasInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/MeshServiceReplicasInner.java new file mode 100644 index 0000000000000..7ab4301030a5b --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/MeshServiceReplicasInner.java @@ -0,0 +1,241 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.servicefabric.FabricErrorException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in MeshServiceReplicas. + */ +public class MeshServiceReplicasInner { + /** The Retrofit service to perform REST calls. */ + private MeshServiceReplicasService service; + /** The service client containing this operation class. */ + private ServiceFabricClientAPIsImpl client; + + /** + * Initializes an instance of MeshServiceReplicasInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public MeshServiceReplicasInner(Retrofit retrofit, ServiceFabricClientAPIsImpl client) { + this.service = retrofit.create(MeshServiceReplicasService.class); + this.client = client; + } + + /** + * The interface defining all the services for MeshServiceReplicas to be + * used by Retrofit to perform actually REST calls. + */ + interface MeshServiceReplicasService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.MeshServiceReplicas get" }) + @GET("Resources/Applications/{applicationResourceName}/Services/{serviceResourceName}/Replicas/{replicaName}") + Observable> get(@Path(value = "applicationResourceName", encoded = true) String applicationResourceName, @Path(value = "serviceResourceName", encoded = true) String serviceResourceName, @Path(value = "replicaName", encoded = true) String replicaName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.MeshServiceReplicas list" }) + @GET("Resources/Applications/{applicationResourceName}/Services/{serviceResourceName}/Replicas") + Observable> list(@Path(value = "applicationResourceName", encoded = true) String applicationResourceName, @Path(value = "serviceResourceName", encoded = true) String serviceResourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @param replicaName Service Fabric replica name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceReplicaDescriptionInner object if successful. + */ + public ServiceReplicaDescriptionInner get(String applicationResourceName, String serviceResourceName, String replicaName) { + return getWithServiceResponseAsync(applicationResourceName, serviceResourceName, replicaName).toBlocking().single().body(); + } + + /** + * 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 applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @param replicaName Service Fabric replica name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String applicationResourceName, String serviceResourceName, String replicaName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(applicationResourceName, serviceResourceName, replicaName), serviceCallback); + } + + /** + * 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 applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @param replicaName Service Fabric replica name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceReplicaDescriptionInner object + */ + public Observable getAsync(String applicationResourceName, String serviceResourceName, String replicaName) { + return getWithServiceResponseAsync(applicationResourceName, serviceResourceName, replicaName).map(new Func1, ServiceReplicaDescriptionInner>() { + @Override + public ServiceReplicaDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @param replicaName Service Fabric replica name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceReplicaDescriptionInner object + */ + public Observable> getWithServiceResponseAsync(String applicationResourceName, String serviceResourceName, String replicaName) { + if (applicationResourceName == null) { + throw new IllegalArgumentException("Parameter applicationResourceName is required and cannot be null."); + } + if (serviceResourceName == null) { + throw new IllegalArgumentException("Parameter serviceResourceName is required and cannot be null."); + } + if (replicaName == null) { + throw new IllegalArgumentException("Parameter replicaName is required and cannot be null."); + } + final String apiVersion = "6.4-preview"; + return service.get(applicationResourceName, serviceResourceName, replicaName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedServiceReplicaDescriptionListInner object if successful. + */ + public PagedServiceReplicaDescriptionListInner list(String applicationResourceName, String serviceResourceName) { + return listWithServiceResponseAsync(applicationResourceName, serviceResourceName).toBlocking().single().body(); + } + + /** + * 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 applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(String applicationResourceName, String serviceResourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(applicationResourceName, serviceResourceName), serviceCallback); + } + + /** + * 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 applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedServiceReplicaDescriptionListInner object + */ + public Observable listAsync(String applicationResourceName, String serviceResourceName) { + return listWithServiceResponseAsync(applicationResourceName, serviceResourceName).map(new Func1, PagedServiceReplicaDescriptionListInner>() { + @Override + public PagedServiceReplicaDescriptionListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedServiceReplicaDescriptionListInner object + */ + public Observable> listWithServiceResponseAsync(String applicationResourceName, String serviceResourceName) { + if (applicationResourceName == null) { + throw new IllegalArgumentException("Parameter applicationResourceName is required and cannot be null."); + } + if (serviceResourceName == null) { + throw new IllegalArgumentException("Parameter serviceResourceName is required and cannot be null."); + } + final String apiVersion = "6.4-preview"; + return service.list(applicationResourceName, serviceResourceName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/MeshServicesInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/MeshServicesInner.java new file mode 100644 index 0000000000000..dd664e5c669ab --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/MeshServicesInner.java @@ -0,0 +1,227 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.servicefabric.FabricErrorException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in MeshServices. + */ +public class MeshServicesInner { + /** The Retrofit service to perform REST calls. */ + private MeshServicesService service; + /** The service client containing this operation class. */ + private ServiceFabricClientAPIsImpl client; + + /** + * Initializes an instance of MeshServicesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public MeshServicesInner(Retrofit retrofit, ServiceFabricClientAPIsImpl client) { + this.service = retrofit.create(MeshServicesService.class); + this.client = client; + } + + /** + * The interface defining all the services for MeshServices to be + * used by Retrofit to perform actually REST calls. + */ + interface MeshServicesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.MeshServices get" }) + @GET("Resources/Applications/{applicationResourceName}/Services/{serviceResourceName}") + Observable> get(@Path(value = "applicationResourceName", encoded = true) String applicationResourceName, @Path(value = "serviceResourceName", encoded = true) String serviceResourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.MeshServices list" }) + @GET("Resources/Applications/{applicationResourceName}/Services") + Observable> list(@Path(value = "applicationResourceName", encoded = true) String applicationResourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceResourceDescriptionInner object if successful. + */ + public ServiceResourceDescriptionInner get(String applicationResourceName, String serviceResourceName) { + return getWithServiceResponseAsync(applicationResourceName, serviceResourceName).toBlocking().single().body(); + } + + /** + * 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 applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String applicationResourceName, String serviceResourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(applicationResourceName, serviceResourceName), serviceCallback); + } + + /** + * 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 applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceResourceDescriptionInner object + */ + public Observable getAsync(String applicationResourceName, String serviceResourceName) { + return getWithServiceResponseAsync(applicationResourceName, serviceResourceName).map(new Func1, ServiceResourceDescriptionInner>() { + @Override + public ServiceResourceDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceResourceDescriptionInner object + */ + public Observable> getWithServiceResponseAsync(String applicationResourceName, String serviceResourceName) { + if (applicationResourceName == null) { + throw new IllegalArgumentException("Parameter applicationResourceName is required and cannot be null."); + } + if (serviceResourceName == null) { + throw new IllegalArgumentException("Parameter serviceResourceName is required and cannot be null."); + } + final String apiVersion = "6.4-preview"; + return service.get(applicationResourceName, serviceResourceName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 applicationResourceName The identity of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedServiceResourceDescriptionListInner object if successful. + */ + public PagedServiceResourceDescriptionListInner list(String applicationResourceName) { + return listWithServiceResponseAsync(applicationResourceName).toBlocking().single().body(); + } + + /** + * 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 applicationResourceName The identity of the application. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(String applicationResourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(applicationResourceName), serviceCallback); + } + + /** + * 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 applicationResourceName The identity of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedServiceResourceDescriptionListInner object + */ + public Observable listAsync(String applicationResourceName) { + return listWithServiceResponseAsync(applicationResourceName).map(new Func1, PagedServiceResourceDescriptionListInner>() { + @Override + public PagedServiceResourceDescriptionListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 applicationResourceName The identity of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedServiceResourceDescriptionListInner object + */ + public Observable> listWithServiceResponseAsync(String applicationResourceName) { + if (applicationResourceName == null) { + throw new IllegalArgumentException("Parameter applicationResourceName is required and cannot be null."); + } + final String apiVersion = "6.4-preview"; + return service.list(applicationResourceName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/MeshVolumesInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/MeshVolumesInner.java new file mode 100644 index 0000000000000..de8d35d7e2545 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/MeshVolumesInner.java @@ -0,0 +1,392 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.servicefabric.FabricErrorException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in MeshVolumes. + */ +public class MeshVolumesInner { + /** The Retrofit service to perform REST calls. */ + private MeshVolumesService service; + /** The service client containing this operation class. */ + private ServiceFabricClientAPIsImpl client; + + /** + * Initializes an instance of MeshVolumesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public MeshVolumesInner(Retrofit retrofit, ServiceFabricClientAPIsImpl client) { + this.service = retrofit.create(MeshVolumesService.class); + this.client = client; + } + + /** + * The interface defining all the services for MeshVolumes to be + * used by Retrofit to perform actually REST calls. + */ + interface MeshVolumesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.MeshVolumes createOrUpdate" }) + @PUT("Resources/Volumes/{volumeResourceName}") + Observable> createOrUpdate(@Path(value = "volumeResourceName", encoded = true) String volumeResourceName, @Query("api-version") String apiVersion, @Body VolumeResourceDescriptionInner volumeResourceDescription, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.MeshVolumes get" }) + @GET("Resources/Volumes/{volumeResourceName}") + Observable> get(@Path(value = "volumeResourceName", encoded = true) String volumeResourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.MeshVolumes delete" }) + @HTTP(path = "Resources/Volumes/{volumeResourceName}", method = "DELETE", hasBody = true) + Observable> delete(@Path(value = "volumeResourceName", encoded = true) String volumeResourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.MeshVolumes list" }) + @GET("Resources/Volumes") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 volumeResourceName The identity of the volume. + * @param volumeResourceDescription Description for creating a Volume resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VolumeResourceDescriptionInner object if successful. + */ + public VolumeResourceDescriptionInner createOrUpdate(String volumeResourceName, VolumeResourceDescriptionInner volumeResourceDescription) { + return createOrUpdateWithServiceResponseAsync(volumeResourceName, volumeResourceDescription).toBlocking().single().body(); + } + + /** + * 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 volumeResourceName The identity of the volume. + * @param volumeResourceDescription Description for creating a Volume resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String volumeResourceName, VolumeResourceDescriptionInner volumeResourceDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(volumeResourceName, volumeResourceDescription), serviceCallback); + } + + /** + * 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 volumeResourceName The identity of the volume. + * @param volumeResourceDescription Description for creating a Volume resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VolumeResourceDescriptionInner object + */ + public Observable createOrUpdateAsync(String volumeResourceName, VolumeResourceDescriptionInner volumeResourceDescription) { + return createOrUpdateWithServiceResponseAsync(volumeResourceName, volumeResourceDescription).map(new Func1, VolumeResourceDescriptionInner>() { + @Override + public VolumeResourceDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 volumeResourceName The identity of the volume. + * @param volumeResourceDescription Description for creating a Volume resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VolumeResourceDescriptionInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String volumeResourceName, VolumeResourceDescriptionInner volumeResourceDescription) { + if (volumeResourceName == null) { + throw new IllegalArgumentException("Parameter volumeResourceName is required and cannot be null."); + } + if (volumeResourceDescription == null) { + throw new IllegalArgumentException("Parameter volumeResourceDescription is required and cannot be null."); + } + Validator.validate(volumeResourceDescription); + final String apiVersion = "6.4-preview"; + return service.createOrUpdate(volumeResourceName, apiVersion, volumeResourceDescription, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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 volumeResourceName The identity of the volume. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VolumeResourceDescriptionInner object if successful. + */ + public VolumeResourceDescriptionInner get(String volumeResourceName) { + return getWithServiceResponseAsync(volumeResourceName).toBlocking().single().body(); + } + + /** + * 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 volumeResourceName The identity of the volume. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String volumeResourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(volumeResourceName), serviceCallback); + } + + /** + * 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 volumeResourceName The identity of the volume. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VolumeResourceDescriptionInner object + */ + public Observable getAsync(String volumeResourceName) { + return getWithServiceResponseAsync(volumeResourceName).map(new Func1, VolumeResourceDescriptionInner>() { + @Override + public VolumeResourceDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 volumeResourceName The identity of the volume. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VolumeResourceDescriptionInner object + */ + public Observable> getWithServiceResponseAsync(String volumeResourceName) { + if (volumeResourceName == null) { + throw new IllegalArgumentException("Parameter volumeResourceName is required and cannot be null."); + } + final String apiVersion = "6.4-preview"; + return service.get(volumeResourceName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * Deletes the Volume resource. + * Deletes the Volume resource identified by the name. + * + * @param volumeResourceName The identity of the volume. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String volumeResourceName) { + deleteWithServiceResponseAsync(volumeResourceName).toBlocking().single().body(); + } + + /** + * Deletes the Volume resource. + * Deletes the Volume resource identified by the name. + * + * @param volumeResourceName The identity of the volume. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String volumeResourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(volumeResourceName), serviceCallback); + } + + /** + * Deletes the Volume resource. + * Deletes the Volume resource identified by the name. + * + * @param volumeResourceName The identity of the volume. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String volumeResourceName) { + return deleteWithServiceResponseAsync(volumeResourceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the Volume resource. + * Deletes the Volume resource identified by the name. + * + * @param volumeResourceName The identity of the volume. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String volumeResourceName) { + if (volumeResourceName == null) { + throw new IllegalArgumentException("Parameter volumeResourceName is required and cannot be null."); + } + final String apiVersion = "6.4-preview"; + return service.delete(volumeResourceName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedVolumeResourceDescriptionListInner object if successful. + */ + public PagedVolumeResourceDescriptionListInner list() { + return listWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedVolumeResourceDescriptionListInner object + */ + public Observable listAsync() { + return listWithServiceResponseAsync().map(new Func1, PagedVolumeResourceDescriptionListInner>() { + @Override + public PagedVolumeResourceDescriptionListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedVolumeResourceDescriptionListInner object + */ + public Observable> listWithServiceResponseAsync() { + final String apiVersion = "6.4-preview"; + return service.list(apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws FabricErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/NetworkResourceDescriptionInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/NetworkResourceDescriptionInner.java new file mode 100644 index 0000000000000..19357891e684e --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/NetworkResourceDescriptionInner.java @@ -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. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.microsoft.azure.servicefabric.NetworkResourceProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * This type describes a network resource. + */ +public class NetworkResourceDescriptionInner { + /** + * Name of the Network resource. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Describes properties of a network resource. + */ + @JsonProperty(value = "properties", required = true) + private NetworkResourceProperties properties; + + /** + * Get name of the Network resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the Network resource. + * + * @param name the name value to set + * @return the NetworkResourceDescriptionInner object itself. + */ + public NetworkResourceDescriptionInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get describes properties of a network resource. + * + * @return the properties value + */ + public NetworkResourceProperties properties() { + return this.properties; + } + + /** + * Set describes properties of a network resource. + * + * @param properties the properties value to set + * @return the NetworkResourceDescriptionInner object itself. + */ + public NetworkResourceDescriptionInner withProperties(NetworkResourceProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/NodeEventInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/NodeEventInner.java index 44775c9c44ed1..f9c3f105022a4 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/NodeEventInner.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/NodeEventInner.java @@ -20,22 +20,18 @@ @JsonTypeName("NodeEvent") @JsonSubTypes({ @JsonSubTypes.Type(name = "NodeAborted", value = NodeAbortedEvent.class), - @JsonSubTypes.Type(name = "NodeAborting", value = NodeAbortingEvent.class), - @JsonSubTypes.Type(name = "NodeAdded", value = NodeAddedEvent.class), - @JsonSubTypes.Type(name = "NodeClose", value = NodeCloseEvent.class), - @JsonSubTypes.Type(name = "NodeClosing", value = NodeClosingEvent.class), - @JsonSubTypes.Type(name = "NodeDeactivateComplete", value = NodeDeactivateCompleteEvent.class), - @JsonSubTypes.Type(name = "NodeDeactivateStart", value = NodeDeactivateStartEvent.class), + @JsonSubTypes.Type(name = "NodeAddedToCluster", value = NodeAddedToClusterEvent.class), + @JsonSubTypes.Type(name = "NodeClosed", value = NodeClosedEvent.class), + @JsonSubTypes.Type(name = "NodeDeactivateCompleted", value = NodeDeactivateCompletedEvent.class), + @JsonSubTypes.Type(name = "NodeDeactivateStarted", value = NodeDeactivateStartedEvent.class), @JsonSubTypes.Type(name = "NodeDown", value = NodeDownEvent.class), - @JsonSubTypes.Type(name = "NodeHealthReportCreated", value = NodeHealthReportCreatedEvent.class), + @JsonSubTypes.Type(name = "NodeNewHealthReport", value = NodeNewHealthReportEvent.class), @JsonSubTypes.Type(name = "NodeHealthReportExpired", value = NodeHealthReportExpiredEvent.class), - @JsonSubTypes.Type(name = "NodeOpenedSuccess", value = NodeOpenedSuccessEvent.class), + @JsonSubTypes.Type(name = "NodeOpenSucceeded", value = NodeOpenSucceededEvent.class), @JsonSubTypes.Type(name = "NodeOpenFailed", value = NodeOpenFailedEvent.class), - @JsonSubTypes.Type(name = "NodeOpening", value = NodeOpeningEvent.class), - @JsonSubTypes.Type(name = "NodeRemoved", value = NodeRemovedEvent.class), + @JsonSubTypes.Type(name = "NodeRemovedFromCluster", value = NodeRemovedFromClusterEvent.class), @JsonSubTypes.Type(name = "NodeUp", value = NodeUpEvent.class), - @JsonSubTypes.Type(name = "ChaosRestartNodeFaultCompleted", value = ChaosRestartNodeFaultCompletedEvent.class), - @JsonSubTypes.Type(name = "ChaosRestartNodeFaultScheduled", value = ChaosRestartNodeFaultScheduledEvent.class) + @JsonSubTypes.Type(name = "ChaosNodeRestartScheduled", value = ChaosNodeRestartScheduledEvent.class) }) public class NodeEventInner extends FabricEventInner { /** diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedApplicationResourceDescriptionListInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedApplicationResourceDescriptionListInner.java new file mode 100644 index 0000000000000..35b6f9169c3ae --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedApplicationResourceDescriptionListInner.java @@ -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. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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. + */ +public class PagedApplicationResourceDescriptionListInner { + /** + * 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. + */ + @JsonProperty(value = "ContinuationToken") + private String continuationToken; + + /** + * One page of the list. + */ + @JsonProperty(value = "Items") + private List items; + + /** + * Get 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. + * + * @return the continuationToken value + */ + public String continuationToken() { + return this.continuationToken; + } + + /** + * Set 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. + * + * @param continuationToken the continuationToken value to set + * @return the PagedApplicationResourceDescriptionListInner object itself. + */ + public PagedApplicationResourceDescriptionListInner withContinuationToken(String continuationToken) { + this.continuationToken = continuationToken; + return this; + } + + /** + * Get one page of the list. + * + * @return the items value + */ + public List items() { + return this.items; + } + + /** + * Set one page of the list. + * + * @param items the items value to set + * @return the PagedApplicationResourceDescriptionListInner object itself. + */ + public PagedApplicationResourceDescriptionListInner withItems(List items) { + this.items = items; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedGatewayResourceDescriptionListInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedGatewayResourceDescriptionListInner.java new file mode 100644 index 0000000000000..4dfdf3f6e1a64 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedGatewayResourceDescriptionListInner.java @@ -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. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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. + */ +public class PagedGatewayResourceDescriptionListInner { + /** + * 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. + */ + @JsonProperty(value = "ContinuationToken") + private String continuationToken; + + /** + * One page of the list. + */ + @JsonProperty(value = "Items") + private List items; + + /** + * Get 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. + * + * @return the continuationToken value + */ + public String continuationToken() { + return this.continuationToken; + } + + /** + * Set 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. + * + * @param continuationToken the continuationToken value to set + * @return the PagedGatewayResourceDescriptionListInner object itself. + */ + public PagedGatewayResourceDescriptionListInner withContinuationToken(String continuationToken) { + this.continuationToken = continuationToken; + return this; + } + + /** + * Get one page of the list. + * + * @return the items value + */ + public List items() { + return this.items; + } + + /** + * Set one page of the list. + * + * @param items the items value to set + * @return the PagedGatewayResourceDescriptionListInner object itself. + */ + public PagedGatewayResourceDescriptionListInner withItems(List items) { + this.items = items; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedNetworkResourceDescriptionListInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedNetworkResourceDescriptionListInner.java new file mode 100644 index 0000000000000..b90b9daf9d210 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedNetworkResourceDescriptionListInner.java @@ -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. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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. + */ +public class PagedNetworkResourceDescriptionListInner { + /** + * 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. + */ + @JsonProperty(value = "ContinuationToken") + private String continuationToken; + + /** + * One page of the list. + */ + @JsonProperty(value = "Items") + private List items; + + /** + * Get 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. + * + * @return the continuationToken value + */ + public String continuationToken() { + return this.continuationToken; + } + + /** + * Set 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. + * + * @param continuationToken the continuationToken value to set + * @return the PagedNetworkResourceDescriptionListInner object itself. + */ + public PagedNetworkResourceDescriptionListInner withContinuationToken(String continuationToken) { + this.continuationToken = continuationToken; + return this; + } + + /** + * Get one page of the list. + * + * @return the items value + */ + public List items() { + return this.items; + } + + /** + * Set one page of the list. + * + * @param items the items value to set + * @return the PagedNetworkResourceDescriptionListInner object itself. + */ + public PagedNetworkResourceDescriptionListInner withItems(List items) { + this.items = items; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedSecretResourceDescriptionListInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedSecretResourceDescriptionListInner.java new file mode 100644 index 0000000000000..1ab498de791ac --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedSecretResourceDescriptionListInner.java @@ -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. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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. + */ +public class PagedSecretResourceDescriptionListInner { + /** + * 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. + */ + @JsonProperty(value = "ContinuationToken") + private String continuationToken; + + /** + * One page of the list. + */ + @JsonProperty(value = "Items") + private List items; + + /** + * Get 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. + * + * @return the continuationToken value + */ + public String continuationToken() { + return this.continuationToken; + } + + /** + * Set 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. + * + * @param continuationToken the continuationToken value to set + * @return the PagedSecretResourceDescriptionListInner object itself. + */ + public PagedSecretResourceDescriptionListInner withContinuationToken(String continuationToken) { + this.continuationToken = continuationToken; + return this; + } + + /** + * Get one page of the list. + * + * @return the items value + */ + public List items() { + return this.items; + } + + /** + * Set one page of the list. + * + * @param items the items value to set + * @return the PagedSecretResourceDescriptionListInner object itself. + */ + public PagedSecretResourceDescriptionListInner withItems(List items) { + this.items = items; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedSecretValueResourceDescriptionListInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedSecretValueResourceDescriptionListInner.java new file mode 100644 index 0000000000000..5ea44e1927ec9 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedSecretValueResourceDescriptionListInner.java @@ -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. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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. + */ +public class PagedSecretValueResourceDescriptionListInner { + /** + * 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. + */ + @JsonProperty(value = "ContinuationToken") + private String continuationToken; + + /** + * One page of the list. + */ + @JsonProperty(value = "Items") + private List items; + + /** + * Get 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. + * + * @return the continuationToken value + */ + public String continuationToken() { + return this.continuationToken; + } + + /** + * Set 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. + * + * @param continuationToken the continuationToken value to set + * @return the PagedSecretValueResourceDescriptionListInner object itself. + */ + public PagedSecretValueResourceDescriptionListInner withContinuationToken(String continuationToken) { + this.continuationToken = continuationToken; + return this; + } + + /** + * Get one page of the list. + * + * @return the items value + */ + public List items() { + return this.items; + } + + /** + * Set one page of the list. + * + * @param items the items value to set + * @return the PagedSecretValueResourceDescriptionListInner object itself. + */ + public PagedSecretValueResourceDescriptionListInner withItems(List items) { + this.items = items; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedServiceReplicaDescriptionListInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedServiceReplicaDescriptionListInner.java new file mode 100644 index 0000000000000..034b3faa06d59 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedServiceReplicaDescriptionListInner.java @@ -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. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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. + */ +public class PagedServiceReplicaDescriptionListInner { + /** + * 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. + */ + @JsonProperty(value = "ContinuationToken") + private String continuationToken; + + /** + * List of service resource replica description. + */ + @JsonProperty(value = "Items") + private List items; + + /** + * Get 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. + * + * @return the continuationToken value + */ + public String continuationToken() { + return this.continuationToken; + } + + /** + * Set 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. + * + * @param continuationToken the continuationToken value to set + * @return the PagedServiceReplicaDescriptionListInner object itself. + */ + public PagedServiceReplicaDescriptionListInner withContinuationToken(String continuationToken) { + this.continuationToken = continuationToken; + return this; + } + + /** + * Get list of service resource replica description. + * + * @return the items value + */ + public List items() { + return this.items; + } + + /** + * Set list of service resource replica description. + * + * @param items the items value to set + * @return the PagedServiceReplicaDescriptionListInner object itself. + */ + public PagedServiceReplicaDescriptionListInner withItems(List items) { + this.items = items; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedServiceResourceDescriptionListInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedServiceResourceDescriptionListInner.java index 4946d4c248353..1a3c60d1988ce 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedServiceResourceDescriptionListInner.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedServiceResourceDescriptionListInner.java @@ -12,10 +12,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * 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. */ public class PagedServiceResourceDescriptionListInner { /** @@ -30,7 +29,7 @@ public class PagedServiceResourceDescriptionListInner { private String continuationToken; /** - * List of service resource description. + * One page of the list. */ @JsonProperty(value = "Items") private List items; @@ -56,7 +55,7 @@ public PagedServiceResourceDescriptionListInner withContinuationToken(String con } /** - * Get list of service resource description. + * Get one page of the list. * * @return the items value */ @@ -65,7 +64,7 @@ public List items() { } /** - * Set list of service resource description. + * Set one page of the list. * * @param items the items value to set * @return the PagedServiceResourceDescriptionListInner object itself. diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedVolumeResourceDescriptionListInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedVolumeResourceDescriptionListInner.java new file mode 100644 index 0000000000000..3f395b85a86ad --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PagedVolumeResourceDescriptionListInner.java @@ -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. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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. + */ +public class PagedVolumeResourceDescriptionListInner { + /** + * 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. + */ + @JsonProperty(value = "ContinuationToken") + private String continuationToken; + + /** + * One page of the list. + */ + @JsonProperty(value = "Items") + private List items; + + /** + * Get 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. + * + * @return the continuationToken value + */ + public String continuationToken() { + return this.continuationToken; + } + + /** + * Set 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. + * + * @param continuationToken the continuationToken value to set + * @return the PagedVolumeResourceDescriptionListInner object itself. + */ + public PagedVolumeResourceDescriptionListInner withContinuationToken(String continuationToken) { + this.continuationToken = continuationToken; + return this; + } + + /** + * Get one page of the list. + * + * @return the items value + */ + public List items() { + return this.items; + } + + /** + * Set one page of the list. + * + * @param items the items value to set + * @return the PagedVolumeResourceDescriptionListInner object itself. + */ + public PagedVolumeResourceDescriptionListInner withItems(List items) { + this.items = items; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PartitionBackupConfigurationInfoInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PartitionBackupConfigurationInfoInner.java index 3a012a54aaa91..dfcb28a6af001 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PartitionBackupConfigurationInfoInner.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PartitionBackupConfigurationInfoInner.java @@ -28,11 +28,7 @@ public class PartitionBackupConfigurationInfoInner extends BackupConfigurationIn private String serviceName; /** - * 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. + * The partition ID indentifying the partition. */ @JsonProperty(value = "PartitionId") private UUID partitionId; @@ -58,7 +54,7 @@ public PartitionBackupConfigurationInfoInner withServiceName(String serviceName) } /** - * Get 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. + * Get the partition ID indentifying the partition. * * @return the partitionId value */ @@ -67,7 +63,7 @@ public UUID partitionId() { } /** - * Set 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. + * Set the partition ID indentifying the partition. * * @param partitionId the partitionId value to set * @return the PartitionBackupConfigurationInfoInner object itself. diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PartitionEventInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PartitionEventInner.java index 13f44eb30ce1b..5a5612f09b08f 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PartitionEventInner.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/PartitionEventInner.java @@ -21,11 +21,11 @@ @JsonTypeName("PartitionEvent") @JsonSubTypes({ @JsonSubTypes.Type(name = "PartitionAnalysisEvent", value = PartitionAnalysisEvent.class), - @JsonSubTypes.Type(name = "PartitionHealthReportCreated", value = PartitionHealthReportCreatedEvent.class), + @JsonSubTypes.Type(name = "PartitionNewHealthReport", value = PartitionNewHealthReportEvent.class), @JsonSubTypes.Type(name = "PartitionHealthReportExpired", value = PartitionHealthReportExpiredEvent.class), - @JsonSubTypes.Type(name = "PartitionReconfigurationCompleted", value = PartitionReconfigurationCompletedEvent.class), - @JsonSubTypes.Type(name = "ChaosMoveSecondaryFaultScheduled", value = ChaosMoveSecondaryFaultScheduledEvent.class), - @JsonSubTypes.Type(name = "ChaosMovePrimaryFaultScheduled", value = ChaosMovePrimaryFaultScheduledEvent.class) + @JsonSubTypes.Type(name = "PartitionReconfigured", value = PartitionReconfiguredEvent.class), + @JsonSubTypes.Type(name = "ChaosPartitionSecondaryMoveScheduled", value = ChaosPartitionSecondaryMoveScheduledEvent.class), + @JsonSubTypes.Type(name = "ChaosPartitionPrimaryMoveScheduled", value = ChaosPartitionPrimaryMoveScheduledEvent.class) }) public class PartitionEventInner extends FabricEventInner { /** diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ReplicaEventInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ReplicaEventInner.java index 5cddf06d6e2a6..a49976e5fb7c0 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ReplicaEventInner.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ReplicaEventInner.java @@ -20,13 +20,12 @@ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Kind") @JsonTypeName("ReplicaEvent") @JsonSubTypes({ - @JsonSubTypes.Type(name = "StatefulReplicaHealthReportCreated", value = StatefulReplicaHealthReportCreatedEvent.class), + @JsonSubTypes.Type(name = "StatefulReplicaNewHealthReport", value = StatefulReplicaNewHealthReportEvent.class), @JsonSubTypes.Type(name = "StatefulReplicaHealthReportExpired", value = StatefulReplicaHealthReportExpiredEvent.class), - @JsonSubTypes.Type(name = "StatelessReplicaHealthReportCreated", value = StatelessReplicaHealthReportCreatedEvent.class), + @JsonSubTypes.Type(name = "StatelessReplicaNewHealthReport", value = StatelessReplicaNewHealthReportEvent.class), @JsonSubTypes.Type(name = "StatelessReplicaHealthReportExpired", value = StatelessReplicaHealthReportExpiredEvent.class), - @JsonSubTypes.Type(name = "ChaosRemoveReplicaFaultScheduled", value = ChaosRemoveReplicaFaultScheduledEvent.class), - @JsonSubTypes.Type(name = "ChaosRemoveReplicaFaultCompleted", value = ChaosRemoveReplicaFaultCompletedEvent.class), - @JsonSubTypes.Type(name = "ChaosRestartReplicaFaultScheduled", value = ChaosRestartReplicaFaultScheduledEvent.class) + @JsonSubTypes.Type(name = "ChaosReplicaRemovalScheduled", value = ChaosReplicaRemovalScheduledEvent.class), + @JsonSubTypes.Type(name = "ChaosReplicaRestartScheduled", value = ChaosReplicaRestartScheduledEvent.class) }) public class ReplicaEventInner extends FabricEventInner { /** diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/RestoreProgressInfoInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/RestoreProgressInfoInner.java index b04e3d8f1ae3f..4cd5213ef6338 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/RestoreProgressInfoInner.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/RestoreProgressInfoInner.java @@ -10,7 +10,7 @@ import com.microsoft.azure.servicefabric.RestoreState; import org.joda.time.DateTime; -import com.microsoft.azure.servicefabric.BackupEpoch; +import com.microsoft.azure.servicefabric.Epoch; import com.microsoft.azure.servicefabric.FabricErrorError; import com.fasterxml.jackson.annotation.JsonProperty; @@ -36,7 +36,7 @@ public class RestoreProgressInfoInner { * Describes the epoch at which the partition is restored. */ @JsonProperty(value = "RestoredEpoch") - private BackupEpoch restoredEpoch; + private Epoch restoredEpoch; /** * Restored LSN. @@ -95,7 +95,7 @@ public RestoreProgressInfoInner withTimeStampUtc(DateTime timeStampUtc) { * * @return the restoredEpoch value */ - public BackupEpoch restoredEpoch() { + public Epoch restoredEpoch() { return this.restoredEpoch; } @@ -105,7 +105,7 @@ public BackupEpoch restoredEpoch() { * @param restoredEpoch the restoredEpoch value to set * @return the RestoreProgressInfoInner object itself. */ - public RestoreProgressInfoInner withRestoredEpoch(BackupEpoch restoredEpoch) { + public RestoreProgressInfoInner withRestoredEpoch(Epoch restoredEpoch) { this.restoredEpoch = restoredEpoch; return this; } diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/SecretResourceDescriptionInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/SecretResourceDescriptionInner.java new file mode 100644 index 0000000000000..d4aa7c6274179 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/SecretResourceDescriptionInner.java @@ -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. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.microsoft.azure.servicefabric.SecretResourceProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * This type describes a secret resource. + */ +public class SecretResourceDescriptionInner { + /** + * Describes the properties of a secret resource. + */ + @JsonProperty(value = "properties", required = true) + private SecretResourceProperties properties; + + /** + * Name of the Secret resource. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get describes the properties of a secret resource. + * + * @return the properties value + */ + public SecretResourceProperties properties() { + return this.properties; + } + + /** + * Set describes the properties of a secret resource. + * + * @param properties the properties value to set + * @return the SecretResourceDescriptionInner object itself. + */ + public SecretResourceDescriptionInner withProperties(SecretResourceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get name of the Secret resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the Secret resource. + * + * @param name the name value to set + * @return the SecretResourceDescriptionInner object itself. + */ + public SecretResourceDescriptionInner withName(String name) { + this.name = name; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/SecretValueInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/SecretValueInner.java new file mode 100644 index 0000000000000..2e8db82a47d2b --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/SecretValueInner.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * This type represents the unencrypted value of the secret. + */ +public class SecretValueInner { + /** + * The actual value of the secret. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the actual value of the secret. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the actual value of the secret. + * + * @param value the value value to set + * @return the SecretValueInner object itself. + */ + public SecretValueInner withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/SecretValueResourceDescriptionInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/SecretValueResourceDescriptionInner.java new file mode 100644 index 0000000000000..4962423ea8ed1 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/SecretValueResourceDescriptionInner.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * This type describes a value of a secret resource. The name of this resource + * is the version identifier corresponding to this secret value. + */ +@JsonFlatten +public class SecretValueResourceDescriptionInner { + /** + * Version identifier of the secret value. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The actual value of the secret. + */ + @JsonProperty(value = "properties.value") + private String value; + + /** + * Get version identifier of the secret value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set version identifier of the secret value. + * + * @param name the name value to set + * @return the SecretValueResourceDescriptionInner object itself. + */ + public SecretValueResourceDescriptionInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the actual value of the secret. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the actual value of the secret. + * + * @param value the value value to set + * @return the SecretValueResourceDescriptionInner object itself. + */ + public SecretValueResourceDescriptionInner withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceEventInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceEventInner.java index 2bbf020ba99a3..0eb05a774230e 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceEventInner.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceEventInner.java @@ -21,7 +21,7 @@ @JsonSubTypes({ @JsonSubTypes.Type(name = "ServiceCreated", value = ServiceCreatedEvent.class), @JsonSubTypes.Type(name = "ServiceDeleted", value = ServiceDeletedEvent.class), - @JsonSubTypes.Type(name = "ServiceHealthReportCreated", value = ServiceHealthReportCreatedEvent.class), + @JsonSubTypes.Type(name = "ServiceNewHealthReport", value = ServiceNewHealthReportEvent.class), @JsonSubTypes.Type(name = "ServiceHealthReportExpired", value = ServiceHealthReportExpiredEvent.class) }) public class ServiceEventInner extends FabricEventInner { diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceFabricClientAPIsImpl.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceFabricClientAPIsImpl.java index f603de19d55c6..908ce3386df88 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceFabricClientAPIsImpl.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceFabricClientAPIsImpl.java @@ -11,7 +11,6 @@ import com.google.common.reflect.TypeToken; import com.microsoft.azure.AzureClient; import com.microsoft.azure.AzureServiceClient; -import com.microsoft.azure.CloudException; import com.microsoft.azure.servicefabric.ApplicationDescription; import com.microsoft.azure.servicefabric.ApplicationHealthPolicy; import com.microsoft.azure.servicefabric.ApplicationUpgradeDescription; @@ -30,6 +29,7 @@ import com.microsoft.azure.servicefabric.DeactivationIntent; import com.microsoft.azure.servicefabric.DeactivationIntentDescription; import com.microsoft.azure.servicefabric.DeployServicePackageToNodeDescription; +import com.microsoft.azure.servicefabric.DisableBackupDescription; import com.microsoft.azure.servicefabric.EnableBackupDescription; import com.microsoft.azure.servicefabric.FabricErrorException; import com.microsoft.azure.servicefabric.GetBackupByStorageQueryDescription; @@ -172,6 +172,123 @@ public ServiceFabricClientAPIsImpl withGenerateClientRequestId(boolean generateC return this; } + /** + * The MeshSecretsInner object to access its operations. + */ + private MeshSecretsInner meshSecrets; + + /** + * Gets the MeshSecretsInner object to access its operations. + * @return the MeshSecretsInner object. + */ + public MeshSecretsInner meshSecrets() { + return this.meshSecrets; + } + + /** + * The MeshSecretValuesInner object to access its operations. + */ + private MeshSecretValuesInner meshSecretValues; + + /** + * Gets the MeshSecretValuesInner object to access its operations. + * @return the MeshSecretValuesInner object. + */ + public MeshSecretValuesInner meshSecretValues() { + return this.meshSecretValues; + } + + /** + * The MeshVolumesInner object to access its operations. + */ + private MeshVolumesInner meshVolumes; + + /** + * Gets the MeshVolumesInner object to access its operations. + * @return the MeshVolumesInner object. + */ + public MeshVolumesInner meshVolumes() { + return this.meshVolumes; + } + + /** + * The MeshNetworksInner object to access its operations. + */ + private MeshNetworksInner meshNetworks; + + /** + * Gets the MeshNetworksInner object to access its operations. + * @return the MeshNetworksInner object. + */ + public MeshNetworksInner meshNetworks() { + return this.meshNetworks; + } + + /** + * The MeshApplicationsInner object to access its operations. + */ + private MeshApplicationsInner meshApplications; + + /** + * Gets the MeshApplicationsInner object to access its operations. + * @return the MeshApplicationsInner object. + */ + public MeshApplicationsInner meshApplications() { + return this.meshApplications; + } + + /** + * The MeshServicesInner object to access its operations. + */ + private MeshServicesInner meshServices; + + /** + * Gets the MeshServicesInner object to access its operations. + * @return the MeshServicesInner object. + */ + public MeshServicesInner meshServices() { + return this.meshServices; + } + + /** + * The MeshCodePackagesInner object to access its operations. + */ + private MeshCodePackagesInner meshCodePackages; + + /** + * Gets the MeshCodePackagesInner object to access its operations. + * @return the MeshCodePackagesInner object. + */ + public MeshCodePackagesInner meshCodePackages() { + return this.meshCodePackages; + } + + /** + * The MeshServiceReplicasInner object to access its operations. + */ + private MeshServiceReplicasInner meshServiceReplicas; + + /** + * Gets the MeshServiceReplicasInner object to access its operations. + * @return the MeshServiceReplicasInner object. + */ + public MeshServiceReplicasInner meshServiceReplicas() { + return this.meshServiceReplicas; + } + + /** + * The MeshGatewaysInner object to access its operations. + */ + private MeshGatewaysInner meshGateways; + + /** + * Gets the MeshGatewaysInner object to access its operations. + * @return the MeshGatewaysInner object. + */ + public MeshGatewaysInner meshGateways() { + return this.meshGateways; + } + /** * Initializes an instance of ServiceFabricClientAPIs client. * @@ -206,6 +323,15 @@ protected void initialize() { this.acceptLanguage = "en-US"; this.longRunningOperationRetryTimeout = 30; this.generateClientRequestId = true; + this.meshSecrets = new MeshSecretsInner(restClient().retrofit(), this); + this.meshSecretValues = new MeshSecretValuesInner(restClient().retrofit(), this); + this.meshVolumes = new MeshVolumesInner(restClient().retrofit(), this); + this.meshNetworks = new MeshNetworksInner(restClient().retrofit(), this); + this.meshApplications = new MeshApplicationsInner(restClient().retrofit(), this); + this.meshServices = new MeshServicesInner(restClient().retrofit(), this); + this.meshCodePackages = new MeshCodePackagesInner(restClient().retrofit(), this); + this.meshServiceReplicas = new MeshServiceReplicasInner(restClient().retrofit(), this); + this.meshGateways = new MeshGatewaysInner(restClient().retrofit(), this); this.azureClient = new AzureClient(this); initializeService(); } @@ -217,7 +343,7 @@ protected void initialize() { */ @Override public String userAgent() { - return String.format("%s (%s, %s)", super.userAgent(), "ServiceFabricClientAPIs", "6.3.0.9"); + return String.format("%s (%s, %s)", super.userAgent(), "ServiceFabricClientAPIs", "6.4.0.36"); } private void initializeService() { @@ -313,6 +439,10 @@ interface ServiceFabricClientAPIsService { @GET("$/GetAadMetadata") Observable> getAadMetadata(@Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getClusterVersion" }) + @GET("$/GetClusterVersion") + Observable> getClusterVersion(@Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getNodeInfoList" }) @GET("Nodes") Observable> getNodeInfoList(@Query("api-version") String apiVersion, @Query(value = "ContinuationToken", encoded = true) String continuationToken, @Query("NodeStatusFilter") NodeStatusFilter nodeStatusFilter1, @Query("MaxResults") Long maxResults, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -655,7 +785,7 @@ interface ServiceFabricClientAPIsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getDeployedCodePackageInfoList" }) @GET("Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetCodePackages") - Observable> getDeployedCodePackageInfoList(@Path("nodeName") String nodeName, @Path(value = "applicationId", encoded = true) String applicationId, @Query("api-version") String apiVersion, @Query("ServiceManifestName") String serviceManifestName, @Query("CodePackageName") String codePackageName, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> getDeployedCodePackageInfoList(@Path("nodeName") String nodeName, @Path(value = "applicationId", encoded = true) String applicationId, @Query("api-version") String apiVersion, @Query("ServiceManifestName") String serviceManifestName, @Query("CodePackageName") String codePackageName1, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs restartDeployedCodePackage" }) @POST("Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetCodePackages/$/Restart") @@ -663,11 +793,11 @@ interface ServiceFabricClientAPIsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getContainerLogsDeployedOnNode" }) @GET("Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetCodePackages/$/ContainerLogs") - Observable> getContainerLogsDeployedOnNode(@Path("nodeName") String nodeName, @Path(value = "applicationId", encoded = true) String applicationId, @Query("api-version") String apiVersion, @Query("ServiceManifestName") String serviceManifestName, @Query("CodePackageName") String codePackageName, @Query("Tail") String tail, @Query("Previous") Boolean previous, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> getContainerLogsDeployedOnNode(@Path("nodeName") String nodeName, @Path(value = "applicationId", encoded = true) String applicationId, @Query("api-version") String apiVersion, @Query("ServiceManifestName") String serviceManifestName, @Query("CodePackageName") String codePackageName1, @Query("Tail") String tail, @Query("Previous") Boolean previous, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs invokeContainerApi" }) @POST("Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetCodePackages/$/ContainerApi") - Observable> invokeContainerApi(@Path("nodeName") String nodeName, @Path(value = "applicationId", encoded = true) String applicationId, @Query("api-version") String apiVersion, @Query("ServiceManifestName") String serviceManifestName, @Query("CodePackageName") String codePackageName, @Query("CodePackageInstanceId") String codePackageInstanceId, @Query("timeout") Long timeout, @Body ContainerApiRequestBody containerApiRequestBody, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> invokeContainerApi(@Path("nodeName") String nodeName, @Path(value = "applicationId", encoded = true) String applicationId, @Query("api-version") String apiVersion, @Query("ServiceManifestName") String serviceManifestName, @Query("CodePackageName") String codePackageName1, @Query("CodePackageInstanceId") String codePackageInstanceId, @Query("timeout") Long timeout, @Body ContainerApiRequestBody containerApiRequestBody, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs createComposeDeployment" }) @PUT("ComposeDeployments/$/Create") @@ -693,6 +823,10 @@ interface ServiceFabricClientAPIsService { @POST("ComposeDeployments/{deploymentName}/$/Upgrade") Observable> startComposeDeploymentUpgrade(@Path(value = "deploymentName", encoded = true) String deploymentName, @Query("api-version") String apiVersion, @Body ComposeDeploymentUpgradeDescription composeDeploymentUpgradeDescription, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs startRollbackComposeDeploymentUpgrade" }) + @POST("ComposeDeployments/{deploymentName}/$/RollbackUpgrade") + Observable> startRollbackComposeDeploymentUpgrade(@Path(value = "deploymentName", encoded = true) String deploymentName, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getChaos" }) @GET("Tools/Chaos") Observable> getChaos(@Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -835,7 +969,7 @@ interface ServiceFabricClientAPIsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs disableApplicationBackup" }) @POST("Applications/{applicationId}/$/DisableBackup") - Observable> disableApplicationBackup(@Path(value = "applicationId", encoded = true) String applicationId, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> disableApplicationBackup(@Path(value = "applicationId", encoded = true) String applicationId, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Body DisableBackupDescription disableBackupDescription, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getApplicationBackupConfigurationInfo" }) @GET("Applications/{applicationId}/$/GetBackupConfigurationInfo") @@ -859,7 +993,7 @@ interface ServiceFabricClientAPIsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs disableServiceBackup" }) @POST("Services/{serviceId}/$/DisableBackup") - Observable> disableServiceBackup(@Path(value = "serviceId", encoded = true) String serviceId, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> disableServiceBackup(@Path(value = "serviceId", encoded = true) String serviceId, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Body DisableBackupDescription disableBackupDescription, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getServiceBackupConfigurationInfo" }) @GET("Services/{serviceId}/$/GetBackupConfigurationInfo") @@ -883,7 +1017,7 @@ interface ServiceFabricClientAPIsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs disablePartitionBackup" }) @POST("Partitions/{partitionId}/$/DisableBackup") - Observable> disablePartitionBackup(@Path(value = "partitionId", encoded = true) UUID partitionId1, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> disablePartitionBackup(@Path(value = "partitionId", encoded = true) UUID partitionId1, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Body DisableBackupDescription disableBackupDescription, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getPartitionBackupConfigurationInfo" }) @GET("Partitions/{partitionId}/$/GetBackupConfigurationInfo") @@ -1009,46 +1143,6 @@ interface ServiceFabricClientAPIsService { @GET("EventsStore/CorrelatedEvents/{eventInstanceId}/$/Events") Observable> getCorrelatedEventList(@Path("eventInstanceId") String eventInstanceId, @Query("api-version") String apiVersion, @Query("timeout") Long timeout, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs createApplicationResource" }) - @PUT("Resources/Applications/{applicationResourceName}") - Observable> createApplicationResource(@Path(value = "applicationResourceName", encoded = true) String applicationResourceName, @Query("api-version") String apiVersion, @Body ApplicationResourceDescriptionInner applicationResourceDescription, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getApplicationResource" }) - @GET("Resources/Applications/{applicationResourceName}") - Observable> getApplicationResource(@Path(value = "applicationResourceName", encoded = true) String applicationResourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs deleteApplicationResource" }) - @HTTP(path = "Resources/Applications/{applicationResourceName}", method = "DELETE", hasBody = true) - Observable> deleteApplicationResource(@Path(value = "applicationResourceName", encoded = true) String applicationResourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getServices" }) - @GET("Resources/Applications/{applicationResourceName}/Services") - Observable> getServices(@Path(value = "applicationResourceName", encoded = true) String applicationResourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getService" }) - @GET("Resources/Applications/{applicationResourceName}/Services/{serviceResourceName}") - Observable> getService(@Path(value = "applicationResourceName", encoded = true) String applicationResourceName, @Path(value = "serviceResourceName", encoded = true) String serviceResourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getReplicas" }) - @GET("Resources/Applications/{applicationResourceName}/Services/{serviceResourceName}/replicas") - Observable> getReplicas(@Path(value = "applicationResourceName", encoded = true) String applicationResourceName, @Path(value = "serviceResourceName", encoded = true) String serviceResourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getReplica" }) - @GET("Resources/Applications/{applicationResourceName}/Services/{serviceResourceName}/Replicas/{replicaName}") - Observable> getReplica(@Path(value = "applicationResourceName", encoded = true) String applicationResourceName, @Path(value = "serviceResourceName", encoded = true) String serviceResourceName, @Path(value = "replicaName", encoded = true) String replicaName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs createVolumeResource" }) - @PUT("Resources/Volumes/{volumeResourceName}") - Observable> createVolumeResource(@Path(value = "volumeResourceName", encoded = true) String volumeResourceName, @Query("api-version") String apiVersion, @Body VolumeResourceDescriptionInner volumeResourceDescription, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs getVolumeResource" }) - @GET("Resources/Volumes/{volumeResourceName}") - Observable> getVolumeResource(@Path(value = "volumeResourceName", encoded = true) String volumeResourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.servicefabric.ServiceFabricClientAPIs deleteVolumeResource" }) - @HTTP(path = "Resources/Volumes/{volumeResourceName}", method = "DELETE", hasBody = true) - Observable> deleteVolumeResource(@Path(value = "volumeResourceName", encoded = true) String volumeResourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - } /** @@ -3790,8 +3884,8 @@ private ServiceResponse unprovisionClusterDelegate(Response } /** - * Rollback the upgrade of a Service Fabric cluster. - * Rollback the code or configuration upgrade of a Service Fabric cluster. + * Roll back the upgrade of a Service Fabric cluster. + * Roll back the code or configuration upgrade of a Service Fabric cluster. * * @throws IllegalArgumentException thrown if parameters fail the validation * @throws FabricErrorException thrown if the request is rejected by server @@ -3802,8 +3896,8 @@ public void rollbackClusterUpgrade() { } /** - * Rollback the upgrade of a Service Fabric cluster. - * Rollback the code or configuration upgrade of a Service Fabric cluster. + * Roll back the upgrade of a Service Fabric cluster. + * Roll back the code or configuration upgrade of a Service Fabric cluster. * * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -3814,8 +3908,8 @@ public ServiceFuture rollbackClusterUpgradeAsync(final ServiceCallback response) { } /** - * Rollback the upgrade of a Service Fabric cluster. - * Rollback the code or configuration upgrade of a Service Fabric cluster. + * Roll back the upgrade of a Service Fabric cluster. + * Roll back the code or configuration upgrade of a Service Fabric cluster. * * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. @@ -3854,8 +3948,8 @@ public Observable> call(Response response) { } /** - * Rollback the upgrade of a Service Fabric cluster. - * Rollback the code or configuration upgrade of a Service Fabric cluster. + * Roll back the upgrade of a Service Fabric cluster. + * Roll back the code or configuration upgrade of a Service Fabric cluster. * * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -3867,8 +3961,8 @@ public void rollbackClusterUpgrade(Long timeout) { } /** - * Rollback the upgrade of a Service Fabric cluster. - * Rollback the code or configuration upgrade of a Service Fabric cluster. + * Roll back the upgrade of a Service Fabric cluster. + * Roll back the code or configuration upgrade of a Service Fabric cluster. * * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -3880,8 +3974,8 @@ public ServiceFuture rollbackClusterUpgradeAsync(Long timeout, final Servi } /** - * Rollback the upgrade of a Service Fabric cluster. - * Rollback the code or configuration upgrade of a Service Fabric cluster. + * Roll back the upgrade of a Service Fabric cluster. + * Roll back the code or configuration upgrade of a Service Fabric cluster. * * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -3897,8 +3991,8 @@ public Void call(ServiceResponse response) { } /** - * Rollback the upgrade of a Service Fabric cluster. - * Rollback the code or configuration upgrade of a Service Fabric cluster. + * Roll back the upgrade of a Service Fabric cluster. + * Roll back the code or configuration upgrade of a Service Fabric cluster. * * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -4693,6 +4787,146 @@ private ServiceResponse getAadMetadataDelegate(Response< .build(response); } + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterVersionInner object if successful. + */ + public ClusterVersionInner getClusterVersion() { + return getClusterVersionWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getClusterVersionAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getClusterVersionWithServiceResponseAsync(), serviceCallback); + } + + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterVersionInner object + */ + public Observable getClusterVersionAsync() { + return getClusterVersionWithServiceResponseAsync().map(new Func1, ClusterVersionInner>() { + @Override + public ClusterVersionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterVersionInner object + */ + public Observable> getClusterVersionWithServiceResponseAsync() { + final String apiVersion = "6.4"; + final Long timeout = null; + return service.getClusterVersion(apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getClusterVersionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterVersionInner object if successful. + */ + public ClusterVersionInner getClusterVersion(Long timeout) { + return getClusterVersionWithServiceResponseAsync(timeout).toBlocking().single().body(); + } + + /** + * 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getClusterVersionAsync(Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getClusterVersionWithServiceResponseAsync(timeout), serviceCallback); + } + + /** + * 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterVersionInner object + */ + public Observable getClusterVersionAsync(Long timeout) { + return getClusterVersionWithServiceResponseAsync(timeout).map(new Func1, ClusterVersionInner>() { + @Override + public ClusterVersionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterVersionInner object + */ + public Observable> getClusterVersionWithServiceResponseAsync(Long timeout) { + final String apiVersion = "6.4"; + return service.getClusterVersion(apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getClusterVersionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getClusterVersionDelegate(Response response) throws FabricErrorException, IOException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + /** * 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. @@ -14437,6 +14671,9 @@ public Observable> call(Response< - 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -14460,6 +14697,9 @@ public ResolvedServicePartitionInner resolveService(String serviceId, Integer pa - 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -14482,6 +14722,9 @@ public ServiceFuture resolveServiceAsync(String s - 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 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -14508,6 +14751,9 @@ public ResolvedServicePartitionInner call(ServiceResponse> getPartit if (serviceId == null) { throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); } - final String apiVersion = "6.0"; + final String apiVersion = "6.4"; final String continuationToken = null; final Long timeout = null; return service.getPartitionInfoList(serviceId, apiVersion, continuationToken, timeout, this.acceptLanguage(), this.userAgent()) @@ -14692,7 +14938,7 @@ public Observable> getPartit if (serviceId == null) { throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); } - final String apiVersion = "6.0"; + final String apiVersion = "6.4"; return service.getPartitionInfoList(serviceId, apiVersion, continuationToken, timeout, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -22444,6 +22690,158 @@ private ServiceResponse startComposeDeploymentUpgradeDelegate(Response startRollbackComposeDeploymentUpgradeAsync(String deploymentName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startRollbackComposeDeploymentUpgradeWithServiceResponseAsync(deploymentName), serviceCallback); + } + + /** + * Starts rolling back a compose deployment upgrade in the Service Fabric cluster. + * Rollback a service fabric compose deployment upgrade. + * + * @param deploymentName The identity of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable startRollbackComposeDeploymentUpgradeAsync(String deploymentName) { + return startRollbackComposeDeploymentUpgradeWithServiceResponseAsync(deploymentName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Starts rolling back a compose deployment upgrade in the Service Fabric cluster. + * Rollback a service fabric compose deployment upgrade. + * + * @param deploymentName The identity of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> startRollbackComposeDeploymentUpgradeWithServiceResponseAsync(String deploymentName) { + if (deploymentName == null) { + throw new IllegalArgumentException("Parameter deploymentName is required and cannot be null."); + } + final String apiVersion = "6.4-preview"; + final Long timeout = null; + return service.startRollbackComposeDeploymentUpgrade(deploymentName, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = startRollbackComposeDeploymentUpgradeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Starts rolling back a compose deployment upgrade in the Service Fabric cluster. + * Rollback a service fabric compose deployment upgrade. + * + * @param deploymentName The identity of the deployment. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws FabricErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void startRollbackComposeDeploymentUpgrade(String deploymentName, Long timeout) { + startRollbackComposeDeploymentUpgradeWithServiceResponseAsync(deploymentName, timeout).toBlocking().single().body(); + } + + /** + * Starts rolling back a compose deployment upgrade in the Service Fabric cluster. + * Rollback a service fabric compose deployment upgrade. + * + * @param deploymentName The identity of the deployment. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture startRollbackComposeDeploymentUpgradeAsync(String deploymentName, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startRollbackComposeDeploymentUpgradeWithServiceResponseAsync(deploymentName, timeout), serviceCallback); + } + + /** + * Starts rolling back a compose deployment upgrade in the Service Fabric cluster. + * Rollback a service fabric compose deployment upgrade. + * + * @param deploymentName The identity of the deployment. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable startRollbackComposeDeploymentUpgradeAsync(String deploymentName, Long timeout) { + return startRollbackComposeDeploymentUpgradeWithServiceResponseAsync(deploymentName, timeout).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Starts rolling back a compose deployment upgrade in the Service Fabric cluster. + * Rollback a service fabric compose deployment upgrade. + * + * @param deploymentName The identity of the deployment. + * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> startRollbackComposeDeploymentUpgradeWithServiceResponseAsync(String deploymentName, Long timeout) { + if (deploymentName == null) { + throw new IllegalArgumentException("Parameter deploymentName is required and cannot be null."); + } + final String apiVersion = "6.4-preview"; + return service.startRollbackComposeDeploymentUpgrade(deploymentName, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = startRollbackComposeDeploymentUpgradeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse startRollbackComposeDeploymentUpgradeDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(FabricErrorException.class) + .build(response); + } + /** * Get the status of Chaos. * Get the status of Chaos indicating whether or not Chaos is running, the Chaos parameters used for running Chaos and the status of the Chaos Schedule. @@ -23710,7 +24108,7 @@ private ServiceResponse getImageStoreContentDelegate(Res /** * 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. + * 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 contentPath Relative path to file or folder in the image store from its root. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -23723,7 +24121,7 @@ public void deleteImageStoreContent(String contentPath) { /** * 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. + * 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 contentPath Relative path to file or folder in the image store from its root. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -23736,7 +24134,7 @@ public ServiceFuture deleteImageStoreContentAsync(String contentPath, fina /** * 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. + * 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 contentPath Relative path to file or folder in the image store from its root. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -23753,7 +24151,7 @@ public Void call(ServiceResponse response) { /** * 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. + * 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 contentPath Relative path to file or folder in the image store from its root. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -23781,7 +24179,7 @@ public Observable> call(Response response) { /** * 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. + * 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 contentPath Relative path to file or folder in the image store from its root. * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @@ -23795,7 +24193,7 @@ public void deleteImageStoreContent(String contentPath, Long timeout) { /** * 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. + * 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 contentPath Relative path to file or folder in the image store from its root. * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @@ -23809,7 +24207,7 @@ public ServiceFuture deleteImageStoreContentAsync(String contentPath, Long /** * 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. + * 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 contentPath Relative path to file or folder in the image store from its root. * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @@ -23827,7 +24225,7 @@ public Void call(ServiceResponse response) { /** * 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. + * 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 contentPath Relative path to file or folder in the image store from its root. * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @@ -27068,7 +27466,7 @@ private ServiceResponse getNodeTransitionProgressDe /** * 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 typeFilter Used to filter on OperationType for user-induced operations. - 65535 - select all @@ -27095,7 +27493,7 @@ public List getFaultOperationList(int typeFilter, int stat /** * 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 typeFilter Used to filter on OperationType for user-induced operations. - 65535 - select all @@ -27121,7 +27519,7 @@ public ServiceFuture> getFaultOperationListAsync(int /** * 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 typeFilter Used to filter on OperationType for user-induced operations. - 65535 - select all @@ -27151,7 +27549,7 @@ public List call(ServiceResponse>> call(Response getFaultOperationList(int typeFilter, int stat /** * 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 typeFilter Used to filter on OperationType for user-induced operations. - 65535 - select all @@ -27244,7 +27642,7 @@ public ServiceFuture> getFaultOperationListAsync(int /** * 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 typeFilter Used to filter on OperationType for user-induced operations. - 65535 - select all @@ -27275,7 +27673,7 @@ public List call(ServiceResponse> getFaultOperationListDelegat Important note: if this API is invoked with force==true, internal state may be left behind. * * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API - * @param force Indicates whether to gracefully rollback and clean up internal system state modified by executing the user-induced operation. + * @param force Indicates whether to gracefully roll back and clean up internal system state modified by executing the user-induced operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws FabricErrorException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent @@ -27351,7 +27749,7 @@ public void cancelOperation(UUID operationId, boolean force) { Important note: if this API is invoked with force==true, internal state may be left behind. * * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API - * @param force Indicates whether to gracefully rollback and clean up internal system state modified by executing the user-induced operation. + * @param force Indicates whether to gracefully roll back and clean up internal system state modified by executing the user-induced operation. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object @@ -27372,7 +27770,7 @@ public ServiceFuture cancelOperationAsync(UUID operationId, boolean force, Important note: if this API is invoked with force==true, internal state may be left behind. * * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API - * @param force Indicates whether to gracefully rollback and clean up internal system state modified by executing the user-induced operation. + * @param force Indicates whether to gracefully roll back and clean up internal system state modified by executing the user-induced operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */ @@ -27397,7 +27795,7 @@ public Void call(ServiceResponse response) { Important note: if this API is invoked with force==true, internal state may be left behind. * * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API - * @param force Indicates whether to gracefully rollback and clean up internal system state modified by executing the user-induced operation. + * @param force Indicates whether to gracefully roll back and clean up internal system state modified by executing the user-induced operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */ @@ -27433,7 +27831,7 @@ public Observable> call(Response response) { Important note: if this API is invoked with force==true, internal state may be left behind. * * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API - * @param force Indicates whether to gracefully rollback and clean up internal system state modified by executing the user-induced operation. + * @param force Indicates whether to gracefully roll back and clean up internal system state modified by executing the user-induced operation. * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws FabricErrorException thrown if the request is rejected by server @@ -27455,7 +27853,7 @@ public void cancelOperation(UUID operationId, boolean force, Long timeout) { Important note: if this API is invoked with force==true, internal state may be left behind. * * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API - * @param force Indicates whether to gracefully rollback and clean up internal system state modified by executing the user-induced operation. + * @param force Indicates whether to gracefully roll back and clean up internal system state modified by executing the user-induced operation. * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -27477,7 +27875,7 @@ public ServiceFuture cancelOperationAsync(UUID operationId, boolean force, Important note: if this API is invoked with force==true, internal state may be left behind. * * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API - * @param force Indicates whether to gracefully rollback and clean up internal system state modified by executing the user-induced operation. + * @param force Indicates whether to gracefully roll back and clean up internal system state modified by executing the user-induced operation. * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. @@ -27503,7 +27901,7 @@ public Void call(ServiceResponse response) { Important note: if this API is invoked with force==true, internal state may be left behind. * * @param operationId A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API - * @param force Indicates whether to gracefully rollback and clean up internal system state modified by executing the user-induced operation. + * @param force Indicates whether to gracefully roll back and clean up internal system state modified by executing the user-induced operation. * @param timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. @@ -27590,7 +27988,7 @@ public Observable> createBackupPolicyWithServiceResponseAs throw new IllegalArgumentException("Parameter backupPolicyDescription is required and cannot be null."); } Validator.validate(backupPolicyDescription); - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; final Long timeout = null; return service.createBackupPolicy(backupPolicyDescription, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>() { @@ -27666,7 +28064,7 @@ public Observable> createBackupPolicyWithServiceResponseAs throw new IllegalArgumentException("Parameter backupPolicyDescription is required and cannot be null."); } Validator.validate(backupPolicyDescription); - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; return service.createBackupPolicy(backupPolicyDescription, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -27743,7 +28141,7 @@ public Observable> deleteBackupPolicyWithServiceResponseAs if (backupPolicyName == null) { throw new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; final Long timeout = null; return service.deleteBackupPolicy(backupPolicyName, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>() { @@ -27818,7 +28216,7 @@ public Observable> deleteBackupPolicyWithServiceResponseAs if (backupPolicyName == null) { throw new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; return service.deleteBackupPolicy(backupPolicyName, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -27889,7 +28287,7 @@ public PagedBackupPolicyDescriptionListInner call(ServiceResponse> getBackupPolicyListWithServiceResponseAsync() { - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; final String continuationToken = null; final Long maxResults = null; final Long timeout = null; @@ -27968,7 +28366,7 @@ public PagedBackupPolicyDescriptionListInner call(ServiceResponse> getBackupPolicyListWithServiceResponseAsync(String continuationToken, Long maxResults, Long timeout) { - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; return service.getBackupPolicyList(apiVersion, continuationToken, maxResults, timeout, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -28046,7 +28444,7 @@ public Observable> getBackupPolicy if (backupPolicyName == null) { throw new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; final Long timeout = null; return service.getBackupPolicyByName(backupPolicyName, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>() { @@ -28122,7 +28520,7 @@ public Observable> getBackupPolicy if (backupPolicyName == null) { throw new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; return service.getBackupPolicyByName(backupPolicyName, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -28200,7 +28598,7 @@ public Observable> getAllEntitiesBac if (backupPolicyName == null) { throw new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; final String continuationToken = null; final Long maxResults = null; final Long timeout = null; @@ -28286,7 +28684,7 @@ public Observable> getAllEntitiesBac if (backupPolicyName == null) { throw new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; return service.getAllEntitiesBackedUpByPolicy(backupPolicyName, apiVersion, continuationToken, maxResults, timeout, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -28371,7 +28769,7 @@ public Observable> updateBackupPolicyWithServiceResponseAs throw new IllegalArgumentException("Parameter backupPolicyDescription is required and cannot be null."); } Validator.validate(backupPolicyDescription); - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; final Long timeout = null; return service.updateBackupPolicy(backupPolicyName, backupPolicyDescription, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>() { @@ -28454,7 +28852,7 @@ public Observable> updateBackupPolicyWithServiceResponseAs throw new IllegalArgumentException("Parameter backupPolicyDescription is required and cannot be null."); } Validator.validate(backupPolicyDescription); - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; return service.updateBackupPolicy(backupPolicyName, backupPolicyDescription, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -28550,7 +28948,7 @@ public Observable> enableApplicationBackupWithServiceRespo if (backupPolicyName == null) { throw new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; final Long timeout = null; EnableBackupDescription enableBackupDescription = new EnableBackupDescription(); enableBackupDescription.withBackupPolicyName(backupPolicyName); @@ -28646,7 +29044,7 @@ public Observable> enableApplicationBackupWithServiceRespo if (backupPolicyName == null) { throw new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; EnableBackupDescription enableBackupDescription = new EnableBackupDescription(); enableBackupDescription.withBackupPolicyName(backupPolicyName); return service.enableApplicationBackup(applicationId, apiVersion, timeout, this.acceptLanguage(), enableBackupDescription, this.userAgent()) @@ -28677,12 +29075,13 @@ private ServiceResponse enableApplicationBackupDelegate(Response disableApplicationBackupAsync(String applicationId, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(disableApplicationBackupWithServiceResponseAsync(applicationId), serviceCallback); + public ServiceFuture disableApplicationBackupAsync(String applicationId, boolean cleanBackup, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(disableApplicationBackupWithServiceResponseAsync(applicationId, cleanBackup), serviceCallback); } /** @@ -28707,11 +29107,12 @@ public ServiceFuture disableApplicationBackupAsync(String applicationId, f * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. Starting from version 6.0, hierarchical names are delimited with the "~" character. For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */ - public Observable disableApplicationBackupAsync(String applicationId) { - return disableApplicationBackupWithServiceResponseAsync(applicationId).map(new Func1, Void>() { + public Observable disableApplicationBackupAsync(String applicationId, boolean cleanBackup) { + return disableApplicationBackupWithServiceResponseAsync(applicationId, cleanBackup).map(new Func1, Void>() { @Override public Void call(ServiceResponse response) { return response.body(); @@ -28726,16 +29127,19 @@ public Void call(ServiceResponse response) { * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. Starting from version 6.0, hierarchical names are delimited with the "~" character. For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */ - public Observable> disableApplicationBackupWithServiceResponseAsync(String applicationId) { + public Observable> disableApplicationBackupWithServiceResponseAsync(String applicationId, boolean cleanBackup) { if (applicationId == null) { throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; final Long timeout = null; - return service.disableApplicationBackup(applicationId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + DisableBackupDescription disableBackupDescription = new DisableBackupDescription(); + disableBackupDescription.withCleanBackup(cleanBackup); + return service.disableApplicationBackup(applicationId, apiVersion, timeout, this.acceptLanguage(), disableBackupDescription, this.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -28756,13 +29160,14 @@ public Observable> call(Response response) { * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. Starting from version 6.0, hierarchical names are delimited with the "~" character. For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws FabricErrorException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */ - public void disableApplicationBackup(String applicationId, Long timeout) { - disableApplicationBackupWithServiceResponseAsync(applicationId, timeout).toBlocking().single().body(); + public void disableApplicationBackup(String applicationId, boolean cleanBackup, Long timeout) { + disableApplicationBackupWithServiceResponseAsync(applicationId, cleanBackup, timeout).toBlocking().single().body(); } /** @@ -28772,13 +29177,14 @@ public void disableApplicationBackup(String applicationId, Long timeout) { * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. Starting from version 6.0, hierarchical names are delimited with the "~" character. For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture disableApplicationBackupAsync(String applicationId, Long timeout, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(disableApplicationBackupWithServiceResponseAsync(applicationId, timeout), serviceCallback); + public ServiceFuture disableApplicationBackupAsync(String applicationId, boolean cleanBackup, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(disableApplicationBackupWithServiceResponseAsync(applicationId, cleanBackup, timeout), serviceCallback); } /** @@ -28788,12 +29194,13 @@ public ServiceFuture disableApplicationBackupAsync(String applicationId, L * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. Starting from version 6.0, hierarchical names are delimited with the "~" character. For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */ - public Observable disableApplicationBackupAsync(String applicationId, Long timeout) { - return disableApplicationBackupWithServiceResponseAsync(applicationId, timeout).map(new Func1, Void>() { + public Observable disableApplicationBackupAsync(String applicationId, boolean cleanBackup, Long timeout) { + return disableApplicationBackupWithServiceResponseAsync(applicationId, cleanBackup, timeout).map(new Func1, Void>() { @Override public Void call(ServiceResponse response) { return response.body(); @@ -28808,16 +29215,19 @@ public Void call(ServiceResponse response) { * @param applicationId The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. Starting from version 6.0, hierarchical names are delimited with the "~" character. For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */ - public Observable> disableApplicationBackupWithServiceResponseAsync(String applicationId, Long timeout) { + public Observable> disableApplicationBackupWithServiceResponseAsync(String applicationId, boolean cleanBackup, Long timeout) { if (applicationId == null) { throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); } - final String apiVersion = "6.2-preview"; - return service.disableApplicationBackup(applicationId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + final String apiVersion = "6.4"; + DisableBackupDescription disableBackupDescription = new DisableBackupDescription(); + disableBackupDescription.withCleanBackup(cleanBackup); + return service.disableApplicationBackup(applicationId, apiVersion, timeout, this.acceptLanguage(), disableBackupDescription, this.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -28902,7 +29312,7 @@ public Observable> getApp if (applicationId == null) { throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; final String continuationToken = null; final Long maxResults = null; final Long timeout = null; @@ -28996,7 +29406,7 @@ public Observable> getApp if (applicationId == null) { throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; return service.getApplicationBackupConfigurationInfo(applicationId, apiVersion, continuationToken, maxResults, timeout, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -29082,7 +29492,7 @@ public Observable> getApplicationBacku if (applicationId == null) { throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; final Long timeout = null; final Boolean latest = null; final DateTime startDateTimeFilter = null; @@ -29191,7 +29601,7 @@ public Observable> getApplicationBacku if (applicationId == null) { throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; return service.getApplicationBackupList(applicationId, apiVersion, timeout, latest, startDateTimeFilter, endDateTimeFilter, continuationToken, maxResults, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -29276,7 +29686,7 @@ public Observable> suspendApplicationBackupWithServiceResp if (applicationId == null) { throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; final Long timeout = null; return service.suspendApplicationBackup(applicationId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>() { @@ -29359,7 +29769,7 @@ public Observable> suspendApplicationBackupWithServiceResp if (applicationId == null) { throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; return service.suspendApplicationBackup(applicationId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -29444,7 +29854,7 @@ public Observable> resumeApplicationBackupWithServiceRespo if (applicationId == null) { throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; final Long timeout = null; return service.resumeApplicationBackup(applicationId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>() { @@ -29527,7 +29937,7 @@ public Observable> resumeApplicationBackupWithServiceRespo if (applicationId == null) { throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; return service.resumeApplicationBackup(applicationId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -29623,7 +30033,7 @@ public Observable> enableServiceBackupWithServiceResponseA if (backupPolicyName == null) { throw new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; final Long timeout = null; EnableBackupDescription enableBackupDescription = new EnableBackupDescription(); enableBackupDescription.withBackupPolicyName(backupPolicyName); @@ -29719,7 +30129,7 @@ public Observable> enableServiceBackupWithServiceResponseA if (backupPolicyName == null) { throw new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; EnableBackupDescription enableBackupDescription = new EnableBackupDescription(); enableBackupDescription.withBackupPolicyName(backupPolicyName); return service.enableServiceBackup(serviceId, apiVersion, timeout, this.acceptLanguage(), enableBackupDescription, this.userAgent()) @@ -29751,12 +30161,13 @@ private ServiceResponse enableServiceBackupDelegate(Response * @param 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 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. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws FabricErrorException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */ - public void disableServiceBackup(String serviceId) { - disableServiceBackupWithServiceResponseAsync(serviceId).toBlocking().single().body(); + public void disableServiceBackup(String serviceId, boolean cleanBackup) { + disableServiceBackupWithServiceResponseAsync(serviceId, cleanBackup).toBlocking().single().body(); } /** @@ -29767,12 +30178,13 @@ public void disableServiceBackup(String serviceId) { * @param 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 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 serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture disableServiceBackupAsync(String serviceId, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(disableServiceBackupWithServiceResponseAsync(serviceId), serviceCallback); + public ServiceFuture disableServiceBackupAsync(String serviceId, boolean cleanBackup, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(disableServiceBackupWithServiceResponseAsync(serviceId, cleanBackup), serviceCallback); } /** @@ -29783,11 +30195,12 @@ public ServiceFuture disableServiceBackupAsync(String serviceId, final Ser * @param 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 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. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */ - public Observable disableServiceBackupAsync(String serviceId) { - return disableServiceBackupWithServiceResponseAsync(serviceId).map(new Func1, Void>() { + public Observable disableServiceBackupAsync(String serviceId, boolean cleanBackup) { + return disableServiceBackupWithServiceResponseAsync(serviceId, cleanBackup).map(new Func1, Void>() { @Override public Void call(ServiceResponse response) { return response.body(); @@ -29803,16 +30216,19 @@ public Void call(ServiceResponse response) { * @param 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 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. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */ - public Observable> disableServiceBackupWithServiceResponseAsync(String serviceId) { + public Observable> disableServiceBackupWithServiceResponseAsync(String serviceId, boolean cleanBackup) { if (serviceId == null) { throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; final Long timeout = null; - return service.disableServiceBackup(serviceId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + DisableBackupDescription disableBackupDescription = new DisableBackupDescription(); + disableBackupDescription.withCleanBackup(cleanBackup); + return service.disableServiceBackup(serviceId, apiVersion, timeout, this.acceptLanguage(), disableBackupDescription, this.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -29834,13 +30250,14 @@ public Observable> call(Response response) { * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws FabricErrorException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */ - public void disableServiceBackup(String serviceId, Long timeout) { - disableServiceBackupWithServiceResponseAsync(serviceId, timeout).toBlocking().single().body(); + public void disableServiceBackup(String serviceId, boolean cleanBackup, Long timeout) { + disableServiceBackupWithServiceResponseAsync(serviceId, cleanBackup, timeout).toBlocking().single().body(); } /** @@ -29851,13 +30268,14 @@ public void disableServiceBackup(String serviceId, Long timeout) { * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture disableServiceBackupAsync(String serviceId, Long timeout, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(disableServiceBackupWithServiceResponseAsync(serviceId, timeout), serviceCallback); + public ServiceFuture disableServiceBackupAsync(String serviceId, boolean cleanBackup, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(disableServiceBackupWithServiceResponseAsync(serviceId, cleanBackup, timeout), serviceCallback); } /** @@ -29868,12 +30286,13 @@ public ServiceFuture disableServiceBackupAsync(String serviceId, Long time * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */ - public Observable disableServiceBackupAsync(String serviceId, Long timeout) { - return disableServiceBackupWithServiceResponseAsync(serviceId, timeout).map(new Func1, Void>() { + public Observable disableServiceBackupAsync(String serviceId, boolean cleanBackup, Long timeout) { + return disableServiceBackupWithServiceResponseAsync(serviceId, cleanBackup, timeout).map(new Func1, Void>() { @Override public Void call(ServiceResponse response) { return response.body(); @@ -29889,16 +30308,19 @@ public Void call(ServiceResponse response) { * @param 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 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */ - public Observable> disableServiceBackupWithServiceResponseAsync(String serviceId, Long timeout) { + public Observable> disableServiceBackupWithServiceResponseAsync(String serviceId, boolean cleanBackup, Long timeout) { if (serviceId == null) { throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); } - final String apiVersion = "6.2-preview"; - return service.disableServiceBackup(serviceId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + final String apiVersion = "6.4"; + DisableBackupDescription disableBackupDescription = new DisableBackupDescription(); + disableBackupDescription.withCleanBackup(cleanBackup); + return service.disableServiceBackup(serviceId, apiVersion, timeout, this.acceptLanguage(), disableBackupDescription, this.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -29983,7 +30405,7 @@ public Observable> getSer if (serviceId == null) { throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; final String continuationToken = null; final Long maxResults = null; final Long timeout = null; @@ -30077,7 +30499,7 @@ public Observable> getSer if (serviceId == null) { throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; return service.getServiceBackupConfigurationInfo(serviceId, apiVersion, continuationToken, maxResults, timeout, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -30163,7 +30585,7 @@ public Observable> getServiceBackupLis if (serviceId == null) { throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; final Long timeout = null; final Boolean latest = null; final DateTime startDateTimeFilter = null; @@ -30272,7 +30694,7 @@ public Observable> getServiceBackupLis if (serviceId == null) { throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; return service.getServiceBackupList(serviceId, apiVersion, timeout, latest, startDateTimeFilter, endDateTimeFilter, continuationToken, maxResults, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -30357,7 +30779,7 @@ public Observable> suspendServiceBackupWithServiceResponse if (serviceId == null) { throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; final Long timeout = null; return service.suspendServiceBackup(serviceId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>() { @@ -30440,7 +30862,7 @@ public Observable> suspendServiceBackupWithServiceResponse if (serviceId == null) { throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; return service.suspendServiceBackup(serviceId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -30525,7 +30947,7 @@ public Observable> resumeServiceBackupWithServiceResponseA if (serviceId == null) { throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; final Long timeout = null; return service.resumeServiceBackup(serviceId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>() { @@ -30608,7 +31030,7 @@ public Observable> resumeServiceBackupWithServiceResponseA if (serviceId == null) { throw new IllegalArgumentException("Parameter serviceId is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; return service.resumeServiceBackup(serviceId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -30696,7 +31118,7 @@ public Observable> enablePartitionBackupWithServiceRespons if (backupPolicyName == null) { throw new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; final Long timeout = null; EnableBackupDescription enableBackupDescription = new EnableBackupDescription(); enableBackupDescription.withBackupPolicyName(backupPolicyName); @@ -30784,7 +31206,7 @@ public Observable> enablePartitionBackupWithServiceRespons if (backupPolicyName == null) { throw new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; EnableBackupDescription enableBackupDescription = new EnableBackupDescription(); enableBackupDescription.withBackupPolicyName(backupPolicyName); return service.enablePartitionBackup(partitionId, apiVersion, timeout, this.acceptLanguage(), enableBackupDescription, this.userAgent()) @@ -30814,12 +31236,13 @@ private ServiceResponse enablePartitionBackupDelegate(Response disablePartitionBackupAsync(UUID partitionId, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(disablePartitionBackupWithServiceResponseAsync(partitionId), serviceCallback); + public ServiceFuture disablePartitionBackupAsync(UUID partitionId, boolean cleanBackup, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(disablePartitionBackupWithServiceResponseAsync(partitionId, cleanBackup), serviceCallback); } /** @@ -30842,11 +31266,12 @@ public ServiceFuture disablePartitionBackupAsync(UUID partitionId, final S 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 partitionId The identity of the partition. + * @param 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. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */ - public Observable disablePartitionBackupAsync(UUID partitionId) { - return disablePartitionBackupWithServiceResponseAsync(partitionId).map(new Func1, Void>() { + public Observable disablePartitionBackupAsync(UUID partitionId, boolean cleanBackup) { + return disablePartitionBackupWithServiceResponseAsync(partitionId, cleanBackup).map(new Func1, Void>() { @Override public Void call(ServiceResponse response) { return response.body(); @@ -30860,16 +31285,19 @@ public Void call(ServiceResponse response) { 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 partitionId The identity of the partition. + * @param 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. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */ - public Observable> disablePartitionBackupWithServiceResponseAsync(UUID partitionId) { + public Observable> disablePartitionBackupWithServiceResponseAsync(UUID partitionId, boolean cleanBackup) { if (partitionId == null) { throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; final Long timeout = null; - return service.disablePartitionBackup(partitionId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + DisableBackupDescription disableBackupDescription = new DisableBackupDescription(); + disableBackupDescription.withCleanBackup(cleanBackup); + return service.disablePartitionBackup(partitionId, apiVersion, timeout, this.acceptLanguage(), disableBackupDescription, this.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -30889,13 +31317,14 @@ public Observable> call(Response response) { 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 partitionId The identity of the partition. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws FabricErrorException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */ - public void disablePartitionBackup(UUID partitionId, Long timeout) { - disablePartitionBackupWithServiceResponseAsync(partitionId, timeout).toBlocking().single().body(); + public void disablePartitionBackup(UUID partitionId, boolean cleanBackup, Long timeout) { + disablePartitionBackupWithServiceResponseAsync(partitionId, cleanBackup, timeout).toBlocking().single().body(); } /** @@ -30904,13 +31333,14 @@ public void disablePartitionBackup(UUID partitionId, Long timeout) { 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 partitionId The identity of the partition. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture disablePartitionBackupAsync(UUID partitionId, Long timeout, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(disablePartitionBackupWithServiceResponseAsync(partitionId, timeout), serviceCallback); + public ServiceFuture disablePartitionBackupAsync(UUID partitionId, boolean cleanBackup, Long timeout, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(disablePartitionBackupWithServiceResponseAsync(partitionId, cleanBackup, timeout), serviceCallback); } /** @@ -30919,12 +31349,13 @@ public ServiceFuture disablePartitionBackupAsync(UUID partitionId, Long ti 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 partitionId The identity of the partition. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */ - public Observable disablePartitionBackupAsync(UUID partitionId, Long timeout) { - return disablePartitionBackupWithServiceResponseAsync(partitionId, timeout).map(new Func1, Void>() { + public Observable disablePartitionBackupAsync(UUID partitionId, boolean cleanBackup, Long timeout) { + return disablePartitionBackupWithServiceResponseAsync(partitionId, cleanBackup, timeout).map(new Func1, Void>() { @Override public Void call(ServiceResponse response) { return response.body(); @@ -30938,16 +31369,19 @@ public Void call(ServiceResponse response) { 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 partitionId The identity of the partition. + * @param 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 timeout The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */ - public Observable> disablePartitionBackupWithServiceResponseAsync(UUID partitionId, Long timeout) { + public Observable> disablePartitionBackupWithServiceResponseAsync(UUID partitionId, boolean cleanBackup, Long timeout) { if (partitionId == null) { throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); } - final String apiVersion = "6.2-preview"; - return service.disablePartitionBackup(partitionId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) + final String apiVersion = "6.4"; + DisableBackupDescription disableBackupDescription = new DisableBackupDescription(); + disableBackupDescription.withCleanBackup(cleanBackup); + return service.disablePartitionBackup(partitionId, apiVersion, timeout, this.acceptLanguage(), disableBackupDescription, this.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -31024,7 +31458,7 @@ public Observable> getPar if (partitionId == null) { throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; final Long timeout = null; return service.getPartitionBackupConfigurationInfo(partitionId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>() { @@ -31100,7 +31534,7 @@ public Observable> getPar if (partitionId == null) { throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; return service.getPartitionBackupConfigurationInfo(partitionId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -31178,7 +31612,7 @@ public Observable> getPartitionBackupL if (partitionId == null) { throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; final Long timeout = null; final Boolean latest = null; final DateTime startDateTimeFilter = null; @@ -31269,7 +31703,7 @@ public Observable> getPartitionBackupL if (partitionId == null) { throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; return service.getPartitionBackupList(partitionId, apiVersion, timeout, latest, startDateTimeFilter, endDateTimeFilter, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -31346,7 +31780,7 @@ public Observable> suspendPartitionBackupWithServiceRespon if (partitionId == null) { throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; final Long timeout = null; return service.suspendPartitionBackup(partitionId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>() { @@ -31421,7 +31855,7 @@ public Observable> suspendPartitionBackupWithServiceRespon if (partitionId == null) { throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; return service.suspendPartitionBackup(partitionId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -31498,7 +31932,7 @@ public Observable> resumePartitionBackupWithServiceRespons if (partitionId == null) { throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; final Long timeout = null; return service.resumePartitionBackup(partitionId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>() { @@ -31573,7 +32007,7 @@ public Observable> resumePartitionBackupWithServiceRespons if (partitionId == null) { throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; return service.resumePartitionBackup(partitionId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -31654,7 +32088,7 @@ public Observable> backupPartitionWithServiceResponseAsync if (partitionId == null) { throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; final Integer backupTimeout = null; final Long timeout = null; final BackupStorageDescription backupStorage = null; @@ -31746,7 +32180,7 @@ public Observable> backupPartitionWithServiceResponseAsync throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); } Validator.validate(backupStorage); - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; BackupPartitionDescription backupPartitionDescription = null; if (backupStorage != null) { backupPartitionDescription = new BackupPartitionDescription(); @@ -31829,7 +32263,7 @@ public Observable> getPartitionBackupPr if (partitionId == null) { throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; final Long timeout = null; return service.getPartitionBackupProgress(partitionId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>() { @@ -31905,7 +32339,7 @@ public Observable> getPartitionBackupPr if (partitionId == null) { throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; return service.getPartitionBackupProgress(partitionId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -31994,7 +32428,7 @@ public Observable> restorePartitionWithServiceResponseAsyn throw new IllegalArgumentException("Parameter restorePartitionDescription is required and cannot be null."); } Validator.validate(restorePartitionDescription); - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; final Integer restoreTimeout = null; final Long timeout = null; return service.restorePartition(partitionId, restorePartitionDescription, restoreTimeout, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) @@ -32086,7 +32520,7 @@ public Observable> restorePartitionWithServiceResponseAsyn throw new IllegalArgumentException("Parameter restorePartitionDescription is required and cannot be null."); } Validator.validate(restorePartitionDescription); - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; return service.restorePartition(partitionId, restorePartitionDescription, restoreTimeout, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -32164,7 +32598,7 @@ public Observable> getPartitionRestore if (partitionId == null) { throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; final Long timeout = null; return service.getPartitionRestoreProgress(partitionId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>() { @@ -32240,7 +32674,7 @@ public Observable> getPartitionRestore if (partitionId == null) { throw new IllegalArgumentException("Parameter partitionId is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; return service.getPartitionRestoreProgress(partitionId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -32319,7 +32753,7 @@ public Observable> getBackupsFromBacku throw new IllegalArgumentException("Parameter getBackupByStorageQueryDescription is required and cannot be null."); } Validator.validate(getBackupByStorageQueryDescription); - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; final Long timeout = null; final String continuationToken = null; final Long maxResults = null; @@ -32406,7 +32840,7 @@ public Observable> getBackupsFromBacku throw new IllegalArgumentException("Parameter getBackupByStorageQueryDescription is required and cannot be null."); } Validator.validate(getBackupByStorageQueryDescription); - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; return service.getBackupsFromBackupLocation(apiVersion, timeout, continuationToken, maxResults, getBackupByStorageQueryDescription, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -33946,7 +34380,7 @@ public Observable>> getClusterEventListW if (endTimeUtc == null) { throw new IllegalArgumentException("Parameter endTimeUtc is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; final Long timeout = null; final String eventsTypesFilter = null; final Boolean excludeAnalysisEvents = null; @@ -34044,7 +34478,7 @@ public Observable>> getClusterEventListW if (endTimeUtc == null) { throw new IllegalArgumentException("Parameter endTimeUtc is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; return service.getClusterEventList(apiVersion, timeout, startTimeUtc, endTimeUtc, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>>() { @Override @@ -34319,7 +34753,7 @@ public Observable>> getNodeEventListWithSer if (endTimeUtc == null) { throw new IllegalArgumentException("Parameter endTimeUtc is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; final Long timeout = null; final String eventsTypesFilter = null; final Boolean excludeAnalysisEvents = null; @@ -34424,7 +34858,7 @@ public Observable>> getNodeEventListWithSer if (endTimeUtc == null) { throw new IllegalArgumentException("Parameter endTimeUtc is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; return service.getNodeEventList(nodeName, apiVersion, timeout, startTimeUtc, endTimeUtc, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>>() { @Override @@ -34509,7 +34943,7 @@ public Observable>> getNodesEventListWithSe if (endTimeUtc == null) { throw new IllegalArgumentException("Parameter endTimeUtc is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; final Long timeout = null; final String eventsTypesFilter = null; final Boolean excludeAnalysisEvents = null; @@ -34607,7 +35041,7 @@ public Observable>> getNodesEventListWithSe if (endTimeUtc == null) { throw new IllegalArgumentException("Parameter endTimeUtc is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; return service.getNodesEventList(apiVersion, timeout, startTimeUtc, endTimeUtc, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>>() { @Override @@ -34707,7 +35141,7 @@ public Observable>> getApplicationEv if (endTimeUtc == null) { throw new IllegalArgumentException("Parameter endTimeUtc is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; final Long timeout = null; final String eventsTypesFilter = null; final Boolean excludeAnalysisEvents = null; @@ -34820,7 +35254,7 @@ public Observable>> getApplicationEv if (endTimeUtc == null) { throw new IllegalArgumentException("Parameter endTimeUtc is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; return service.getApplicationEventList(applicationId, apiVersion, timeout, startTimeUtc, endTimeUtc, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>>() { @Override @@ -34905,7 +35339,7 @@ public Observable>> getApplicationsE if (endTimeUtc == null) { throw new IllegalArgumentException("Parameter endTimeUtc is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; final Long timeout = null; final String eventsTypesFilter = null; final Boolean excludeAnalysisEvents = null; @@ -35003,7 +35437,7 @@ public Observable>> getApplicationsE if (endTimeUtc == null) { throw new IllegalArgumentException("Parameter endTimeUtc is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; return service.getApplicationsEventList(apiVersion, timeout, startTimeUtc, endTimeUtc, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>>() { @Override @@ -35103,7 +35537,7 @@ public Observable>> getServiceEventListW if (endTimeUtc == null) { throw new IllegalArgumentException("Parameter endTimeUtc is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; final Long timeout = null; final String eventsTypesFilter = null; final Boolean excludeAnalysisEvents = null; @@ -35216,7 +35650,7 @@ public Observable>> getServiceEventListW if (endTimeUtc == null) { throw new IllegalArgumentException("Parameter endTimeUtc is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; return service.getServiceEventList(serviceId, apiVersion, timeout, startTimeUtc, endTimeUtc, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>>() { @Override @@ -35301,7 +35735,7 @@ public Observable>> getServicesEventList if (endTimeUtc == null) { throw new IllegalArgumentException("Parameter endTimeUtc is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; final Long timeout = null; final String eventsTypesFilter = null; final Boolean excludeAnalysisEvents = null; @@ -35399,7 +35833,7 @@ public Observable>> getServicesEventList if (endTimeUtc == null) { throw new IllegalArgumentException("Parameter endTimeUtc is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; return service.getServicesEventList(apiVersion, timeout, startTimeUtc, endTimeUtc, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>>() { @Override @@ -35491,7 +35925,7 @@ public Observable>> getPartitionEventL if (endTimeUtc == null) { throw new IllegalArgumentException("Parameter endTimeUtc is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; final Long timeout = null; final String eventsTypesFilter = null; final Boolean excludeAnalysisEvents = null; @@ -35596,7 +36030,7 @@ public Observable>> getPartitionEventL if (endTimeUtc == null) { throw new IllegalArgumentException("Parameter endTimeUtc is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; return service.getPartitionEventList(partitionId, apiVersion, timeout, startTimeUtc, endTimeUtc, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>>() { @Override @@ -35681,7 +36115,7 @@ public Observable>> getPartitionsEvent if (endTimeUtc == null) { throw new IllegalArgumentException("Parameter endTimeUtc is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; final Long timeout = null; final String eventsTypesFilter = null; final Boolean excludeAnalysisEvents = null; @@ -35779,7 +36213,7 @@ public Observable>> getPartitionsEvent if (endTimeUtc == null) { throw new IllegalArgumentException("Parameter endTimeUtc is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; return service.getPartitionsEventList(apiVersion, timeout, startTimeUtc, endTimeUtc, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>>() { @Override @@ -35878,7 +36312,7 @@ public Observable>> getPartitionReplicaE if (endTimeUtc == null) { throw new IllegalArgumentException("Parameter endTimeUtc is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; final Long timeout = null; final String eventsTypesFilter = null; final Boolean excludeAnalysisEvents = null; @@ -35990,7 +36424,7 @@ public Observable>> getPartitionReplicaE if (endTimeUtc == null) { throw new IllegalArgumentException("Parameter endTimeUtc is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; return service.getPartitionReplicaEventList(partitionId, replicaId, apiVersion, timeout, startTimeUtc, endTimeUtc, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>>() { @Override @@ -36082,7 +36516,7 @@ public Observable>> getPartitionReplicas if (endTimeUtc == null) { throw new IllegalArgumentException("Parameter endTimeUtc is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; final Long timeout = null; final String eventsTypesFilter = null; final Boolean excludeAnalysisEvents = null; @@ -36187,7 +36621,7 @@ public Observable>> getPartitionReplicas if (endTimeUtc == null) { throw new IllegalArgumentException("Parameter endTimeUtc is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; return service.getPartitionReplicasEventList(partitionId, apiVersion, timeout, startTimeUtc, endTimeUtc, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>>() { @Override @@ -36265,7 +36699,7 @@ public Observable>> getCorrelatedEventLis if (eventInstanceId == null) { throw new IllegalArgumentException("Parameter eventInstanceId is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; final Long timeout = null; return service.getCorrelatedEventList(eventInstanceId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>>() { @@ -36341,7 +36775,7 @@ public Observable>> getCorrelatedEventLis if (eventInstanceId == null) { throw new IllegalArgumentException("Parameter eventInstanceId is required and cannot be null."); } - final String apiVersion = "6.2-preview"; + final String apiVersion = "6.4"; return service.getCorrelatedEventList(eventInstanceId, apiVersion, timeout, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1, Observable>>>() { @Override @@ -36363,830 +36797,4 @@ private ServiceResponse> getCorrelatedEventListDelegate(R .build(response); } - /** - * 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 applicationResourceName Service Fabric application resource name. - * @param applicationResourceDescription Description for creating an application resource. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws FabricErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - */ - public void createApplicationResource(String applicationResourceName, ApplicationResourceDescriptionInner applicationResourceDescription) { - createApplicationResourceWithServiceResponseAsync(applicationResourceName, applicationResourceDescription).toBlocking().single().body(); - } - - /** - * 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 applicationResourceName Service Fabric application resource name. - * @param applicationResourceDescription Description for creating an application resource. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture createApplicationResourceAsync(String applicationResourceName, ApplicationResourceDescriptionInner applicationResourceDescription, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createApplicationResourceWithServiceResponseAsync(applicationResourceName, applicationResourceDescription), serviceCallback); - } - - /** - * 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 applicationResourceName Service Fabric application resource name. - * @param applicationResourceDescription Description for creating an application resource. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable createApplicationResourceAsync(String applicationResourceName, ApplicationResourceDescriptionInner applicationResourceDescription) { - return createApplicationResourceWithServiceResponseAsync(applicationResourceName, applicationResourceDescription).map(new Func1, Void>() { - @Override - public Void call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * 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 applicationResourceName Service Fabric application resource name. - * @param applicationResourceDescription Description for creating an application resource. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable> createApplicationResourceWithServiceResponseAsync(String applicationResourceName, ApplicationResourceDescriptionInner applicationResourceDescription) { - if (applicationResourceName == null) { - throw new IllegalArgumentException("Parameter applicationResourceName is required and cannot be null."); - } - if (applicationResourceDescription == null) { - throw new IllegalArgumentException("Parameter applicationResourceDescription is required and cannot be null."); - } - Validator.validate(applicationResourceDescription); - final String apiVersion = "6.3-preview"; - return service.createApplicationResource(applicationResourceName, apiVersion, applicationResourceDescription, this.acceptLanguage(), this.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = createApplicationResourceDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse createApplicationResourceDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { - return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) - .register(201, new TypeToken() { }.getType()) - .register(202, new TypeToken() { }.getType()) - .registerError(FabricErrorException.class) - .build(response); - } - - /** - * 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 applicationResourceName Service Fabric application resource name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws FabricErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the ApplicationResourceDescriptionInner object if successful. - */ - public ApplicationResourceDescriptionInner getApplicationResource(String applicationResourceName) { - return getApplicationResourceWithServiceResponseAsync(applicationResourceName).toBlocking().single().body(); - } - - /** - * 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 applicationResourceName Service Fabric application resource name. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture getApplicationResourceAsync(String applicationResourceName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getApplicationResourceWithServiceResponseAsync(applicationResourceName), serviceCallback); - } - - /** - * 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 applicationResourceName Service Fabric application resource name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ApplicationResourceDescriptionInner object - */ - public Observable getApplicationResourceAsync(String applicationResourceName) { - return getApplicationResourceWithServiceResponseAsync(applicationResourceName).map(new Func1, ApplicationResourceDescriptionInner>() { - @Override - public ApplicationResourceDescriptionInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * 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 applicationResourceName Service Fabric application resource name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ApplicationResourceDescriptionInner object - */ - public Observable> getApplicationResourceWithServiceResponseAsync(String applicationResourceName) { - if (applicationResourceName == null) { - throw new IllegalArgumentException("Parameter applicationResourceName is required and cannot be null."); - } - final String apiVersion = "6.3-preview"; - return service.getApplicationResource(applicationResourceName, apiVersion, this.acceptLanguage(), this.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = getApplicationResourceDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse getApplicationResourceDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { - return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(FabricErrorException.class) - .build(response); - } - - /** - * Deletes the specified application. - * Deletes the application identified by the name. - * - * @param applicationResourceName Service Fabric application resource name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws FabricErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - */ - public void deleteApplicationResource(String applicationResourceName) { - deleteApplicationResourceWithServiceResponseAsync(applicationResourceName).toBlocking().single().body(); - } - - /** - * Deletes the specified application. - * Deletes the application identified by the name. - * - * @param applicationResourceName Service Fabric application resource name. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture deleteApplicationResourceAsync(String applicationResourceName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(deleteApplicationResourceWithServiceResponseAsync(applicationResourceName), serviceCallback); - } - - /** - * Deletes the specified application. - * Deletes the application identified by the name. - * - * @param applicationResourceName Service Fabric application resource name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable deleteApplicationResourceAsync(String applicationResourceName) { - return deleteApplicationResourceWithServiceResponseAsync(applicationResourceName).map(new Func1, Void>() { - @Override - public Void call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Deletes the specified application. - * Deletes the application identified by the name. - * - * @param applicationResourceName Service Fabric application resource name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable> deleteApplicationResourceWithServiceResponseAsync(String applicationResourceName) { - if (applicationResourceName == null) { - throw new IllegalArgumentException("Parameter applicationResourceName is required and cannot be null."); - } - final String apiVersion = "6.3-preview"; - return service.deleteApplicationResource(applicationResourceName, apiVersion, this.acceptLanguage(), this.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = deleteApplicationResourceDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse deleteApplicationResourceDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { - return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(202, new TypeToken() { }.getType()) - .register(204, new TypeToken() { }.getType()) - .registerError(FabricErrorException.class) - .build(response); - } - - /** - * Gets all the services in the application resource. - * The operation returns the service descriptions of all the services in the application resource. - * - * @param applicationResourceName Service Fabric application resource name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedServiceResourceDescriptionListInner object if successful. - */ - public PagedServiceResourceDescriptionListInner getServices(String applicationResourceName) { - return getServicesWithServiceResponseAsync(applicationResourceName).toBlocking().single().body(); - } - - /** - * Gets all the services in the application resource. - * The operation returns the service descriptions of all the services in the application resource. - * - * @param applicationResourceName Service Fabric application resource name. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture getServicesAsync(String applicationResourceName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getServicesWithServiceResponseAsync(applicationResourceName), serviceCallback); - } - - /** - * Gets all the services in the application resource. - * The operation returns the service descriptions of all the services in the application resource. - * - * @param applicationResourceName Service Fabric application resource name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedServiceResourceDescriptionListInner object - */ - public Observable getServicesAsync(String applicationResourceName) { - return getServicesWithServiceResponseAsync(applicationResourceName).map(new Func1, PagedServiceResourceDescriptionListInner>() { - @Override - public PagedServiceResourceDescriptionListInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Gets all the services in the application resource. - * The operation returns the service descriptions of all the services in the application resource. - * - * @param applicationResourceName Service Fabric application resource name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedServiceResourceDescriptionListInner object - */ - public Observable> getServicesWithServiceResponseAsync(String applicationResourceName) { - if (applicationResourceName == null) { - throw new IllegalArgumentException("Parameter applicationResourceName is required and cannot be null."); - } - final String apiVersion = "6.3-preview"; - return service.getServices(applicationResourceName, apiVersion, this.acceptLanguage(), this.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = getServicesDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse getServicesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) - .build(response); - } - - /** - * Gets the description of the specified service in an application resource. - * Gets the description of the service resource. - * - * @param applicationResourceName Service Fabric application resource name. - * @param serviceResourceName Service Fabric service resource name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the ServiceResourceDescriptionInner object if successful. - */ - public ServiceResourceDescriptionInner getService(String applicationResourceName, String serviceResourceName) { - return getServiceWithServiceResponseAsync(applicationResourceName, serviceResourceName).toBlocking().single().body(); - } - - /** - * Gets the description of the specified service in an application resource. - * Gets the description of the service resource. - * - * @param applicationResourceName Service Fabric application resource name. - * @param serviceResourceName Service Fabric service resource name. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture getServiceAsync(String applicationResourceName, String serviceResourceName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getServiceWithServiceResponseAsync(applicationResourceName, serviceResourceName), serviceCallback); - } - - /** - * Gets the description of the specified service in an application resource. - * Gets the description of the service resource. - * - * @param applicationResourceName Service Fabric application resource name. - * @param serviceResourceName Service Fabric service resource name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ServiceResourceDescriptionInner object - */ - public Observable getServiceAsync(String applicationResourceName, String serviceResourceName) { - return getServiceWithServiceResponseAsync(applicationResourceName, serviceResourceName).map(new Func1, ServiceResourceDescriptionInner>() { - @Override - public ServiceResourceDescriptionInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Gets the description of the specified service in an application resource. - * Gets the description of the service resource. - * - * @param applicationResourceName Service Fabric application resource name. - * @param serviceResourceName Service Fabric service resource name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ServiceResourceDescriptionInner object - */ - public Observable> getServiceWithServiceResponseAsync(String applicationResourceName, String serviceResourceName) { - if (applicationResourceName == null) { - throw new IllegalArgumentException("Parameter applicationResourceName is required and cannot be null."); - } - if (serviceResourceName == null) { - throw new IllegalArgumentException("Parameter serviceResourceName is required and cannot be null."); - } - final String apiVersion = "6.3-preview"; - return service.getService(applicationResourceName, serviceResourceName, apiVersion, this.acceptLanguage(), this.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = getServiceDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse getServiceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) - .build(response); - } - - /** - * 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 applicationResourceName Service Fabric application resource name. - * @param serviceResourceName Service Fabric service resource name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedServiceResourceReplicaDescriptionListInner object if successful. - */ - public PagedServiceResourceReplicaDescriptionListInner getReplicas(String applicationResourceName, String serviceResourceName) { - return getReplicasWithServiceResponseAsync(applicationResourceName, serviceResourceName).toBlocking().single().body(); - } - - /** - * 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 applicationResourceName Service Fabric application resource name. - * @param serviceResourceName Service Fabric service resource name. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture getReplicasAsync(String applicationResourceName, String serviceResourceName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getReplicasWithServiceResponseAsync(applicationResourceName, serviceResourceName), serviceCallback); - } - - /** - * 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 applicationResourceName Service Fabric application resource name. - * @param serviceResourceName Service Fabric service resource name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedServiceResourceReplicaDescriptionListInner object - */ - public Observable getReplicasAsync(String applicationResourceName, String serviceResourceName) { - return getReplicasWithServiceResponseAsync(applicationResourceName, serviceResourceName).map(new Func1, PagedServiceResourceReplicaDescriptionListInner>() { - @Override - public PagedServiceResourceReplicaDescriptionListInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * 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 applicationResourceName Service Fabric application resource name. - * @param serviceResourceName Service Fabric service resource name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedServiceResourceReplicaDescriptionListInner object - */ - public Observable> getReplicasWithServiceResponseAsync(String applicationResourceName, String serviceResourceName) { - if (applicationResourceName == null) { - throw new IllegalArgumentException("Parameter applicationResourceName is required and cannot be null."); - } - if (serviceResourceName == null) { - throw new IllegalArgumentException("Parameter serviceResourceName is required and cannot be null."); - } - final String apiVersion = "6.3-preview"; - return service.getReplicas(applicationResourceName, serviceResourceName, apiVersion, this.acceptLanguage(), this.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = getReplicasDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse getReplicasDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) - .build(response); - } - - /** - * 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 applicationResourceName Service Fabric application resource name. - * @param serviceResourceName Service Fabric service resource name. - * @param replicaName Service Fabric replica name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the ServiceResourceReplicaDescriptionInner object if successful. - */ - public ServiceResourceReplicaDescriptionInner getReplica(String applicationResourceName, String serviceResourceName, String replicaName) { - return getReplicaWithServiceResponseAsync(applicationResourceName, serviceResourceName, replicaName).toBlocking().single().body(); - } - - /** - * 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 applicationResourceName Service Fabric application resource name. - * @param serviceResourceName Service Fabric service resource name. - * @param replicaName Service Fabric replica name. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture getReplicaAsync(String applicationResourceName, String serviceResourceName, String replicaName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getReplicaWithServiceResponseAsync(applicationResourceName, serviceResourceName, replicaName), serviceCallback); - } - - /** - * 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 applicationResourceName Service Fabric application resource name. - * @param serviceResourceName Service Fabric service resource name. - * @param replicaName Service Fabric replica name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ServiceResourceReplicaDescriptionInner object - */ - public Observable getReplicaAsync(String applicationResourceName, String serviceResourceName, String replicaName) { - return getReplicaWithServiceResponseAsync(applicationResourceName, serviceResourceName, replicaName).map(new Func1, ServiceResourceReplicaDescriptionInner>() { - @Override - public ServiceResourceReplicaDescriptionInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * 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 applicationResourceName Service Fabric application resource name. - * @param serviceResourceName Service Fabric service resource name. - * @param replicaName Service Fabric replica name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ServiceResourceReplicaDescriptionInner object - */ - public Observable> getReplicaWithServiceResponseAsync(String applicationResourceName, String serviceResourceName, String replicaName) { - if (applicationResourceName == null) { - throw new IllegalArgumentException("Parameter applicationResourceName is required and cannot be null."); - } - if (serviceResourceName == null) { - throw new IllegalArgumentException("Parameter serviceResourceName is required and cannot be null."); - } - if (replicaName == null) { - throw new IllegalArgumentException("Parameter replicaName is required and cannot be null."); - } - final String apiVersion = "6.3-preview"; - return service.getReplica(applicationResourceName, serviceResourceName, replicaName, apiVersion, this.acceptLanguage(), this.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = getReplicaDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse getReplicaDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) - .build(response); - } - - /** - * 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 volumeResourceName Service Fabric volume resource name. - * @param volumeResourceDescription Description for creating a volume resource. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws FabricErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - */ - public void createVolumeResource(String volumeResourceName, VolumeResourceDescriptionInner volumeResourceDescription) { - createVolumeResourceWithServiceResponseAsync(volumeResourceName, volumeResourceDescription).toBlocking().single().body(); - } - - /** - * 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 volumeResourceName Service Fabric volume resource name. - * @param volumeResourceDescription Description for creating a volume resource. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture createVolumeResourceAsync(String volumeResourceName, VolumeResourceDescriptionInner volumeResourceDescription, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createVolumeResourceWithServiceResponseAsync(volumeResourceName, volumeResourceDescription), serviceCallback); - } - - /** - * 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 volumeResourceName Service Fabric volume resource name. - * @param volumeResourceDescription Description for creating a volume resource. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable createVolumeResourceAsync(String volumeResourceName, VolumeResourceDescriptionInner volumeResourceDescription) { - return createVolumeResourceWithServiceResponseAsync(volumeResourceName, volumeResourceDescription).map(new Func1, Void>() { - @Override - public Void call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * 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 volumeResourceName Service Fabric volume resource name. - * @param volumeResourceDescription Description for creating a volume resource. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable> createVolumeResourceWithServiceResponseAsync(String volumeResourceName, VolumeResourceDescriptionInner volumeResourceDescription) { - if (volumeResourceName == null) { - throw new IllegalArgumentException("Parameter volumeResourceName is required and cannot be null."); - } - if (volumeResourceDescription == null) { - throw new IllegalArgumentException("Parameter volumeResourceDescription is required and cannot be null."); - } - Validator.validate(volumeResourceDescription); - final String apiVersion = "6.3-preview"; - return service.createVolumeResource(volumeResourceName, apiVersion, volumeResourceDescription, this.acceptLanguage(), this.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = createVolumeResourceDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse createVolumeResourceDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { - return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) - .register(201, new TypeToken() { }.getType()) - .register(202, new TypeToken() { }.getType()) - .registerError(FabricErrorException.class) - .build(response); - } - - /** - * 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 volumeResourceName Service Fabric volume resource name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws FabricErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the VolumeResourceDescriptionInner object if successful. - */ - public VolumeResourceDescriptionInner getVolumeResource(String volumeResourceName) { - return getVolumeResourceWithServiceResponseAsync(volumeResourceName).toBlocking().single().body(); - } - - /** - * 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 volumeResourceName Service Fabric volume resource name. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture getVolumeResourceAsync(String volumeResourceName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getVolumeResourceWithServiceResponseAsync(volumeResourceName), serviceCallback); - } - - /** - * 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 volumeResourceName Service Fabric volume resource name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the VolumeResourceDescriptionInner object - */ - public Observable getVolumeResourceAsync(String volumeResourceName) { - return getVolumeResourceWithServiceResponseAsync(volumeResourceName).map(new Func1, VolumeResourceDescriptionInner>() { - @Override - public VolumeResourceDescriptionInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * 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 volumeResourceName Service Fabric volume resource name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the VolumeResourceDescriptionInner object - */ - public Observable> getVolumeResourceWithServiceResponseAsync(String volumeResourceName) { - if (volumeResourceName == null) { - throw new IllegalArgumentException("Parameter volumeResourceName is required and cannot be null."); - } - final String apiVersion = "6.3-preview"; - return service.getVolumeResource(volumeResourceName, apiVersion, this.acceptLanguage(), this.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = getVolumeResourceDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse getVolumeResourceDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { - return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(FabricErrorException.class) - .build(response); - } - - /** - * Deletes the volume resource. - * Deletes the volume identified by the name. - * - * @param volumeResourceName Service Fabric volume resource name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws FabricErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - */ - public void deleteVolumeResource(String volumeResourceName) { - deleteVolumeResourceWithServiceResponseAsync(volumeResourceName).toBlocking().single().body(); - } - - /** - * Deletes the volume resource. - * Deletes the volume identified by the name. - * - * @param volumeResourceName Service Fabric volume resource name. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture deleteVolumeResourceAsync(String volumeResourceName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(deleteVolumeResourceWithServiceResponseAsync(volumeResourceName), serviceCallback); - } - - /** - * Deletes the volume resource. - * Deletes the volume identified by the name. - * - * @param volumeResourceName Service Fabric volume resource name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable deleteVolumeResourceAsync(String volumeResourceName) { - return deleteVolumeResourceWithServiceResponseAsync(volumeResourceName).map(new Func1, Void>() { - @Override - public Void call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Deletes the volume resource. - * Deletes the volume identified by the name. - * - * @param volumeResourceName Service Fabric volume resource name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable> deleteVolumeResourceWithServiceResponseAsync(String volumeResourceName) { - if (volumeResourceName == null) { - throw new IllegalArgumentException("Parameter volumeResourceName is required and cannot be null."); - } - final String apiVersion = "6.3-preview"; - return service.deleteVolumeResource(volumeResourceName, apiVersion, this.acceptLanguage(), this.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = deleteVolumeResourceDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse deleteVolumeResourceDelegate(Response response) throws FabricErrorException, IOException, IllegalArgumentException { - return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(202, new TypeToken() { }.getType()) - .register(204, new TypeToken() { }.getType()) - .registerError(FabricErrorException.class) - .build(response); - } - } diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceReplicaDescriptionInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceReplicaDescriptionInner.java new file mode 100644 index 0000000000000..489c807b17c75 --- /dev/null +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceReplicaDescriptionInner.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.servicefabric.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.servicefabric.ServiceReplicaProperties; + +/** + * Describes a replica of a service resource. + */ +public class ServiceReplicaDescriptionInner extends ServiceReplicaProperties { + /** + * Name of the replica. + */ + @JsonProperty(value = "replicaName", required = true) + private String replicaName; + + /** + * Get name of the replica. + * + * @return the replicaName value + */ + public String replicaName() { + return this.replicaName; + } + + /** + * Set name of the replica. + * + * @param replicaName the replicaName value to set + * @return the ServiceReplicaDescriptionInner object itself. + */ + public ServiceReplicaDescriptionInner withReplicaName(String replicaName) { + this.replicaName = replicaName; + return this; + } + +} diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceResourceDescriptionInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceResourceDescriptionInner.java index 69e009423ea0e..a2f72ccf704fe 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceResourceDescriptionInner.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/ServiceResourceDescriptionInner.java @@ -8,27 +8,34 @@ package com.microsoft.azure.servicefabric.implementation; -import com.microsoft.azure.servicefabric.OperatingSystemTypes; +import com.microsoft.azure.servicefabric.OperatingSystemType; import java.util.List; import com.microsoft.azure.servicefabric.ContainerCodePackageProperties; import com.microsoft.azure.servicefabric.NetworkRef; import com.microsoft.azure.servicefabric.DiagnosticsRef; +import com.microsoft.azure.servicefabric.AutoScalingPolicy; +import com.microsoft.azure.servicefabric.ResourceStatus; import com.microsoft.azure.servicefabric.HealthState; -import com.microsoft.azure.servicefabric.ServiceResourceStatus; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; /** - * Describes a service fabric service resource. + * This type describes a service resource. */ @JsonFlatten public class ServiceResourceDescriptionInner { /** - * The Operating system type required by the code in service. Possible - * values include: 'Linux', 'Windows'. + * Name of the Service resource. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The operation system required by the code in service. Possible values + * include: 'Linux', 'Windows'. */ @JsonProperty(value = "properties.osType", required = true) - private OperatingSystemTypes osType; + private OperatingSystemType osType; /** * Describes the set of code packages that forms the service. A code @@ -65,42 +72,75 @@ public class ServiceResourceDescriptionInner { private Integer replicaCount; /** - * 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'. + * Auto scaling policies. */ - @JsonProperty(value = "properties.healthState") - private HealthState healthState; + @JsonProperty(value = "properties.autoScalingPolicies") + private List autoScalingPolicies; /** - * Represents the status of the service. Possible values include: - * 'Unknown', 'Active', 'Upgrading', 'Deleting', 'Creating', 'Failed'. + * Status of the service. Possible values include: 'Unknown', 'Ready', + * 'Upgrading', 'Creating', 'Deleting', 'Failed'. */ @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) - private ServiceResourceStatus status; + private ResourceStatus status; /** - * Service resource name. + * Gives additional information about the current status of the service. */ - @JsonProperty(value = "name", required = true) - private String name; + @JsonProperty(value = "properties.statusDetails", access = JsonProperty.Access.WRITE_ONLY) + private String statusDetails; + + /** + * Describes the health state of an application resource. Possible values + * include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown'. + */ + @JsonProperty(value = "properties.healthState", access = JsonProperty.Access.WRITE_ONLY) + private HealthState healthState; + + /** + * 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. + */ + @JsonProperty(value = "properties.unhealthyEvaluation", access = JsonProperty.Access.WRITE_ONLY) + private String unhealthyEvaluation; + + /** + * Get name of the Service resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the Service resource. + * + * @param name the name value to set + * @return the ServiceResourceDescriptionInner object itself. + */ + public ServiceResourceDescriptionInner withName(String name) { + this.name = name; + return this; + } /** - * Get the Operating system type required by the code in service. Possible values include: 'Linux', 'Windows'. + * Get the operation system required by the code in service. Possible values include: 'Linux', 'Windows'. * * @return the osType value */ - public OperatingSystemTypes osType() { + public OperatingSystemType osType() { return this.osType; } /** - * Set the Operating system type required by the code in service. Possible values include: 'Linux', 'Windows'. + * Set the operation system required by the code in service. Possible values include: 'Linux', 'Windows'. * * @param osType the osType value to set * @return the ServiceResourceDescriptionInner object itself. */ - public ServiceResourceDescriptionInner withOsType(OperatingSystemTypes osType) { + public ServiceResourceDescriptionInner withOsType(OperatingSystemType osType) { this.osType = osType; return this; } @@ -206,52 +246,59 @@ public ServiceResourceDescriptionInner withReplicaCount(Integer replicaCount) { } /** - * Get 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'. + * Get auto scaling policies. * - * @return the healthState value + * @return the autoScalingPolicies value */ - public HealthState healthState() { - return this.healthState; + public List autoScalingPolicies() { + return this.autoScalingPolicies; } /** - * Set 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'. + * Set auto scaling policies. * - * @param healthState the healthState value to set + * @param autoScalingPolicies the autoScalingPolicies value to set * @return the ServiceResourceDescriptionInner object itself. */ - public ServiceResourceDescriptionInner withHealthState(HealthState healthState) { - this.healthState = healthState; + public ServiceResourceDescriptionInner withAutoScalingPolicies(List autoScalingPolicies) { + this.autoScalingPolicies = autoScalingPolicies; return this; } /** - * Get represents the status of the service. Possible values include: 'Unknown', 'Active', 'Upgrading', 'Deleting', 'Creating', 'Failed'. + * Get status of the service. Possible values include: 'Unknown', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed'. * * @return the status value */ - public ServiceResourceStatus status() { + public ResourceStatus status() { return this.status; } /** - * Get service resource name. + * Get gives additional information about the current status of the service. * - * @return the name value + * @return the statusDetails value */ - public String name() { - return this.name; + public String statusDetails() { + return this.statusDetails; } /** - * Set service resource name. + * Get describes the health state of an application resource. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown'. * - * @param name the name value to set - * @return the ServiceResourceDescriptionInner object itself. + * @return the healthState value */ - public ServiceResourceDescriptionInner withName(String name) { - this.name = name; - return this; + public HealthState healthState() { + return this.healthState; + } + + /** + * Get 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. + * + * @return the unhealthyEvaluation value + */ + public String unhealthyEvaluation() { + return this.unhealthyEvaluation; } } diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/VolumeResourceDescriptionInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/VolumeResourceDescriptionInner.java index 8e893700930be..d95eae370eeda 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/VolumeResourceDescriptionInner.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/VolumeResourceDescriptionInner.java @@ -8,21 +8,41 @@ package com.microsoft.azure.servicefabric.implementation; +import com.microsoft.azure.servicefabric.ResourceStatus; import com.microsoft.azure.servicefabric.VolumeProviderParametersAzureFile; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; /** - * Describes a service fabric volume resource. + * This type describes a volume resource. */ @JsonFlatten public class VolumeResourceDescriptionInner { + /** + * Name of the Volume resource. + */ + @JsonProperty(value = "name", required = true) + private String name; + /** * User readable description of the volume. */ @JsonProperty(value = "properties.description") private String description; + /** + * Status of the volume. Possible values include: 'Unknown', 'Ready', + * 'Upgrading', 'Creating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private ResourceStatus status; + + /** + * Gives additional information about the current status of the volume. + */ + @JsonProperty(value = "properties.statusDetails", access = JsonProperty.Access.WRITE_ONLY) + private String statusDetails; + /** * Provider of the volume. */ @@ -35,20 +55,34 @@ public class VolumeResourceDescriptionInner { @JsonProperty(value = "properties.azureFileParameters") private VolumeProviderParametersAzureFile azureFileParameters; - /** - * Volume resource name. - */ - @JsonProperty(value = "name", required = true) - private String name; - /** * Creates an instance of VolumeResourceDescriptionInner class. - * @param name volume resource name. + * @param name name of the Volume resource. */ public VolumeResourceDescriptionInner() { provider = "SFAzureFile"; } + /** + * Get name of the Volume resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the Volume resource. + * + * @param name the name value to set + * @return the VolumeResourceDescriptionInner object itself. + */ + public VolumeResourceDescriptionInner withName(String name) { + this.name = name; + return this; + } + /** * Get user readable description of the volume. * @@ -69,6 +103,24 @@ public VolumeResourceDescriptionInner withDescription(String description) { return this; } + /** + * Get status of the volume. Possible values include: 'Unknown', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed'. + * + * @return the status value + */ + public ResourceStatus status() { + return this.status; + } + + /** + * Get gives additional information about the current status of the volume. + * + * @return the statusDetails value + */ + public String statusDetails() { + return this.statusDetails; + } + /** * Get provider of the volume. * @@ -109,24 +161,4 @@ public VolumeResourceDescriptionInner withAzureFileParameters(VolumeProviderPara return this; } - /** - * Get volume resource name. - * - * @return the name value - */ - public String name() { - return this.name; - } - - /** - * Set volume resource name. - * - * @param name the name value to set - * @return the VolumeResourceDescriptionInner object itself. - */ - public VolumeResourceDescriptionInner withName(String name) { - this.name = name; - return this; - } - } From 9b8083a116275aa9fcc21dea71b8a7a1b6dfe0a8 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 4 Dec 2018 23:06:20 -0800 Subject: [PATCH 5/7] [AutoPR servicefabric/data-plane] typo: servicefabric/data-plane/Microsoft.ServiceFabric (#2740) * Generated from 5305ee85120064c4201d196fbc1b272ea31cdd0a typo: servicefabric/data-plane/Microsoft.ServiceFabric - dataloss -> data loss - specificed -> specified - sucsessful -> successful * Generated from 5305ee85120064c4201d196fbc1b272ea31cdd0a typo: servicefabric/data-plane/Microsoft.ServiceFabric - dataloss -> data loss - specificed -> specified - sucsessful -> successful --- .../microsoft/azure/servicefabric/BackupEpoch.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupEpoch.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupEpoch.java index af1595e4ffb7f..1edaba208d4a8 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupEpoch.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/BackupEpoch.java @@ -27,10 +27,10 @@ public class BackupEpoch { private String configurationNumber; /** - * 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. + * 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. */ @JsonProperty(value = "DataLossNumber") private String dataLossNumber; @@ -56,7 +56,7 @@ public BackupEpoch withConfigurationNumber(String configurationNumber) { } /** - * Get 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. + * Get 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. * * @return the dataLossNumber value */ @@ -65,7 +65,7 @@ public String dataLossNumber() { } /** - * Set 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. + * Set 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. * * @param dataLossNumber the dataLossNumber value to set * @return the BackupEpoch object itself. From a2c19a30e948c34639129635dcdafc46abe2ce40 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 10 Dec 2018 13:06:40 -0800 Subject: [PATCH 6/7] [AutoPR servicefabric/data-plane] typo: servicefabric/data-plane/Microsoft.ServiceFabric (#2761) * Generated from 8c41c042c345003dcfcccabf18994983b56d22c9 typo: servicefabric/data-plane/Microsoft.ServiceFabric - Double word "the" - ABRIC -> FABRIC - dataloss -> data loss - valus -> value - indentifying -> identifying - deletd -> deleted - hamdle -> handle * Generated from cc06be4e41e2746fee4c6401cc8d042c0cd145e6 typo: servicefabric/data-plane/Microsoft.ServiceFabric - Double word "the" - ABRIC -> FABRIC - dataloss -> data loss - valus -> value - indentifying -> identifying - deletd -> deleted - hamdle -> handle - ReliablecollectionsRef -> ReliableCollectionsRef - URI's -> URIs * Generated from cc06be4e41e2746fee4c6401cc8d042c0cd145e6 typo: servicefabric/data-plane/Microsoft.ServiceFabric - Double word "the" - ABRIC -> FABRIC - dataloss -> data loss - valus -> value - indentifying -> identifying - deletd -> deleted - hamdle -> handle - ReliablecollectionsRef -> ReliableCollectionsRef - URI's -> URIs --- .../azure/servicefabric/ChaosTargetFilter.java | 6 +++--- .../ContainerCodePackageProperties.java | 6 +++--- .../com/microsoft/azure/servicefabric/Epoch.java | 12 ++++++------ .../azure/servicefabric/FabricErrorError.java | 6 +++--- .../azure/servicefabric/HttpHostConfig.java | 6 +++--- .../azure/servicefabric/PartitionBackupEntity.java | 6 +++--- .../implementation/MeshSecretValuesInner.java | 8 ++++---- .../PartitionBackupConfigurationInfoInner.java | 6 +++--- 8 files changed, 28 insertions(+), 28 deletions(-) diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosTargetFilter.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosTargetFilter.java index 1bc1d46a6cbec..eda8375069a3f 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosTargetFilter.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosTargetFilter.java @@ -51,7 +51,7 @@ public class ChaosTargetFilter { private List nodeTypeInclusionList; /** - * A list of application URI's to include in Chaos faults. + * A list of application URIs 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. @@ -102,7 +102,7 @@ public ChaosTargetFilter withNodeTypeInclusionList(List nodeTypeInclusio } /** - * Get a list of application URI's to include in Chaos faults. + * Get a list of application URIs 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. @@ -116,7 +116,7 @@ public List applicationInclusionList() { } /** - * Set a list of application URI's to include in Chaos faults. + * Set a list of application URIs 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. diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ContainerCodePackageProperties.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ContainerCodePackageProperties.java index a9c01150e0c83..ad98a40f0db93 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ContainerCodePackageProperties.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ContainerCodePackageProperties.java @@ -100,7 +100,7 @@ public class ContainerCodePackageProperties { /** * A list of ReliableCollection resources used by this particular code - * package. Please refer to ReliablecollectionsRef for more details. + * package. Please refer to ReliableCollectionsRef for more details. */ @JsonProperty(value = "reliableCollectionsRefs") private List reliableCollectionsRefs; @@ -372,7 +372,7 @@ public ContainerCodePackageProperties withDiagnostics(DiagnosticsRef diagnostics } /** - * Get a list of ReliableCollection resources used by this particular code package. Please refer to ReliablecollectionsRef for more details. + * Get a list of ReliableCollection resources used by this particular code package. Please refer to ReliableCollectionsRef for more details. * * @return the reliableCollectionsRefs value */ @@ -381,7 +381,7 @@ public List reliableCollectionsRefs() { } /** - * Set a list of ReliableCollection resources used by this particular code package. Please refer to ReliablecollectionsRef for more details. + * Set a list of ReliableCollection resources used by this particular code package. Please refer to ReliableCollectionsRef for more details. * * @param reliableCollectionsRefs the reliableCollectionsRefs value to set * @return the ContainerCodePackageProperties object itself. diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/Epoch.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/Epoch.java index 0629c511dab40..064bfacdf309a 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/Epoch.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/Epoch.java @@ -27,10 +27,10 @@ public class Epoch { private String configurationVersion; /** - * 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. + * 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. */ @JsonProperty(value = "DataLossVersion") private String dataLossVersion; @@ -56,7 +56,7 @@ public Epoch withConfigurationVersion(String configurationVersion) { } /** - * Get 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. + * Get 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. * * @return the dataLossVersion value */ @@ -65,7 +65,7 @@ public String dataLossVersion() { } /** - * Set 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. + * Set 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. * * @param dataLossVersion the dataLossVersion value to set * @return the Epoch object itself. diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FabricErrorError.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FabricErrorError.java index bc30904a3a715..3b16e4e6de613 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FabricErrorError.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/FabricErrorError.java @@ -105,7 +105,7 @@ public class FabricErrorError { * - "FABRIC_E_SINGLE_INSTANCE_APPLICATION_ALREADY_EXISTS" * - "FABRIC_E_SINGLE_INSTANCE_APPLICATION_NOT_FOUND" * - "FABRIC_E_VOLUME_ALREADY_EXISTS" - * - "ABRIC_E_VOLUME_NOT_FOUND" + * - "FABRIC_E_VOLUME_NOT_FOUND" * - "SerializationError" * * - Possible values of the error code for HTTP status code 503 (Service @@ -269,7 +269,7 @@ public class FabricErrorError { - "FABRIC_E_SINGLE_INSTANCE_APPLICATION_ALREADY_EXISTS" - "FABRIC_E_SINGLE_INSTANCE_APPLICATION_NOT_FOUND" - "FABRIC_E_VOLUME_ALREADY_EXISTS" - - "ABRIC_E_VOLUME_NOT_FOUND" + - "FABRIC_E_VOLUME_NOT_FOUND" - "SerializationError" - Possible values of the error code for HTTP status code 503 (Service Unavailable) - "FABRIC_E_NO_WRITE_QUORUM" @@ -370,7 +370,7 @@ public FabricErrorCodes code() { - "FABRIC_E_SINGLE_INSTANCE_APPLICATION_ALREADY_EXISTS" - "FABRIC_E_SINGLE_INSTANCE_APPLICATION_NOT_FOUND" - "FABRIC_E_VOLUME_ALREADY_EXISTS" - - "ABRIC_E_VOLUME_NOT_FOUND" + - "FABRIC_E_VOLUME_NOT_FOUND" - "SerializationError" - Possible values of the error code for HTTP status code 503 (Service Unavailable) - "FABRIC_E_NO_WRITE_QUORUM" diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HttpHostConfig.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HttpHostConfig.java index 486de76695a68..96c5e8688693f 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HttpHostConfig.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/HttpHostConfig.java @@ -24,7 +24,7 @@ public class HttpHostConfig { /** * 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. + * that can handle general cases. */ @JsonProperty(value = "routes", required = true) private List routes; @@ -50,7 +50,7 @@ public HttpHostConfig withName(String name) { } /** - * Get 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. + * Get 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 handle general cases. * * @return the routes value */ @@ -59,7 +59,7 @@ public List routes() { } /** - * Set 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. + * Set 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 handle general cases. * * @param routes the routes value to set * @return the HttpHostConfig object itself. diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionBackupEntity.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionBackupEntity.java index 673423b74939c..8dea8d2b27761 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionBackupEntity.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/PartitionBackupEntity.java @@ -26,7 +26,7 @@ public class PartitionBackupEntity extends BackupEntity { private String serviceName; /** - * The partition ID indentifying the partition. + * The partition ID identifying the partition. */ @JsonProperty(value = "PartitionId") private UUID partitionId; @@ -52,7 +52,7 @@ public PartitionBackupEntity withServiceName(String serviceName) { } /** - * Get the partition ID indentifying the partition. + * Get the partition ID identifying the partition. * * @return the partitionId value */ @@ -61,7 +61,7 @@ public UUID partitionId() { } /** - * Set the partition ID indentifying the partition. + * Set the partition ID identifying the partition. * * @param partitionId the partitionId value to set * @return the PartitionBackupEntity object itself. diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/MeshSecretValuesInner.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/MeshSecretValuesInner.java index d5993db292e52..0c876c36c27f8 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/MeshSecretValuesInner.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/implementation/MeshSecretValuesInner.java @@ -346,7 +346,7 @@ private ServiceResponse deleteDelegate(Response response) th } /** - * List names of all values of the the specified secret resource. + * List names of all values of 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 secretResourceName The name of the secret resource. @@ -360,7 +360,7 @@ public PagedSecretValueResourceDescriptionListInner list(String secretResourceNa } /** - * List names of all values of the the specified secret resource. + * List names of all values of 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 secretResourceName The name of the secret resource. @@ -373,7 +373,7 @@ public ServiceFuture listAsync(Str } /** - * List names of all values of the the specified secret resource. + * List names of all values of 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 secretResourceName The name of the secret resource. @@ -390,7 +390,7 @@ public PagedSecretValueResourceDescriptionListInner call(ServiceResponse Date: Mon, 17 Dec 2018 11:17:41 -0800 Subject: [PATCH 7/7] Generated from f527ecb8e82ee2f0e277d06cd1c0a42cb9e50b91 (#2802) typo: servicefabric/data-plane/Microsoft.ServiceFabric - nodetype -> node type --- .../microsoft/azure/servicefabric/ChaosTargetFilter.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosTargetFilter.java b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosTargetFilter.java index eda8375069a3f..e66bef982566a 100644 --- a/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosTargetFilter.java +++ b/azure-servicefabric/src/main/java/com/microsoft/azure/servicefabric/ChaosTargetFilter.java @@ -37,7 +37,7 @@ public class ChaosTargetFilter { * 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 + * If a node type (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 @@ -74,7 +74,7 @@ public class ChaosTargetFilter { /** * Get 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 + If a node type (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. @@ -88,7 +88,7 @@ public List nodeTypeInclusionList() { /** * Set 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 + If a node type (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.