From 96f40fee76ee794eef6f93c5e315166d02c01b24 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 13 May 2025 21:56:11 +0000 Subject: [PATCH] CodeGen from PR 33408 in Azure/azure-rest-api-specs Merge 54e99e7a19003586366a2a0efa32323a81e14641 into 7fc6689d84858b1c71b786526b04c014c4589968 --- .../azure/compute/batch/BatchAsyncClient.java | 4871 +++++++++-------- .../com/azure/compute/batch/BatchClient.java | 4385 +++++++-------- .../batch/implementation/BatchClientImpl.java | 608 +- .../models/AuthenticationTokenSettings.java | 9 +- .../models/AzureFileShareConfiguration.java | 16 +- .../batch/models/BatchAccessScope.java | 51 + .../batch/models/BatchAffinityInfo.java | 90 + .../models/BatchAllTasksCompleteMode.java | 57 + .../models/BatchApplicationGetOptions.java | 60 + .../models/BatchApplicationsListOptions.java | 91 + .../batch/models/BatchCertificate.java | 48 +- ...BatchCertificateCancelDeletionOptions.java | 60 + .../models/BatchCertificateCreateOptions.java | 60 + .../models/BatchCertificateDeleteError.java | 127 + .../models/BatchCertificateDeleteOptions.java | 60 + .../models/BatchCertificateGetOptions.java | 89 + .../models/BatchCertificatesListOptions.java | 151 + .../models/BatchContainerConfiguration.java | 165 + .../BatchCreateTaskCollectionResult.java | 84 + .../batch/models/BatchDiffDiskSettings.java | 107 + .../models/BatchErrorSourceCategory.java | 57 + .../batch/models/BatchInboundNatPool.java | 247 + .../azure/compute/batch/models/BatchJob.java | 180 +- .../batch/models/BatchJobActionKind.java | 63 + .../batch/models/BatchJobCreateOptions.java | 60 + .../models/BatchJobCreateParameters.java | 674 +++ .../batch/models/BatchJobDeleteOptions.java | 91 + .../batch/models/BatchJobDisableOptions.java | 60 + .../models/BatchJobDisableParameters.java | 83 + .../batch/models/BatchJobEnableOptions.java | 60 + .../batch/models/BatchJobGetOptions.java | 117 + .../models/BatchJobNetworkConfiguration.java | 54 +- ...rationAndReleaseTaskStatusListOptions.java | 151 + .../batch/models/BatchJobReplaceOptions.java | 60 + .../batch/models/BatchJobSchedule.java | 54 +- .../models/BatchJobScheduleCreateOptions.java | 60 + .../BatchJobScheduleCreateParameters.java | 212 + .../models/BatchJobScheduleDeleteOptions.java | 91 + .../BatchJobScheduleDisableOptions.java | 60 + .../models/BatchJobScheduleEnableOptions.java | 60 + .../models/BatchJobScheduleExistsOptions.java | 18 +- .../models/BatchJobScheduleGetOptions.java | 117 + .../BatchJobScheduleReplaceOptions.java | 60 + .../models/BatchJobScheduleStatistics.java | 321 +- .../BatchJobScheduleTerminateOptions.java | 91 + .../models/BatchJobScheduleUpdateOptions.java | 60 + .../BatchJobScheduleUpdateParameters.java | 172 + .../models/BatchJobSchedulesListOptions.java | 179 + .../batch/models/BatchJobSchedulingError.java | 28 +- .../batch/models/BatchJobSpecification.java | 185 +- .../batch/models/BatchJobStatistics.java | 311 +- .../models/BatchJobTaskCountsGetOptions.java | 60 + .../models/BatchJobTerminateOptions.java | 119 + .../models/BatchJobTerminateParameters.java | 94 + .../batch/models/BatchJobUpdateOptions.java | 60 + .../models/BatchJobUpdateParameters.java | 366 ++ .../BatchJobsFromScheduleListOptions.java | 179 + .../batch/models/BatchJobsListOptions.java | 179 + .../batch/models/BatchMetadataItem.java | 106 + .../models/BatchNodeDeallocateOptions.java | 88 + .../models/BatchNodeDeallocateParameters.java | 97 + .../BatchNodeDisableSchedulingParameters.java | 100 + .../models/BatchNodeExtensionGetOptions.java | 89 + .../BatchNodeExtensionsListOptions.java | 120 + .../models/BatchNodeFileDeleteOptions.java | 97 + .../batch/models/BatchNodeFileGetOptions.java | 175 + .../BatchNodeFilePropertiesGetOptions.java | 144 + .../models/BatchNodeFilesListOptions.java | 150 + .../batch/models/BatchNodeGetOptions.java | 89 + .../models/BatchNodeLogsUploadOptions.java | 60 + .../batch/models/BatchNodeRebootKind.java | 73 + .../batch/models/BatchNodeRebootOptions.java | 88 + .../models/BatchNodeRebootParameters.java | 96 + .../batch/models/BatchNodeReimageOptions.java | 88 + .../models/BatchNodeReimageParameters.java | 96 + ...atchNodeRemoteLoginSettingsGetOptions.java | 60 + .../models/BatchNodeRemoveParameters.java | 166 + .../BatchNodeSchedulingDisableOptions.java | 88 + .../BatchNodeSchedulingEnableOptions.java | 60 + .../batch/models/BatchNodeStartOptions.java | 60 + .../models/BatchNodeUserCreateOptions.java | 60 + .../models/BatchNodeUserCreateParameters.java | 240 + .../models/BatchNodeUserDeleteOptions.java | 60 + .../models/BatchNodeUserReplaceOptions.java | 60 + .../models/BatchNodeUserUpdateParameters.java | 181 + .../batch/models/BatchNodesListOptions.java | 151 + .../batch/models/BatchNodesRemoveOptions.java | 60 + .../compute/batch/models/BatchOsDisk.java | 223 + .../azure/compute/batch/models/BatchPool.java | 52 +- .../BatchPoolAutoScaleDisableOptions.java | 60 + .../BatchPoolAutoScaleEnableOptions.java | 60 + .../BatchPoolAutoScaleEnableParameters.java | 160 + .../BatchPoolAutoScaleEvaluateOptions.java | 60 + .../BatchPoolAutoScaleEvaluateParameters.java | 90 + .../batch/models/BatchPoolCreateOptions.java | 60 + .../models/BatchPoolCreateParameters.java | 956 ++++ .../batch/models/BatchPoolDeleteOptions.java | 60 + .../BatchPoolEndpointConfiguration.java | 10 +- .../batch/models/BatchPoolExistsOptions.java | 18 +- .../batch/models/BatchPoolGetOptions.java | 117 + .../batch/models/BatchPoolIdentity.java | 8 +- .../BatchPoolNodeCountsListOptions.java | 122 + .../BatchPoolPropertiesReplaceOptions.java | 60 + .../models/BatchPoolReplaceParameters.java | 243 + .../batch/models/BatchPoolResizeOptions.java | 60 + .../models/BatchPoolResizeParameters.java | 202 + .../models/BatchPoolResizeStopOptions.java | 60 + .../models/BatchPoolResourceStatistics.java | 88 +- .../batch/models/BatchPoolSpecification.java | 10 +- .../batch/models/BatchPoolStatistics.java | 80 +- .../batch/models/BatchPoolUpdateOptions.java | 60 + .../models/BatchPoolUpdateParameters.java | 692 +++ .../BatchPoolUsageMetricsListOptions.java | 191 + .../batch/models/BatchPoolsListOptions.java | 179 + .../BatchPublicIpAddressConfiguration.java | 143 + .../models/BatchSubTasksListOptions.java | 89 + .../batch/models/BatchSupportedImage.java | 42 +- .../azure/compute/batch/models/BatchTask.java | 40 +- .../BatchTaskCollectionCreateOptions.java | 60 + .../batch/models/BatchTaskCreateOptions.java | 60 + .../models/BatchTaskCreateParameters.java | 690 +++ .../batch/models/BatchTaskCreateResult.java | 200 + .../batch/models/BatchTaskDeleteOptions.java | 60 + .../batch/models/BatchTaskFailureInfo.java | 28 +- .../batch/models/BatchTaskFailureMode.java | 58 + .../models/BatchTaskFileDeleteOptions.java | 97 + .../batch/models/BatchTaskFileGetOptions.java | 175 + .../BatchTaskFilePropertiesGetOptions.java | 144 + .../models/BatchTaskFilesListOptions.java | 153 + .../batch/models/BatchTaskGetOptions.java | 117 + .../compute/batch/models/BatchTaskGroup.java | 58 +- .../models/BatchTaskReactivateOptions.java | 60 + .../batch/models/BatchTaskReplaceOptions.java | 60 + .../batch/models/BatchTaskStatistics.java | 174 +- .../models/BatchTaskTerminateOptions.java | 60 + .../batch/models/BatchTasksListOptions.java | 179 + .../batch/models/BatchUefiSettings.java | 123 + .../models/BatchUserAssignedIdentity.java | 125 + .../batch/models/BatchVmImageReference.java | 346 ++ .../compute/batch/models/ExitOptions.java | 38 +- .../compute/batch/models/ManagedDisk.java | 30 +- .../batch/models/NetworkConfiguration.java | 94 +- .../OutputFileBlobContainerDestination.java | 10 +- .../batch/models/OutputFileUploadHeader.java | 118 + .../compute/batch/models/SecurityProfile.java | 36 +- .../SupportedBatchImagesListOptions.java | 122 + .../UploadBatchServiceLogsParameters.java | 205 + .../models/VirtualMachineConfiguration.java | 100 +- .../batch/models/VirtualMachineInfo.java | 6 +- .../batch/models/VmDiskSecurityProfile.java | 103 + ...zure-compute-batch_apiview_properties.json | 235 +- .../azure-compute-batch/tsp-location.yaml | 4 +- 152 files changed, 21602 insertions(+), 6105 deletions(-) create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchAccessScope.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchAffinityInfo.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchAllTasksCompleteMode.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchApplicationGetOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchApplicationsListOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchCertificateCancelDeletionOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchCertificateCreateOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchCertificateDeleteError.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchCertificateDeleteOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchCertificateGetOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchCertificatesListOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchContainerConfiguration.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchCreateTaskCollectionResult.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchDiffDiskSettings.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchErrorSourceCategory.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchInboundNatPool.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobActionKind.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobCreateOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobCreateParameters.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobDeleteOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobDisableOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobDisableParameters.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobEnableOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobGetOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobPreparationAndReleaseTaskStatusListOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobReplaceOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleCreateOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleCreateParameters.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleDeleteOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleDisableOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleEnableOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleGetOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleReplaceOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleTerminateOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleUpdateOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleUpdateParameters.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobSchedulesListOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobTaskCountsGetOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobTerminateOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobTerminateParameters.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobUpdateOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobUpdateParameters.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobsFromScheduleListOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobsListOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchMetadataItem.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeDeallocateOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeDeallocateParameters.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeDisableSchedulingParameters.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeExtensionGetOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeExtensionsListOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeFileDeleteOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeFileGetOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeFilePropertiesGetOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeFilesListOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeGetOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeLogsUploadOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeRebootKind.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeRebootOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeRebootParameters.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeReimageOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeReimageParameters.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeRemoteLoginSettingsGetOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeRemoveParameters.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeSchedulingDisableOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeSchedulingEnableOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeStartOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeUserCreateOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeUserCreateParameters.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeUserDeleteOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeUserReplaceOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeUserUpdateParameters.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodesListOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodesRemoveOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchOsDisk.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolAutoScaleDisableOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolAutoScaleEnableOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolAutoScaleEnableParameters.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolAutoScaleEvaluateOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolAutoScaleEvaluateParameters.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolCreateOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolCreateParameters.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolDeleteOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolGetOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolNodeCountsListOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolPropertiesReplaceOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolReplaceParameters.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolResizeOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolResizeParameters.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolResizeStopOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolUpdateOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolUpdateParameters.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolUsageMetricsListOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolsListOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPublicIpAddressConfiguration.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchSubTasksListOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskCollectionCreateOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskCreateOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskCreateParameters.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskCreateResult.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskDeleteOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskFailureMode.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskFileDeleteOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskFileGetOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskFilePropertiesGetOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskFilesListOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskGetOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskReactivateOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskReplaceOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskTerminateOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTasksListOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchUefiSettings.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchUserAssignedIdentity.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchVmImageReference.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/OutputFileUploadHeader.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/SupportedBatchImagesListOptions.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/UploadBatchServiceLogsParameters.java create mode 100644 sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/VmDiskSecurityProfile.java diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/BatchAsyncClient.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/BatchAsyncClient.java index e16a901798d4..c6c6b54d2fdb 100644 --- a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/BatchAsyncClient.java +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/BatchAsyncClient.java @@ -9,124 +9,124 @@ import com.azure.compute.batch.implementation.task.TaskSubmitter; import com.azure.compute.batch.models.AutoScaleRun; import com.azure.compute.batch.models.BatchApplication; +import com.azure.compute.batch.models.BatchApplicationGetOptions; +import com.azure.compute.batch.models.BatchApplicationsListOptions; import com.azure.compute.batch.models.BatchCertificate; +import com.azure.compute.batch.models.BatchCertificateCancelDeletionOptions; +import com.azure.compute.batch.models.BatchCertificateCreateOptions; +import com.azure.compute.batch.models.BatchCertificateDeleteOptions; +import com.azure.compute.batch.models.BatchCertificateGetOptions; +import com.azure.compute.batch.models.BatchCertificatesListOptions; import com.azure.compute.batch.models.BatchClientParallelOptions; +import com.azure.compute.batch.models.BatchCreateTaskCollectionResult; import com.azure.compute.batch.models.BatchJob; -import com.azure.compute.batch.models.BatchJobCreateContent; -import com.azure.compute.batch.models.BatchJobDisableContent; +import com.azure.compute.batch.models.BatchJobCreateOptions; +import com.azure.compute.batch.models.BatchJobCreateParameters; +import com.azure.compute.batch.models.BatchJobDeleteOptions; +import com.azure.compute.batch.models.BatchJobDisableOptions; +import com.azure.compute.batch.models.BatchJobDisableParameters; +import com.azure.compute.batch.models.BatchJobEnableOptions; +import com.azure.compute.batch.models.BatchJobGetOptions; import com.azure.compute.batch.models.BatchJobPreparationAndReleaseTaskStatus; +import com.azure.compute.batch.models.BatchJobPreparationAndReleaseTaskStatusListOptions; +import com.azure.compute.batch.models.BatchJobReplaceOptions; import com.azure.compute.batch.models.BatchJobSchedule; -import com.azure.compute.batch.models.BatchJobScheduleCreateContent; +import com.azure.compute.batch.models.BatchJobScheduleCreateOptions; +import com.azure.compute.batch.models.BatchJobScheduleCreateParameters; +import com.azure.compute.batch.models.BatchJobScheduleDeleteOptions; +import com.azure.compute.batch.models.BatchJobScheduleDisableOptions; +import com.azure.compute.batch.models.BatchJobScheduleEnableOptions; import com.azure.compute.batch.models.BatchJobScheduleExistsOptions; -import com.azure.compute.batch.models.BatchJobScheduleUpdateContent; -import com.azure.compute.batch.models.BatchJobTerminateContent; -import com.azure.compute.batch.models.BatchJobUpdateContent; +import com.azure.compute.batch.models.BatchJobScheduleGetOptions; +import com.azure.compute.batch.models.BatchJobScheduleReplaceOptions; +import com.azure.compute.batch.models.BatchJobScheduleTerminateOptions; +import com.azure.compute.batch.models.BatchJobScheduleUpdateOptions; +import com.azure.compute.batch.models.BatchJobScheduleUpdateParameters; +import com.azure.compute.batch.models.BatchJobSchedulesListOptions; +import com.azure.compute.batch.models.BatchJobTaskCountsGetOptions; +import com.azure.compute.batch.models.BatchJobTerminateOptions; +import com.azure.compute.batch.models.BatchJobTerminateParameters; +import com.azure.compute.batch.models.BatchJobUpdateOptions; +import com.azure.compute.batch.models.BatchJobUpdateParameters; +import com.azure.compute.batch.models.BatchJobsFromScheduleListOptions; +import com.azure.compute.batch.models.BatchJobsListOptions; import com.azure.compute.batch.models.BatchNode; -import com.azure.compute.batch.models.BatchNodeDeallocateContent; -import com.azure.compute.batch.models.BatchNodeDisableSchedulingContent; +import com.azure.compute.batch.models.BatchNodeDeallocateOptions; +import com.azure.compute.batch.models.BatchNodeDeallocateParameters; +import com.azure.compute.batch.models.BatchNodeDisableSchedulingParameters; +import com.azure.compute.batch.models.BatchNodeExtensionGetOptions; +import com.azure.compute.batch.models.BatchNodeExtensionsListOptions; import com.azure.compute.batch.models.BatchNodeFile; -import com.azure.compute.batch.models.BatchNodeRebootContent; -import com.azure.compute.batch.models.BatchNodeReimageContent; +import com.azure.compute.batch.models.BatchNodeFileDeleteOptions; +import com.azure.compute.batch.models.BatchNodeFileGetOptions; +import com.azure.compute.batch.models.BatchNodeFilesListOptions; +import com.azure.compute.batch.models.BatchNodeGetOptions; +import com.azure.compute.batch.models.BatchNodeLogsUploadOptions; +import com.azure.compute.batch.models.BatchNodeRebootOptions; +import com.azure.compute.batch.models.BatchNodeRebootParameters; +import com.azure.compute.batch.models.BatchNodeReimageOptions; +import com.azure.compute.batch.models.BatchNodeReimageParameters; import com.azure.compute.batch.models.BatchNodeRemoteLoginSettings; -import com.azure.compute.batch.models.BatchNodeRemoveContent; -import com.azure.compute.batch.models.BatchNodeUserCreateContent; -import com.azure.compute.batch.models.BatchNodeUserUpdateContent; +import com.azure.compute.batch.models.BatchNodeRemoteLoginSettingsGetOptions; +import com.azure.compute.batch.models.BatchNodeRemoveParameters; +import com.azure.compute.batch.models.BatchNodeSchedulingDisableOptions; +import com.azure.compute.batch.models.BatchNodeSchedulingEnableOptions; +import com.azure.compute.batch.models.BatchNodeStartOptions; +import com.azure.compute.batch.models.BatchNodeUserCreateOptions; +import com.azure.compute.batch.models.BatchNodeUserCreateParameters; +import com.azure.compute.batch.models.BatchNodeUserDeleteOptions; +import com.azure.compute.batch.models.BatchNodeUserReplaceOptions; +import com.azure.compute.batch.models.BatchNodeUserUpdateParameters; import com.azure.compute.batch.models.BatchNodeVMExtension; +import com.azure.compute.batch.models.BatchNodesListOptions; +import com.azure.compute.batch.models.BatchNodesRemoveOptions; import com.azure.compute.batch.models.BatchPool; -import com.azure.compute.batch.models.BatchPoolCreateContent; -import com.azure.compute.batch.models.BatchPoolEnableAutoScaleContent; -import com.azure.compute.batch.models.BatchPoolEvaluateAutoScaleContent; +import com.azure.compute.batch.models.BatchPoolAutoScaleDisableOptions; +import com.azure.compute.batch.models.BatchPoolAutoScaleEnableOptions; +import com.azure.compute.batch.models.BatchPoolAutoScaleEnableParameters; +import com.azure.compute.batch.models.BatchPoolAutoScaleEvaluateOptions; +import com.azure.compute.batch.models.BatchPoolAutoScaleEvaluateParameters; +import com.azure.compute.batch.models.BatchPoolCreateOptions; +import com.azure.compute.batch.models.BatchPoolCreateParameters; +import com.azure.compute.batch.models.BatchPoolDeleteOptions; import com.azure.compute.batch.models.BatchPoolExistsOptions; +import com.azure.compute.batch.models.BatchPoolGetOptions; import com.azure.compute.batch.models.BatchPoolNodeCounts; -import com.azure.compute.batch.models.BatchPoolReplaceContent; -import com.azure.compute.batch.models.BatchPoolResizeContent; -import com.azure.compute.batch.models.BatchPoolUpdateContent; +import com.azure.compute.batch.models.BatchPoolNodeCountsListOptions; +import com.azure.compute.batch.models.BatchPoolPropertiesReplaceOptions; +import com.azure.compute.batch.models.BatchPoolReplaceParameters; +import com.azure.compute.batch.models.BatchPoolResizeOptions; +import com.azure.compute.batch.models.BatchPoolResizeParameters; +import com.azure.compute.batch.models.BatchPoolResizeStopOptions; +import com.azure.compute.batch.models.BatchPoolUpdateOptions; +import com.azure.compute.batch.models.BatchPoolUpdateParameters; import com.azure.compute.batch.models.BatchPoolUsageMetrics; +import com.azure.compute.batch.models.BatchPoolUsageMetricsListOptions; +import com.azure.compute.batch.models.BatchPoolsListOptions; +import com.azure.compute.batch.models.BatchSubTasksListOptions; import com.azure.compute.batch.models.BatchSubtask; import com.azure.compute.batch.models.BatchSupportedImage; import com.azure.compute.batch.models.BatchTask; -import com.azure.compute.batch.models.BatchTaskAddCollectionResult; +import com.azure.compute.batch.models.BatchTaskCollectionCreateOptions; import com.azure.compute.batch.models.BatchTaskCountsResult; import com.azure.compute.batch.models.BatchTaskCreateContent; +import com.azure.compute.batch.models.BatchTaskCreateOptions; +import com.azure.compute.batch.models.BatchTaskCreateParameters; +import com.azure.compute.batch.models.BatchTaskDeleteOptions; +import com.azure.compute.batch.models.BatchTaskFileDeleteOptions; +import com.azure.compute.batch.models.BatchTaskFileGetOptions; +import com.azure.compute.batch.models.BatchTaskFilesListOptions; +import com.azure.compute.batch.models.BatchTaskGetOptions; import com.azure.compute.batch.models.BatchTaskGroup; -import com.azure.compute.batch.models.CancelBatchCertificateDeletionOptions; -import com.azure.compute.batch.models.CreateBatchCertificateOptions; -import com.azure.compute.batch.models.CreateBatchJobOptions; -import com.azure.compute.batch.models.CreateBatchJobScheduleOptions; -import com.azure.compute.batch.models.CreateBatchNodeUserOptions; -import com.azure.compute.batch.models.CreateBatchPoolOptions; -import com.azure.compute.batch.models.CreateBatchTaskCollectionOptions; -import com.azure.compute.batch.models.CreateBatchTaskOptions; -import com.azure.compute.batch.models.DeallocateBatchNodeOptions; -import com.azure.compute.batch.models.DeleteBatchCertificateOptions; -import com.azure.compute.batch.models.DeleteBatchJobOptions; -import com.azure.compute.batch.models.DeleteBatchJobScheduleOptions; -import com.azure.compute.batch.models.DeleteBatchNodeFileOptions; -import com.azure.compute.batch.models.DeleteBatchNodeUserOptions; -import com.azure.compute.batch.models.DeleteBatchPoolOptions; -import com.azure.compute.batch.models.DeleteBatchTaskFileOptions; -import com.azure.compute.batch.models.DeleteBatchTaskOptions; -import com.azure.compute.batch.models.DisableBatchJobOptions; -import com.azure.compute.batch.models.DisableBatchJobScheduleOptions; -import com.azure.compute.batch.models.DisableBatchNodeSchedulingOptions; -import com.azure.compute.batch.models.DisableBatchPoolAutoScaleOptions; -import com.azure.compute.batch.models.EnableBatchJobOptions; -import com.azure.compute.batch.models.EnableBatchJobScheduleOptions; -import com.azure.compute.batch.models.EnableBatchNodeSchedulingOptions; -import com.azure.compute.batch.models.EnableBatchPoolAutoScaleOptions; -import com.azure.compute.batch.models.EvaluateBatchPoolAutoScaleOptions; +import com.azure.compute.batch.models.BatchTaskReactivateOptions; +import com.azure.compute.batch.models.BatchTaskReplaceOptions; +import com.azure.compute.batch.models.BatchTaskTerminateOptions; +import com.azure.compute.batch.models.BatchTasksListOptions; import com.azure.compute.batch.models.FileResponseHeaderProperties; -import com.azure.compute.batch.models.GetBatchApplicationOptions; -import com.azure.compute.batch.models.GetBatchCertificateOptions; -import com.azure.compute.batch.models.GetBatchJobOptions; -import com.azure.compute.batch.models.GetBatchJobScheduleOptions; -import com.azure.compute.batch.models.GetBatchJobTaskCountsOptions; -import com.azure.compute.batch.models.GetBatchNodeExtensionOptions; -import com.azure.compute.batch.models.GetBatchNodeFileOptions; import com.azure.compute.batch.models.GetBatchNodeFilePropertiesOptions; -import com.azure.compute.batch.models.GetBatchNodeOptions; -import com.azure.compute.batch.models.GetBatchNodeRemoteLoginSettingsOptions; -import com.azure.compute.batch.models.GetBatchPoolOptions; -import com.azure.compute.batch.models.GetBatchTaskFileOptions; import com.azure.compute.batch.models.GetBatchTaskFilePropertiesOptions; -import com.azure.compute.batch.models.GetBatchTaskOptions; -import com.azure.compute.batch.models.GetCertificateResponse; -import com.azure.compute.batch.models.ListBatchApplicationsOptions; -import com.azure.compute.batch.models.ListBatchCertificatesOptions; -import com.azure.compute.batch.models.ListBatchJobPreparationAndReleaseTaskStatusOptions; -import com.azure.compute.batch.models.ListBatchJobSchedulesOptions; -import com.azure.compute.batch.models.ListBatchJobsFromScheduleOptions; -import com.azure.compute.batch.models.ListBatchJobsOptions; -import com.azure.compute.batch.models.ListBatchNodeExtensionsOptions; -import com.azure.compute.batch.models.ListBatchNodeFilesOptions; -import com.azure.compute.batch.models.ListBatchNodesOptions; -import com.azure.compute.batch.models.ListBatchPoolNodeCountsOptions; -import com.azure.compute.batch.models.ListBatchPoolUsageMetricsOptions; -import com.azure.compute.batch.models.ListBatchPoolsOptions; -import com.azure.compute.batch.models.ListBatchSubTasksOptions; -import com.azure.compute.batch.models.ListBatchTaskFilesOptions; -import com.azure.compute.batch.models.ListBatchTasksOptions; -import com.azure.compute.batch.models.ListSupportedBatchImagesOptions; -import com.azure.compute.batch.models.ReactivateBatchTaskOptions; -import com.azure.compute.batch.models.RebootBatchNodeOptions; -import com.azure.compute.batch.models.ReimageBatchNodeOptions; -import com.azure.compute.batch.models.RemoveBatchNodesOptions; -import com.azure.compute.batch.models.ReplaceBatchJobOptions; -import com.azure.compute.batch.models.ReplaceBatchJobScheduleOptions; -import com.azure.compute.batch.models.ReplaceBatchNodeUserOptions; -import com.azure.compute.batch.models.ReplaceBatchPoolPropertiesOptions; -import com.azure.compute.batch.models.ReplaceBatchTaskOptions; -import com.azure.compute.batch.models.ResizeBatchPoolOptions; -import com.azure.compute.batch.models.StartBatchNodeOptions; -import com.azure.compute.batch.models.StopBatchPoolResizeOptions; -import com.azure.compute.batch.models.TerminateBatchJobOptions; -import com.azure.compute.batch.models.TerminateBatchJobScheduleOptions; -import com.azure.compute.batch.models.TerminateBatchTaskOptions; -import com.azure.compute.batch.models.UpdateBatchJobOptions; -import com.azure.compute.batch.models.UpdateBatchJobScheduleOptions; -import com.azure.compute.batch.models.UpdateBatchPoolOptions; -import com.azure.compute.batch.models.UploadBatchNodeLogsOptions; -import com.azure.compute.batch.models.UploadBatchServiceLogsContent; +import com.azure.compute.batch.models.SupportedBatchImagesListOptions; +import com.azure.compute.batch.models.UploadBatchServiceLogsParameters; import com.azure.compute.batch.models.UploadBatchServiceLogsResult; import com.azure.core.annotation.Generated; import com.azure.core.annotation.ReturnType; @@ -146,6 +146,7 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.DateTimeRfc1123; import com.azure.core.util.FluxUtil; +import java.time.Duration; import java.time.OffsetDateTime; import java.util.List; import java.util.Objects; @@ -223,7 +224,7 @@ public Mono createTasks(String jobId, List taskLis * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -271,7 +272,7 @@ public PagedFlux listApplications(RequestOptions requestOptions) { * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -322,7 +323,7 @@ public Mono> getApplicationWithResponse(String applicationI * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -378,7 +379,7 @@ public PagedFlux listPoolUsageMetrics(RequestOptions requestOptions) * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -634,8 +635,8 @@ public PagedFlux listPoolUsageMetrics(RequestOptions requestOptions) * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -684,7 +685,7 @@ public Mono> createPoolWithResponse(BinaryData pool, RequestOptio * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -1008,8 +1009,8 @@ public Mono> createPoolWithResponse(BinaryData pool, RequestOptio * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -1081,7 +1082,7 @@ public PagedFlux listPools(RequestOptions requestOptions) { * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -1129,7 +1130,7 @@ public Mono> deletePoolWithResponse(String poolId, RequestOptions * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -1183,7 +1184,7 @@ public Mono> poolExistsWithResponse(String poolId, RequestOpti * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
$selectList<String>NoAn OData $select clause. In the form of "," @@ -1523,8 +1524,8 @@ public Mono> poolExistsWithResponse(String poolId, RequestOpti * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -1589,7 +1590,7 @@ public Mono> getPoolWithResponse(String poolId, RequestOpti * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -1861,8 +1862,8 @@ public Mono> getPoolWithResponse(String poolId, RequestOpti * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -1911,7 +1912,7 @@ public Mono> updatePoolWithResponse(String poolId, BinaryData poo * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -1944,7 +1945,7 @@ public Mono> disablePoolAutoScaleWithResponse(String poolId, Requ * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -1983,7 +1984,7 @@ public Mono> disablePoolAutoScaleWithResponse(String poolId, Requ * * * @param poolId The ID of the Pool to get. - * @param content The options to use for enabling automatic scaling. + * @param parameters The options to use for enabling automatic scaling. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1993,9 +1994,9 @@ public Mono> disablePoolAutoScaleWithResponse(String poolId, Requ */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> enablePoolAutoScaleWithResponse(String poolId, BinaryData content, + public Mono> enablePoolAutoScaleWithResponse(String poolId, BinaryData parameters, RequestOptions requestOptions) { - return this.serviceClient.enablePoolAutoScaleWithResponseAsync(poolId, content, requestOptions); + return this.serviceClient.enablePoolAutoScaleWithResponseAsync(poolId, parameters, requestOptions); } /** @@ -2008,7 +2009,7 @@ public Mono> enablePoolAutoScaleWithResponse(String poolId, Binar * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -2045,7 +2046,7 @@ public Mono> enablePoolAutoScaleWithResponse(String poolId, Binar * * * @param poolId The ID of the Pool on which to evaluate the automatic scaling formula. - * @param content The options to use for evaluating the automatic scaling formula. + * @param parameters The options to use for evaluating the automatic scaling formula. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -2059,9 +2060,9 @@ public Mono> enablePoolAutoScaleWithResponse(String poolId, Binar */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> evaluatePoolAutoScaleWithResponse(String poolId, BinaryData content, + public Mono> evaluatePoolAutoScaleWithResponse(String poolId, BinaryData parameters, RequestOptions requestOptions) { - return this.serviceClient.evaluatePoolAutoScaleWithResponseAsync(poolId, content, requestOptions); + return this.serviceClient.evaluatePoolAutoScaleWithResponseAsync(poolId, parameters, requestOptions); } /** @@ -2078,7 +2079,7 @@ public Mono> evaluatePoolAutoScaleWithResponse(String poolI * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -2119,7 +2120,7 @@ public Mono> evaluatePoolAutoScaleWithResponse(String poolI * * * @param poolId The ID of the Pool to get. - * @param content The options to use for resizing the pool. + * @param parameters The options to use for resizing the pool. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -2129,9 +2130,9 @@ public Mono> evaluatePoolAutoScaleWithResponse(String poolI */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> resizePoolWithResponse(String poolId, BinaryData content, + public Mono> resizePoolWithResponse(String poolId, BinaryData parameters, RequestOptions requestOptions) { - return this.serviceClient.resizePoolWithResponseAsync(poolId, content, requestOptions); + return this.serviceClient.resizePoolWithResponseAsync(poolId, parameters, requestOptions); } /** @@ -2148,7 +2149,7 @@ public Mono> resizePoolWithResponse(String poolId, BinaryData con * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -2200,7 +2201,7 @@ public Mono> stopPoolResizeWithResponse(String poolId, RequestOpt * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -2312,7 +2313,7 @@ public Mono> replacePoolPropertiesWithResponse(String poolId, Bin * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -2354,7 +2355,7 @@ public Mono> replacePoolPropertiesWithResponse(String poolId, Bin * * * @param poolId The ID of the Pool to get. - * @param content The options to use for removing the node. + * @param parameters The options to use for removing the node. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -2364,9 +2365,9 @@ public Mono> replacePoolPropertiesWithResponse(String poolId, Bin */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> removeNodesWithResponse(String poolId, BinaryData content, + public Mono> removeNodesWithResponse(String poolId, BinaryData parameters, RequestOptions requestOptions) { - return this.serviceClient.removeNodesWithResponseAsync(poolId, content, requestOptions); + return this.serviceClient.removeNodesWithResponseAsync(poolId, parameters, requestOptions); } /** @@ -2375,7 +2376,7 @@ public Mono> removeNodesWithResponse(String poolId, BinaryData co * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -2433,7 +2434,7 @@ public PagedFlux listSupportedImages(RequestOptions requestOptions) * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -2502,7 +2503,7 @@ public PagedFlux listPoolNodeCounts(RequestOptions requestOptions) { * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
forceBooleanNoIf true, the server will delete the Job even if the @@ -2552,7 +2553,7 @@ public Mono> deleteJobWithResponse(String jobId, RequestOptions r * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
$selectList<String>NoAn OData $select clause. In the form of "," @@ -2939,8 +2940,8 @@ public Mono> deleteJobWithResponse(String jobId, RequestOptions r * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -3038,7 +3039,7 @@ public Mono> getJobWithResponse(String jobId, RequestOption * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -3327,8 +3328,8 @@ public Mono> getJobWithResponse(String jobId, RequestOption * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -3393,7 +3394,7 @@ public Mono> updateJobWithResponse(String jobId, BinaryData job, * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -3776,8 +3777,8 @@ public Mono> updateJobWithResponse(String jobId, BinaryData job, * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -3881,7 +3882,7 @@ public Mono> replaceJobWithResponse(String jobId, BinaryData job, * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -3919,7 +3920,7 @@ public Mono> replaceJobWithResponse(String jobId, BinaryData job, * * * @param jobId The ID of the Job to disable. - * @param content The options to use for disabling the Job. + * @param parameters The options to use for disabling the Job. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -3929,9 +3930,9 @@ public Mono> replaceJobWithResponse(String jobId, BinaryData job, */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> disableJobWithResponse(String jobId, BinaryData content, + public Mono> disableJobWithResponse(String jobId, BinaryData parameters, RequestOptions requestOptions) { - return this.serviceClient.disableJobWithResponseAsync(jobId, content, requestOptions); + return this.serviceClient.disableJobWithResponseAsync(jobId, parameters, requestOptions); } /** @@ -3947,7 +3948,7 @@ public Mono> disableJobWithResponse(String jobId, BinaryData cont * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -4002,7 +4003,7 @@ public Mono> enableJobWithResponse(String jobId, RequestOptions r * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
forceBooleanNoIf true, the server will terminate the Job even if the @@ -4073,7 +4074,7 @@ public Mono> terminateJobWithResponse(String jobId, RequestOption * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -4426,8 +4427,8 @@ public Mono> terminateJobWithResponse(String jobId, RequestOption * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -4488,7 +4489,7 @@ public Mono> createJobWithResponse(BinaryData job, RequestOptions * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -4859,8 +4860,8 @@ public Mono> createJobWithResponse(BinaryData job, RequestOptions * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -4953,7 +4954,7 @@ public PagedFlux listJobs(RequestOptions requestOptions) { * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -5324,8 +5325,8 @@ public PagedFlux listJobs(RequestOptions requestOptions) { * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -5427,7 +5428,7 @@ public PagedFlux listJobsFromSchedule(String jobScheduleId, RequestO * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -5516,7 +5517,7 @@ public PagedFlux listJobPreparationAndReleaseTaskStatus(String jobId * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -5568,7 +5569,7 @@ public Mono> getJobTaskCountsWithResponse(String jobId, Req * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -5596,7 +5597,7 @@ public Mono> getJobTaskCountsWithResponse(String jobId, Req * } * ] * } - * data: String (Required) + * data: byte[] (Required) * certificateFormat: String(pfx/cer) (Optional) * password: String (Optional) * } @@ -5623,7 +5624,7 @@ public Mono> createCertificateWithResponse(BinaryData certificate * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -5659,7 +5660,7 @@ public Mono> createCertificateWithResponse(BinaryData certificate * } * ] * } - * data: String (Required) + * data: byte[] (Required) * certificateFormat: String(pfx/cer) (Optional) * password: String (Optional) * } @@ -5693,7 +5694,7 @@ public PagedFlux listCertificates(RequestOptions requestOptions) { * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -5732,7 +5733,7 @@ public Mono> cancelCertificateDeletionWithResponse(String thumbpr * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -5760,7 +5761,7 @@ public Mono> deleteCertificateWithResponse(String thumbprintAlgor * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
$selectList<String>NoAn OData $select clause. In the form of "," @@ -5790,6 +5791,9 @@ public Mono> deleteCertificateWithResponse(String thumbprintAlgor * } * ] * } + * data: byte[] (Required) + * certificateFormat: String(pfx/cer) (Optional) + * password: String (Optional) * } * } * @@ -5817,7 +5821,7 @@ public Mono> getCertificateWithResponse(String thumbprintAl * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -5877,7 +5881,7 @@ public Mono> jobScheduleExistsWithResponse(String jobScheduleI * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
forceBooleanNoIf true, the server will delete the JobSchedule even if the @@ -5927,7 +5931,7 @@ public Mono> deleteJobScheduleWithResponse(String jobScheduleId, * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
$selectList<String>NoAn OData $select clause. In the form of "," @@ -6328,8 +6332,8 @@ public Mono> deleteJobScheduleWithResponse(String jobScheduleId, * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -6419,7 +6423,7 @@ public Mono> getJobScheduleWithResponse(String jobScheduleI * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -6806,8 +6810,8 @@ public Mono> getJobScheduleWithResponse(String jobScheduleI * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -6874,7 +6878,7 @@ public Mono> updateJobScheduleWithResponse(String jobScheduleId, * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -7271,8 +7275,8 @@ public Mono> updateJobScheduleWithResponse(String jobScheduleId, * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -7359,7 +7363,7 @@ public Mono> replaceJobScheduleWithResponse(String jobScheduleId, * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -7407,7 +7411,7 @@ public Mono> disableJobScheduleWithResponse(String jobScheduleId, * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -7455,7 +7459,7 @@ public Mono> enableJobScheduleWithResponse(String jobScheduleId, * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
forceBooleanNoIf true, the server will terminate the JobSchedule even if the @@ -7505,7 +7509,7 @@ public Mono> terminateJobScheduleWithResponse(String jobScheduleI * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -7872,8 +7876,8 @@ public Mono> terminateJobScheduleWithResponse(String jobScheduleI * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -7932,7 +7936,7 @@ public Mono> createJobScheduleWithResponse(BinaryData jobSchedule * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -8317,8 +8321,8 @@ public Mono> createJobScheduleWithResponse(BinaryData jobSchedule * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -8404,7 +8408,7 @@ public PagedFlux listJobSchedules(RequestOptions requestOptions) { * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -8569,7 +8573,7 @@ public Mono> createTaskWithResponse(String jobId, BinaryData task * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -8809,7 +8813,7 @@ public PagedFlux listTasks(String jobId, RequestOptions requestOptio * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -8991,8 +8995,8 @@ public PagedFlux listTasks(String jobId, RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the result of adding a collection of Tasks to a Job along with {@link Response} on successful completion - * of {@link Mono}. + * @return the result of creating a collection of Tasks to a Job along with {@link Response} on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -9013,7 +9017,7 @@ public Mono> createTaskCollectionWithResponse(String jobId, * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -9066,7 +9070,7 @@ public Mono> deleteTaskWithResponse(String jobId, String taskId, * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
$selectList<String>NoAn OData $select clause. In the form of "," @@ -9311,7 +9315,7 @@ public Mono> getTaskWithResponse(String jobId, String taskI * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -9554,7 +9558,7 @@ public Mono> replaceTaskWithResponse(String jobId, String taskId, * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
$selectList<String>NoAn OData $select clause. In the form of "," @@ -9628,7 +9632,7 @@ public PagedFlux listSubTasks(String jobId, String taskId, RequestOp * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -9686,7 +9690,7 @@ public Mono> terminateTaskWithResponse(String jobId, String taskI * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -9735,7 +9739,7 @@ public Mono> reactivateTaskWithResponse(String jobId, String task * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
recursiveBooleanNoWhether to delete children of a directory. If the filePath @@ -9769,7 +9773,7 @@ public Mono> deleteTaskFileWithResponse(String jobId, String task * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -9822,7 +9826,7 @@ public Mono> getTaskFileWithResponse(String jobId, String t * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -9866,7 +9870,7 @@ public Mono> getTaskFilePropertiesWithResponse(String jobId, Stri * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -9924,7 +9928,7 @@ public PagedFlux listTaskFiles(String jobId, String taskId, RequestO * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -9969,7 +9973,7 @@ public Mono> createNodeUserWithResponse(String poolId, String nod * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -10003,7 +10007,7 @@ public Mono> deleteNodeUserWithResponse(String poolId, String nod * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -10023,7 +10027,7 @@ public Mono> deleteNodeUserWithResponse(String poolId, String nod * @param poolId The ID of the Pool that contains the Compute Node. * @param nodeId The ID of the machine on which you want to update a user Account. * @param userName The name of the user Account to update. - * @param content The options to use for updating the user. + * @param parameters The options to use for updating the user. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -10034,8 +10038,9 @@ public Mono> deleteNodeUserWithResponse(String poolId, String nod @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Mono> replaceNodeUserWithResponse(String poolId, String nodeId, String userName, - BinaryData content, RequestOptions requestOptions) { - return this.serviceClient.replaceNodeUserWithResponseAsync(poolId, nodeId, userName, content, requestOptions); + BinaryData parameters, RequestOptions requestOptions) { + return this.serviceClient.replaceNodeUserWithResponseAsync(poolId, nodeId, userName, parameters, + requestOptions); } /** @@ -10044,7 +10049,7 @@ public Mono> replaceNodeUserWithResponse(String poolId, String no * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
$selectList<String>NoAn OData $select clause. In the form of "," @@ -10242,7 +10247,7 @@ public Mono> getNodeWithResponse(String poolId, String node * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -10288,7 +10293,7 @@ public Mono> rebootNodeWithResponse(String poolId, String nodeId, * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -10319,7 +10324,7 @@ public Mono> startNodeWithResponse(String poolId, String nodeId, * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -10365,7 +10370,7 @@ public Mono> reimageNodeWithResponse(String poolId, String nodeId * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -10413,7 +10418,7 @@ public Mono> deallocateNodeWithResponse(String poolId, String nod * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -10461,7 +10466,7 @@ public Mono> disableNodeSchedulingWithResponse(String poolId, Str * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -10492,7 +10497,7 @@ public Mono> enableNodeSchedulingWithResponse(String poolId, Stri * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -10540,7 +10545,7 @@ public Mono> getNodeRemoteLoginSettingsWithResponse(String * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -10574,7 +10579,7 @@ public Mono> getNodeRemoteLoginSettingsWithResponse(String * @param poolId The ID of the Pool that contains the Compute Node. * @param nodeId The ID of the Compute Node for which you want to get the Remote Desktop * Protocol file. - * @param content The Azure Batch service log files upload options. + * @param parameters The Azure Batch service log files upload options. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -10585,9 +10590,9 @@ public Mono> getNodeRemoteLoginSettingsWithResponse(String */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> uploadNodeLogsWithResponse(String poolId, String nodeId, BinaryData content, + public Mono> uploadNodeLogsWithResponse(String poolId, String nodeId, BinaryData parameters, RequestOptions requestOptions) { - return this.serviceClient.uploadNodeLogsWithResponseAsync(poolId, nodeId, content, requestOptions); + return this.serviceClient.uploadNodeLogsWithResponseAsync(poolId, nodeId, parameters, requestOptions); } /** @@ -10596,7 +10601,7 @@ public Mono> uploadNodeLogsWithResponse(String poolId, Stri * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -10796,7 +10801,7 @@ public PagedFlux listNodes(String poolId, RequestOptions requestOpti * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
$selectList<String>NoAn OData $select clause. In the form of "," @@ -10869,7 +10874,7 @@ public Mono> getNodeExtensionWithResponse(String poolId, St * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -10942,7 +10947,7 @@ public PagedFlux listNodeExtensions(String poolId, String nodeId, Re * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
recursiveBooleanNoWhether to delete children of a directory. If the filePath @@ -10976,7 +10981,7 @@ public Mono> deleteNodeFileWithResponse(String poolId, String nod * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -11029,7 +11034,7 @@ public Mono> getNodeFileWithResponse(String poolId, String * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -11073,7 +11078,7 @@ public Mono> getNodeFilePropertiesWithResponse(String poolId, Str * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -11120,49 +11125,6 @@ public PagedFlux listNodeFiles(String poolId, String nodeId, Request return this.serviceClient.listNodeFilesAsync(poolId, nodeId, requestOptions); } - /** - * Lists all of the applications available in the specified Account. - * - * This operation returns only Applications and versions that are available for - * use on Compute Nodes; that is, that can be used in an Package reference. For - * administrator information about applications and versions that are not yet - * available to Compute Nodes, use the Azure portal or the Azure Resource Manager - * API. - * - * @param options Optional parameters for List Applications operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of listing the applications available in an Account as paginated response with - * {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listApplications(ListBatchApplicationsOptions options) { - // Generated convenience method for listApplications - RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); - if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); - } - PagedFlux pagedFluxResponse = listApplications(requestOptions); - return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { - Flux> flux = (continuationTokenParam == null) - ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationTokenParam).take(1); - return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), - pagedResponse.getStatusCode(), pagedResponse.getHeaders(), - pagedResponse.getValue() - .stream() - .map(protocolMethodData -> protocolMethodData.toObject(BatchApplication.class)) - .collect(Collectors.toList()), - pagedResponse.getContinuationToken(), null)); - }); - } - /** * Lists all of the applications available in the specified Account. * @@ -11200,41 +11162,6 @@ public PagedFlux listApplications() { }); } - /** - * Gets information about the specified Application. - * - * This operation returns only Applications and versions that are available for - * use on Compute Nodes; that is, that can be used in an Package reference. For - * administrator information about Applications and versions that are not yet - * available to Compute Nodes, use the Azure portal or the Azure Resource Manager - * API. - * - * @param applicationId The ID of the Application. - * @param options Optional parameters for Get Application operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified Application. - * - * This operation returns only Applications and versions that are available for - * use on Compute Nodes; that is, that can be used in an Package reference on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getApplication(String applicationId, GetBatchApplicationOptions options) { - // Generated convenience method for getApplicationWithResponse - RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); - if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); - } - return getApplicationWithResponse(applicationId, requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(BatchApplication.class)); - } - /** * Gets information about the specified Application. * @@ -11276,8 +11203,6 @@ public Mono getApplication(String applicationId) { * times of the last aggregation interval currently available; that is, only the * last aggregation interval is returned. * - * @param options Optional parameters for List Pool Usage Metrics operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. @@ -11287,25 +11212,9 @@ public Mono getApplication(String applicationId) { */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listPoolUsageMetrics(ListBatchPoolUsageMetricsOptions options) { + public PagedFlux listPoolUsageMetrics() { // Generated convenience method for listPoolUsageMetrics RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); - OffsetDateTime startTime = options == null ? null : options.getStartTime(); - OffsetDateTime endtime = options == null ? null : options.getEndtime(); - String filter = options == null ? null : options.getFilter(); - if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); - } - if (startTime != null) { - requestOptions.addQueryParam("startTime", String.valueOf(startTime), false); - } - if (endtime != null) { - requestOptions.addQueryParam("endtime", String.valueOf(endtime), false); - } - if (filter != null) { - requestOptions.addQueryParam("$filter", filter, false); - } PagedFlux pagedFluxResponse = listPoolUsageMetrics(requestOptions); return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { Flux> flux = (continuationTokenParam == null) @@ -11323,53 +11232,52 @@ public PagedFlux listPoolUsageMetrics(ListBatchPoolUsageM } /** - * Lists the usage metrics, aggregated by Pool across individual time intervals, - * for the specified Account. - * - * If you do not specify a $filter clause including a poolId, the response - * includes all Pools that existed in the Account in the time range of the - * returned aggregation intervals. If you do not specify a $filter clause - * including a startTime or endTime these filters default to the start and end - * times of the last aggregation interval currently available; that is, only the - * last aggregation interval is returned. + * Lists all of the Pools which be mounted. * * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a listing the usage metrics for an Account as paginated response with {@link PagedFlux}. + * @return the result of listing the Pools in an Account as paginated response with {@link PagedFlux}. */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listPoolUsageMetrics() { - // Generated convenience method for listPoolUsageMetrics + public PagedFlux listPools() { + // Generated convenience method for listPools RequestOptions requestOptions = new RequestOptions(); - PagedFlux pagedFluxResponse = listPoolUsageMetrics(requestOptions); + PagedFlux pagedFluxResponse = listPools(requestOptions); return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { Flux> flux = (continuationTokenParam == null) ? pagedFluxResponse.byPage().take(1) : pagedFluxResponse.byPage(continuationTokenParam).take(1); - return flux - .map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), - pagedResponse.getStatusCode(), pagedResponse.getHeaders(), - pagedResponse.getValue() - .stream() - .map(protocolMethodData -> protocolMethodData.toObject(BatchPoolUsageMetrics.class)) - .collect(Collectors.toList()), - pagedResponse.getContinuationToken(), null)); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(BatchPool.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); }); } /** - * Creates a Pool to the specified Account. + * Deletes a Pool from the specified Account. * - * When naming Pools, avoid including sensitive information such as user names or - * secret project names. This information may appear in telemetry logs accessible - * to Microsoft Support engineers. + * When you request that a Pool be deleted, the following actions occur: the Pool + * state is set to deleting; any ongoing resize operation on the Pool are stopped; + * the Batch service starts resizing the Pool to zero Compute Nodes; any Tasks + * running on existing Compute Nodes are terminated and requeued (as if a resize + * Pool operation had been requested with the default requeue option); finally, + * the Pool is removed from the system. Because running Tasks are requeued, the + * user can rerun these Tasks by updating their Job to target a different Pool. + * The Tasks can then run on the new Pool. If you want to override the requeue + * behavior, then you should call resize Pool explicitly to shrink the Pool to + * zero size before deleting the Pool. If you call an Update, Patch or Delete API + * on a Pool in the deleting state, it will fail with HTTP status code 409 with + * error code PoolBeingDeleted. * - * @param pool The Pool to be created. - * @param options Optional parameters for Create Pool operation. + * @param poolId The ID of the Pool to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -11380,145 +11288,1800 @@ public PagedFlux listPoolUsageMetrics() { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createPool(BatchPoolCreateContent pool, CreateBatchPoolOptions options) { - // Generated convenience method for createPoolWithResponse + public Mono deletePool(String poolId) { + // Generated convenience method for deletePoolWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + return deletePoolWithResponse(poolId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Gets basic properties of a Pool. + * + * @param poolId The ID of the Pool to get. + * @param options Optional parameters for Pool Exists operation. + * @param requestConditions Specifies HTTP options for conditional requests based on modification time. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return basic properties of a Pool on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono poolExists(String poolId, BatchPoolExistsOptions options, + RequestConditions requestConditions) { + // Generated convenience method for poolExistsWithResponse + RequestOptions requestOptions = new RequestOptions(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); + OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); + String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); + String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } - return createPoolWithResponse(BinaryData.fromObject(pool), requestOptions).flatMap(FluxUtil::toMono); + if (ifModifiedSince != null) { + requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, + String.valueOf(new DateTimeRfc1123(ifModifiedSince))); + } + if (ifUnmodifiedSince != null) { + requestOptions.setHeader(HttpHeaderName.IF_UNMODIFIED_SINCE, + String.valueOf(new DateTimeRfc1123(ifUnmodifiedSince))); + } + if (ifMatch != null) { + requestOptions.setHeader(HttpHeaderName.IF_MATCH, ifMatch); + } + if (ifNoneMatch != null) { + requestOptions.setHeader(HttpHeaderName.IF_NONE_MATCH, ifNoneMatch); + } + return poolExistsWithResponse(poolId, requestOptions).flatMap(FluxUtil::toMono); } /** - * Creates a Pool to the specified Account. - * - * When naming Pools, avoid including sensitive information such as user names or - * secret project names. This information may appear in telemetry logs accessible - * to Microsoft Support engineers. + * Gets basic properties of a Pool. * - * @param pool The Pool to be created. + * @param poolId The ID of the Pool to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return basic properties of a Pool on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createPool(BatchPoolCreateContent pool) { - // Generated convenience method for createPoolWithResponse + public Mono poolExists(String poolId) { + // Generated convenience method for poolExistsWithResponse RequestOptions requestOptions = new RequestOptions(); - return createPoolWithResponse(BinaryData.fromObject(pool), requestOptions).flatMap(FluxUtil::toMono); + return poolExistsWithResponse(poolId, requestOptions).flatMap(FluxUtil::toMono); } /** - * Lists all of the Pools which be mounted. + * Gets information about the specified Pool. * - * @param options Optional parameters for List Pools operation. + * @param poolId The ID of the Pool to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of listing the Pools in an Account as paginated response with {@link PagedFlux}. + * @return information about the specified Pool on successful completion of {@link Mono}. */ @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listPools(ListBatchPoolsOptions options) { - // Generated convenience method for listPools + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getPool(String poolId) { + // Generated convenience method for getPoolWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getPoolWithResponse(poolId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(BatchPool.class)); + } + + /** + * Disables automatic scaling for a Pool. + * + * @param poolId The ID of the Pool on which to disable automatic scaling. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono disablePoolAutoScale(String poolId) { + // Generated convenience method for disablePoolAutoScaleWithResponse + RequestOptions requestOptions = new RequestOptions(); + return disablePoolAutoScaleWithResponse(poolId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Stops an ongoing resize operation on the Pool. + * + * This does not restore the Pool to its previous state before the resize + * operation: it only stops any further changes being made, and the Pool maintains + * its current state. After stopping, the Pool stabilizes at the number of Compute + * Nodes it was at when the stop operation was done. During the stop operation, + * the Pool allocation state changes first to stopping and then to steady. A + * resize operation need not be an explicit resize Pool request; this API can also + * be used to halt the initial sizing of the Pool when it is created. + * + * @param poolId The ID of the Pool to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono stopPoolResize(String poolId) { + // Generated convenience method for stopPoolResizeWithResponse + RequestOptions requestOptions = new RequestOptions(); + return stopPoolResizeWithResponse(poolId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Lists all Virtual Machine Images supported by the Azure Batch service. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of listing the supported Virtual Machine Images as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listSupportedImages() { + // Generated convenience method for listSupportedImages + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listSupportedImages(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux + .map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(BatchSupportedImage.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Gets the number of Compute Nodes in each state, grouped by Pool. Note that the + * numbers returned may not always be up to date. If you need exact node counts, + * use a list query. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the number of Compute Nodes in each state, grouped by Pool as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listPoolNodeCounts() { + // Generated convenience method for listPoolNodeCounts + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listPoolNodeCounts(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux + .map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(BatchPoolNodeCounts.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Deletes a Job. + * + * Deleting a Job also deletes all Tasks that are part of that Job, and all Job + * statistics. This also overrides the retention period for Task data; that is, if + * the Job contains Tasks which are still retained on Compute Nodes, the Batch + * services deletes those Tasks' working directories and all their contents. When + * a Delete Job request is received, the Batch service sets the Job to the + * deleting state. All update operations on a Job that is in deleting state will + * fail with status code 409 (Conflict), with additional information indicating + * that the Job is being deleted. + * + * @param jobId The ID of the Job to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteJob(String jobId) { + // Generated convenience method for deleteJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteJobWithResponse(jobId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Gets information about the specified Job. + * + * @param jobId The ID of the Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified Job on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getJob(String jobId) { + // Generated convenience method for getJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getJobWithResponse(jobId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(BatchJob.class)); + } + + /** + * Updates the properties of the specified Job. + * + * This fully replaces all the updatable properties of the Job. For example, if + * the Job has constraints associated with it and if constraints is not specified + * with this request, then the Batch service will remove the existing constraints. + * + * @param jobId The ID of the Job whose properties you want to update. + * @param job A job with updated properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono replaceJob(String jobId, BatchJob job) { + // Generated convenience method for replaceJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + return replaceJobWithResponse(jobId, BinaryData.fromObject(job), requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Enables the specified Job, allowing new Tasks to run. + * + * When you call this API, the Batch service sets a disabled Job to the enabling + * state. After the this operation is completed, the Job moves to the active + * state, and scheduling of new Tasks under the Job resumes. The Batch service + * does not allow a Task to remain in the active state for more than 180 days. + * Therefore, if you enable a Job containing active Tasks which were added more + * than 180 days ago, those Tasks will not run. + * + * @param jobId The ID of the Job to enable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono enableJob(String jobId) { + // Generated convenience method for enableJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + return enableJobWithResponse(jobId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Terminates the specified Job, marking it as completed. + * + * When a Terminate Job request is received, the Batch service sets the Job to the + * terminating state. The Batch service then terminates any running Tasks + * associated with the Job and runs any required Job release Tasks. Then the Job + * moves into the completed state. If there are any Tasks in the Job in the active + * state, they will remain in the active state. Once a Job is terminated, new + * Tasks cannot be added and any remaining active Tasks will not be scheduled. + * + * @param jobId The ID of the Job to terminate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono terminateJob(String jobId) { + // Generated convenience method for terminateJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + return terminateJobWithResponse(jobId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Lists all of the Jobs in the specified Account. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of listing the Jobs in an Account as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listJobs() { + // Generated convenience method for listJobs + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listJobs(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(BatchJob.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Lists the Jobs that have been created under the specified Job Schedule. + * + * @param jobScheduleId The ID of the Job Schedule from which you want to get a list of Jobs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of listing the Jobs in an Account as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listJobsFromSchedule(String jobScheduleId) { + // Generated convenience method for listJobsFromSchedule + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listJobsFromSchedule(jobScheduleId, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(BatchJob.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Lists the execution status of the Job Preparation and Job Release Task for the + * specified Job across the Compute Nodes where the Job has run. + * + * This API returns the Job Preparation and Job Release Task status on all Compute + * Nodes that have run the Job Preparation or Job Release Task. This includes + * Compute Nodes which have since been removed from the Pool. If this API is + * invoked on a Job which has no Job Preparation or Job Release Task, the Batch + * service returns HTTP status code 409 (Conflict) with an error code of + * JobPreparationTaskNotSpecified. + * + * @param jobId The ID of the Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of listing the status of the Job Preparation and Job Release Tasks + * for a Job as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listJobPreparationAndReleaseTaskStatus(String jobId) { + // Generated convenience method for listJobPreparationAndReleaseTaskStatus + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listJobPreparationAndReleaseTaskStatus(jobId, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase( + pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData + .toObject(BatchJobPreparationAndReleaseTaskStatus.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Gets the Task counts for the specified Job. + * + * Task counts provide a count of the Tasks by active, running or completed Task + * state, and a count of Tasks which succeeded or failed. Tasks in the preparing + * state are counted as running. Note that the numbers returned may not always be + * up to date. If you need exact task counts, use a list query. + * + * @param jobId The ID of the Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Task counts for the specified Job. + * + * Task counts provide a count of the Tasks by active, running or completed Task + * state, and a count of Tasks which succeeded or failed on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getJobTaskCounts(String jobId) { + // Generated convenience method for getJobTaskCountsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getJobTaskCountsWithResponse(jobId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(BatchTaskCountsResult.class)); + } + + /** + * Creates a Certificate to the specified Account. + * + * @param certificate The Certificate to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createCertificate(BatchCertificate certificate) { + // Generated convenience method for createCertificateWithResponse + RequestOptions requestOptions = new RequestOptions(); + return createCertificateWithResponse(BinaryData.fromObject(certificate), requestOptions) + .flatMap(FluxUtil::toMono); + } + + /** + * Lists all of the Certificates that have been added to the specified Account. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of listing the Certificates in the Account as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listCertificates() { + // Generated convenience method for listCertificates + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listCertificates(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(BatchCertificate.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Cancels a failed deletion of a Certificate from the specified Account. + * + * If you try to delete a Certificate that is being used by a Pool or Compute + * Node, the status of the Certificate changes to deleteFailed. If you decide that + * you want to continue using the Certificate, you can use this operation to set + * the status of the Certificate back to active. If you intend to delete the + * Certificate, you do not need to run this operation after the deletion failed. + * You must make sure that the Certificate is not being used by any resources, and + * then you can try again to delete the Certificate. + * + * @param thumbprintAlgorithm The algorithm used to derive the thumbprint parameter. This must be sha1. + * @param thumbprint The thumbprint of the Certificate being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono cancelCertificateDeletion(String thumbprintAlgorithm, String thumbprint) { + // Generated convenience method for cancelCertificateDeletionWithResponse + RequestOptions requestOptions = new RequestOptions(); + return cancelCertificateDeletionWithResponse(thumbprintAlgorithm, thumbprint, requestOptions) + .flatMap(FluxUtil::toMono); + } + + /** + * Deletes a Certificate from the specified Account. + * + * You cannot delete a Certificate if a resource (Pool or Compute Node) is using + * it. Before you can delete a Certificate, you must therefore make sure that the + * Certificate is not associated with any existing Pools, the Certificate is not + * installed on any Nodes (even if you remove a Certificate from a Pool, it is not + * removed from existing Compute Nodes in that Pool until they restart), and no + * running Tasks depend on the Certificate. If you try to delete a Certificate + * that is in use, the deletion fails. The Certificate status changes to + * deleteFailed. You can use Cancel Delete Certificate to set the status back to + * active if you decide that you want to continue using the Certificate. + * + * @param thumbprintAlgorithm The algorithm used to derive the thumbprint parameter. This must be sha1. + * @param thumbprint The thumbprint of the Certificate to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteCertificate(String thumbprintAlgorithm, String thumbprint) { + // Generated convenience method for deleteCertificateWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteCertificateWithResponse(thumbprintAlgorithm, thumbprint, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Gets information about the specified Certificate. + * + * @param thumbprintAlgorithm The algorithm used to derive the thumbprint parameter. This must be sha1. + * @param thumbprint The thumbprint of the Certificate to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified Certificate on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getCertificate(String thumbprintAlgorithm, String thumbprint) { + // Generated convenience method for getCertificateWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getCertificateWithResponse(thumbprintAlgorithm, thumbprint, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(BatchCertificate.class)); + } + + /** + * Checks the specified Job Schedule exists. + * + * @param jobScheduleId The ID of the Job Schedule which you want to check. + * @param options Optional parameters for Job Schedule Exists operation. + * @param requestConditions Specifies HTTP options for conditional requests based on modification time. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono jobScheduleExists(String jobScheduleId, BatchJobScheduleExistsOptions options, + RequestConditions requestConditions) { + // Generated convenience method for jobScheduleExistsWithResponse + RequestOptions requestOptions = new RequestOptions(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); + OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); + String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); + String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); + if (timeOutInSeconds != null) { + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); + } + if (ifModifiedSince != null) { + requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, + String.valueOf(new DateTimeRfc1123(ifModifiedSince))); + } + if (ifUnmodifiedSince != null) { + requestOptions.setHeader(HttpHeaderName.IF_UNMODIFIED_SINCE, + String.valueOf(new DateTimeRfc1123(ifUnmodifiedSince))); + } + if (ifMatch != null) { + requestOptions.setHeader(HttpHeaderName.IF_MATCH, ifMatch); + } + if (ifNoneMatch != null) { + requestOptions.setHeader(HttpHeaderName.IF_NONE_MATCH, ifNoneMatch); + } + return jobScheduleExistsWithResponse(jobScheduleId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Checks the specified Job Schedule exists. + * + * @param jobScheduleId The ID of the Job Schedule which you want to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono jobScheduleExists(String jobScheduleId) { + // Generated convenience method for jobScheduleExistsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return jobScheduleExistsWithResponse(jobScheduleId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Deletes a Job Schedule from the specified Account. + * + * When you delete a Job Schedule, this also deletes all Jobs and Tasks under that + * schedule. When Tasks are deleted, all the files in their working directories on + * the Compute Nodes are also deleted (the retention period is ignored). The Job + * Schedule statistics are no longer accessible once the Job Schedule is deleted, + * though they are still counted towards Account lifetime statistics. + * + * @param jobScheduleId The ID of the Job Schedule to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteJobSchedule(String jobScheduleId) { + // Generated convenience method for deleteJobScheduleWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteJobScheduleWithResponse(jobScheduleId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Gets information about the specified Job Schedule. + * + * @param jobScheduleId The ID of the Job Schedule to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified Job Schedule on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getJobSchedule(String jobScheduleId) { + // Generated convenience method for getJobScheduleWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getJobScheduleWithResponse(jobScheduleId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(BatchJobSchedule.class)); + } + + /** + * Updates the properties of the specified Job Schedule. + * + * This fully replaces all the updatable properties of the Job Schedule. For + * example, if the schedule property is not specified with this request, then the + * Batch service will remove the existing schedule. Changes to a Job Schedule only + * impact Jobs created by the schedule after the update has taken place; currently + * running Jobs are unaffected. + * + * @param jobScheduleId The ID of the Job Schedule to update. + * @param jobSchedule A Job Schedule with updated properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono replaceJobSchedule(String jobScheduleId, BatchJobSchedule jobSchedule) { + // Generated convenience method for replaceJobScheduleWithResponse + RequestOptions requestOptions = new RequestOptions(); + return replaceJobScheduleWithResponse(jobScheduleId, BinaryData.fromObject(jobSchedule), requestOptions) + .flatMap(FluxUtil::toMono); + } + + /** + * Disables a Job Schedule. + * + * No new Jobs will be created until the Job Schedule is enabled again. + * + * @param jobScheduleId The ID of the Job Schedule to disable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono disableJobSchedule(String jobScheduleId) { + // Generated convenience method for disableJobScheduleWithResponse + RequestOptions requestOptions = new RequestOptions(); + return disableJobScheduleWithResponse(jobScheduleId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Enables a Job Schedule. + * + * @param jobScheduleId The ID of the Job Schedule to enable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono enableJobSchedule(String jobScheduleId) { + // Generated convenience method for enableJobScheduleWithResponse + RequestOptions requestOptions = new RequestOptions(); + return enableJobScheduleWithResponse(jobScheduleId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Terminates a Job Schedule. + * + * @param jobScheduleId The ID of the Job Schedule to terminates. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono terminateJobSchedule(String jobScheduleId) { + // Generated convenience method for terminateJobScheduleWithResponse + RequestOptions requestOptions = new RequestOptions(); + return terminateJobScheduleWithResponse(jobScheduleId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Lists all of the Job Schedules in the specified Account. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of listing the Job Schedules in an Account as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listJobSchedules() { + // Generated convenience method for listJobSchedules + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listJobSchedules(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(BatchJobSchedule.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Lists all of the Tasks that are associated with the specified Job. + * + * For multi-instance Tasks, information such as affinityId, executionInfo and + * nodeInfo refer to the primary Task. Use the list subtasks API to retrieve + * information about subtasks. + * + * @param jobId The ID of the Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of listing the Tasks in a Job as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTasks(String jobId) { + // Generated convenience method for listTasks + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listTasks(jobId, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(BatchTask.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Adds a collection of Tasks to the specified Job. + * + * Note that each Task must have a unique ID. The Batch service may not return the + * results for each Task in the same order the Tasks were submitted in this + * request. If the server times out or the connection is closed during the + * request, the request may have been partially or fully processed, or not at all. + * In such cases, the user should re-issue the request. Note that it is up to the + * user to correctly handle failures when re-issuing a request. For example, you + * should use the same Task IDs during a retry so that if the prior operation + * succeeded, the retry will not create extra Tasks unexpectedly. If the response + * contains any Tasks which failed to add, a client can retry the request. In a + * retry, it is most efficient to resubmit only Tasks that failed to add, and to + * omit Tasks that were successfully added on the first attempt. The maximum + * lifetime of a Task from addition to completion is 180 days. If a Task has not + * completed within 180 days of being added it will be terminated by the Batch + * service and left in whatever state it was in at that time. + * + * @param jobId The ID of the Job to which the Task collection is to be added. + * @param taskCollection The Tasks to be added. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of creating a collection of Tasks to a Job on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createTaskCollection(String jobId, BatchTaskGroup taskCollection) { + // Generated convenience method for createTaskCollectionWithResponse + RequestOptions requestOptions = new RequestOptions(); + return createTaskCollectionWithResponse(jobId, BinaryData.fromObject(taskCollection), requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(BatchCreateTaskCollectionResult.class)); + } + + /** + * Deletes a Task from the specified Job. + * + * When a Task is deleted, all of the files in its directory on the Compute Node + * where it ran are also deleted (regardless of the retention time). For + * multi-instance Tasks, the delete Task operation applies synchronously to the + * primary task; subtasks and their files are then deleted asynchronously in the + * background. + * + * @param jobId The ID of the Job from which to delete the Task. + * @param taskId The ID of the Task to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteTask(String jobId, String taskId) { + // Generated convenience method for deleteTaskWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteTaskWithResponse(jobId, taskId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Gets information about the specified Task. + * + * For multi-instance Tasks, information such as affinityId, executionInfo and + * nodeInfo refer to the primary Task. Use the list subtasks API to retrieve + * information about subtasks. + * + * @param jobId The ID of the Job that contains the Task. + * @param taskId The ID of the Task to get information about. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified Task. + * + * For multi-instance Tasks, information such as affinityId, executionInfo and + * nodeInfo refer to the primary Task on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getTask(String jobId, String taskId) { + // Generated convenience method for getTaskWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getTaskWithResponse(jobId, taskId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(BatchTask.class)); + } + + /** + * Updates the properties of the specified Task. + * + * @param jobId The ID of the Job containing the Task. + * @param taskId The ID of the Task to update. + * @param task The Task to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono replaceTask(String jobId, String taskId, BatchTask task) { + // Generated convenience method for replaceTaskWithResponse + RequestOptions requestOptions = new RequestOptions(); + return replaceTaskWithResponse(jobId, taskId, BinaryData.fromObject(task), requestOptions) + .flatMap(FluxUtil::toMono); + } + + /** + * Lists all of the subtasks that are associated with the specified multi-instance + * Task. + * + * If the Task is not a multi-instance Task then this returns an empty collection. + * + * @param jobId The ID of the Job. + * @param taskId The ID of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of listing the subtasks of a Task as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listSubTasks(String jobId, String taskId) { + // Generated convenience method for listSubTasks + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listSubTasks(jobId, taskId, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(BatchSubtask.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Terminates the specified Task. + * + * When the Task has been terminated, it moves to the completed state. For + * multi-instance Tasks, the terminate Task operation applies synchronously to the + * primary task; subtasks are then terminated asynchronously in the background. + * + * @param jobId The ID of the Job containing the Task. + * @param taskId The ID of the Task to terminate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono terminateTask(String jobId, String taskId) { + // Generated convenience method for terminateTaskWithResponse + RequestOptions requestOptions = new RequestOptions(); + return terminateTaskWithResponse(jobId, taskId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Reactivates a Task, allowing it to run again even if its retry count has been + * exhausted. + * + * Reactivation makes a Task eligible to be retried again up to its maximum retry + * count. The Task's state is changed to active. As the Task is no longer in the + * completed state, any previous exit code or failure information is no longer + * available after reactivation. Each time a Task is reactivated, its retry count + * is reset to 0. Reactivation will fail for Tasks that are not completed or that + * previously completed successfully (with an exit code of 0). Additionally, it + * will fail if the Job has completed (or is terminating or deleting). + * + * @param jobId The ID of the Job containing the Task. + * @param taskId The ID of the Task to reactivate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono reactivateTask(String jobId, String taskId) { + // Generated convenience method for reactivateTaskWithResponse + RequestOptions requestOptions = new RequestOptions(); + return reactivateTaskWithResponse(jobId, taskId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Deletes the specified Task file from the Compute Node where the Task ran. + * + * @param jobId The ID of the Job that contains the Task. + * @param taskId The ID of the Task whose file you want to retrieve. + * @param filePath The path to the Task file that you want to get the content of. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteTaskFile(String jobId, String taskId, String filePath) { + // Generated convenience method for deleteTaskFileWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteTaskFileWithResponse(jobId, taskId, filePath, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Returns the content of the specified Task file. + * + * @param jobId The ID of the Job that contains the Task. + * @param taskId The ID of the Task whose file you want to retrieve. + * @param filePath The path to the Task file that you want to get the content of. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getTaskFile(String jobId, String taskId, String filePath) { + // Generated convenience method for getTaskFileWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getTaskFileWithResponse(jobId, taskId, filePath, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Gets the properties of the specified Task file. + * + * @param jobId The ID of the Job that contains the Task. + * @param taskId The ID of the Task whose file you want to retrieve. + * @param filePath The path to the Task file that you want to get the content of. + * @param options Optional parameters for Get Task File Properties operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified Task file on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getTaskFileProperties(String jobId, String taskId, String filePath, + GetBatchTaskFilePropertiesOptions options) { + RequestOptions requestOptions = new RequestOptions(); + Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + OffsetDateTime ifModifiedSince = options == null ? null : options.getIfModifiedSince(); + OffsetDateTime ifUnmodifiedSince = options == null ? null : options.getIfUnmodifiedSince(); + if (timeOutInSeconds != null) { + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + } + if (ifModifiedSince != null) { + requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, + String.valueOf(new DateTimeRfc1123(ifModifiedSince))); + } + if (ifUnmodifiedSince != null) { + requestOptions.setHeader(HttpHeaderName.IF_UNMODIFIED_SINCE, + String.valueOf(new DateTimeRfc1123(ifUnmodifiedSince))); + } + // Map the response headers of getTaskFilePropertiesWithResponse to FileResponseHeaderProperties + return getTaskFilePropertiesWithResponse(jobId, taskId, filePath, requestOptions) + .map(response -> new FileResponseHeaderProperties(response.getHeaders())); + } + + /** + * Gets the properties of the specified Task file. + * + * @param jobId The ID of the Job that contains the Task. + * @param taskId The ID of the Task whose file you want to retrieve. + * @param filePath The path to the Task file that you want to get the content of. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified Task file on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getTaskFileProperties(String jobId, String taskId, String filePath) { + return getTaskFilePropertiesWithResponse(jobId, taskId, filePath, new RequestOptions()) + .map(response -> new FileResponseHeaderProperties(response.getHeaders())); + } + + /** + * Lists the files in a Task's directory on its Compute Node. + * + * @param jobId The ID of the Job that contains the Task. + * @param taskId The ID of the Task whose files you want to list. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of listing the files on a Compute Node, or the files associated with + * a Task on a Compute Node as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTaskFiles(String jobId, String taskId) { + // Generated convenience method for listTaskFiles + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listTaskFiles(jobId, taskId, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(BatchNodeFile.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Deletes a user Account from the specified Compute Node. + * + * You can delete a user Account to a Compute Node only when it is in the idle or + * running state. + * + * @param poolId The ID of the Pool that contains the Compute Node. + * @param nodeId The ID of the machine on which you want to delete a user Account. + * @param userName The name of the user Account to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteNodeUser(String poolId, String nodeId, String userName) { + // Generated convenience method for deleteNodeUserWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteNodeUserWithResponse(poolId, nodeId, userName, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Gets information about the specified Compute Node. + * + * @param poolId The ID of the Pool that contains the Compute Node. + * @param nodeId The ID of the Compute Node that you want to get information about. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified Compute Node on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getNode(String poolId, String nodeId) { + // Generated convenience method for getNodeWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getNodeWithResponse(poolId, nodeId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(BatchNode.class)); + } + + /** + * Restarts the specified Compute Node. + * + * You can restart a Compute Node only if it is in an idle or running state. + * + * @param poolId The ID of the Pool that contains the Compute Node. + * @param nodeId The ID of the Compute Node that you want to restart. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono rebootNode(String poolId, String nodeId) { + // Generated convenience method for rebootNodeWithResponse + RequestOptions requestOptions = new RequestOptions(); + return rebootNodeWithResponse(poolId, nodeId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Starts the specified Compute Node. + * + * You can start a Compute Node only if it has been deallocated. + * + * @param poolId The ID of the Pool that contains the Compute Node. + * @param nodeId The ID of the Compute Node that you want to restart. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono startNode(String poolId, String nodeId) { + // Generated convenience method for startNodeWithResponse + RequestOptions requestOptions = new RequestOptions(); + return startNodeWithResponse(poolId, nodeId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Reinstalls the operating system on the specified Compute Node. + * + * You can reinstall the operating system on a Compute Node only if it is in an + * idle or running state. This API can be invoked only on Pools created with the + * cloud service configuration property. + * + * @param poolId The ID of the Pool that contains the Compute Node. + * @param nodeId The ID of the Compute Node that you want to restart. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono reimageNode(String poolId, String nodeId) { + // Generated convenience method for reimageNodeWithResponse + RequestOptions requestOptions = new RequestOptions(); + return reimageNodeWithResponse(poolId, nodeId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Deallocates the specified Compute Node. + * + * You can deallocate a Compute Node only if it is in an idle or running state. + * + * @param poolId The ID of the Pool that contains the Compute Node. + * @param nodeId The ID of the Compute Node that you want to restart. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deallocateNode(String poolId, String nodeId) { + // Generated convenience method for deallocateNodeWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deallocateNodeWithResponse(poolId, nodeId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Disables Task scheduling on the specified Compute Node. + * + * You can disable Task scheduling on a Compute Node only if its current + * scheduling state is enabled. + * + * @param poolId The ID of the Pool that contains the Compute Node. + * @param nodeId The ID of the Compute Node on which you want to disable Task scheduling. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono disableNodeScheduling(String poolId, String nodeId) { + // Generated convenience method for disableNodeSchedulingWithResponse + RequestOptions requestOptions = new RequestOptions(); + return disableNodeSchedulingWithResponse(poolId, nodeId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Enables Task scheduling on the specified Compute Node. + * + * You can enable Task scheduling on a Compute Node only if its current scheduling + * state is disabled. + * + * @param poolId The ID of the Pool that contains the Compute Node. + * @param nodeId The ID of the Compute Node on which you want to enable Task scheduling. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono enableNodeScheduling(String poolId, String nodeId) { + // Generated convenience method for enableNodeSchedulingWithResponse + RequestOptions requestOptions = new RequestOptions(); + return enableNodeSchedulingWithResponse(poolId, nodeId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Gets the settings required for remote login to a Compute Node. + * + * Before you can remotely login to a Compute Node using the remote login settings, + * you must create a user Account on the Compute Node. + * + * @param poolId The ID of the Pool that contains the Compute Node. + * @param nodeId The ID of the Compute Node for which to obtain the remote login settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the settings required for remote login to a Compute Node. + * + * Before you can remotely login to a Compute Node using the remote login settings, + * you must create a user Account on the Compute Node on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getNodeRemoteLoginSettings(String poolId, String nodeId) { + // Generated convenience method for getNodeRemoteLoginSettingsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getNodeRemoteLoginSettingsWithResponse(poolId, nodeId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(BatchNodeRemoteLoginSettings.class)); + } + + /** + * Lists the Compute Nodes in the specified Pool. + * + * @param poolId The ID of the Pool from which you want to list Compute Nodes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of listing the Compute Nodes in a Pool as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listNodes(String poolId) { + // Generated convenience method for listNodes + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listNodes(poolId, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(BatchNode.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Gets information about the specified Compute Node Extension. + * + * @param poolId The ID of the Pool that contains the Compute Node. + * @param nodeId The ID of the Compute Node that contains the extensions. + * @param extensionName The name of the Compute Node Extension that you want to get information about. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified Compute Node Extension on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getNodeExtension(String poolId, String nodeId, String extensionName) { + // Generated convenience method for getNodeExtensionWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getNodeExtensionWithResponse(poolId, nodeId, extensionName, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(BatchNodeVMExtension.class)); + } + + /** + * Lists the Compute Nodes Extensions in the specified Pool. + * + * @param poolId The ID of the Pool that contains Compute Node. + * @param nodeId The ID of the Compute Node that you want to list extensions. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of listing the Compute Node extensions in a Node as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listNodeExtensions(String poolId, String nodeId) { + // Generated convenience method for listNodeExtensions + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listNodeExtensions(poolId, nodeId, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux + .map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(BatchNodeVMExtension.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Deletes the specified file from the Compute Node. + * + * @param poolId The ID of the Pool that contains the Compute Node. + * @param nodeId The ID of the Compute Node. + * @param filePath The path to the file or directory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteNodeFile(String poolId, String nodeId, String filePath) { + // Generated convenience method for deleteNodeFileWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteNodeFileWithResponse(poolId, nodeId, filePath, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Returns the content of the specified Compute Node file. + * + * @param poolId The ID of the Pool that contains the Compute Node. + * @param nodeId The ID of the Compute Node. + * @param filePath The path to the file or directory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getNodeFile(String poolId, String nodeId, String filePath) { + // Generated convenience method for getNodeFileWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getNodeFileWithResponse(poolId, nodeId, filePath, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Gets the properties of the specified Compute Node file. + * + * @param poolId The ID of the Pool that contains the Compute Node. + * @param nodeId The ID of the Compute Node. + * @param filePath The path to the file or directory. + * @param options Optional parameters for Get Node File Properties operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified Compute Node file on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getNodeFileProperties(String poolId, String nodeId, String filePath, + GetBatchNodeFilePropertiesOptions options) { RequestOptions requestOptions = new RequestOptions(); Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); - String filter = options == null ? null : options.getFilter(); - List select = options == null ? null : options.getSelect(); - List expand = options == null ? null : options.getExpand(); + OffsetDateTime ifModifiedSince = options == null ? null : options.getIfModifiedSince(); + OffsetDateTime ifUnmodifiedSince = options == null ? null : options.getIfUnmodifiedSince(); if (timeOutInSeconds != null) { requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); } - if (filter != null) { - requestOptions.addQueryParam("$filter", filter, false); - } - if (select != null) { - requestOptions.addQueryParam("$select", - select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")), - false); + if (ifModifiedSince != null) { + requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, + String.valueOf(new DateTimeRfc1123(ifModifiedSince))); } - if (expand != null) { - requestOptions.addQueryParam("$expand", - expand.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")), - false); + if (ifUnmodifiedSince != null) { + requestOptions.setHeader(HttpHeaderName.IF_UNMODIFIED_SINCE, + String.valueOf(new DateTimeRfc1123(ifUnmodifiedSince))); } - PagedFlux pagedFluxResponse = listPools(requestOptions); + // Map the response headers of getNodeFilePropertiesWithResponse to NodeFileProperties + return getNodeFilePropertiesWithResponse(poolId, nodeId, filePath, requestOptions) + .map(response -> new FileResponseHeaderProperties(response.getHeaders())); + } + + /** + * Gets the properties of the specified Compute Node file. + * + * @param poolId The ID of the Pool that contains the Compute Node. + * @param nodeId The ID of the Compute Node. + * @param filePath The path to the file or directory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified Compute Node file on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getNodeFileProperties(String poolId, String nodeId, String filePath) { + return getNodeFilePropertiesWithResponse(poolId, nodeId, filePath, new RequestOptions()) + .map(response -> new FileResponseHeaderProperties(response.getHeaders())); + } + + /** + * Lists all of the files in Task directories on the specified Compute Node. + * + * @param poolId The ID of the Pool that contains the Compute Node. + * @param nodeId The ID of the Compute Node whose files you want to list. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of listing the files on a Compute Node, or the files associated with + * a Task on a Compute Node as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listNodeFiles(String poolId, String nodeId) { + // Generated convenience method for listNodeFiles + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listNodeFiles(poolId, nodeId, requestOptions); return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { Flux> flux = (continuationTokenParam == null) ? pagedFluxResponse.byPage().take(1) : pagedFluxResponse.byPage(continuationTokenParam).take(1); - return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() .stream() - .map(protocolMethodData -> protocolMethodData.toObject(BatchPool.class)) + .map(protocolMethodData -> protocolMethodData.toObject(BatchNodeFile.class)) .collect(Collectors.toList()), pagedResponse.getContinuationToken(), null)); }); } /** - * Lists all of the Pools which be mounted. + * Lists all of the applications available in the specified Account. + * + * This operation returns only Applications and versions that are available for + * use on Compute Nodes; that is, that can be used in an Package reference. For + * administrator information about applications and versions that are not yet + * available to Compute Nodes, use the Azure portal or the Azure Resource Manager + * API. * + * @param options Optional parameters for List Applications operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of listing the Pools in an Account as paginated response with {@link PagedFlux}. + * @return the result of listing the applications available in an Account as paginated response with + * {@link PagedFlux}. */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listPools() { - // Generated convenience method for listPools + public PagedFlux listApplications(BatchApplicationsListOptions options) { + // Generated convenience method for listApplications RequestOptions requestOptions = new RequestOptions(); - PagedFlux pagedFluxResponse = listPools(requestOptions); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + if (timeOutInSeconds != null) { + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); + } + PagedFlux pagedFluxResponse = listApplications(requestOptions); return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { Flux> flux = (continuationTokenParam == null) ? pagedFluxResponse.byPage().take(1) : pagedFluxResponse.byPage(continuationTokenParam).take(1); - return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() .stream() - .map(protocolMethodData -> protocolMethodData.toObject(BatchPool.class)) + .map(protocolMethodData -> protocolMethodData.toObject(BatchApplication.class)) .collect(Collectors.toList()), pagedResponse.getContinuationToken(), null)); }); } /** - * Deletes a Pool from the specified Account. + * Gets information about the specified Application. * - * When you request that a Pool be deleted, the following actions occur: the Pool - * state is set to deleting; any ongoing resize operation on the Pool are stopped; - * the Batch service starts resizing the Pool to zero Compute Nodes; any Tasks - * running on existing Compute Nodes are terminated and requeued (as if a resize - * Pool operation had been requested with the default requeue option); finally, - * the Pool is removed from the system. Because running Tasks are requeued, the - * user can rerun these Tasks by updating their Job to target a different Pool. - * The Tasks can then run on the new Pool. If you want to override the requeue - * behavior, then you should call resize Pool explicitly to shrink the Pool to - * zero size before deleting the Pool. If you call an Update, Patch or Delete API - * on a Pool in the deleting state, it will fail with HTTP status code 409 with - * error code PoolBeingDeleted. + * This operation returns only Applications and versions that are available for + * use on Compute Nodes; that is, that can be used in an Package reference. For + * administrator information about Applications and versions that are not yet + * available to Compute Nodes, use the Azure portal or the Azure Resource Manager + * API. * - * @param poolId The ID of the Pool to get. - * @param options Optional parameters for Delete Pool operation. - * @param requestConditions Specifies HTTP options for conditional requests based on modification time. + * @param applicationId The ID of the Application. + * @param options Optional parameters for Get Application operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified Application. + * + * This operation returns only Applications and versions that are available for + * use on Compute Nodes; that is, that can be used in an Package reference on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getApplication(String applicationId, BatchApplicationGetOptions options) { + // Generated convenience method for getApplicationWithResponse + RequestOptions requestOptions = new RequestOptions(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + if (timeOutInSeconds != null) { + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); + } + return getApplicationWithResponse(applicationId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(BatchApplication.class)); + } + + /** + * Lists the usage metrics, aggregated by Pool across individual time intervals, + * for the specified Account. + * + * If you do not specify a $filter clause including a poolId, the response + * includes all Pools that existed in the Account in the time range of the + * returned aggregation intervals. If you do not specify a $filter clause + * including a startTime or endTime these filters default to the start and end + * times of the last aggregation interval currently available; that is, only the + * last aggregation interval is returned. + * + * @param options Optional parameters for List Pool Usage Metrics operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a listing the usage metrics for an Account as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listPoolUsageMetrics(BatchPoolUsageMetricsListOptions options) { + // Generated convenience method for listPoolUsageMetrics + RequestOptions requestOptions = new RequestOptions(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + OffsetDateTime startTime = options == null ? null : options.getStartTime(); + OffsetDateTime endtime = options == null ? null : options.getEndtime(); + String filter = options == null ? null : options.getFilter(); + if (timeOutInSeconds != null) { + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); + } + if (startTime != null) { + requestOptions.addQueryParam("startTime", String.valueOf(startTime), false); + } + if (endtime != null) { + requestOptions.addQueryParam("endtime", String.valueOf(endtime), false); + } + if (filter != null) { + requestOptions.addQueryParam("$filter", filter, false); + } + PagedFlux pagedFluxResponse = listPoolUsageMetrics(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux + .map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(BatchPoolUsageMetrics.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Creates a Pool to the specified Account. + * + * When naming Pools, avoid including sensitive information such as user names or + * secret project names. This information may appear in telemetry logs accessible + * to Microsoft Support engineers. + * + * @param pool The Pool to be created. + * @param options Optional parameters for Create Pool operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -11529,32 +13092,94 @@ public PagedFlux listPools() { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deletePool(String poolId, DeleteBatchPoolOptions options, RequestConditions requestConditions) { - // Generated convenience method for deletePoolWithResponse + public Mono createPool(BatchPoolCreateParameters pool, BatchPoolCreateOptions options) { + // Generated convenience method for createPoolWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); - OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); - OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); - String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); - String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } - if (ifModifiedSince != null) { - requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, - String.valueOf(new DateTimeRfc1123(ifModifiedSince))); + return createPoolWithResponse(BinaryData.fromObject(pool), requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Creates a Pool to the specified Account. + * + * When naming Pools, avoid including sensitive information such as user names or + * secret project names. This information may appear in telemetry logs accessible + * to Microsoft Support engineers. + * + * @param pool The Pool to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createPool(BatchPoolCreateParameters pool) { + // Generated convenience method for createPoolWithResponse + RequestOptions requestOptions = new RequestOptions(); + return createPoolWithResponse(BinaryData.fromObject(pool), requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Lists all of the Pools which be mounted. + * + * @param options Optional parameters for List Pools operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of listing the Pools in an Account as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listPools(BatchPoolsListOptions options) { + // Generated convenience method for listPools + RequestOptions requestOptions = new RequestOptions(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + String filter = options == null ? null : options.getFilter(); + List select = options == null ? null : options.getSelect(); + List expand = options == null ? null : options.getExpand(); + if (timeOutInSeconds != null) { + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } - if (ifUnmodifiedSince != null) { - requestOptions.setHeader(HttpHeaderName.IF_UNMODIFIED_SINCE, - String.valueOf(new DateTimeRfc1123(ifUnmodifiedSince))); + if (filter != null) { + requestOptions.addQueryParam("$filter", filter, false); } - if (ifMatch != null) { - requestOptions.setHeader(HttpHeaderName.IF_MATCH, ifMatch); + if (select != null) { + requestOptions.addQueryParam("$select", + select.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")), + false); } - if (ifNoneMatch != null) { - requestOptions.setHeader(HttpHeaderName.IF_NONE_MATCH, ifNoneMatch); + if (expand != null) { + requestOptions.addQueryParam("$expand", + expand.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")), + false); } - return deletePoolWithResponse(poolId, requestOptions).flatMap(FluxUtil::toMono); + PagedFlux pagedFluxResponse = listPools(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(BatchPool.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); } /** @@ -11574,6 +13199,8 @@ public Mono deletePool(String poolId, DeleteBatchPoolOptions options, Requ * error code PoolBeingDeleted. * * @param poolId The ID of the Pool to get. + * @param options Optional parameters for Delete Pool operation. + * @param requestConditions Specifies HTTP options for conditional requests based on modification time. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -11584,38 +13211,16 @@ public Mono deletePool(String poolId, DeleteBatchPoolOptions options, Requ */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deletePool(String poolId) { + public Mono deletePool(String poolId, BatchPoolDeleteOptions options, RequestConditions requestConditions) { // Generated convenience method for deletePoolWithResponse RequestOptions requestOptions = new RequestOptions(); - return deletePoolWithResponse(poolId, requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * Gets basic properties of a Pool. - * - * @param poolId The ID of the Pool to get. - * @param options Optional parameters for Pool Exists operation. - * @param requestConditions Specifies HTTP options for conditional requests based on modification time. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return basic properties of a Pool on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono poolExists(String poolId, BatchPoolExistsOptions options, - RequestConditions requestConditions) { - // Generated convenience method for poolExistsWithResponse - RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (ifModifiedSince != null) { requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, @@ -11631,26 +13236,7 @@ public Mono poolExists(String poolId, BatchPoolExistsOptions options, if (ifNoneMatch != null) { requestOptions.setHeader(HttpHeaderName.IF_NONE_MATCH, ifNoneMatch); } - return poolExistsWithResponse(poolId, requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * Gets basic properties of a Pool. - * - * @param poolId The ID of the Pool to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return basic properties of a Pool on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono poolExists(String poolId) { - // Generated convenience method for poolExistsWithResponse - RequestOptions requestOptions = new RequestOptions(); - return poolExistsWithResponse(poolId, requestOptions).flatMap(FluxUtil::toMono); + return deletePoolWithResponse(poolId, requestOptions).flatMap(FluxUtil::toMono); } /** @@ -11669,10 +13255,10 @@ public Mono poolExists(String poolId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getPool(String poolId, GetBatchPoolOptions options, RequestConditions requestConditions) { + public Mono getPool(String poolId, BatchPoolGetOptions options, RequestConditions requestConditions) { // Generated convenience method for getPoolWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); List select = options == null ? null : options.getSelect(); List expand = options == null ? null : options.getExpand(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); @@ -11680,7 +13266,7 @@ public Mono getPool(String poolId, GetBatchPoolOptions options, Reque String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (select != null) { requestOptions.addQueryParam("$select", @@ -11714,27 +13300,6 @@ public Mono getPool(String poolId, GetBatchPoolOptions options, Reque .map(protocolMethodData -> protocolMethodData.toObject(BatchPool.class)); } - /** - * Gets information about the specified Pool. - * - * @param poolId The ID of the Pool to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified Pool on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getPool(String poolId) { - // Generated convenience method for getPoolWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getPoolWithResponse(poolId, requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(BatchPool.class)); - } - /** * Updates the properties of the specified Pool. * @@ -11756,17 +13321,17 @@ public Mono getPool(String poolId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updatePool(String poolId, BatchPoolUpdateContent pool, UpdateBatchPoolOptions options, + public Mono updatePool(String poolId, BatchPoolUpdateParameters pool, BatchPoolUpdateOptions options, RequestConditions requestConditions) { // Generated convenience method for updatePoolWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (ifModifiedSince != null) { requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, @@ -11804,7 +13369,7 @@ public Mono updatePool(String poolId, BatchPoolUpdateContent pool, UpdateB */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updatePool(String poolId, BatchPoolUpdateContent pool) { + public Mono updatePool(String poolId, BatchPoolUpdateParameters pool) { // Generated convenience method for updatePoolWithResponse RequestOptions requestOptions = new RequestOptions(); return updatePoolWithResponse(poolId, BinaryData.fromObject(pool), requestOptions).flatMap(FluxUtil::toMono); @@ -11825,36 +13390,16 @@ public Mono updatePool(String poolId, BatchPoolUpdateContent pool) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono disablePoolAutoScale(String poolId, DisableBatchPoolAutoScaleOptions options) { + public Mono disablePoolAutoScale(String poolId, BatchPoolAutoScaleDisableOptions options) { // Generated convenience method for disablePoolAutoScaleWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } return disablePoolAutoScaleWithResponse(poolId, requestOptions).flatMap(FluxUtil::toMono); } - /** - * Disables automatic scaling for a Pool. - * - * @param poolId The ID of the Pool on which to disable automatic scaling. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono disablePoolAutoScale(String poolId) { - // Generated convenience method for disablePoolAutoScaleWithResponse - RequestOptions requestOptions = new RequestOptions(); - return disablePoolAutoScaleWithResponse(poolId, requestOptions).flatMap(FluxUtil::toMono); - } - /** * Enables automatic scaling for a Pool. * @@ -11866,7 +13411,7 @@ public Mono disablePoolAutoScale(String poolId) { * more than once every 30 seconds. * * @param poolId The ID of the Pool to get. - * @param content The options to use for enabling automatic scaling. + * @param parameters The options to use for enabling automatic scaling. * @param options Optional parameters for Enable Pool AutoScale operation. * @param requestConditions Specifies HTTP options for conditional requests based on modification time. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -11879,17 +13424,17 @@ public Mono disablePoolAutoScale(String poolId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono enablePoolAutoScale(String poolId, BatchPoolEnableAutoScaleContent content, - EnableBatchPoolAutoScaleOptions options, RequestConditions requestConditions) { + public Mono enablePoolAutoScale(String poolId, BatchPoolAutoScaleEnableParameters parameters, + BatchPoolAutoScaleEnableOptions options, RequestConditions requestConditions) { // Generated convenience method for enablePoolAutoScaleWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (ifModifiedSince != null) { requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, @@ -11905,7 +13450,7 @@ public Mono enablePoolAutoScale(String poolId, BatchPoolEnableAutoScaleCon if (ifNoneMatch != null) { requestOptions.setHeader(HttpHeaderName.IF_NONE_MATCH, ifNoneMatch); } - return enablePoolAutoScaleWithResponse(poolId, BinaryData.fromObject(content), requestOptions) + return enablePoolAutoScaleWithResponse(poolId, BinaryData.fromObject(parameters), requestOptions) .flatMap(FluxUtil::toMono); } @@ -11920,7 +13465,7 @@ public Mono enablePoolAutoScale(String poolId, BatchPoolEnableAutoScaleCon * more than once every 30 seconds. * * @param poolId The ID of the Pool to get. - * @param content The options to use for enabling automatic scaling. + * @param parameters The options to use for enabling automatic scaling. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -11931,10 +13476,10 @@ public Mono enablePoolAutoScale(String poolId, BatchPoolEnableAutoScaleCon */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono enablePoolAutoScale(String poolId, BatchPoolEnableAutoScaleContent content) { + public Mono enablePoolAutoScale(String poolId, BatchPoolAutoScaleEnableParameters parameters) { // Generated convenience method for enablePoolAutoScaleWithResponse RequestOptions requestOptions = new RequestOptions(); - return enablePoolAutoScaleWithResponse(poolId, BinaryData.fromObject(content), requestOptions) + return enablePoolAutoScaleWithResponse(poolId, BinaryData.fromObject(parameters), requestOptions) .flatMap(FluxUtil::toMono); } @@ -11946,7 +13491,7 @@ public Mono enablePoolAutoScale(String poolId, BatchPoolEnableAutoScaleCon * scaling enabled in order to evaluate a formula. * * @param poolId The ID of the Pool on which to evaluate the automatic scaling formula. - * @param content The options to use for evaluating the automatic scaling formula. + * @param parameters The options to use for evaluating the automatic scaling formula. * @param options Optional parameters for Evaluate Pool AutoScale operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -11961,15 +13506,15 @@ public Mono enablePoolAutoScale(String poolId, BatchPoolEnableAutoScaleCon */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono evaluatePoolAutoScale(String poolId, BatchPoolEvaluateAutoScaleContent content, - EvaluateBatchPoolAutoScaleOptions options) { + public Mono evaluatePoolAutoScale(String poolId, BatchPoolAutoScaleEvaluateParameters parameters, + BatchPoolAutoScaleEvaluateOptions options) { // Generated convenience method for evaluatePoolAutoScaleWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } - return evaluatePoolAutoScaleWithResponse(poolId, BinaryData.fromObject(content), requestOptions) + return evaluatePoolAutoScaleWithResponse(poolId, BinaryData.fromObject(parameters), requestOptions) .flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(AutoScaleRun.class)); } @@ -11982,7 +13527,7 @@ public Mono evaluatePoolAutoScale(String poolId, BatchPoolEvaluate * scaling enabled in order to evaluate a formula. * * @param poolId The ID of the Pool on which to evaluate the automatic scaling formula. - * @param content The options to use for evaluating the automatic scaling formula. + * @param parameters The options to use for evaluating the automatic scaling formula. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -11996,10 +13541,10 @@ public Mono evaluatePoolAutoScale(String poolId, BatchPoolEvaluate */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono evaluatePoolAutoScale(String poolId, BatchPoolEvaluateAutoScaleContent content) { + public Mono evaluatePoolAutoScale(String poolId, BatchPoolAutoScaleEvaluateParameters parameters) { // Generated convenience method for evaluatePoolAutoScaleWithResponse RequestOptions requestOptions = new RequestOptions(); - return evaluatePoolAutoScaleWithResponse(poolId, BinaryData.fromObject(content), requestOptions) + return evaluatePoolAutoScaleWithResponse(poolId, BinaryData.fromObject(parameters), requestOptions) .flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(AutoScaleRun.class)); } @@ -12016,7 +13561,7 @@ public Mono evaluatePoolAutoScale(String poolId, BatchPoolEvaluate * Nodes, use the Pool remove Compute Nodes API instead. * * @param poolId The ID of the Pool to get. - * @param content The options to use for resizing the pool. + * @param parameters The options to use for resizing the pool. * @param options Optional parameters for Resize Pool operation. * @param requestConditions Specifies HTTP options for conditional requests based on modification time. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -12029,17 +13574,17 @@ public Mono evaluatePoolAutoScale(String poolId, BatchPoolEvaluate */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono resizePool(String poolId, BatchPoolResizeContent content, ResizeBatchPoolOptions options, + public Mono resizePool(String poolId, BatchPoolResizeParameters parameters, BatchPoolResizeOptions options, RequestConditions requestConditions) { // Generated convenience method for resizePoolWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (ifModifiedSince != null) { requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, @@ -12055,7 +13600,8 @@ public Mono resizePool(String poolId, BatchPoolResizeContent content, Resi if (ifNoneMatch != null) { requestOptions.setHeader(HttpHeaderName.IF_NONE_MATCH, ifNoneMatch); } - return resizePoolWithResponse(poolId, BinaryData.fromObject(content), requestOptions).flatMap(FluxUtil::toMono); + return resizePoolWithResponse(poolId, BinaryData.fromObject(parameters), requestOptions) + .flatMap(FluxUtil::toMono); } /** @@ -12070,7 +13616,7 @@ public Mono resizePool(String poolId, BatchPoolResizeContent content, Resi * Nodes, use the Pool remove Compute Nodes API instead. * * @param poolId The ID of the Pool to get. - * @param content The options to use for resizing the pool. + * @param parameters The options to use for resizing the pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -12081,10 +13627,11 @@ public Mono resizePool(String poolId, BatchPoolResizeContent content, Resi */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono resizePool(String poolId, BatchPoolResizeContent content) { + public Mono resizePool(String poolId, BatchPoolResizeParameters parameters) { // Generated convenience method for resizePoolWithResponse RequestOptions requestOptions = new RequestOptions(); - return resizePoolWithResponse(poolId, BinaryData.fromObject(content), requestOptions).flatMap(FluxUtil::toMono); + return resizePoolWithResponse(poolId, BinaryData.fromObject(parameters), requestOptions) + .flatMap(FluxUtil::toMono); } /** @@ -12111,17 +13658,17 @@ public Mono resizePool(String poolId, BatchPoolResizeContent content) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono stopPoolResize(String poolId, StopBatchPoolResizeOptions options, + public Mono stopPoolResize(String poolId, BatchPoolResizeStopOptions options, RequestConditions requestConditions) { // Generated convenience method for stopPoolResizeWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (ifModifiedSince != null) { requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, @@ -12140,34 +13687,6 @@ public Mono stopPoolResize(String poolId, StopBatchPoolResizeOptions optio return stopPoolResizeWithResponse(poolId, requestOptions).flatMap(FluxUtil::toMono); } - /** - * Stops an ongoing resize operation on the Pool. - * - * This does not restore the Pool to its previous state before the resize - * operation: it only stops any further changes being made, and the Pool maintains - * its current state. After stopping, the Pool stabilizes at the number of Compute - * Nodes it was at when the stop operation was done. During the stop operation, - * the Pool allocation state changes first to stopping and then to steady. A - * resize operation need not be an explicit resize Pool request; this API can also - * be used to halt the initial sizing of the Pool when it is created. - * - * @param poolId The ID of the Pool to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono stopPoolResize(String poolId) { - // Generated convenience method for stopPoolResizeWithResponse - RequestOptions requestOptions = new RequestOptions(); - return stopPoolResizeWithResponse(poolId, requestOptions).flatMap(FluxUtil::toMono); - } - /** * Updates the properties of the specified Pool. * @@ -12188,13 +13707,13 @@ public Mono stopPoolResize(String poolId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono replacePoolProperties(String poolId, BatchPoolReplaceContent pool, - ReplaceBatchPoolPropertiesOptions options) { + public Mono replacePoolProperties(String poolId, BatchPoolReplaceParameters pool, + BatchPoolPropertiesReplaceOptions options) { // Generated convenience method for replacePoolPropertiesWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } return replacePoolPropertiesWithResponse(poolId, BinaryData.fromObject(pool), requestOptions) .flatMap(FluxUtil::toMono); @@ -12219,7 +13738,7 @@ public Mono replacePoolProperties(String poolId, BatchPoolReplaceContent p */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono replacePoolProperties(String poolId, BatchPoolReplaceContent pool) { + public Mono replacePoolProperties(String poolId, BatchPoolReplaceParameters pool) { // Generated convenience method for replacePoolPropertiesWithResponse RequestOptions requestOptions = new RequestOptions(); return replacePoolPropertiesWithResponse(poolId, BinaryData.fromObject(pool), requestOptions) @@ -12234,7 +13753,7 @@ public Mono replacePoolProperties(String poolId, BatchPoolReplaceContent p * Each request may remove up to 100 nodes. * * @param poolId The ID of the Pool to get. - * @param content The options to use for removing the node. + * @param parameters The options to use for removing the node. * @param options Optional parameters for Remove Nodes operation. * @param requestConditions Specifies HTTP options for conditional requests based on modification time. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -12247,17 +13766,17 @@ public Mono replacePoolProperties(String poolId, BatchPoolReplaceContent p */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono removeNodes(String poolId, BatchNodeRemoveContent content, RemoveBatchNodesOptions options, + public Mono removeNodes(String poolId, BatchNodeRemoveParameters parameters, BatchNodesRemoveOptions options, RequestConditions requestConditions) { // Generated convenience method for removeNodesWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (ifModifiedSince != null) { requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, @@ -12273,7 +13792,7 @@ public Mono removeNodes(String poolId, BatchNodeRemoveContent content, Rem if (ifNoneMatch != null) { requestOptions.setHeader(HttpHeaderName.IF_NONE_MATCH, ifNoneMatch); } - return removeNodesWithResponse(poolId, BinaryData.fromObject(content), requestOptions) + return removeNodesWithResponse(poolId, BinaryData.fromObject(parameters), requestOptions) .flatMap(FluxUtil::toMono); } @@ -12285,134 +13804,60 @@ public Mono removeNodes(String poolId, BatchNodeRemoveContent content, Rem * Each request may remove up to 100 nodes. * * @param poolId The ID of the Pool to get. - * @param content The options to use for removing the node. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono removeNodes(String poolId, BatchNodeRemoveContent content) { - // Generated convenience method for removeNodesWithResponse - RequestOptions requestOptions = new RequestOptions(); - return removeNodesWithResponse(poolId, BinaryData.fromObject(content), requestOptions) - .flatMap(FluxUtil::toMono); - } - - /** - * Lists all Virtual Machine Images supported by the Azure Batch service. - * - * @param options Optional parameters for List Supported Images operation. + * @param parameters The options to use for removing the node. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of listing the supported Virtual Machine Images as paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listSupportedImages(ListSupportedBatchImagesOptions options) { - // Generated convenience method for listSupportedImages - RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); - String filter = options == null ? null : options.getFilter(); - if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); - } - if (filter != null) { - requestOptions.addQueryParam("$filter", filter, false); - } - PagedFlux pagedFluxResponse = listSupportedImages(requestOptions); - return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { - Flux> flux = (continuationTokenParam == null) - ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationTokenParam).take(1); - return flux - .map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), - pagedResponse.getStatusCode(), pagedResponse.getHeaders(), - pagedResponse.getValue() - .stream() - .map(protocolMethodData -> protocolMethodData.toObject(BatchSupportedImage.class)) - .collect(Collectors.toList()), - pagedResponse.getContinuationToken(), null)); - }); - } - - /** - * Lists all Virtual Machine Images supported by the Azure Batch service. - * - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of listing the supported Virtual Machine Images as paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listSupportedImages() { - // Generated convenience method for listSupportedImages - RequestOptions requestOptions = new RequestOptions(); - PagedFlux pagedFluxResponse = listSupportedImages(requestOptions); - return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { - Flux> flux = (continuationTokenParam == null) - ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationTokenParam).take(1); - return flux - .map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), - pagedResponse.getStatusCode(), pagedResponse.getHeaders(), - pagedResponse.getValue() - .stream() - .map(protocolMethodData -> protocolMethodData.toObject(BatchSupportedImage.class)) - .collect(Collectors.toList()), - pagedResponse.getContinuationToken(), null)); - }); + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono removeNodes(String poolId, BatchNodeRemoveParameters parameters) { + // Generated convenience method for removeNodesWithResponse + RequestOptions requestOptions = new RequestOptions(); + return removeNodesWithResponse(poolId, BinaryData.fromObject(parameters), requestOptions) + .flatMap(FluxUtil::toMono); } /** - * Gets the number of Compute Nodes in each state, grouped by Pool. Note that the - * numbers returned may not always be up to date. If you need exact node counts, - * use a list query. + * Lists all Virtual Machine Images supported by the Azure Batch service. * - * @param options Optional parameters for List Pool Node Counts operation. + * @param options Optional parameters for List Supported Images operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the number of Compute Nodes in each state, grouped by Pool as paginated response with {@link PagedFlux}. + * @return the result of listing the supported Virtual Machine Images as paginated response with {@link PagedFlux}. */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listPoolNodeCounts(ListBatchPoolNodeCountsOptions options) { - // Generated convenience method for listPoolNodeCounts + public PagedFlux listSupportedImages(SupportedBatchImagesListOptions options) { + // Generated convenience method for listSupportedImages RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); String filter = options == null ? null : options.getFilter(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (filter != null) { requestOptions.addQueryParam("$filter", filter, false); } - PagedFlux pagedFluxResponse = listPoolNodeCounts(requestOptions); + PagedFlux pagedFluxResponse = listSupportedImages(requestOptions); return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { Flux> flux = (continuationTokenParam == null) ? pagedFluxResponse.byPage().take(1) : pagedFluxResponse.byPage(continuationTokenParam).take(1); return flux - .map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + .map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() .stream() - .map(protocolMethodData -> protocolMethodData.toObject(BatchPoolNodeCounts.class)) + .map(protocolMethodData -> protocolMethodData.toObject(BatchSupportedImage.class)) .collect(Collectors.toList()), pagedResponse.getContinuationToken(), null)); }); @@ -12423,6 +13868,8 @@ public PagedFlux listPoolNodeCounts(ListBatchPoolNodeCounts * numbers returned may not always be up to date. If you need exact node counts, * use a list query. * + * @param options Optional parameters for List Pool Node Counts operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. @@ -12432,9 +13879,17 @@ public PagedFlux listPoolNodeCounts(ListBatchPoolNodeCounts */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listPoolNodeCounts() { + public PagedFlux listPoolNodeCounts(BatchPoolNodeCountsListOptions options) { // Generated convenience method for listPoolNodeCounts RequestOptions requestOptions = new RequestOptions(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + String filter = options == null ? null : options.getFilter(); + if (timeOutInSeconds != null) { + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); + } + if (filter != null) { + requestOptions.addQueryParam("$filter", filter, false); + } PagedFlux pagedFluxResponse = listPoolNodeCounts(requestOptions); return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { Flux> flux = (continuationTokenParam == null) @@ -12476,17 +13931,17 @@ public PagedFlux listPoolNodeCounts() { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteJob(String jobId, DeleteBatchJobOptions options, RequestConditions requestConditions) { + public Mono deleteJob(String jobId, BatchJobDeleteOptions options, RequestConditions requestConditions) { // Generated convenience method for deleteJobWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); Boolean force = options == null ? null : options.isForce(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (force != null) { requestOptions.addQueryParam("force", String.valueOf(force), false); @@ -12508,35 +13963,6 @@ public Mono deleteJob(String jobId, DeleteBatchJobOptions options, Request return deleteJobWithResponse(jobId, requestOptions).flatMap(FluxUtil::toMono); } - /** - * Deletes a Job. - * - * Deleting a Job also deletes all Tasks that are part of that Job, and all Job - * statistics. This also overrides the retention period for Task data; that is, if - * the Job contains Tasks which are still retained on Compute Nodes, the Batch - * services deletes those Tasks' working directories and all their contents. When - * a Delete Job request is received, the Batch service sets the Job to the - * deleting state. All update operations on a Job that is in deleting state will - * fail with status code 409 (Conflict), with additional information indicating - * that the Job is being deleted. - * - * @param jobId The ID of the Job to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteJob(String jobId) { - // Generated convenience method for deleteJobWithResponse - RequestOptions requestOptions = new RequestOptions(); - return deleteJobWithResponse(jobId, requestOptions).flatMap(FluxUtil::toMono); - } - /** * Gets information about the specified Job. * @@ -12553,10 +13979,10 @@ public Mono deleteJob(String jobId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getJob(String jobId, GetBatchJobOptions options, RequestConditions requestConditions) { + public Mono getJob(String jobId, BatchJobGetOptions options, RequestConditions requestConditions) { // Generated convenience method for getJobWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); List select = options == null ? null : options.getSelect(); List expand = options == null ? null : options.getExpand(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); @@ -12564,7 +13990,7 @@ public Mono getJob(String jobId, GetBatchJobOptions options, RequestCo String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (select != null) { requestOptions.addQueryParam("$select", @@ -12598,27 +14024,6 @@ public Mono getJob(String jobId, GetBatchJobOptions options, RequestCo .map(protocolMethodData -> protocolMethodData.toObject(BatchJob.class)); } - /** - * Gets information about the specified Job. - * - * @param jobId The ID of the Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified Job on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getJob(String jobId) { - // Generated convenience method for getJobWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getJobWithResponse(jobId, requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(BatchJob.class)); - } - /** * Updates the properties of the specified Job. * @@ -12640,17 +14045,17 @@ public Mono getJob(String jobId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateJob(String jobId, BatchJobUpdateContent job, UpdateBatchJobOptions options, + public Mono updateJob(String jobId, BatchJobUpdateParameters job, BatchJobUpdateOptions options, RequestConditions requestConditions) { // Generated convenience method for updateJobWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (ifModifiedSince != null) { requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, @@ -12688,7 +14093,7 @@ public Mono updateJob(String jobId, BatchJobUpdateContent job, UpdateBatch */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateJob(String jobId, BatchJobUpdateContent job) { + public Mono updateJob(String jobId, BatchJobUpdateParameters job) { // Generated convenience method for updateJobWithResponse RequestOptions requestOptions = new RequestOptions(); return updateJobWithResponse(jobId, BinaryData.fromObject(job), requestOptions).flatMap(FluxUtil::toMono); @@ -12715,17 +14120,17 @@ public Mono updateJob(String jobId, BatchJobUpdateContent job) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono replaceJob(String jobId, BatchJob job, ReplaceBatchJobOptions options, + public Mono replaceJob(String jobId, BatchJob job, BatchJobReplaceOptions options, RequestConditions requestConditions) { // Generated convenience method for replaceJobWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (ifModifiedSince != null) { requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, @@ -12744,31 +14149,6 @@ public Mono replaceJob(String jobId, BatchJob job, ReplaceBatchJobOptions return replaceJobWithResponse(jobId, BinaryData.fromObject(job), requestOptions).flatMap(FluxUtil::toMono); } - /** - * Updates the properties of the specified Job. - * - * This fully replaces all the updatable properties of the Job. For example, if - * the Job has constraints associated with it and if constraints is not specified - * with this request, then the Batch service will remove the existing constraints. - * - * @param jobId The ID of the Job whose properties you want to update. - * @param job A job with updated properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono replaceJob(String jobId, BatchJob job) { - // Generated convenience method for replaceJobWithResponse - RequestOptions requestOptions = new RequestOptions(); - return replaceJobWithResponse(jobId, BinaryData.fromObject(job), requestOptions).flatMap(FluxUtil::toMono); - } - /** * Disables the specified Job, preventing new Tasks from running. * @@ -12782,7 +14162,7 @@ public Mono replaceJob(String jobId, BatchJob job) { * the request fails with status code 409. * * @param jobId The ID of the Job to disable. - * @param content The options to use for disabling the Job. + * @param parameters The options to use for disabling the Job. * @param options Optional parameters for Disable Job operation. * @param requestConditions Specifies HTTP options for conditional requests based on modification time. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -12795,17 +14175,17 @@ public Mono replaceJob(String jobId, BatchJob job) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono disableJob(String jobId, BatchJobDisableContent content, DisableBatchJobOptions options, + public Mono disableJob(String jobId, BatchJobDisableParameters parameters, BatchJobDisableOptions options, RequestConditions requestConditions) { // Generated convenience method for disableJobWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (ifModifiedSince != null) { requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, @@ -12821,7 +14201,8 @@ public Mono disableJob(String jobId, BatchJobDisableContent content, Disab if (ifNoneMatch != null) { requestOptions.setHeader(HttpHeaderName.IF_NONE_MATCH, ifNoneMatch); } - return disableJobWithResponse(jobId, BinaryData.fromObject(content), requestOptions).flatMap(FluxUtil::toMono); + return disableJobWithResponse(jobId, BinaryData.fromObject(parameters), requestOptions) + .flatMap(FluxUtil::toMono); } /** @@ -12837,7 +14218,7 @@ public Mono disableJob(String jobId, BatchJobDisableContent content, Disab * the request fails with status code 409. * * @param jobId The ID of the Job to disable. - * @param content The options to use for disabling the Job. + * @param parameters The options to use for disabling the Job. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -12848,10 +14229,11 @@ public Mono disableJob(String jobId, BatchJobDisableContent content, Disab */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono disableJob(String jobId, BatchJobDisableContent content) { + public Mono disableJob(String jobId, BatchJobDisableParameters parameters) { // Generated convenience method for disableJobWithResponse RequestOptions requestOptions = new RequestOptions(); - return disableJobWithResponse(jobId, BinaryData.fromObject(content), requestOptions).flatMap(FluxUtil::toMono); + return disableJobWithResponse(jobId, BinaryData.fromObject(parameters), requestOptions) + .flatMap(FluxUtil::toMono); } /** @@ -12877,16 +14259,16 @@ public Mono disableJob(String jobId, BatchJobDisableContent content) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono enableJob(String jobId, EnableBatchJobOptions options, RequestConditions requestConditions) { + public Mono enableJob(String jobId, BatchJobEnableOptions options, RequestConditions requestConditions) { // Generated convenience method for enableJobWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (ifModifiedSince != null) { requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, @@ -12905,33 +14287,6 @@ public Mono enableJob(String jobId, EnableBatchJobOptions options, Request return enableJobWithResponse(jobId, requestOptions).flatMap(FluxUtil::toMono); } - /** - * Enables the specified Job, allowing new Tasks to run. - * - * When you call this API, the Batch service sets a disabled Job to the enabling - * state. After the this operation is completed, the Job moves to the active - * state, and scheduling of new Tasks under the Job resumes. The Batch service - * does not allow a Task to remain in the active state for more than 180 days. - * Therefore, if you enable a Job containing active Tasks which were added more - * than 180 days ago, those Tasks will not run. - * - * @param jobId The ID of the Job to enable. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono enableJob(String jobId) { - // Generated convenience method for enableJobWithResponse - RequestOptions requestOptions = new RequestOptions(); - return enableJobWithResponse(jobId, requestOptions).flatMap(FluxUtil::toMono); - } - /** * Terminates the specified Job, marking it as completed. * @@ -12955,19 +14310,19 @@ public Mono enableJob(String jobId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono terminateJob(String jobId, TerminateBatchJobOptions options, + public Mono terminateJob(String jobId, BatchJobTerminateOptions options, RequestConditions requestConditions) { // Generated convenience method for terminateJobWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); - BatchJobTerminateContent parameters = options == null ? null : options.getParameters(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + BatchJobTerminateParameters parameters = options == null ? null : options.getParameters(); Boolean force = options == null ? null : options.isForce(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (parameters != null) { requestOptions.setBody(BinaryData.fromObject(parameters)); @@ -12992,33 +14347,6 @@ public Mono terminateJob(String jobId, TerminateBatchJobOptions options, return terminateJobWithResponse(jobId, requestOptions).flatMap(FluxUtil::toMono); } - /** - * Terminates the specified Job, marking it as completed. - * - * When a Terminate Job request is received, the Batch service sets the Job to the - * terminating state. The Batch service then terminates any running Tasks - * associated with the Job and runs any required Job release Tasks. Then the Job - * moves into the completed state. If there are any Tasks in the Job in the active - * state, they will remain in the active state. Once a Job is terminated, new - * Tasks cannot be added and any remaining active Tasks will not be scheduled. - * - * @param jobId The ID of the Job to terminate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono terminateJob(String jobId) { - // Generated convenience method for terminateJobWithResponse - RequestOptions requestOptions = new RequestOptions(); - return terminateJobWithResponse(jobId, requestOptions).flatMap(FluxUtil::toMono); - } - /** * Creates a Job to the specified Account. * @@ -13044,12 +14372,12 @@ public Mono terminateJob(String jobId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createJob(BatchJobCreateContent job, CreateBatchJobOptions options) { + public Mono createJob(BatchJobCreateParameters job, BatchJobCreateOptions options) { // Generated convenience method for createJobWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } return createJobWithResponse(BinaryData.fromObject(job), requestOptions).flatMap(FluxUtil::toMono); } @@ -13068,113 +14396,26 @@ public Mono createJob(BatchJobCreateContent job, CreateBatchJobOptions opt * engineers. * * @param job The Job to be created. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createJob(BatchJobCreateContent job) { - // Generated convenience method for createJobWithResponse - RequestOptions requestOptions = new RequestOptions(); - return createJobWithResponse(BinaryData.fromObject(job), requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * Lists all of the Jobs in the specified Account. - * - * @param options Optional parameters for List Jobs operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of listing the Jobs in an Account as paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listJobs(ListBatchJobsOptions options) { - // Generated convenience method for listJobs - RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); - String filter = options == null ? null : options.getFilter(); - List select = options == null ? null : options.getSelect(); - List expand = options == null ? null : options.getExpand(); - if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); - } - if (filter != null) { - requestOptions.addQueryParam("$filter", filter, false); - } - if (select != null) { - requestOptions.addQueryParam("$select", - select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")), - false); - } - if (expand != null) { - requestOptions.addQueryParam("$expand", - expand.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")), - false); - } - PagedFlux pagedFluxResponse = listJobs(requestOptions); - return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { - Flux> flux = (continuationTokenParam == null) - ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationTokenParam).take(1); - return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), - pagedResponse.getStatusCode(), pagedResponse.getHeaders(), - pagedResponse.getValue() - .stream() - .map(protocolMethodData -> protocolMethodData.toObject(BatchJob.class)) - .collect(Collectors.toList()), - pagedResponse.getContinuationToken(), null)); - }); - } - - /** - * Lists all of the Jobs in the specified Account. - * + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of listing the Jobs in an Account as paginated response with {@link PagedFlux}. + * @return A {@link Mono} that completes when a successful response is received. */ @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listJobs() { - // Generated convenience method for listJobs + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createJob(BatchJobCreateParameters job) { + // Generated convenience method for createJobWithResponse RequestOptions requestOptions = new RequestOptions(); - PagedFlux pagedFluxResponse = listJobs(requestOptions); - return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { - Flux> flux = (continuationTokenParam == null) - ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationTokenParam).take(1); - return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), - pagedResponse.getStatusCode(), pagedResponse.getHeaders(), - pagedResponse.getValue() - .stream() - .map(protocolMethodData -> protocolMethodData.toObject(BatchJob.class)) - .collect(Collectors.toList()), - pagedResponse.getContinuationToken(), null)); - }); + return createJobWithResponse(BinaryData.fromObject(job), requestOptions).flatMap(FluxUtil::toMono); } /** - * Lists the Jobs that have been created under the specified Job Schedule. + * Lists all of the Jobs in the specified Account. * - * @param jobScheduleId The ID of the Job Schedule from which you want to get a list of Jobs. - * @param options Optional parameters for List Jobs From Schedule operation. + * @param options Optional parameters for List Jobs operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -13185,15 +14426,15 @@ public PagedFlux listJobs() { */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listJobsFromSchedule(String jobScheduleId, ListBatchJobsFromScheduleOptions options) { - // Generated convenience method for listJobsFromSchedule + public PagedFlux listJobs(BatchJobsListOptions options) { + // Generated convenience method for listJobs RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); String filter = options == null ? null : options.getFilter(); List select = options == null ? null : options.getSelect(); List expand = options == null ? null : options.getExpand(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (filter != null) { requestOptions.addQueryParam("$filter", filter, false); @@ -13212,7 +14453,7 @@ public PagedFlux listJobsFromSchedule(String jobScheduleId, ListBatchJ .collect(Collectors.joining(",")), false); } - PagedFlux pagedFluxResponse = listJobsFromSchedule(jobScheduleId, requestOptions); + PagedFlux pagedFluxResponse = listJobs(requestOptions); return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { Flux> flux = (continuationTokenParam == null) ? pagedFluxResponse.byPage().take(1) @@ -13231,6 +14472,7 @@ public PagedFlux listJobsFromSchedule(String jobScheduleId, ListBatchJ * Lists the Jobs that have been created under the specified Job Schedule. * * @param jobScheduleId The ID of the Job Schedule from which you want to get a list of Jobs. + * @param options Optional parameters for List Jobs From Schedule operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -13241,9 +14483,33 @@ public PagedFlux listJobsFromSchedule(String jobScheduleId, ListBatchJ */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listJobsFromSchedule(String jobScheduleId) { + public PagedFlux listJobsFromSchedule(String jobScheduleId, BatchJobsFromScheduleListOptions options) { // Generated convenience method for listJobsFromSchedule RequestOptions requestOptions = new RequestOptions(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + String filter = options == null ? null : options.getFilter(); + List select = options == null ? null : options.getSelect(); + List expand = options == null ? null : options.getExpand(); + if (timeOutInSeconds != null) { + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); + } + if (filter != null) { + requestOptions.addQueryParam("$filter", filter, false); + } + if (select != null) { + requestOptions.addQueryParam("$select", + select.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")), + false); + } + if (expand != null) { + requestOptions.addQueryParam("$expand", + expand.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")), + false); + } PagedFlux pagedFluxResponse = listJobsFromSchedule(jobScheduleId, requestOptions); return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { Flux> flux = (continuationTokenParam == null) @@ -13284,14 +14550,14 @@ public PagedFlux listJobsFromSchedule(String jobScheduleId) { @Generated @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listJobPreparationAndReleaseTaskStatus(String jobId, - ListBatchJobPreparationAndReleaseTaskStatusOptions options) { + BatchJobPreparationAndReleaseTaskStatusListOptions options) { // Generated convenience method for listJobPreparationAndReleaseTaskStatus RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); String filter = options == null ? null : options.getFilter(); List select = options == null ? null : options.getSelect(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (filter != null) { requestOptions.addQueryParam("$filter", filter, false); @@ -13319,48 +14585,6 @@ public PagedFlux listJobPreparationAndR }); } - /** - * Lists the execution status of the Job Preparation and Job Release Task for the - * specified Job across the Compute Nodes where the Job has run. - * - * This API returns the Job Preparation and Job Release Task status on all Compute - * Nodes that have run the Job Preparation or Job Release Task. This includes - * Compute Nodes which have since been removed from the Pool. If this API is - * invoked on a Job which has no Job Preparation or Job Release Task, the Batch - * service returns HTTP status code 409 (Conflict) with an error code of - * JobPreparationTaskNotSpecified. - * - * @param jobId The ID of the Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of listing the status of the Job Preparation and Job Release Tasks - * for a Job as paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listJobPreparationAndReleaseTaskStatus(String jobId) { - // Generated convenience method for listJobPreparationAndReleaseTaskStatus - RequestOptions requestOptions = new RequestOptions(); - PagedFlux pagedFluxResponse = listJobPreparationAndReleaseTaskStatus(jobId, requestOptions); - return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { - Flux> flux = (continuationTokenParam == null) - ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationTokenParam).take(1); - return flux.map(pagedResponse -> new PagedResponseBase( - pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), - pagedResponse.getValue() - .stream() - .map(protocolMethodData -> protocolMethodData - .toObject(BatchJobPreparationAndReleaseTaskStatus.class)) - .collect(Collectors.toList()), - pagedResponse.getContinuationToken(), null)); - }); - } - /** * Gets the Task counts for the specified Job. * @@ -13384,46 +14608,17 @@ public PagedFlux listJobPreparationAndR */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getJobTaskCounts(String jobId, GetBatchJobTaskCountsOptions options) { + public Mono getJobTaskCounts(String jobId, BatchJobTaskCountsGetOptions options) { // Generated convenience method for getJobTaskCountsWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } return getJobTaskCountsWithResponse(jobId, requestOptions).flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(BatchTaskCountsResult.class)); } - /** - * Gets the Task counts for the specified Job. - * - * Task counts provide a count of the Tasks by active, running or completed Task - * state, and a count of Tasks which succeeded or failed. Tasks in the preparing - * state are counted as running. Note that the numbers returned may not always be - * up to date. If you need exact task counts, use a list query. - * - * @param jobId The ID of the Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Task counts for the specified Job. - * - * Task counts provide a count of the Tasks by active, running or completed Task - * state, and a count of Tasks which succeeded or failed on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getJobTaskCounts(String jobId) { - // Generated convenience method for getJobTaskCountsWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getJobTaskCountsWithResponse(jobId, requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(BatchTaskCountsResult.class)); - } - /** * Creates a Certificate to the specified Account. * @@ -13439,38 +14634,17 @@ public Mono getJobTaskCounts(String jobId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createCertificate(BatchCertificate certificate, CreateBatchCertificateOptions options) { + public Mono createCertificate(BatchCertificate certificate, BatchCertificateCreateOptions options) { // Generated convenience method for createCertificateWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } return createCertificateWithResponse(BinaryData.fromObject(certificate), requestOptions) .flatMap(FluxUtil::toMono); } - /** - * Creates a Certificate to the specified Account. - * - * @param certificate The Certificate to be created. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createCertificate(BatchCertificate certificate) { - // Generated convenience method for createCertificateWithResponse - RequestOptions requestOptions = new RequestOptions(); - return createCertificateWithResponse(BinaryData.fromObject(certificate), requestOptions) - .flatMap(FluxUtil::toMono); - } - /** * Lists all of the Certificates that have been added to the specified Account. * @@ -13485,14 +14659,14 @@ public Mono createCertificate(BatchCertificate certificate) { */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listCertificates(ListBatchCertificatesOptions options) { + public PagedFlux listCertificates(BatchCertificatesListOptions options) { // Generated convenience method for listCertificates RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); String filter = options == null ? null : options.getFilter(); List select = options == null ? null : options.getSelect(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (filter != null) { requestOptions.addQueryParam("$filter", filter, false); @@ -13519,72 +14693,6 @@ public PagedFlux listCertificates(ListBatchCertificatesOptions }); } - /** - * Lists all of the Certificates that have been added to the specified Account. - * - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of listing the Certificates in the Account as paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listCertificates() { - // Generated convenience method for listCertificates - RequestOptions requestOptions = new RequestOptions(); - PagedFlux pagedFluxResponse = listCertificates(requestOptions); - return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { - Flux> flux = (continuationTokenParam == null) - ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationTokenParam).take(1); - return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), - pagedResponse.getStatusCode(), pagedResponse.getHeaders(), - pagedResponse.getValue() - .stream() - .map(protocolMethodData -> protocolMethodData.toObject(BatchCertificate.class)) - .collect(Collectors.toList()), - pagedResponse.getContinuationToken(), null)); - }); - } - - /** - * Cancels a failed deletion of a Certificate from the specified Account. - * - * If you try to delete a Certificate that is being used by a Pool or Compute - * Node, the status of the Certificate changes to deleteFailed. If you decide that - * you want to continue using the Certificate, you can use this operation to set - * the status of the Certificate back to active. If you intend to delete the - * Certificate, you do not need to run this operation after the deletion failed. - * You must make sure that the Certificate is not being used by any resources, and - * then you can try again to delete the Certificate. - * - * @param thumbprintAlgorithm The algorithm used to derive the thumbprint parameter. This must be sha1. - * @param thumbprint The thumbprint of the Certificate being deleted. - * @param options Optional parameters for Cancel Certificate Deletion operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono cancelCertificateDeletion(String thumbprintAlgorithm, String thumbprint, - CancelBatchCertificateDeletionOptions options) { - // Generated convenience method for cancelCertificateDeletionWithResponse - RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); - if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); - } - return cancelCertificateDeletionWithResponse(thumbprintAlgorithm, thumbprint, requestOptions) - .flatMap(FluxUtil::toMono); - } - /** * Cancels a failed deletion of a Certificate from the specified Account. * @@ -13593,44 +14701,12 @@ public Mono cancelCertificateDeletion(String thumbprintAlgorithm, String t * you want to continue using the Certificate, you can use this operation to set * the status of the Certificate back to active. If you intend to delete the * Certificate, you do not need to run this operation after the deletion failed. - * You must make sure that the Certificate is not being used by any resources, and - * then you can try again to delete the Certificate. - * - * @param thumbprintAlgorithm The algorithm used to derive the thumbprint parameter. This must be sha1. - * @param thumbprint The thumbprint of the Certificate being deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono cancelCertificateDeletion(String thumbprintAlgorithm, String thumbprint) { - // Generated convenience method for cancelCertificateDeletionWithResponse - RequestOptions requestOptions = new RequestOptions(); - return cancelCertificateDeletionWithResponse(thumbprintAlgorithm, thumbprint, requestOptions) - .flatMap(FluxUtil::toMono); - } - - /** - * Deletes a Certificate from the specified Account. - * - * You cannot delete a Certificate if a resource (Pool or Compute Node) is using - * it. Before you can delete a Certificate, you must therefore make sure that the - * Certificate is not associated with any existing Pools, the Certificate is not - * installed on any Nodes (even if you remove a Certificate from a Pool, it is not - * removed from existing Compute Nodes in that Pool until they restart), and no - * running Tasks depend on the Certificate. If you try to delete a Certificate - * that is in use, the deletion fails. The Certificate status changes to - * deleteFailed. You can use Cancel Delete Certificate to set the status back to - * active if you decide that you want to continue using the Certificate. + * You must make sure that the Certificate is not being used by any resources, and + * then you can try again to delete the Certificate. * * @param thumbprintAlgorithm The algorithm used to derive the thumbprint parameter. This must be sha1. - * @param thumbprint The thumbprint of the Certificate to be deleted. - * @param options Optional parameters for Delete Certificate operation. + * @param thumbprint The thumbprint of the Certificate being deleted. + * @param options Optional parameters for Cancel Certificate Deletion operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -13641,15 +14717,16 @@ public Mono cancelCertificateDeletion(String thumbprintAlgorithm, String t */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteCertificate(String thumbprintAlgorithm, String thumbprint, - DeleteBatchCertificateOptions options) { - // Generated convenience method for deleteCertificateWithResponse + public Mono cancelCertificateDeletion(String thumbprintAlgorithm, String thumbprint, + BatchCertificateCancelDeletionOptions options) { + // Generated convenience method for cancelCertificateDeletionWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } - return deleteCertificateWithResponse(thumbprintAlgorithm, thumbprint, requestOptions).flatMap(FluxUtil::toMono); + return cancelCertificateDeletionWithResponse(thumbprintAlgorithm, thumbprint, requestOptions) + .flatMap(FluxUtil::toMono); } /** @@ -13667,6 +14744,7 @@ public Mono deleteCertificate(String thumbprintAlgorithm, String thumbprin * * @param thumbprintAlgorithm The algorithm used to derive the thumbprint parameter. This must be sha1. * @param thumbprint The thumbprint of the Certificate to be deleted. + * @param options Optional parameters for Delete Certificate operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -13677,9 +14755,14 @@ public Mono deleteCertificate(String thumbprintAlgorithm, String thumbprin */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteCertificate(String thumbprintAlgorithm, String thumbprint) { + public Mono deleteCertificate(String thumbprintAlgorithm, String thumbprint, + BatchCertificateDeleteOptions options) { // Generated convenience method for deleteCertificateWithResponse RequestOptions requestOptions = new RequestOptions(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + if (timeOutInSeconds != null) { + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); + } return deleteCertificateWithResponse(thumbprintAlgorithm, thumbprint, requestOptions).flatMap(FluxUtil::toMono); } @@ -13699,14 +14782,14 @@ public Mono deleteCertificate(String thumbprintAlgorithm, String thumbprin */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getCertificate(String thumbprintAlgorithm, String thumbprint, - GetBatchCertificateOptions options) { + public Mono getCertificate(String thumbprintAlgorithm, String thumbprint, + BatchCertificateGetOptions options) { // Generated convenience method for getCertificateWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); List select = options == null ? null : options.getSelect(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (select != null) { requestOptions.addQueryParam("$select", @@ -13716,92 +14799,7 @@ public Mono getCertificate(String thumbprintAlgorithm, S false); } return getCertificateWithResponse(thumbprintAlgorithm, thumbprint, requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(GetCertificateResponse.class)); - } - - /** - * Gets information about the specified Certificate. - * - * @param thumbprintAlgorithm The algorithm used to derive the thumbprint parameter. This must be sha1. - * @param thumbprint The thumbprint of the Certificate to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified Certificate on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getCertificate(String thumbprintAlgorithm, String thumbprint) { - // Generated convenience method for getCertificateWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getCertificateWithResponse(thumbprintAlgorithm, thumbprint, requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(GetCertificateResponse.class)); - } - - /** - * Checks the specified Job Schedule exists. - * - * @param jobScheduleId The ID of the Job Schedule which you want to check. - * @param options Optional parameters for Job Schedule Exists operation. - * @param requestConditions Specifies HTTP options for conditional requests based on modification time. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono jobScheduleExists(String jobScheduleId, BatchJobScheduleExistsOptions options, - RequestConditions requestConditions) { - // Generated convenience method for jobScheduleExistsWithResponse - RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); - OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); - OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); - String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); - String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); - if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); - } - if (ifModifiedSince != null) { - requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, - String.valueOf(new DateTimeRfc1123(ifModifiedSince))); - } - if (ifUnmodifiedSince != null) { - requestOptions.setHeader(HttpHeaderName.IF_UNMODIFIED_SINCE, - String.valueOf(new DateTimeRfc1123(ifUnmodifiedSince))); - } - if (ifMatch != null) { - requestOptions.setHeader(HttpHeaderName.IF_MATCH, ifMatch); - } - if (ifNoneMatch != null) { - requestOptions.setHeader(HttpHeaderName.IF_NONE_MATCH, ifNoneMatch); - } - return jobScheduleExistsWithResponse(jobScheduleId, requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * Checks the specified Job Schedule exists. - * - * @param jobScheduleId The ID of the Job Schedule which you want to check. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono jobScheduleExists(String jobScheduleId) { - // Generated convenience method for jobScheduleExistsWithResponse - RequestOptions requestOptions = new RequestOptions(); - return jobScheduleExistsWithResponse(jobScheduleId, requestOptions).flatMap(FluxUtil::toMono); + .map(protocolMethodData -> protocolMethodData.toObject(BatchCertificate.class)); } /** @@ -13826,18 +14824,18 @@ public Mono jobScheduleExists(String jobScheduleId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteJobSchedule(String jobScheduleId, DeleteBatchJobScheduleOptions options, + public Mono deleteJobSchedule(String jobScheduleId, BatchJobScheduleDeleteOptions options, RequestConditions requestConditions) { // Generated convenience method for deleteJobScheduleWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); Boolean force = options == null ? null : options.isForce(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (force != null) { requestOptions.addQueryParam("force", String.valueOf(force), false); @@ -13859,32 +14857,6 @@ public Mono deleteJobSchedule(String jobScheduleId, DeleteBatchJobSchedule return deleteJobScheduleWithResponse(jobScheduleId, requestOptions).flatMap(FluxUtil::toMono); } - /** - * Deletes a Job Schedule from the specified Account. - * - * When you delete a Job Schedule, this also deletes all Jobs and Tasks under that - * schedule. When Tasks are deleted, all the files in their working directories on - * the Compute Nodes are also deleted (the retention period is ignored). The Job - * Schedule statistics are no longer accessible once the Job Schedule is deleted, - * though they are still counted towards Account lifetime statistics. - * - * @param jobScheduleId The ID of the Job Schedule to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteJobSchedule(String jobScheduleId) { - // Generated convenience method for deleteJobScheduleWithResponse - RequestOptions requestOptions = new RequestOptions(); - return deleteJobScheduleWithResponse(jobScheduleId, requestOptions).flatMap(FluxUtil::toMono); - } - /** * Gets information about the specified Job Schedule. * @@ -13901,11 +14873,11 @@ public Mono deleteJobSchedule(String jobScheduleId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getJobSchedule(String jobScheduleId, GetBatchJobScheduleOptions options, + public Mono getJobSchedule(String jobScheduleId, BatchJobScheduleGetOptions options, RequestConditions requestConditions) { // Generated convenience method for getJobScheduleWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); List select = options == null ? null : options.getSelect(); List expand = options == null ? null : options.getExpand(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); @@ -13913,7 +14885,7 @@ public Mono getJobSchedule(String jobScheduleId, GetBatchJobSc String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (select != null) { requestOptions.addQueryParam("$select", @@ -13947,27 +14919,6 @@ public Mono getJobSchedule(String jobScheduleId, GetBatchJobSc .map(protocolMethodData -> protocolMethodData.toObject(BatchJobSchedule.class)); } - /** - * Gets information about the specified Job Schedule. - * - * @param jobScheduleId The ID of the Job Schedule to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified Job Schedule on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getJobSchedule(String jobScheduleId) { - // Generated convenience method for getJobScheduleWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getJobScheduleWithResponse(jobScheduleId, requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(BatchJobSchedule.class)); - } - /** * Updates the properties of the specified Job Schedule. * @@ -13991,17 +14942,17 @@ public Mono getJobSchedule(String jobScheduleId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateJobSchedule(String jobScheduleId, BatchJobScheduleUpdateContent jobSchedule, - UpdateBatchJobScheduleOptions options, RequestConditions requestConditions) { + public Mono updateJobSchedule(String jobScheduleId, BatchJobScheduleUpdateParameters jobSchedule, + BatchJobScheduleUpdateOptions options, RequestConditions requestConditions) { // Generated convenience method for updateJobScheduleWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (ifModifiedSince != null) { requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, @@ -14042,7 +14993,7 @@ public Mono updateJobSchedule(String jobScheduleId, BatchJobScheduleUpdate */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateJobSchedule(String jobScheduleId, BatchJobScheduleUpdateContent jobSchedule) { + public Mono updateJobSchedule(String jobScheduleId, BatchJobScheduleUpdateParameters jobSchedule) { // Generated convenience method for updateJobScheduleWithResponse RequestOptions requestOptions = new RequestOptions(); return updateJobScheduleWithResponse(jobScheduleId, BinaryData.fromObject(jobSchedule), requestOptions) @@ -14073,16 +15024,16 @@ public Mono updateJobSchedule(String jobScheduleId, BatchJobScheduleUpdate @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Mono replaceJobSchedule(String jobScheduleId, BatchJobSchedule jobSchedule, - ReplaceBatchJobScheduleOptions options, RequestConditions requestConditions) { + BatchJobScheduleReplaceOptions options, RequestConditions requestConditions) { // Generated convenience method for replaceJobScheduleWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (ifModifiedSince != null) { requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, @@ -14102,108 +15053,13 @@ public Mono replaceJobSchedule(String jobScheduleId, BatchJobSchedule jobS .flatMap(FluxUtil::toMono); } - /** - * Updates the properties of the specified Job Schedule. - * - * This fully replaces all the updatable properties of the Job Schedule. For - * example, if the schedule property is not specified with this request, then the - * Batch service will remove the existing schedule. Changes to a Job Schedule only - * impact Jobs created by the schedule after the update has taken place; currently - * running Jobs are unaffected. - * - * @param jobScheduleId The ID of the Job Schedule to update. - * @param jobSchedule A Job Schedule with updated properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono replaceJobSchedule(String jobScheduleId, BatchJobSchedule jobSchedule) { - // Generated convenience method for replaceJobScheduleWithResponse - RequestOptions requestOptions = new RequestOptions(); - return replaceJobScheduleWithResponse(jobScheduleId, BinaryData.fromObject(jobSchedule), requestOptions) - .flatMap(FluxUtil::toMono); - } - - /** - * Disables a Job Schedule. - * - * No new Jobs will be created until the Job Schedule is enabled again. - * - * @param jobScheduleId The ID of the Job Schedule to disable. - * @param options Optional parameters for Disable Job Schedule operation. - * @param requestConditions Specifies HTTP options for conditional requests based on modification time. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono disableJobSchedule(String jobScheduleId, DisableBatchJobScheduleOptions options, - RequestConditions requestConditions) { - // Generated convenience method for disableJobScheduleWithResponse - RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); - OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); - OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); - String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); - String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); - if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); - } - if (ifModifiedSince != null) { - requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, - String.valueOf(new DateTimeRfc1123(ifModifiedSince))); - } - if (ifUnmodifiedSince != null) { - requestOptions.setHeader(HttpHeaderName.IF_UNMODIFIED_SINCE, - String.valueOf(new DateTimeRfc1123(ifUnmodifiedSince))); - } - if (ifMatch != null) { - requestOptions.setHeader(HttpHeaderName.IF_MATCH, ifMatch); - } - if (ifNoneMatch != null) { - requestOptions.setHeader(HttpHeaderName.IF_NONE_MATCH, ifNoneMatch); - } - return disableJobScheduleWithResponse(jobScheduleId, requestOptions).flatMap(FluxUtil::toMono); - } - /** * Disables a Job Schedule. * * No new Jobs will be created until the Job Schedule is enabled again. * - * @param jobScheduleId The ID of the Job Schedule to disable. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono disableJobSchedule(String jobScheduleId) { - // Generated convenience method for disableJobScheduleWithResponse - RequestOptions requestOptions = new RequestOptions(); - return disableJobScheduleWithResponse(jobScheduleId, requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * Enables a Job Schedule. - * - * @param jobScheduleId The ID of the Job Schedule to enable. - * @param options Optional parameters for Enable Job Schedule operation. + * @param jobScheduleId The ID of the Job Schedule to disable. + * @param options Optional parameters for Disable Job Schedule operation. * @param requestConditions Specifies HTTP options for conditional requests based on modification time. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -14215,17 +15071,17 @@ public Mono disableJobSchedule(String jobScheduleId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono enableJobSchedule(String jobScheduleId, EnableBatchJobScheduleOptions options, + public Mono disableJobSchedule(String jobScheduleId, BatchJobScheduleDisableOptions options, RequestConditions requestConditions) { - // Generated convenience method for enableJobScheduleWithResponse + // Generated convenience method for disableJobScheduleWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (ifModifiedSince != null) { requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, @@ -14241,13 +15097,15 @@ public Mono enableJobSchedule(String jobScheduleId, EnableBatchJobSchedule if (ifNoneMatch != null) { requestOptions.setHeader(HttpHeaderName.IF_NONE_MATCH, ifNoneMatch); } - return enableJobScheduleWithResponse(jobScheduleId, requestOptions).flatMap(FluxUtil::toMono); + return disableJobScheduleWithResponse(jobScheduleId, requestOptions).flatMap(FluxUtil::toMono); } /** * Enables a Job Schedule. * * @param jobScheduleId The ID of the Job Schedule to enable. + * @param options Optional parameters for Enable Job Schedule operation. + * @param requestConditions Specifies HTTP options for conditional requests based on modification time. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -14258,9 +15116,32 @@ public Mono enableJobSchedule(String jobScheduleId, EnableBatchJobSchedule */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono enableJobSchedule(String jobScheduleId) { + public Mono enableJobSchedule(String jobScheduleId, BatchJobScheduleEnableOptions options, + RequestConditions requestConditions) { // Generated convenience method for enableJobScheduleWithResponse RequestOptions requestOptions = new RequestOptions(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); + OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); + String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); + String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); + if (timeOutInSeconds != null) { + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); + } + if (ifModifiedSince != null) { + requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, + String.valueOf(new DateTimeRfc1123(ifModifiedSince))); + } + if (ifUnmodifiedSince != null) { + requestOptions.setHeader(HttpHeaderName.IF_UNMODIFIED_SINCE, + String.valueOf(new DateTimeRfc1123(ifUnmodifiedSince))); + } + if (ifMatch != null) { + requestOptions.setHeader(HttpHeaderName.IF_MATCH, ifMatch); + } + if (ifNoneMatch != null) { + requestOptions.setHeader(HttpHeaderName.IF_NONE_MATCH, ifNoneMatch); + } return enableJobScheduleWithResponse(jobScheduleId, requestOptions).flatMap(FluxUtil::toMono); } @@ -14280,18 +15161,18 @@ public Mono enableJobSchedule(String jobScheduleId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono terminateJobSchedule(String jobScheduleId, TerminateBatchJobScheduleOptions options, + public Mono terminateJobSchedule(String jobScheduleId, BatchJobScheduleTerminateOptions options, RequestConditions requestConditions) { // Generated convenience method for terminateJobScheduleWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); Boolean force = options == null ? null : options.isForce(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (force != null) { requestOptions.addQueryParam("force", String.valueOf(force), false); @@ -14313,26 +15194,6 @@ public Mono terminateJobSchedule(String jobScheduleId, TerminateBatchJobSc return terminateJobScheduleWithResponse(jobScheduleId, requestOptions).flatMap(FluxUtil::toMono); } - /** - * Terminates a Job Schedule. - * - * @param jobScheduleId The ID of the Job Schedule to terminates. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono terminateJobSchedule(String jobScheduleId) { - // Generated convenience method for terminateJobScheduleWithResponse - RequestOptions requestOptions = new RequestOptions(); - return terminateJobScheduleWithResponse(jobScheduleId, requestOptions).flatMap(FluxUtil::toMono); - } - /** * Creates a Job Schedule to the specified Account. * @@ -14348,13 +15209,13 @@ public Mono terminateJobSchedule(String jobScheduleId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createJobSchedule(BatchJobScheduleCreateContent jobSchedule, - CreateBatchJobScheduleOptions options) { + public Mono createJobSchedule(BatchJobScheduleCreateParameters jobSchedule, + BatchJobScheduleCreateOptions options) { // Generated convenience method for createJobScheduleWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } return createJobScheduleWithResponse(BinaryData.fromObject(jobSchedule), requestOptions) .flatMap(FluxUtil::toMono); @@ -14374,7 +15235,7 @@ public Mono createJobSchedule(BatchJobScheduleCreateContent jobSchedule, */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createJobSchedule(BatchJobScheduleCreateContent jobSchedule) { + public Mono createJobSchedule(BatchJobScheduleCreateParameters jobSchedule) { // Generated convenience method for createJobScheduleWithResponse RequestOptions requestOptions = new RequestOptions(); return createJobScheduleWithResponse(BinaryData.fromObject(jobSchedule), requestOptions) @@ -14395,15 +15256,15 @@ public Mono createJobSchedule(BatchJobScheduleCreateContent jobSchedule) { */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listJobSchedules(ListBatchJobSchedulesOptions options) { + public PagedFlux listJobSchedules(BatchJobSchedulesListOptions options) { // Generated convenience method for listJobSchedules RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); String filter = options == null ? null : options.getFilter(); List select = options == null ? null : options.getSelect(); List expand = options == null ? null : options.getExpand(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (filter != null) { requestOptions.addQueryParam("$filter", filter, false); @@ -14437,36 +15298,6 @@ public PagedFlux listJobSchedules(ListBatchJobSchedulesOptions }); } - /** - * Lists all of the Job Schedules in the specified Account. - * - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of listing the Job Schedules in an Account as paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listJobSchedules() { - // Generated convenience method for listJobSchedules - RequestOptions requestOptions = new RequestOptions(); - PagedFlux pagedFluxResponse = listJobSchedules(requestOptions); - return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { - Flux> flux = (continuationTokenParam == null) - ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationTokenParam).take(1); - return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), - pagedResponse.getStatusCode(), pagedResponse.getHeaders(), - pagedResponse.getValue() - .stream() - .map(protocolMethodData -> protocolMethodData.toObject(BatchJobSchedule.class)) - .collect(Collectors.toList()), - pagedResponse.getContinuationToken(), null)); - }); - } - /** * Creates a Task to the specified Job. * @@ -14487,12 +15318,12 @@ public PagedFlux listJobSchedules() { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createTask(String jobId, BatchTaskCreateContent task, CreateBatchTaskOptions options) { + public Mono createTask(String jobId, BatchTaskCreateParameters task, BatchTaskCreateOptions options) { // Generated convenience method for createTaskWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } return createTaskWithResponse(jobId, BinaryData.fromObject(task), requestOptions).flatMap(FluxUtil::toMono); } @@ -14516,7 +15347,7 @@ public Mono createTask(String jobId, BatchTaskCreateContent task, CreateBa */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createTask(String jobId, BatchTaskCreateContent task) { + public Mono createTask(String jobId, BatchTaskCreateParameters task) { // Generated convenience method for createTaskWithResponse RequestOptions requestOptions = new RequestOptions(); return createTaskWithResponse(jobId, BinaryData.fromObject(task), requestOptions).flatMap(FluxUtil::toMono); @@ -14541,15 +15372,15 @@ public Mono createTask(String jobId, BatchTaskCreateContent task) { */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listTasks(String jobId, ListBatchTasksOptions options) { + public PagedFlux listTasks(String jobId, BatchTasksListOptions options) { // Generated convenience method for listTasks RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); String filter = options == null ? null : options.getFilter(); List select = options == null ? null : options.getSelect(); List expand = options == null ? null : options.getExpand(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (filter != null) { requestOptions.addQueryParam("$filter", filter, false); @@ -14583,42 +15414,6 @@ public PagedFlux listTasks(String jobId, ListBatchTasksOptions option }); } - /** - * Lists all of the Tasks that are associated with the specified Job. - * - * For multi-instance Tasks, information such as affinityId, executionInfo and - * nodeInfo refer to the primary Task. Use the list subtasks API to retrieve - * information about subtasks. - * - * @param jobId The ID of the Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of listing the Tasks in a Job as paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listTasks(String jobId) { - // Generated convenience method for listTasks - RequestOptions requestOptions = new RequestOptions(); - PagedFlux pagedFluxResponse = listTasks(jobId, requestOptions); - return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { - Flux> flux = (continuationTokenParam == null) - ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationTokenParam).take(1); - return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), - pagedResponse.getStatusCode(), pagedResponse.getHeaders(), - pagedResponse.getValue() - .stream() - .map(protocolMethodData -> protocolMethodData.toObject(BatchTask.class)) - .collect(Collectors.toList()), - pagedResponse.getContinuationToken(), null)); - }); - } - /** * Adds a collection of Tasks to the specified Job. * @@ -14646,59 +15441,21 @@ public PagedFlux listTasks(String jobId) { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of adding a collection of Tasks to a Job on successful completion of {@link Mono}. + * @return the result of creating a collection of Tasks to a Job on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createTaskCollection(String jobId, BatchTaskGroup taskCollection, - CreateBatchTaskCollectionOptions options) { + public Mono createTaskCollection(String jobId, BatchTaskGroup taskCollection, + BatchTaskCollectionCreateOptions options) { // Generated convenience method for createTaskCollectionWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } return createTaskCollectionWithResponse(jobId, BinaryData.fromObject(taskCollection), requestOptions) .flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(BatchTaskAddCollectionResult.class)); - } - - /** - * Adds a collection of Tasks to the specified Job. - * - * Note that each Task must have a unique ID. The Batch service may not return the - * results for each Task in the same order the Tasks were submitted in this - * request. If the server times out or the connection is closed during the - * request, the request may have been partially or fully processed, or not at all. - * In such cases, the user should re-issue the request. Note that it is up to the - * user to correctly handle failures when re-issuing a request. For example, you - * should use the same Task IDs during a retry so that if the prior operation - * succeeded, the retry will not create extra Tasks unexpectedly. If the response - * contains any Tasks which failed to add, a client can retry the request. In a - * retry, it is most efficient to resubmit only Tasks that failed to add, and to - * omit Tasks that were successfully added on the first attempt. The maximum - * lifetime of a Task from addition to completion is 180 days. If a Task has not - * completed within 180 days of being added it will be terminated by the Batch - * service and left in whatever state it was in at that time. - * - * @param jobId The ID of the Job to which the Task collection is to be added. - * @param taskCollection The Tasks to be added. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of adding a collection of Tasks to a Job on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createTaskCollection(String jobId, BatchTaskGroup taskCollection) { - // Generated convenience method for createTaskCollectionWithResponse - RequestOptions requestOptions = new RequestOptions(); - return createTaskCollectionWithResponse(jobId, BinaryData.fromObject(taskCollection), requestOptions) - .flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(BatchTaskAddCollectionResult.class)); + .map(protocolMethodData -> protocolMethodData.toObject(BatchCreateTaskCollectionResult.class)); } /** @@ -14724,17 +15481,17 @@ public Mono createTaskCollection(String jobId, Bat */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteTask(String jobId, String taskId, DeleteBatchTaskOptions options, + public Mono deleteTask(String jobId, String taskId, BatchTaskDeleteOptions options, RequestConditions requestConditions) { // Generated convenience method for deleteTaskWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (ifModifiedSince != null) { requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, @@ -14753,33 +15510,6 @@ public Mono deleteTask(String jobId, String taskId, DeleteBatchTaskOptions return deleteTaskWithResponse(jobId, taskId, requestOptions).flatMap(FluxUtil::toMono); } - /** - * Deletes a Task from the specified Job. - * - * When a Task is deleted, all of the files in its directory on the Compute Node - * where it ran are also deleted (regardless of the retention time). For - * multi-instance Tasks, the delete Task operation applies synchronously to the - * primary task; subtasks and their files are then deleted asynchronously in the - * background. - * - * @param jobId The ID of the Job from which to delete the Task. - * @param taskId The ID of the Task to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteTask(String jobId, String taskId) { - // Generated convenience method for deleteTaskWithResponse - RequestOptions requestOptions = new RequestOptions(); - return deleteTaskWithResponse(jobId, taskId, requestOptions).flatMap(FluxUtil::toMono); - } - /** * Gets information about the specified Task. * @@ -14804,11 +15534,11 @@ public Mono deleteTask(String jobId, String taskId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getTask(String jobId, String taskId, GetBatchTaskOptions options, + public Mono getTask(String jobId, String taskId, BatchTaskGetOptions options, RequestConditions requestConditions) { // Generated convenience method for getTaskWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); List select = options == null ? null : options.getSelect(); List expand = options == null ? null : options.getExpand(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); @@ -14816,7 +15546,7 @@ public Mono getTask(String jobId, String taskId, GetBatchTaskOptions String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (select != null) { requestOptions.addQueryParam("$select", @@ -14850,35 +15580,6 @@ public Mono getTask(String jobId, String taskId, GetBatchTaskOptions .map(protocolMethodData -> protocolMethodData.toObject(BatchTask.class)); } - /** - * Gets information about the specified Task. - * - * For multi-instance Tasks, information such as affinityId, executionInfo and - * nodeInfo refer to the primary Task. Use the list subtasks API to retrieve - * information about subtasks. - * - * @param jobId The ID of the Job that contains the Task. - * @param taskId The ID of the Task to get information about. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified Task. - * - * For multi-instance Tasks, information such as affinityId, executionInfo and - * nodeInfo refer to the primary Task on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getTask(String jobId, String taskId) { - // Generated convenience method for getTaskWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getTaskWithResponse(jobId, taskId, requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(BatchTask.class)); - } - /** * Updates the properties of the specified Task. * @@ -14897,17 +15598,17 @@ public Mono getTask(String jobId, String taskId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono replaceTask(String jobId, String taskId, BatchTask task, ReplaceBatchTaskOptions options, + public Mono replaceTask(String jobId, String taskId, BatchTask task, BatchTaskReplaceOptions options, RequestConditions requestConditions) { // Generated convenience method for replaceTaskWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (ifModifiedSince != null) { requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, @@ -14917,35 +15618,12 @@ public Mono replaceTask(String jobId, String taskId, BatchTask task, Repla requestOptions.setHeader(HttpHeaderName.IF_UNMODIFIED_SINCE, String.valueOf(new DateTimeRfc1123(ifUnmodifiedSince))); } - if (ifMatch != null) { - requestOptions.setHeader(HttpHeaderName.IF_MATCH, ifMatch); - } - if (ifNoneMatch != null) { - requestOptions.setHeader(HttpHeaderName.IF_NONE_MATCH, ifNoneMatch); - } - return replaceTaskWithResponse(jobId, taskId, BinaryData.fromObject(task), requestOptions) - .flatMap(FluxUtil::toMono); - } - - /** - * Updates the properties of the specified Task. - * - * @param jobId The ID of the Job containing the Task. - * @param taskId The ID of the Task to update. - * @param task The Task to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono replaceTask(String jobId, String taskId, BatchTask task) { - // Generated convenience method for replaceTaskWithResponse - RequestOptions requestOptions = new RequestOptions(); + if (ifMatch != null) { + requestOptions.setHeader(HttpHeaderName.IF_MATCH, ifMatch); + } + if (ifNoneMatch != null) { + requestOptions.setHeader(HttpHeaderName.IF_NONE_MATCH, ifNoneMatch); + } return replaceTaskWithResponse(jobId, taskId, BinaryData.fromObject(task), requestOptions) .flatMap(FluxUtil::toMono); } @@ -14969,13 +15647,13 @@ public Mono replaceTask(String jobId, String taskId, BatchTask task) { */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listSubTasks(String jobId, String taskId, ListBatchSubTasksOptions options) { + public PagedFlux listSubTasks(String jobId, String taskId, BatchSubTasksListOptions options) { // Generated convenience method for listSubTasks RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); List select = options == null ? null : options.getSelect(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (select != null) { requestOptions.addQueryParam("$select", @@ -14999,42 +15677,6 @@ public PagedFlux listSubTasks(String jobId, String taskId, ListBat }); } - /** - * Lists all of the subtasks that are associated with the specified multi-instance - * Task. - * - * If the Task is not a multi-instance Task then this returns an empty collection. - * - * @param jobId The ID of the Job. - * @param taskId The ID of the Task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of listing the subtasks of a Task as paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listSubTasks(String jobId, String taskId) { - // Generated convenience method for listSubTasks - RequestOptions requestOptions = new RequestOptions(); - PagedFlux pagedFluxResponse = listSubTasks(jobId, taskId, requestOptions); - return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { - Flux> flux = (continuationTokenParam == null) - ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationTokenParam).take(1); - return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), - pagedResponse.getStatusCode(), pagedResponse.getHeaders(), - pagedResponse.getValue() - .stream() - .map(protocolMethodData -> protocolMethodData.toObject(BatchSubtask.class)) - .collect(Collectors.toList()), - pagedResponse.getContinuationToken(), null)); - }); - } - /** * Terminates the specified Task. * @@ -15056,17 +15698,17 @@ public PagedFlux listSubTasks(String jobId, String taskId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono terminateTask(String jobId, String taskId, TerminateBatchTaskOptions options, + public Mono terminateTask(String jobId, String taskId, BatchTaskTerminateOptions options, RequestConditions requestConditions) { // Generated convenience method for terminateTaskWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (ifModifiedSince != null) { requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, @@ -15085,31 +15727,6 @@ public Mono terminateTask(String jobId, String taskId, TerminateBatchTaskO return terminateTaskWithResponse(jobId, taskId, requestOptions).flatMap(FluxUtil::toMono); } - /** - * Terminates the specified Task. - * - * When the Task has been terminated, it moves to the completed state. For - * multi-instance Tasks, the terminate Task operation applies synchronously to the - * primary task; subtasks are then terminated asynchronously in the background. - * - * @param jobId The ID of the Job containing the Task. - * @param taskId The ID of the Task to terminate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono terminateTask(String jobId, String taskId) { - // Generated convenience method for terminateTaskWithResponse - RequestOptions requestOptions = new RequestOptions(); - return terminateTaskWithResponse(jobId, taskId, requestOptions).flatMap(FluxUtil::toMono); - } - /** * Reactivates a Task, allowing it to run again even if its retry count has been * exhausted. @@ -15136,17 +15753,17 @@ public Mono terminateTask(String jobId, String taskId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono reactivateTask(String jobId, String taskId, ReactivateBatchTaskOptions options, + public Mono reactivateTask(String jobId, String taskId, BatchTaskReactivateOptions options, RequestConditions requestConditions) { // Generated convenience method for reactivateTaskWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (ifModifiedSince != null) { requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, @@ -15165,36 +15782,6 @@ public Mono reactivateTask(String jobId, String taskId, ReactivateBatchTas return reactivateTaskWithResponse(jobId, taskId, requestOptions).flatMap(FluxUtil::toMono); } - /** - * Reactivates a Task, allowing it to run again even if its retry count has been - * exhausted. - * - * Reactivation makes a Task eligible to be retried again up to its maximum retry - * count. The Task's state is changed to active. As the Task is no longer in the - * completed state, any previous exit code or failure information is no longer - * available after reactivation. Each time a Task is reactivated, its retry count - * is reset to 0. Reactivation will fail for Tasks that are not completed or that - * previously completed successfully (with an exit code of 0). Additionally, it - * will fail if the Job has completed (or is terminating or deleting). - * - * @param jobId The ID of the Job containing the Task. - * @param taskId The ID of the Task to reactivate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono reactivateTask(String jobId, String taskId) { - // Generated convenience method for reactivateTaskWithResponse - RequestOptions requestOptions = new RequestOptions(); - return reactivateTaskWithResponse(jobId, taskId, requestOptions).flatMap(FluxUtil::toMono); - } - /** * Deletes the specified Task file from the Compute Node where the Task ran. * @@ -15212,13 +15799,13 @@ public Mono reactivateTask(String jobId, String taskId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteTaskFile(String jobId, String taskId, String filePath, DeleteBatchTaskFileOptions options) { + public Mono deleteTaskFile(String jobId, String taskId, String filePath, BatchTaskFileDeleteOptions options) { // Generated convenience method for deleteTaskFileWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); Boolean recursive = options == null ? null : options.isRecursive(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (recursive != null) { requestOptions.addQueryParam("recursive", String.valueOf(recursive), false); @@ -15226,28 +15813,6 @@ public Mono deleteTaskFile(String jobId, String taskId, String filePath, D return deleteTaskFileWithResponse(jobId, taskId, filePath, requestOptions).flatMap(FluxUtil::toMono); } - /** - * Deletes the specified Task file from the Compute Node where the Task ran. - * - * @param jobId The ID of the Job that contains the Task. - * @param taskId The ID of the Task whose file you want to retrieve. - * @param filePath The path to the Task file that you want to get the content of. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteTaskFile(String jobId, String taskId, String filePath) { - // Generated convenience method for deleteTaskFileWithResponse - RequestOptions requestOptions = new RequestOptions(); - return deleteTaskFileWithResponse(jobId, taskId, filePath, requestOptions).flatMap(FluxUtil::toMono); - } - /** * Returns the content of the specified Task file. * @@ -15265,15 +15830,15 @@ public Mono deleteTaskFile(String jobId, String taskId, String filePath) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getTaskFile(String jobId, String taskId, String filePath, GetBatchTaskFileOptions options) { + public Mono getTaskFile(String jobId, String taskId, String filePath, BatchTaskFileGetOptions options) { // Generated convenience method for getTaskFileWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); OffsetDateTime ifModifiedSince = options == null ? null : options.getIfModifiedSince(); OffsetDateTime ifUnmodifiedSince = options == null ? null : options.getIfUnmodifiedSince(); String ocpRange = options == null ? null : options.getOcpRange(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (ifModifiedSince != null) { requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, @@ -15286,134 +15851,7 @@ public Mono getTaskFile(String jobId, String taskId, String filePath if (ocpRange != null) { requestOptions.setHeader(HttpHeaderName.fromString("ocp-range"), ocpRange); } - return getTaskFileWithResponse(jobId, taskId, filePath, requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * Returns the content of the specified Task file. - * - * @param jobId The ID of the Job that contains the Task. - * @param taskId The ID of the Task whose file you want to retrieve. - * @param filePath The path to the Task file that you want to get the content of. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getTaskFile(String jobId, String taskId, String filePath) { - // Generated convenience method for getTaskFileWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getTaskFileWithResponse(jobId, taskId, filePath, requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * Gets the properties of the specified Task file. - * - * @param jobId The ID of the Job that contains the Task. - * @param taskId The ID of the Task whose file you want to retrieve. - * @param filePath The path to the Task file that you want to get the content of. - * @param options Optional parameters for Get Task File Properties operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified Task file on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getTaskFileProperties(String jobId, String taskId, String filePath, - GetBatchTaskFilePropertiesOptions options) { - RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); - OffsetDateTime ifModifiedSince = options == null ? null : options.getIfModifiedSince(); - OffsetDateTime ifUnmodifiedSince = options == null ? null : options.getIfUnmodifiedSince(); - if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); - } - if (ifModifiedSince != null) { - requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, - String.valueOf(new DateTimeRfc1123(ifModifiedSince))); - } - if (ifUnmodifiedSince != null) { - requestOptions.setHeader(HttpHeaderName.IF_UNMODIFIED_SINCE, - String.valueOf(new DateTimeRfc1123(ifUnmodifiedSince))); - } - // Map the response headers of getTaskFilePropertiesWithResponse to FileResponseHeaderProperties - return getTaskFilePropertiesWithResponse(jobId, taskId, filePath, requestOptions) - .map(response -> new FileResponseHeaderProperties(response.getHeaders())); - } - - /** - * Gets the properties of the specified Task file. - * - * @param jobId The ID of the Job that contains the Task. - * @param taskId The ID of the Task whose file you want to retrieve. - * @param filePath The path to the Task file that you want to get the content of. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified Task file on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getTaskFileProperties(String jobId, String taskId, String filePath) { - return getTaskFilePropertiesWithResponse(jobId, taskId, filePath, new RequestOptions()) - .map(response -> new FileResponseHeaderProperties(response.getHeaders())); - } - - /** - * Lists the files in a Task's directory on its Compute Node. - * - * @param jobId The ID of the Job that contains the Task. - * @param taskId The ID of the Task whose files you want to list. - * @param options Optional parameters for List Task Files operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of listing the files on a Compute Node, or the files associated with - * a Task on a Compute Node as paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listTaskFiles(String jobId, String taskId, ListBatchTaskFilesOptions options) { - // Generated convenience method for listTaskFiles - RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); - String filter = options == null ? null : options.getFilter(); - Boolean recursive = options == null ? null : options.isRecursive(); - if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); - } - if (filter != null) { - requestOptions.addQueryParam("$filter", filter, false); - } - if (recursive != null) { - requestOptions.addQueryParam("recursive", String.valueOf(recursive), false); - } - PagedFlux pagedFluxResponse = listTaskFiles(jobId, taskId, requestOptions); - return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { - Flux> flux = (continuationTokenParam == null) - ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationTokenParam).take(1); - return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), - pagedResponse.getStatusCode(), pagedResponse.getHeaders(), - pagedResponse.getValue() - .stream() - .map(protocolMethodData -> protocolMethodData.toObject(BatchNodeFile.class)) - .collect(Collectors.toList()), - pagedResponse.getContinuationToken(), null)); - }); + return getTaskFileWithResponse(jobId, taskId, filePath, requestOptions).flatMap(FluxUtil::toMono); } /** @@ -15421,6 +15859,7 @@ public PagedFlux listTaskFiles(String jobId, String taskId, ListB * * @param jobId The ID of the Job that contains the Task. * @param taskId The ID of the Task whose files you want to list. + * @param options Optional parameters for List Task Files operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -15432,9 +15871,21 @@ public PagedFlux listTaskFiles(String jobId, String taskId, ListB */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listTaskFiles(String jobId, String taskId) { + public PagedFlux listTaskFiles(String jobId, String taskId, BatchTaskFilesListOptions options) { // Generated convenience method for listTaskFiles RequestOptions requestOptions = new RequestOptions(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + String filter = options == null ? null : options.getFilter(); + Boolean recursive = options == null ? null : options.isRecursive(); + if (timeOutInSeconds != null) { + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); + } + if (filter != null) { + requestOptions.addQueryParam("$filter", filter, false); + } + if (recursive != null) { + requestOptions.addQueryParam("recursive", String.valueOf(recursive), false); + } PagedFlux pagedFluxResponse = listTaskFiles(jobId, taskId, requestOptions); return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { Flux> flux = (continuationTokenParam == null) @@ -15470,13 +15921,13 @@ public PagedFlux listTaskFiles(String jobId, String taskId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createNodeUser(String poolId, String nodeId, BatchNodeUserCreateContent user, - CreateBatchNodeUserOptions options) { + public Mono createNodeUser(String poolId, String nodeId, BatchNodeUserCreateParameters user, + BatchNodeUserCreateOptions options) { // Generated convenience method for createNodeUserWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } return createNodeUserWithResponse(poolId, nodeId, BinaryData.fromObject(user), requestOptions) .flatMap(FluxUtil::toMono); @@ -15501,7 +15952,7 @@ public Mono createNodeUser(String poolId, String nodeId, BatchNodeUserCrea */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createNodeUser(String poolId, String nodeId, BatchNodeUserCreateContent user) { + public Mono createNodeUser(String poolId, String nodeId, BatchNodeUserCreateParameters user) { // Generated convenience method for createNodeUserWithResponse RequestOptions requestOptions = new RequestOptions(); return createNodeUserWithResponse(poolId, nodeId, BinaryData.fromObject(user), requestOptions) @@ -15529,41 +15980,16 @@ public Mono createNodeUser(String poolId, String nodeId, BatchNodeUserCrea @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Mono deleteNodeUser(String poolId, String nodeId, String userName, - DeleteBatchNodeUserOptions options) { + BatchNodeUserDeleteOptions options) { // Generated convenience method for deleteNodeUserWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } return deleteNodeUserWithResponse(poolId, nodeId, userName, requestOptions).flatMap(FluxUtil::toMono); } - /** - * Deletes a user Account from the specified Compute Node. - * - * You can delete a user Account to a Compute Node only when it is in the idle or - * running state. - * - * @param poolId The ID of the Pool that contains the Compute Node. - * @param nodeId The ID of the machine on which you want to delete a user Account. - * @param userName The name of the user Account to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteNodeUser(String poolId, String nodeId, String userName) { - // Generated convenience method for deleteNodeUserWithResponse - RequestOptions requestOptions = new RequestOptions(); - return deleteNodeUserWithResponse(poolId, nodeId, userName, requestOptions).flatMap(FluxUtil::toMono); - } - /** * Updates the password and expiration time of a user Account on the specified Compute Node. * @@ -15575,7 +16001,7 @@ public Mono deleteNodeUser(String poolId, String nodeId, String userName) * @param poolId The ID of the Pool that contains the Compute Node. * @param nodeId The ID of the machine on which you want to update a user Account. * @param userName The name of the user Account to update. - * @param content The options to use for updating the user. + * @param parameters The options to use for updating the user. * @param options Optional parameters for Replace Node User operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -15587,15 +16013,15 @@ public Mono deleteNodeUser(String poolId, String nodeId, String userName) */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono replaceNodeUser(String poolId, String nodeId, String userName, BatchNodeUserUpdateContent content, - ReplaceBatchNodeUserOptions options) { + public Mono replaceNodeUser(String poolId, String nodeId, String userName, + BatchNodeUserUpdateParameters parameters, BatchNodeUserReplaceOptions options) { // Generated convenience method for replaceNodeUserWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } - return replaceNodeUserWithResponse(poolId, nodeId, userName, BinaryData.fromObject(content), requestOptions) + return replaceNodeUserWithResponse(poolId, nodeId, userName, BinaryData.fromObject(parameters), requestOptions) .flatMap(FluxUtil::toMono); } @@ -15610,7 +16036,7 @@ public Mono replaceNodeUser(String poolId, String nodeId, String userName, * @param poolId The ID of the Pool that contains the Compute Node. * @param nodeId The ID of the machine on which you want to update a user Account. * @param userName The name of the user Account to update. - * @param content The options to use for updating the user. + * @param parameters The options to use for updating the user. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -15622,10 +16048,10 @@ public Mono replaceNodeUser(String poolId, String nodeId, String userName, @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Mono replaceNodeUser(String poolId, String nodeId, String userName, - BatchNodeUserUpdateContent content) { + BatchNodeUserUpdateParameters parameters) { // Generated convenience method for replaceNodeUserWithResponse RequestOptions requestOptions = new RequestOptions(); - return replaceNodeUserWithResponse(poolId, nodeId, userName, BinaryData.fromObject(content), requestOptions) + return replaceNodeUserWithResponse(poolId, nodeId, userName, BinaryData.fromObject(parameters), requestOptions) .flatMap(FluxUtil::toMono); } @@ -15645,13 +16071,13 @@ public Mono replaceNodeUser(String poolId, String nodeId, String userName, */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getNode(String poolId, String nodeId, GetBatchNodeOptions options) { + public Mono getNode(String poolId, String nodeId, BatchNodeGetOptions options) { // Generated convenience method for getNodeWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); List select = options == null ? null : options.getSelect(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (select != null) { requestOptions.addQueryParam("$select", @@ -15664,28 +16090,6 @@ public Mono getNode(String poolId, String nodeId, GetBatchNodeOptions .map(protocolMethodData -> protocolMethodData.toObject(BatchNode.class)); } - /** - * Gets information about the specified Compute Node. - * - * @param poolId The ID of the Pool that contains the Compute Node. - * @param nodeId The ID of the Compute Node that you want to get information about. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified Compute Node on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getNode(String poolId, String nodeId) { - // Generated convenience method for getNodeWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getNodeWithResponse(poolId, nodeId, requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(BatchNode.class)); - } - /** * Restarts the specified Compute Node. * @@ -15704,13 +16108,13 @@ public Mono getNode(String poolId, String nodeId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono rebootNode(String poolId, String nodeId, RebootBatchNodeOptions options) { + public Mono rebootNode(String poolId, String nodeId, BatchNodeRebootOptions options) { // Generated convenience method for rebootNodeWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); - BatchNodeRebootContent parameters = options == null ? null : options.getParameters(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + BatchNodeRebootParameters parameters = options == null ? null : options.getParameters(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (parameters != null) { requestOptions.setBody(BinaryData.fromObject(parameters)); @@ -15718,29 +16122,6 @@ public Mono rebootNode(String poolId, String nodeId, RebootBatchNodeOption return rebootNodeWithResponse(poolId, nodeId, requestOptions).flatMap(FluxUtil::toMono); } - /** - * Restarts the specified Compute Node. - * - * You can restart a Compute Node only if it is in an idle or running state. - * - * @param poolId The ID of the Pool that contains the Compute Node. - * @param nodeId The ID of the Compute Node that you want to restart. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono rebootNode(String poolId, String nodeId) { - // Generated convenience method for rebootNodeWithResponse - RequestOptions requestOptions = new RequestOptions(); - return rebootNodeWithResponse(poolId, nodeId, requestOptions).flatMap(FluxUtil::toMono); - } - /** * Starts the specified Compute Node. * @@ -15759,39 +16140,16 @@ public Mono rebootNode(String poolId, String nodeId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startNode(String poolId, String nodeId, StartBatchNodeOptions options) { + public Mono startNode(String poolId, String nodeId, BatchNodeStartOptions options) { // Generated convenience method for startNodeWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } return startNodeWithResponse(poolId, nodeId, requestOptions).flatMap(FluxUtil::toMono); } - /** - * Starts the specified Compute Node. - * - * You can start a Compute Node only if it has been deallocated. - * - * @param poolId The ID of the Pool that contains the Compute Node. - * @param nodeId The ID of the Compute Node that you want to restart. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startNode(String poolId, String nodeId) { - // Generated convenience method for startNodeWithResponse - RequestOptions requestOptions = new RequestOptions(); - return startNodeWithResponse(poolId, nodeId, requestOptions).flatMap(FluxUtil::toMono); - } - /** * Reinstalls the operating system on the specified Compute Node. * @@ -15812,13 +16170,13 @@ public Mono startNode(String poolId, String nodeId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono reimageNode(String poolId, String nodeId, ReimageBatchNodeOptions options) { + public Mono reimageNode(String poolId, String nodeId, BatchNodeReimageOptions options) { // Generated convenience method for reimageNodeWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); - BatchNodeReimageContent parameters = options == null ? null : options.getParameters(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + BatchNodeReimageParameters parameters = options == null ? null : options.getParameters(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (parameters != null) { requestOptions.setBody(BinaryData.fromObject(parameters)); @@ -15826,31 +16184,6 @@ public Mono reimageNode(String poolId, String nodeId, ReimageBatchNodeOpti return reimageNodeWithResponse(poolId, nodeId, requestOptions).flatMap(FluxUtil::toMono); } - /** - * Reinstalls the operating system on the specified Compute Node. - * - * You can reinstall the operating system on a Compute Node only if it is in an - * idle or running state. This API can be invoked only on Pools created with the - * cloud service configuration property. - * - * @param poolId The ID of the Pool that contains the Compute Node. - * @param nodeId The ID of the Compute Node that you want to restart. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono reimageNode(String poolId, String nodeId) { - // Generated convenience method for reimageNodeWithResponse - RequestOptions requestOptions = new RequestOptions(); - return reimageNodeWithResponse(poolId, nodeId, requestOptions).flatMap(FluxUtil::toMono); - } - /** * Deallocates the specified Compute Node. * @@ -15869,13 +16202,13 @@ public Mono reimageNode(String poolId, String nodeId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deallocateNode(String poolId, String nodeId, DeallocateBatchNodeOptions options) { + public Mono deallocateNode(String poolId, String nodeId, BatchNodeDeallocateOptions options) { // Generated convenience method for deallocateNodeWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); - BatchNodeDeallocateContent parameters = options == null ? null : options.getParameters(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + BatchNodeDeallocateParameters parameters = options == null ? null : options.getParameters(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (parameters != null) { requestOptions.setBody(BinaryData.fromObject(parameters)); @@ -15883,29 +16216,6 @@ public Mono deallocateNode(String poolId, String nodeId, DeallocateBatchNo return deallocateNodeWithResponse(poolId, nodeId, requestOptions).flatMap(FluxUtil::toMono); } - /** - * Deallocates the specified Compute Node. - * - * You can deallocate a Compute Node only if it is in an idle or running state. - * - * @param poolId The ID of the Pool that contains the Compute Node. - * @param nodeId The ID of the Compute Node that you want to restart. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deallocateNode(String poolId, String nodeId) { - // Generated convenience method for deallocateNodeWithResponse - RequestOptions requestOptions = new RequestOptions(); - return deallocateNodeWithResponse(poolId, nodeId, requestOptions).flatMap(FluxUtil::toMono); - } - /** * Disables Task scheduling on the specified Compute Node. * @@ -15925,13 +16235,13 @@ public Mono deallocateNode(String poolId, String nodeId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono disableNodeScheduling(String poolId, String nodeId, DisableBatchNodeSchedulingOptions options) { + public Mono disableNodeScheduling(String poolId, String nodeId, BatchNodeSchedulingDisableOptions options) { // Generated convenience method for disableNodeSchedulingWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); - BatchNodeDisableSchedulingContent parameters = options == null ? null : options.getParameters(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + BatchNodeDisableSchedulingParameters parameters = options == null ? null : options.getParameters(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (parameters != null) { requestOptions.setBody(BinaryData.fromObject(parameters)); @@ -15939,30 +16249,6 @@ public Mono disableNodeScheduling(String poolId, String nodeId, DisableBat return disableNodeSchedulingWithResponse(poolId, nodeId, requestOptions).flatMap(FluxUtil::toMono); } - /** - * Disables Task scheduling on the specified Compute Node. - * - * You can disable Task scheduling on a Compute Node only if its current - * scheduling state is enabled. - * - * @param poolId The ID of the Pool that contains the Compute Node. - * @param nodeId The ID of the Compute Node on which you want to disable Task scheduling. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono disableNodeScheduling(String poolId, String nodeId) { - // Generated convenience method for disableNodeSchedulingWithResponse - RequestOptions requestOptions = new RequestOptions(); - return disableNodeSchedulingWithResponse(poolId, nodeId, requestOptions).flatMap(FluxUtil::toMono); - } - /** * Enables Task scheduling on the specified Compute Node. * @@ -15975,79 +16261,21 @@ public Mono disableNodeScheduling(String poolId, String nodeId) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono enableNodeScheduling(String poolId, String nodeId, EnableBatchNodeSchedulingOptions options) { - // Generated convenience method for enableNodeSchedulingWithResponse - RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); - if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); - } - return enableNodeSchedulingWithResponse(poolId, nodeId, requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * Enables Task scheduling on the specified Compute Node. - * - * You can enable Task scheduling on a Compute Node only if its current scheduling - * state is disabled. - * - * @param poolId The ID of the Pool that contains the Compute Node. - * @param nodeId The ID of the Compute Node on which you want to enable Task scheduling. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono enableNodeScheduling(String poolId, String nodeId) { - // Generated convenience method for enableNodeSchedulingWithResponse - RequestOptions requestOptions = new RequestOptions(); - return enableNodeSchedulingWithResponse(poolId, nodeId, requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * Gets the settings required for remote login to a Compute Node. - * - * Before you can remotely login to a Compute Node using the remote login settings, - * you must create a user Account on the Compute Node. - * - * @param poolId The ID of the Pool that contains the Compute Node. - * @param nodeId The ID of the Compute Node for which to obtain the remote login settings. - * @param options Optional parameters for Get Node Remote Login Settings operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the settings required for remote login to a Compute Node. - * - * Before you can remotely login to a Compute Node using the remote login settings, - * you must create a user Account on the Compute Node on successful completion of {@link Mono}. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getNodeRemoteLoginSettings(String poolId, String nodeId, - GetBatchNodeRemoteLoginSettingsOptions options) { - // Generated convenience method for getNodeRemoteLoginSettingsWithResponse + public Mono enableNodeScheduling(String poolId, String nodeId, BatchNodeSchedulingEnableOptions options) { + // Generated convenience method for enableNodeSchedulingWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } - return getNodeRemoteLoginSettingsWithResponse(poolId, nodeId, requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(BatchNodeRemoteLoginSettings.class)); + return enableNodeSchedulingWithResponse(poolId, nodeId, requestOptions).flatMap(FluxUtil::toMono); } /** @@ -16058,6 +16286,7 @@ public Mono getNodeRemoteLoginSettings(String pool * * @param poolId The ID of the Pool that contains the Compute Node. * @param nodeId The ID of the Compute Node for which to obtain the remote login settings. + * @param options Optional parameters for Get Node Remote Login Settings operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -16071,9 +16300,14 @@ public Mono getNodeRemoteLoginSettings(String pool */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getNodeRemoteLoginSettings(String poolId, String nodeId) { + public Mono getNodeRemoteLoginSettings(String poolId, String nodeId, + BatchNodeRemoteLoginSettingsGetOptions options) { // Generated convenience method for getNodeRemoteLoginSettingsWithResponse RequestOptions requestOptions = new RequestOptions(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + if (timeOutInSeconds != null) { + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); + } return getNodeRemoteLoginSettingsWithResponse(poolId, nodeId, requestOptions).flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(BatchNodeRemoteLoginSettings.class)); } @@ -16090,7 +16324,7 @@ public Mono getNodeRemoteLoginSettings(String pool * @param poolId The ID of the Pool that contains the Compute Node. * @param nodeId The ID of the Compute Node for which you want to get the Remote Desktop * Protocol file. - * @param content The Azure Batch service log files upload options. + * @param parameters The Azure Batch service log files upload options. * @param options Optional parameters for Upload Node Logs operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -16104,14 +16338,14 @@ public Mono getNodeRemoteLoginSettings(String pool @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Mono uploadNodeLogs(String poolId, String nodeId, - UploadBatchServiceLogsContent content, UploadBatchNodeLogsOptions options) { + UploadBatchServiceLogsParameters parameters, BatchNodeLogsUploadOptions options) { // Generated convenience method for uploadNodeLogsWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } - return uploadNodeLogsWithResponse(poolId, nodeId, BinaryData.fromObject(content), requestOptions) + return uploadNodeLogsWithResponse(poolId, nodeId, BinaryData.fromObject(parameters), requestOptions) .flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(UploadBatchServiceLogsResult.class)); } @@ -16128,7 +16362,7 @@ public Mono uploadNodeLogs(String poolId, String n * @param poolId The ID of the Pool that contains the Compute Node. * @param nodeId The ID of the Compute Node for which you want to get the Remote Desktop * Protocol file. - * @param content The Azure Batch service log files upload options. + * @param parameters The Azure Batch service log files upload options. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -16141,10 +16375,10 @@ public Mono uploadNodeLogs(String poolId, String n @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Mono uploadNodeLogs(String poolId, String nodeId, - UploadBatchServiceLogsContent content) { + UploadBatchServiceLogsParameters parameters) { // Generated convenience method for uploadNodeLogsWithResponse RequestOptions requestOptions = new RequestOptions(); - return uploadNodeLogsWithResponse(poolId, nodeId, BinaryData.fromObject(content), requestOptions) + return uploadNodeLogsWithResponse(poolId, nodeId, BinaryData.fromObject(parameters), requestOptions) .flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(UploadBatchServiceLogsResult.class)); } @@ -16164,14 +16398,14 @@ public Mono uploadNodeLogs(String poolId, String n */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listNodes(String poolId, ListBatchNodesOptions options) { + public PagedFlux listNodes(String poolId, BatchNodesListOptions options) { // Generated convenience method for listNodes RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); String filter = options == null ? null : options.getFilter(); List select = options == null ? null : options.getSelect(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (filter != null) { requestOptions.addQueryParam("$filter", filter, false); @@ -16198,38 +16432,6 @@ public PagedFlux listNodes(String poolId, ListBatchNodesOptions optio }); } - /** - * Lists the Compute Nodes in the specified Pool. - * - * @param poolId The ID of the Pool from which you want to list Compute Nodes. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of listing the Compute Nodes in a Pool as paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listNodes(String poolId) { - // Generated convenience method for listNodes - RequestOptions requestOptions = new RequestOptions(); - PagedFlux pagedFluxResponse = listNodes(poolId, requestOptions); - return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { - Flux> flux = (continuationTokenParam == null) - ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationTokenParam).take(1); - return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), - pagedResponse.getStatusCode(), pagedResponse.getHeaders(), - pagedResponse.getValue() - .stream() - .map(protocolMethodData -> protocolMethodData.toObject(BatchNode.class)) - .collect(Collectors.toList()), - pagedResponse.getContinuationToken(), null)); - }); - } - /** * Gets information about the specified Compute Node Extension. * @@ -16248,13 +16450,13 @@ public PagedFlux listNodes(String poolId) { @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Mono getNodeExtension(String poolId, String nodeId, String extensionName, - GetBatchNodeExtensionOptions options) { + BatchNodeExtensionGetOptions options) { // Generated convenience method for getNodeExtensionWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); List select = options == null ? null : options.getSelect(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (select != null) { requestOptions.addQueryParam("$select", @@ -16267,29 +16469,6 @@ public Mono getNodeExtension(String poolId, String nodeId, .map(protocolMethodData -> protocolMethodData.toObject(BatchNodeVMExtension.class)); } - /** - * Gets information about the specified Compute Node Extension. - * - * @param poolId The ID of the Pool that contains the Compute Node. - * @param nodeId The ID of the Compute Node that contains the extensions. - * @param extensionName The name of the Compute Node Extension that you want to get information about. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified Compute Node Extension on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getNodeExtension(String poolId, String nodeId, String extensionName) { - // Generated convenience method for getNodeExtensionWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getNodeExtensionWithResponse(poolId, nodeId, extensionName, requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(BatchNodeVMExtension.class)); - } - /** * Lists the Compute Nodes Extensions in the specified Pool. * @@ -16307,13 +16486,13 @@ public Mono getNodeExtension(String poolId, String nodeId, @Generated @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listNodeExtensions(String poolId, String nodeId, - ListBatchNodeExtensionsOptions options) { + BatchNodeExtensionsListOptions options) { // Generated convenience method for listNodeExtensions RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); List select = options == null ? null : options.getSelect(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (select != null) { requestOptions.addQueryParam("$select", @@ -16338,40 +16517,6 @@ public PagedFlux listNodeExtensions(String poolId, String }); } - /** - * Lists the Compute Nodes Extensions in the specified Pool. - * - * @param poolId The ID of the Pool that contains Compute Node. - * @param nodeId The ID of the Compute Node that you want to list extensions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of listing the Compute Node extensions in a Node as paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listNodeExtensions(String poolId, String nodeId) { - // Generated convenience method for listNodeExtensions - RequestOptions requestOptions = new RequestOptions(); - PagedFlux pagedFluxResponse = listNodeExtensions(poolId, nodeId, requestOptions); - return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { - Flux> flux = (continuationTokenParam == null) - ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationTokenParam).take(1); - return flux - .map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), - pagedResponse.getStatusCode(), pagedResponse.getHeaders(), - pagedResponse.getValue() - .stream() - .map(protocolMethodData -> protocolMethodData.toObject(BatchNodeVMExtension.class)) - .collect(Collectors.toList()), - pagedResponse.getContinuationToken(), null)); - }); - } - /** * Deletes the specified file from the Compute Node. * @@ -16390,13 +16535,13 @@ public PagedFlux listNodeExtensions(String poolId, String @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Mono deleteNodeFile(String poolId, String nodeId, String filePath, - DeleteBatchNodeFileOptions options) { + BatchNodeFileDeleteOptions options) { // Generated convenience method for deleteNodeFileWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); Boolean recursive = options == null ? null : options.isRecursive(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (recursive != null) { requestOptions.addQueryParam("recursive", String.valueOf(recursive), false); @@ -16404,28 +16549,6 @@ public Mono deleteNodeFile(String poolId, String nodeId, String filePath, return deleteNodeFileWithResponse(poolId, nodeId, filePath, requestOptions).flatMap(FluxUtil::toMono); } - /** - * Deletes the specified file from the Compute Node. - * - * @param poolId The ID of the Pool that contains the Compute Node. - * @param nodeId The ID of the Compute Node. - * @param filePath The path to the file or directory. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteNodeFile(String poolId, String nodeId, String filePath) { - // Generated convenience method for deleteNodeFileWithResponse - RequestOptions requestOptions = new RequestOptions(); - return deleteNodeFileWithResponse(poolId, nodeId, filePath, requestOptions).flatMap(FluxUtil::toMono); - } - /** * Returns the content of the specified Compute Node file. * @@ -16444,15 +16567,15 @@ public Mono deleteNodeFile(String poolId, String nodeId, String filePath) @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Mono getNodeFile(String poolId, String nodeId, String filePath, - GetBatchNodeFileOptions options) { + BatchNodeFileGetOptions options) { // Generated convenience method for getNodeFileWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); OffsetDateTime ifModifiedSince = options == null ? null : options.getIfModifiedSince(); OffsetDateTime ifUnmodifiedSince = options == null ? null : options.getIfUnmodifiedSince(); String ocpRange = options == null ? null : options.getOcpRange(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (ifModifiedSince != null) { requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, @@ -16468,86 +16591,6 @@ public Mono getNodeFile(String poolId, String nodeId, String filePat return getNodeFileWithResponse(poolId, nodeId, filePath, requestOptions).flatMap(FluxUtil::toMono); } - /** - * Returns the content of the specified Compute Node file. - * - * @param poolId The ID of the Pool that contains the Compute Node. - * @param nodeId The ID of the Compute Node. - * @param filePath The path to the file or directory. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getNodeFile(String poolId, String nodeId, String filePath) { - // Generated convenience method for getNodeFileWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getNodeFileWithResponse(poolId, nodeId, filePath, requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * Gets the properties of the specified Compute Node file. - * - * @param poolId The ID of the Pool that contains the Compute Node. - * @param nodeId The ID of the Compute Node. - * @param filePath The path to the file or directory. - * @param options Optional parameters for Get Node File Properties operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified Compute Node file on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getNodeFileProperties(String poolId, String nodeId, String filePath, - GetBatchNodeFilePropertiesOptions options) { - RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); - OffsetDateTime ifModifiedSince = options == null ? null : options.getIfModifiedSince(); - OffsetDateTime ifUnmodifiedSince = options == null ? null : options.getIfUnmodifiedSince(); - if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); - } - if (ifModifiedSince != null) { - requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, - String.valueOf(new DateTimeRfc1123(ifModifiedSince))); - } - if (ifUnmodifiedSince != null) { - requestOptions.setHeader(HttpHeaderName.IF_UNMODIFIED_SINCE, - String.valueOf(new DateTimeRfc1123(ifUnmodifiedSince))); - } - // Map the response headers of getNodeFilePropertiesWithResponse to NodeFileProperties - return getNodeFilePropertiesWithResponse(poolId, nodeId, filePath, requestOptions) - .map(response -> new FileResponseHeaderProperties(response.getHeaders())); - } - - /** - * Gets the properties of the specified Compute Node file. - * - * @param poolId The ID of the Pool that contains the Compute Node. - * @param nodeId The ID of the Compute Node. - * @param filePath The path to the file or directory. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified Compute Node file on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getNodeFileProperties(String poolId, String nodeId, String filePath) { - return getNodeFilePropertiesWithResponse(poolId, nodeId, filePath, new RequestOptions()) - .map(response -> new FileResponseHeaderProperties(response.getHeaders())); - } - /** * Lists all of the files in Task directories on the specified Compute Node. * @@ -16565,14 +16608,14 @@ public Mono getNodeFileProperties(String poolId, S */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listNodeFiles(String poolId, String nodeId, ListBatchNodeFilesOptions options) { + public PagedFlux listNodeFiles(String poolId, String nodeId, BatchNodeFilesListOptions options) { // Generated convenience method for listNodeFiles RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); String filter = options == null ? null : options.getFilter(); Boolean recursive = options == null ? null : options.isRecursive(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (filter != null) { requestOptions.addQueryParam("$filter", filter, false); @@ -16594,38 +16637,4 @@ public PagedFlux listNodeFiles(String poolId, String nodeId, List pagedResponse.getContinuationToken(), null)); }); } - - /** - * Lists all of the files in Task directories on the specified Compute Node. - * - * @param poolId The ID of the Pool that contains the Compute Node. - * @param nodeId The ID of the Compute Node whose files you want to list. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of listing the files on a Compute Node, or the files associated with - * a Task on a Compute Node as paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listNodeFiles(String poolId, String nodeId) { - // Generated convenience method for listNodeFiles - RequestOptions requestOptions = new RequestOptions(); - PagedFlux pagedFluxResponse = listNodeFiles(poolId, nodeId, requestOptions); - return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { - Flux> flux = (continuationTokenParam == null) - ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationTokenParam).take(1); - return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), - pagedResponse.getStatusCode(), pagedResponse.getHeaders(), - pagedResponse.getValue() - .stream() - .map(protocolMethodData -> protocolMethodData.toObject(BatchNodeFile.class)) - .collect(Collectors.toList()), - pagedResponse.getContinuationToken(), null)); - }); - } } diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/BatchClient.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/BatchClient.java index 5237b192624a..951b69fb3ae2 100644 --- a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/BatchClient.java +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/BatchClient.java @@ -9,124 +9,124 @@ import com.azure.compute.batch.implementation.task.TaskSubmitter; import com.azure.compute.batch.models.AutoScaleRun; import com.azure.compute.batch.models.BatchApplication; +import com.azure.compute.batch.models.BatchApplicationGetOptions; +import com.azure.compute.batch.models.BatchApplicationsListOptions; import com.azure.compute.batch.models.BatchCertificate; +import com.azure.compute.batch.models.BatchCertificateCancelDeletionOptions; +import com.azure.compute.batch.models.BatchCertificateCreateOptions; +import com.azure.compute.batch.models.BatchCertificateDeleteOptions; +import com.azure.compute.batch.models.BatchCertificateGetOptions; +import com.azure.compute.batch.models.BatchCertificatesListOptions; import com.azure.compute.batch.models.BatchClientParallelOptions; +import com.azure.compute.batch.models.BatchCreateTaskCollectionResult; import com.azure.compute.batch.models.BatchJob; -import com.azure.compute.batch.models.BatchJobCreateContent; -import com.azure.compute.batch.models.BatchJobDisableContent; +import com.azure.compute.batch.models.BatchJobCreateOptions; +import com.azure.compute.batch.models.BatchJobCreateParameters; +import com.azure.compute.batch.models.BatchJobDeleteOptions; +import com.azure.compute.batch.models.BatchJobDisableOptions; +import com.azure.compute.batch.models.BatchJobDisableParameters; +import com.azure.compute.batch.models.BatchJobEnableOptions; +import com.azure.compute.batch.models.BatchJobGetOptions; import com.azure.compute.batch.models.BatchJobPreparationAndReleaseTaskStatus; +import com.azure.compute.batch.models.BatchJobPreparationAndReleaseTaskStatusListOptions; +import com.azure.compute.batch.models.BatchJobReplaceOptions; import com.azure.compute.batch.models.BatchJobSchedule; -import com.azure.compute.batch.models.BatchJobScheduleCreateContent; +import com.azure.compute.batch.models.BatchJobScheduleCreateOptions; +import com.azure.compute.batch.models.BatchJobScheduleCreateParameters; +import com.azure.compute.batch.models.BatchJobScheduleDeleteOptions; +import com.azure.compute.batch.models.BatchJobScheduleDisableOptions; +import com.azure.compute.batch.models.BatchJobScheduleEnableOptions; import com.azure.compute.batch.models.BatchJobScheduleExistsOptions; -import com.azure.compute.batch.models.BatchJobScheduleUpdateContent; -import com.azure.compute.batch.models.BatchJobTerminateContent; -import com.azure.compute.batch.models.BatchJobUpdateContent; +import com.azure.compute.batch.models.BatchJobScheduleGetOptions; +import com.azure.compute.batch.models.BatchJobScheduleReplaceOptions; +import com.azure.compute.batch.models.BatchJobScheduleTerminateOptions; +import com.azure.compute.batch.models.BatchJobScheduleUpdateOptions; +import com.azure.compute.batch.models.BatchJobScheduleUpdateParameters; +import com.azure.compute.batch.models.BatchJobSchedulesListOptions; +import com.azure.compute.batch.models.BatchJobTaskCountsGetOptions; +import com.azure.compute.batch.models.BatchJobTerminateOptions; +import com.azure.compute.batch.models.BatchJobTerminateParameters; +import com.azure.compute.batch.models.BatchJobUpdateOptions; +import com.azure.compute.batch.models.BatchJobUpdateParameters; +import com.azure.compute.batch.models.BatchJobsFromScheduleListOptions; +import com.azure.compute.batch.models.BatchJobsListOptions; import com.azure.compute.batch.models.BatchNode; -import com.azure.compute.batch.models.BatchNodeDeallocateContent; -import com.azure.compute.batch.models.BatchNodeDisableSchedulingContent; +import com.azure.compute.batch.models.BatchNodeDeallocateOptions; +import com.azure.compute.batch.models.BatchNodeDeallocateParameters; +import com.azure.compute.batch.models.BatchNodeDisableSchedulingParameters; +import com.azure.compute.batch.models.BatchNodeExtensionGetOptions; +import com.azure.compute.batch.models.BatchNodeExtensionsListOptions; import com.azure.compute.batch.models.BatchNodeFile; -import com.azure.compute.batch.models.BatchNodeRebootContent; -import com.azure.compute.batch.models.BatchNodeReimageContent; +import com.azure.compute.batch.models.BatchNodeFileDeleteOptions; +import com.azure.compute.batch.models.BatchNodeFileGetOptions; +import com.azure.compute.batch.models.BatchNodeFilesListOptions; +import com.azure.compute.batch.models.BatchNodeGetOptions; +import com.azure.compute.batch.models.BatchNodeLogsUploadOptions; +import com.azure.compute.batch.models.BatchNodeRebootOptions; +import com.azure.compute.batch.models.BatchNodeRebootParameters; +import com.azure.compute.batch.models.BatchNodeReimageOptions; +import com.azure.compute.batch.models.BatchNodeReimageParameters; import com.azure.compute.batch.models.BatchNodeRemoteLoginSettings; -import com.azure.compute.batch.models.BatchNodeRemoveContent; -import com.azure.compute.batch.models.BatchNodeUserCreateContent; -import com.azure.compute.batch.models.BatchNodeUserUpdateContent; +import com.azure.compute.batch.models.BatchNodeRemoteLoginSettingsGetOptions; +import com.azure.compute.batch.models.BatchNodeRemoveParameters; +import com.azure.compute.batch.models.BatchNodeSchedulingDisableOptions; +import com.azure.compute.batch.models.BatchNodeSchedulingEnableOptions; +import com.azure.compute.batch.models.BatchNodeStartOptions; +import com.azure.compute.batch.models.BatchNodeUserCreateOptions; +import com.azure.compute.batch.models.BatchNodeUserCreateParameters; +import com.azure.compute.batch.models.BatchNodeUserDeleteOptions; +import com.azure.compute.batch.models.BatchNodeUserReplaceOptions; +import com.azure.compute.batch.models.BatchNodeUserUpdateParameters; import com.azure.compute.batch.models.BatchNodeVMExtension; +import com.azure.compute.batch.models.BatchNodesListOptions; +import com.azure.compute.batch.models.BatchNodesRemoveOptions; import com.azure.compute.batch.models.BatchPool; -import com.azure.compute.batch.models.BatchPoolCreateContent; -import com.azure.compute.batch.models.BatchPoolEnableAutoScaleContent; -import com.azure.compute.batch.models.BatchPoolEvaluateAutoScaleContent; +import com.azure.compute.batch.models.BatchPoolAutoScaleDisableOptions; +import com.azure.compute.batch.models.BatchPoolAutoScaleEnableOptions; +import com.azure.compute.batch.models.BatchPoolAutoScaleEnableParameters; +import com.azure.compute.batch.models.BatchPoolAutoScaleEvaluateOptions; +import com.azure.compute.batch.models.BatchPoolAutoScaleEvaluateParameters; +import com.azure.compute.batch.models.BatchPoolCreateOptions; +import com.azure.compute.batch.models.BatchPoolCreateParameters; +import com.azure.compute.batch.models.BatchPoolDeleteOptions; import com.azure.compute.batch.models.BatchPoolExistsOptions; +import com.azure.compute.batch.models.BatchPoolGetOptions; import com.azure.compute.batch.models.BatchPoolNodeCounts; -import com.azure.compute.batch.models.BatchPoolReplaceContent; -import com.azure.compute.batch.models.BatchPoolResizeContent; -import com.azure.compute.batch.models.BatchPoolUpdateContent; +import com.azure.compute.batch.models.BatchPoolNodeCountsListOptions; +import com.azure.compute.batch.models.BatchPoolPropertiesReplaceOptions; +import com.azure.compute.batch.models.BatchPoolReplaceParameters; +import com.azure.compute.batch.models.BatchPoolResizeOptions; +import com.azure.compute.batch.models.BatchPoolResizeParameters; +import com.azure.compute.batch.models.BatchPoolResizeStopOptions; +import com.azure.compute.batch.models.BatchPoolUpdateOptions; +import com.azure.compute.batch.models.BatchPoolUpdateParameters; import com.azure.compute.batch.models.BatchPoolUsageMetrics; +import com.azure.compute.batch.models.BatchPoolUsageMetricsListOptions; +import com.azure.compute.batch.models.BatchPoolsListOptions; +import com.azure.compute.batch.models.BatchSubTasksListOptions; import com.azure.compute.batch.models.BatchSubtask; import com.azure.compute.batch.models.BatchSupportedImage; import com.azure.compute.batch.models.BatchTask; -import com.azure.compute.batch.models.BatchTaskAddCollectionResult; +import com.azure.compute.batch.models.BatchTaskCollectionCreateOptions; import com.azure.compute.batch.models.BatchTaskCountsResult; import com.azure.compute.batch.models.BatchTaskCreateContent; +import com.azure.compute.batch.models.BatchTaskCreateOptions; +import com.azure.compute.batch.models.BatchTaskCreateParameters; +import com.azure.compute.batch.models.BatchTaskDeleteOptions; +import com.azure.compute.batch.models.BatchTaskFileDeleteOptions; +import com.azure.compute.batch.models.BatchTaskFileGetOptions; +import com.azure.compute.batch.models.BatchTaskFilesListOptions; +import com.azure.compute.batch.models.BatchTaskGetOptions; import com.azure.compute.batch.models.BatchTaskGroup; -import com.azure.compute.batch.models.CancelBatchCertificateDeletionOptions; -import com.azure.compute.batch.models.CreateBatchCertificateOptions; -import com.azure.compute.batch.models.CreateBatchJobOptions; -import com.azure.compute.batch.models.CreateBatchJobScheduleOptions; -import com.azure.compute.batch.models.CreateBatchNodeUserOptions; -import com.azure.compute.batch.models.CreateBatchPoolOptions; -import com.azure.compute.batch.models.CreateBatchTaskCollectionOptions; -import com.azure.compute.batch.models.CreateBatchTaskOptions; -import com.azure.compute.batch.models.DeallocateBatchNodeOptions; -import com.azure.compute.batch.models.DeleteBatchCertificateOptions; -import com.azure.compute.batch.models.DeleteBatchJobOptions; -import com.azure.compute.batch.models.DeleteBatchJobScheduleOptions; -import com.azure.compute.batch.models.DeleteBatchNodeFileOptions; -import com.azure.compute.batch.models.DeleteBatchNodeUserOptions; -import com.azure.compute.batch.models.DeleteBatchPoolOptions; -import com.azure.compute.batch.models.DeleteBatchTaskFileOptions; -import com.azure.compute.batch.models.DeleteBatchTaskOptions; -import com.azure.compute.batch.models.DisableBatchJobOptions; -import com.azure.compute.batch.models.DisableBatchJobScheduleOptions; -import com.azure.compute.batch.models.DisableBatchNodeSchedulingOptions; -import com.azure.compute.batch.models.DisableBatchPoolAutoScaleOptions; -import com.azure.compute.batch.models.EnableBatchJobOptions; -import com.azure.compute.batch.models.EnableBatchJobScheduleOptions; -import com.azure.compute.batch.models.EnableBatchNodeSchedulingOptions; -import com.azure.compute.batch.models.EnableBatchPoolAutoScaleOptions; -import com.azure.compute.batch.models.EvaluateBatchPoolAutoScaleOptions; +import com.azure.compute.batch.models.BatchTaskReactivateOptions; +import com.azure.compute.batch.models.BatchTaskReplaceOptions; +import com.azure.compute.batch.models.BatchTaskTerminateOptions; +import com.azure.compute.batch.models.BatchTasksListOptions; import com.azure.compute.batch.models.FileResponseHeaderProperties; -import com.azure.compute.batch.models.GetBatchApplicationOptions; -import com.azure.compute.batch.models.GetBatchCertificateOptions; -import com.azure.compute.batch.models.GetBatchJobOptions; -import com.azure.compute.batch.models.GetBatchJobScheduleOptions; -import com.azure.compute.batch.models.GetBatchJobTaskCountsOptions; -import com.azure.compute.batch.models.GetBatchNodeExtensionOptions; -import com.azure.compute.batch.models.GetBatchNodeFileOptions; import com.azure.compute.batch.models.GetBatchNodeFilePropertiesOptions; -import com.azure.compute.batch.models.GetBatchNodeOptions; -import com.azure.compute.batch.models.GetBatchNodeRemoteLoginSettingsOptions; -import com.azure.compute.batch.models.GetBatchPoolOptions; -import com.azure.compute.batch.models.GetBatchTaskFileOptions; import com.azure.compute.batch.models.GetBatchTaskFilePropertiesOptions; -import com.azure.compute.batch.models.GetBatchTaskOptions; -import com.azure.compute.batch.models.GetCertificateResponse; -import com.azure.compute.batch.models.ListBatchApplicationsOptions; -import com.azure.compute.batch.models.ListBatchCertificatesOptions; -import com.azure.compute.batch.models.ListBatchJobPreparationAndReleaseTaskStatusOptions; -import com.azure.compute.batch.models.ListBatchJobSchedulesOptions; -import com.azure.compute.batch.models.ListBatchJobsFromScheduleOptions; -import com.azure.compute.batch.models.ListBatchJobsOptions; -import com.azure.compute.batch.models.ListBatchNodeExtensionsOptions; -import com.azure.compute.batch.models.ListBatchNodeFilesOptions; -import com.azure.compute.batch.models.ListBatchNodesOptions; -import com.azure.compute.batch.models.ListBatchPoolNodeCountsOptions; -import com.azure.compute.batch.models.ListBatchPoolUsageMetricsOptions; -import com.azure.compute.batch.models.ListBatchPoolsOptions; -import com.azure.compute.batch.models.ListBatchSubTasksOptions; -import com.azure.compute.batch.models.ListBatchTaskFilesOptions; -import com.azure.compute.batch.models.ListBatchTasksOptions; -import com.azure.compute.batch.models.ListSupportedBatchImagesOptions; -import com.azure.compute.batch.models.ReactivateBatchTaskOptions; -import com.azure.compute.batch.models.RebootBatchNodeOptions; -import com.azure.compute.batch.models.ReimageBatchNodeOptions; -import com.azure.compute.batch.models.RemoveBatchNodesOptions; -import com.azure.compute.batch.models.ReplaceBatchJobOptions; -import com.azure.compute.batch.models.ReplaceBatchJobScheduleOptions; -import com.azure.compute.batch.models.ReplaceBatchNodeUserOptions; -import com.azure.compute.batch.models.ReplaceBatchPoolPropertiesOptions; -import com.azure.compute.batch.models.ReplaceBatchTaskOptions; -import com.azure.compute.batch.models.ResizeBatchPoolOptions; -import com.azure.compute.batch.models.StartBatchNodeOptions; -import com.azure.compute.batch.models.StopBatchPoolResizeOptions; -import com.azure.compute.batch.models.TerminateBatchJobOptions; -import com.azure.compute.batch.models.TerminateBatchJobScheduleOptions; -import com.azure.compute.batch.models.TerminateBatchTaskOptions; -import com.azure.compute.batch.models.UpdateBatchJobOptions; -import com.azure.compute.batch.models.UpdateBatchJobScheduleOptions; -import com.azure.compute.batch.models.UpdateBatchPoolOptions; -import com.azure.compute.batch.models.UploadBatchNodeLogsOptions; -import com.azure.compute.batch.models.UploadBatchServiceLogsContent; +import com.azure.compute.batch.models.SupportedBatchImagesListOptions; +import com.azure.compute.batch.models.UploadBatchServiceLogsParameters; import com.azure.compute.batch.models.UploadBatchServiceLogsResult; import com.azure.core.annotation.Generated; import com.azure.core.annotation.ReturnType; @@ -143,6 +143,7 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.core.util.DateTimeRfc1123; +import java.time.Duration; import java.time.OffsetDateTime; import java.util.List; import java.util.Objects; @@ -216,7 +217,7 @@ public void createTasks(String jobId, List taskList, * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -264,7 +265,7 @@ public PagedIterable listApplications(RequestOptions requestOptions) * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -314,7 +315,7 @@ public Response getApplicationWithResponse(String applicationId, Req * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -371,7 +372,7 @@ public PagedIterable listPoolUsageMetrics(RequestOptions requestOpti * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -627,8 +628,8 @@ public PagedIterable listPoolUsageMetrics(RequestOptions requestOpti * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -677,7 +678,7 @@ public Response createPoolWithResponse(BinaryData pool, RequestOptions req * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -1001,8 +1002,8 @@ public Response createPoolWithResponse(BinaryData pool, RequestOptions req * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -1074,7 +1075,7 @@ public PagedIterable listPools(RequestOptions requestOptions) { * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -1122,7 +1123,7 @@ public Response deletePoolWithResponse(String poolId, RequestOptions reque * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -1176,7 +1177,7 @@ public Response poolExistsWithResponse(String poolId, RequestOptions re * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
$selectList<String>NoAn OData $select clause. In the form of "," @@ -1516,8 +1517,8 @@ public Response poolExistsWithResponse(String poolId, RequestOptions re * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -1581,7 +1582,7 @@ public Response getPoolWithResponse(String poolId, RequestOptions re * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -1853,8 +1854,8 @@ public Response getPoolWithResponse(String poolId, RequestOptions re * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -1903,7 +1904,7 @@ public Response updatePoolWithResponse(String poolId, BinaryData pool, Req * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -1936,7 +1937,7 @@ public Response disablePoolAutoScaleWithResponse(String poolId, RequestOpt * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -1975,7 +1976,7 @@ public Response disablePoolAutoScaleWithResponse(String poolId, RequestOpt * * * @param poolId The ID of the Pool to get. - * @param content The options to use for enabling automatic scaling. + * @param parameters The options to use for enabling automatic scaling. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1985,9 +1986,9 @@ public Response disablePoolAutoScaleWithResponse(String poolId, RequestOpt */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response enablePoolAutoScaleWithResponse(String poolId, BinaryData content, + public Response enablePoolAutoScaleWithResponse(String poolId, BinaryData parameters, RequestOptions requestOptions) { - return this.serviceClient.enablePoolAutoScaleWithResponse(poolId, content, requestOptions); + return this.serviceClient.enablePoolAutoScaleWithResponse(poolId, parameters, requestOptions); } /** @@ -2000,7 +2001,7 @@ public Response enablePoolAutoScaleWithResponse(String poolId, BinaryData * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -2037,7 +2038,7 @@ public Response enablePoolAutoScaleWithResponse(String poolId, BinaryData * * * @param poolId The ID of the Pool on which to evaluate the automatic scaling formula. - * @param content The options to use for evaluating the automatic scaling formula. + * @param parameters The options to use for evaluating the automatic scaling formula. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -2050,9 +2051,9 @@ public Response enablePoolAutoScaleWithResponse(String poolId, BinaryData */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response evaluatePoolAutoScaleWithResponse(String poolId, BinaryData content, + public Response evaluatePoolAutoScaleWithResponse(String poolId, BinaryData parameters, RequestOptions requestOptions) { - return this.serviceClient.evaluatePoolAutoScaleWithResponse(poolId, content, requestOptions); + return this.serviceClient.evaluatePoolAutoScaleWithResponse(poolId, parameters, requestOptions); } /** @@ -2069,7 +2070,7 @@ public Response evaluatePoolAutoScaleWithResponse(String poolId, Bin * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -2110,7 +2111,7 @@ public Response evaluatePoolAutoScaleWithResponse(String poolId, Bin * * * @param poolId The ID of the Pool to get. - * @param content The options to use for resizing the pool. + * @param parameters The options to use for resizing the pool. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -2120,8 +2121,8 @@ public Response evaluatePoolAutoScaleWithResponse(String poolId, Bin */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response resizePoolWithResponse(String poolId, BinaryData content, RequestOptions requestOptions) { - return this.serviceClient.resizePoolWithResponse(poolId, content, requestOptions); + public Response resizePoolWithResponse(String poolId, BinaryData parameters, RequestOptions requestOptions) { + return this.serviceClient.resizePoolWithResponse(poolId, parameters, requestOptions); } /** @@ -2138,7 +2139,7 @@ public Response resizePoolWithResponse(String poolId, BinaryData content, * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -2190,7 +2191,7 @@ public Response stopPoolResizeWithResponse(String poolId, RequestOptions r * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -2302,7 +2303,7 @@ public Response replacePoolPropertiesWithResponse(String poolId, BinaryDat * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -2344,7 +2345,7 @@ public Response replacePoolPropertiesWithResponse(String poolId, BinaryDat * * * @param poolId The ID of the Pool to get. - * @param content The options to use for removing the node. + * @param parameters The options to use for removing the node. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -2354,8 +2355,8 @@ public Response replacePoolPropertiesWithResponse(String poolId, BinaryDat */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response removeNodesWithResponse(String poolId, BinaryData content, RequestOptions requestOptions) { - return this.serviceClient.removeNodesWithResponse(poolId, content, requestOptions); + public Response removeNodesWithResponse(String poolId, BinaryData parameters, RequestOptions requestOptions) { + return this.serviceClient.removeNodesWithResponse(poolId, parameters, requestOptions); } /** @@ -2364,7 +2365,7 @@ public Response removeNodesWithResponse(String poolId, BinaryData content, * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -2423,7 +2424,7 @@ public PagedIterable listSupportedImages(RequestOptions requestOptio * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -2493,7 +2494,7 @@ public PagedIterable listPoolNodeCounts(RequestOptions requestOption * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
forceBooleanNoIf true, the server will delete the Job even if the @@ -2543,7 +2544,7 @@ public Response deleteJobWithResponse(String jobId, RequestOptions request * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
$selectList<String>NoAn OData $select clause. In the form of "," @@ -2930,8 +2931,8 @@ public Response deleteJobWithResponse(String jobId, RequestOptions request * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -3029,7 +3030,7 @@ public Response getJobWithResponse(String jobId, RequestOptions requ * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -3318,8 +3319,8 @@ public Response getJobWithResponse(String jobId, RequestOptions requ * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -3384,7 +3385,7 @@ public Response updateJobWithResponse(String jobId, BinaryData job, Reques * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -3767,8 +3768,8 @@ public Response updateJobWithResponse(String jobId, BinaryData job, Reques * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -3872,7 +3873,7 @@ public Response replaceJobWithResponse(String jobId, BinaryData job, Reque * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -3910,7 +3911,7 @@ public Response replaceJobWithResponse(String jobId, BinaryData job, Reque * * * @param jobId The ID of the Job to disable. - * @param content The options to use for disabling the Job. + * @param parameters The options to use for disabling the Job. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -3920,8 +3921,8 @@ public Response replaceJobWithResponse(String jobId, BinaryData job, Reque */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response disableJobWithResponse(String jobId, BinaryData content, RequestOptions requestOptions) { - return this.serviceClient.disableJobWithResponse(jobId, content, requestOptions); + public Response disableJobWithResponse(String jobId, BinaryData parameters, RequestOptions requestOptions) { + return this.serviceClient.disableJobWithResponse(jobId, parameters, requestOptions); } /** @@ -3937,7 +3938,7 @@ public Response disableJobWithResponse(String jobId, BinaryData content, R * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -3992,7 +3993,7 @@ public Response enableJobWithResponse(String jobId, RequestOptions request * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
forceBooleanNoIf true, the server will terminate the Job even if the @@ -4063,7 +4064,7 @@ public Response terminateJobWithResponse(String jobId, RequestOptions requ * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -4416,8 +4417,8 @@ public Response terminateJobWithResponse(String jobId, RequestOptions requ * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -4478,7 +4479,7 @@ public Response createJobWithResponse(BinaryData job, RequestOptions reque * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -4849,8 +4850,8 @@ public Response createJobWithResponse(BinaryData job, RequestOptions reque * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -4943,7 +4944,7 @@ public PagedIterable listJobs(RequestOptions requestOptions) { * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -5314,8 +5315,8 @@ public PagedIterable listJobs(RequestOptions requestOptions) { * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -5417,7 +5418,7 @@ public PagedIterable listJobsFromSchedule(String jobScheduleId, Requ * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -5507,7 +5508,7 @@ public PagedIterable listJobPreparationAndReleaseTaskStatus(String j * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -5558,7 +5559,7 @@ public Response getJobTaskCountsWithResponse(String jobId, RequestOp * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -5586,7 +5587,7 @@ public Response getJobTaskCountsWithResponse(String jobId, RequestOp * } * ] * } - * data: String (Required) + * data: byte[] (Required) * certificateFormat: String(pfx/cer) (Optional) * password: String (Optional) * } @@ -5613,7 +5614,7 @@ public Response createCertificateWithResponse(BinaryData certificate, Requ * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -5649,7 +5650,7 @@ public Response createCertificateWithResponse(BinaryData certificate, Requ * } * ] * } - * data: String (Required) + * data: byte[] (Required) * certificateFormat: String(pfx/cer) (Optional) * password: String (Optional) * } @@ -5683,7 +5684,7 @@ public PagedIterable listCertificates(RequestOptions requestOptions) * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -5722,7 +5723,7 @@ public Response cancelCertificateDeletionWithResponse(String thumbprintAlg * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -5750,7 +5751,7 @@ public Response deleteCertificateWithResponse(String thumbprintAlgorithm, * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
$selectList<String>NoAn OData $select clause. In the form of "," @@ -5780,6 +5781,9 @@ public Response deleteCertificateWithResponse(String thumbprintAlgorithm, * } * ] * } + * data: byte[] (Required) + * certificateFormat: String(pfx/cer) (Optional) + * password: String (Optional) * } * } * @@ -5806,7 +5810,7 @@ public Response getCertificateWithResponse(String thumbprintAlgorith * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -5866,7 +5870,7 @@ public Response jobScheduleExistsWithResponse(String jobScheduleId, Req * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
forceBooleanNoIf true, the server will delete the JobSchedule even if the @@ -5916,7 +5920,7 @@ public Response deleteJobScheduleWithResponse(String jobScheduleId, Reques * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
$selectList<String>NoAn OData $select clause. In the form of "," @@ -6317,8 +6321,8 @@ public Response deleteJobScheduleWithResponse(String jobScheduleId, Reques * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -6407,7 +6411,7 @@ public Response getJobScheduleWithResponse(String jobScheduleId, Req * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -6794,8 +6798,8 @@ public Response getJobScheduleWithResponse(String jobScheduleId, Req * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -6862,7 +6866,7 @@ public Response updateJobScheduleWithResponse(String jobScheduleId, Binary * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -7259,8 +7263,8 @@ public Response updateJobScheduleWithResponse(String jobScheduleId, Binary * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -7347,7 +7351,7 @@ public Response replaceJobScheduleWithResponse(String jobScheduleId, Binar * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -7395,7 +7399,7 @@ public Response disableJobScheduleWithResponse(String jobScheduleId, Reque * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -7443,7 +7447,7 @@ public Response enableJobScheduleWithResponse(String jobScheduleId, Reques * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
forceBooleanNoIf true, the server will terminate the JobSchedule even if the @@ -7493,7 +7497,7 @@ public Response terminateJobScheduleWithResponse(String jobScheduleId, Req * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -7860,8 +7864,8 @@ public Response terminateJobScheduleWithResponse(String jobScheduleId, Req * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -7920,7 +7924,7 @@ public Response createJobScheduleWithResponse(BinaryData jobSchedule, Requ * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -8305,8 +8309,8 @@ public Response createJobScheduleWithResponse(BinaryData jobSchedule, Requ * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -8392,7 +8396,7 @@ public PagedIterable listJobSchedules(RequestOptions requestOptions) * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -8557,7 +8561,7 @@ public Response createTaskWithResponse(String jobId, BinaryData task, Requ * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -8797,7 +8801,7 @@ public PagedIterable listTasks(String jobId, RequestOptions requestO * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -8979,7 +8983,7 @@ public PagedIterable listTasks(String jobId, RequestOptions requestO * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the result of adding a collection of Tasks to a Job along with {@link Response}. + * @return the result of creating a collection of Tasks to a Job along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -9000,7 +9004,7 @@ public Response createTaskCollectionWithResponse(String jobId, Binar * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -9053,7 +9057,7 @@ public Response deleteTaskWithResponse(String jobId, String taskId, Reques * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
$selectList<String>NoAn OData $select clause. In the form of "," @@ -9298,7 +9302,7 @@ public Response getTaskWithResponse(String jobId, String taskId, Req * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -9541,7 +9545,7 @@ public Response replaceTaskWithResponse(String jobId, String taskId, Binar * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
$selectList<String>NoAn OData $select clause. In the form of "," @@ -9615,7 +9619,7 @@ public PagedIterable listSubTasks(String jobId, String taskId, Reque * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -9673,7 +9677,7 @@ public Response terminateTaskWithResponse(String jobId, String taskId, Req * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -9722,7 +9726,7 @@ public Response reactivateTaskWithResponse(String jobId, String taskId, Re * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
recursiveBooleanNoWhether to delete children of a directory. If the filePath @@ -9756,7 +9760,7 @@ public Response deleteTaskFileWithResponse(String jobId, String taskId, St * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -9809,7 +9813,7 @@ public Response getTaskFileWithResponse(String jobId, String taskId, * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -9852,7 +9856,7 @@ public Response getTaskFilePropertiesWithResponse(String jobId, String tas * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -9910,7 +9914,7 @@ public PagedIterable listTaskFiles(String jobId, String taskId, Requ * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -9955,7 +9959,7 @@ public Response createNodeUserWithResponse(String poolId, String nodeId, B * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -9989,7 +9993,7 @@ public Response deleteNodeUserWithResponse(String poolId, String nodeId, S * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -10009,7 +10013,7 @@ public Response deleteNodeUserWithResponse(String poolId, String nodeId, S * @param poolId The ID of the Pool that contains the Compute Node. * @param nodeId The ID of the machine on which you want to update a user Account. * @param userName The name of the user Account to update. - * @param content The options to use for updating the user. + * @param parameters The options to use for updating the user. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -10019,9 +10023,9 @@ public Response deleteNodeUserWithResponse(String poolId, String nodeId, S */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response replaceNodeUserWithResponse(String poolId, String nodeId, String userName, BinaryData content, - RequestOptions requestOptions) { - return this.serviceClient.replaceNodeUserWithResponse(poolId, nodeId, userName, content, requestOptions); + public Response replaceNodeUserWithResponse(String poolId, String nodeId, String userName, + BinaryData parameters, RequestOptions requestOptions) { + return this.serviceClient.replaceNodeUserWithResponse(poolId, nodeId, userName, parameters, requestOptions); } /** @@ -10030,7 +10034,7 @@ public Response replaceNodeUserWithResponse(String poolId, String nodeId, * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
$selectList<String>NoAn OData $select clause. In the form of "," @@ -10227,7 +10231,7 @@ public Response getNodeWithResponse(String poolId, String nodeId, Re * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -10273,7 +10277,7 @@ public Response rebootNodeWithResponse(String poolId, String nodeId, Reque * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -10304,7 +10308,7 @@ public Response startNodeWithResponse(String poolId, String nodeId, Reques * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -10350,7 +10354,7 @@ public Response reimageNodeWithResponse(String poolId, String nodeId, Requ * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -10397,7 +10401,7 @@ public Response deallocateNodeWithResponse(String poolId, String nodeId, R * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -10445,7 +10449,7 @@ public Response disableNodeSchedulingWithResponse(String poolId, String no * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -10476,7 +10480,7 @@ public Response enableNodeSchedulingWithResponse(String poolId, String nod * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -10523,7 +10527,7 @@ public Response getNodeRemoteLoginSettingsWithResponse(String poolId * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -10557,7 +10561,7 @@ public Response getNodeRemoteLoginSettingsWithResponse(String poolId * @param poolId The ID of the Pool that contains the Compute Node. * @param nodeId The ID of the Compute Node for which you want to get the Remote Desktop * Protocol file. - * @param content The Azure Batch service log files upload options. + * @param parameters The Azure Batch service log files upload options. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -10567,9 +10571,9 @@ public Response getNodeRemoteLoginSettingsWithResponse(String poolId */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response uploadNodeLogsWithResponse(String poolId, String nodeId, BinaryData content, + public Response uploadNodeLogsWithResponse(String poolId, String nodeId, BinaryData parameters, RequestOptions requestOptions) { - return this.serviceClient.uploadNodeLogsWithResponse(poolId, nodeId, content, requestOptions); + return this.serviceClient.uploadNodeLogsWithResponse(poolId, nodeId, parameters, requestOptions); } /** @@ -10578,7 +10582,7 @@ public Response uploadNodeLogsWithResponse(String poolId, String nod * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -10778,7 +10782,7 @@ public PagedIterable listNodes(String poolId, RequestOptions request * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
$selectList<String>NoAn OData $select clause. In the form of "," @@ -10850,7 +10854,7 @@ public Response getNodeExtensionWithResponse(String poolId, String n * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -10924,7 +10928,7 @@ public PagedIterable listNodeExtensions(String poolId, String nodeId * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
recursiveBooleanNoWhether to delete children of a directory. If the filePath @@ -10958,7 +10962,7 @@ public Response deleteNodeFileWithResponse(String poolId, String nodeId, S * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -11011,7 +11015,7 @@ public Response getNodeFileWithResponse(String poolId, String nodeId * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -11054,7 +11058,7 @@ public Response getNodeFilePropertiesWithResponse(String poolId, String no * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -11101,38 +11105,6 @@ public PagedIterable listNodeFiles(String poolId, String nodeId, Req return this.serviceClient.listNodeFiles(poolId, nodeId, requestOptions); } - /** - * Lists all of the applications available in the specified Account. - * - * This operation returns only Applications and versions that are available for - * use on Compute Nodes; that is, that can be used in an Package reference. For - * administrator information about applications and versions that are not yet - * available to Compute Nodes, use the Azure portal or the Azure Resource Manager - * API. - * - * @param options Optional parameters for List Applications operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of listing the applications available in an Account as paginated response with - * {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listApplications(ListBatchApplicationsOptions options) { - // Generated convenience method for listApplications - RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); - if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); - } - return serviceClient.listApplications(requestOptions) - .mapPage(bodyItemValue -> bodyItemValue.toObject(BatchApplication.class)); - } - /** * Lists all of the applications available in the specified Account. * @@ -11159,40 +11131,6 @@ public PagedIterable listApplications() { .mapPage(bodyItemValue -> bodyItemValue.toObject(BatchApplication.class)); } - /** - * Gets information about the specified Application. - * - * This operation returns only Applications and versions that are available for - * use on Compute Nodes; that is, that can be used in an Package reference. For - * administrator information about Applications and versions that are not yet - * available to Compute Nodes, use the Azure portal or the Azure Resource Manager - * API. - * - * @param applicationId The ID of the Application. - * @param options Optional parameters for Get Application operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified Application. - * - * This operation returns only Applications and versions that are available for - * use on Compute Nodes; that is, that can be used in an Package reference. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public BatchApplication getApplication(String applicationId, GetBatchApplicationOptions options) { - // Generated convenience method for getApplicationWithResponse - RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); - if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); - } - return getApplicationWithResponse(applicationId, requestOptions).getValue().toObject(BatchApplication.class); - } - /** * Gets information about the specified Application. * @@ -11233,8 +11171,6 @@ public BatchApplication getApplication(String applicationId) { * times of the last aggregation interval currently available; that is, only the * last aggregation interval is returned. * - * @param options Optional parameters for List Pool Usage Metrics operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. @@ -11245,66 +11181,49 @@ public BatchApplication getApplication(String applicationId) { */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listPoolUsageMetrics(ListBatchPoolUsageMetricsOptions options) { + public PagedIterable listPoolUsageMetrics() { // Generated convenience method for listPoolUsageMetrics RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); - OffsetDateTime startTime = options == null ? null : options.getStartTime(); - OffsetDateTime endtime = options == null ? null : options.getEndtime(); - String filter = options == null ? null : options.getFilter(); - if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); - } - if (startTime != null) { - requestOptions.addQueryParam("startTime", String.valueOf(startTime), false); - } - if (endtime != null) { - requestOptions.addQueryParam("endtime", String.valueOf(endtime), false); - } - if (filter != null) { - requestOptions.addQueryParam("$filter", filter, false); - } return serviceClient.listPoolUsageMetrics(requestOptions) .mapPage(bodyItemValue -> bodyItemValue.toObject(BatchPoolUsageMetrics.class)); } /** - * Lists the usage metrics, aggregated by Pool across individual time intervals, - * for the specified Account. - * - * If you do not specify a $filter clause including a poolId, the response - * includes all Pools that existed in the Account in the time range of the - * returned aggregation intervals. If you do not specify a $filter clause - * including a startTime or endTime these filters default to the start and end - * times of the last aggregation interval currently available; that is, only the - * last aggregation interval is returned. + * Lists all of the Pools which be mounted. * * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a listing the usage metrics for an Account as paginated response with - * {@link PagedIterable}. + * @return the result of listing the Pools in an Account as paginated response with {@link PagedIterable}. */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listPoolUsageMetrics() { - // Generated convenience method for listPoolUsageMetrics + public PagedIterable listPools() { + // Generated convenience method for listPools RequestOptions requestOptions = new RequestOptions(); - return serviceClient.listPoolUsageMetrics(requestOptions) - .mapPage(bodyItemValue -> bodyItemValue.toObject(BatchPoolUsageMetrics.class)); + return serviceClient.listPools(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(BatchPool.class)); } /** - * Creates a Pool to the specified Account. + * Deletes a Pool from the specified Account. * - * When naming Pools, avoid including sensitive information such as user names or - * secret project names. This information may appear in telemetry logs accessible - * to Microsoft Support engineers. + * When you request that a Pool be deleted, the following actions occur: the Pool + * state is set to deleting; any ongoing resize operation on the Pool are stopped; + * the Batch service starts resizing the Pool to zero Compute Nodes; any Tasks + * running on existing Compute Nodes are terminated and requeued (as if a resize + * Pool operation had been requested with the default requeue option); finally, + * the Pool is removed from the system. Because running Tasks are requeued, the + * user can rerun these Tasks by updating their Job to target a different Pool. + * The Tasks can then run on the new Pool. If you want to override the requeue + * behavior, then you should call resize Pool explicitly to shrink the Pool to + * zero size before deleting the Pool. If you call an Update, Patch or Delete API + * on a Pool in the deleting state, it will fail with HTTP status code 409 with + * error code PoolBeingDeleted. * - * @param pool The Pool to be created. - * @param options Optional parameters for Create Pool operation. + * @param poolId The ID of the Pool to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -11314,157 +11233,1683 @@ public PagedIterable listPoolUsageMetrics() { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void createPool(BatchPoolCreateContent pool, CreateBatchPoolOptions options) { - // Generated convenience method for createPoolWithResponse + public void deletePool(String poolId) { + // Generated convenience method for deletePoolWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); - if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); - } - createPoolWithResponse(BinaryData.fromObject(pool), requestOptions).getValue(); + deletePoolWithResponse(poolId, requestOptions).getValue(); } /** - * Creates a Pool to the specified Account. - * - * When naming Pools, avoid including sensitive information such as user names or - * secret project names. This information may appear in telemetry logs accessible - * to Microsoft Support engineers. + * Gets basic properties of a Pool. * - * @param pool The Pool to be created. + * @param poolId The ID of the Pool to get. + * @param options Optional parameters for Pool Exists operation. + * @param requestConditions Specifies HTTP options for conditional requests based on modification time. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return basic properties of a Pool. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void createPool(BatchPoolCreateContent pool) { - // Generated convenience method for createPoolWithResponse + public boolean poolExists(String poolId, BatchPoolExistsOptions options, RequestConditions requestConditions) { + // Generated convenience method for poolExistsWithResponse RequestOptions requestOptions = new RequestOptions(); - createPoolWithResponse(BinaryData.fromObject(pool), requestOptions).getValue(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); + OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); + String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); + String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); + if (timeOutInSeconds != null) { + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); + } + if (ifModifiedSince != null) { + requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, + String.valueOf(new DateTimeRfc1123(ifModifiedSince))); + } + if (ifUnmodifiedSince != null) { + requestOptions.setHeader(HttpHeaderName.IF_UNMODIFIED_SINCE, + String.valueOf(new DateTimeRfc1123(ifUnmodifiedSince))); + } + if (ifMatch != null) { + requestOptions.setHeader(HttpHeaderName.IF_MATCH, ifMatch); + } + if (ifNoneMatch != null) { + requestOptions.setHeader(HttpHeaderName.IF_NONE_MATCH, ifNoneMatch); + } + return poolExistsWithResponse(poolId, requestOptions).getValue(); } /** - * Lists all of the Pools which be mounted. + * Gets basic properties of a Pool. * - * @param options Optional parameters for List Pools operation. + * @param poolId The ID of the Pool to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of listing the Pools in an Account as paginated response with {@link PagedIterable}. + * @return basic properties of a Pool. */ @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listPools(ListBatchPoolsOptions options) { - // Generated convenience method for listPools + @ServiceMethod(returns = ReturnType.SINGLE) + public boolean poolExists(String poolId) { + // Generated convenience method for poolExistsWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); - String filter = options == null ? null : options.getFilter(); - List select = options == null ? null : options.getSelect(); - List expand = options == null ? null : options.getExpand(); - if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); - } - if (filter != null) { - requestOptions.addQueryParam("$filter", filter, false); - } - if (select != null) { - requestOptions.addQueryParam("$select", - select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")), - false); - } - if (expand != null) { - requestOptions.addQueryParam("$expand", - expand.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")), - false); - } - return serviceClient.listPools(requestOptions) - .mapPage(bodyItemValue -> bodyItemValue.toObject(BatchPool.class)); + return poolExistsWithResponse(poolId, requestOptions).getValue(); } /** - * Lists all of the Pools which be mounted. + * Gets information about the specified Pool. * + * @param poolId The ID of the Pool to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of listing the Pools in an Account as paginated response with {@link PagedIterable}. + * @return information about the specified Pool. */ @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listPools() { - // Generated convenience method for listPools + @ServiceMethod(returns = ReturnType.SINGLE) + public BatchPool getPool(String poolId) { + // Generated convenience method for getPoolWithResponse RequestOptions requestOptions = new RequestOptions(); - return serviceClient.listPools(requestOptions) - .mapPage(bodyItemValue -> bodyItemValue.toObject(BatchPool.class)); + return getPoolWithResponse(poolId, requestOptions).getValue().toObject(BatchPool.class); + } + + /** + * Disables automatic scaling for a Pool. + * + * @param poolId The ID of the Pool on which to disable automatic scaling. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void disablePoolAutoScale(String poolId) { + // Generated convenience method for disablePoolAutoScaleWithResponse + RequestOptions requestOptions = new RequestOptions(); + disablePoolAutoScaleWithResponse(poolId, requestOptions).getValue(); + } + + /** + * Stops an ongoing resize operation on the Pool. + * + * This does not restore the Pool to its previous state before the resize + * operation: it only stops any further changes being made, and the Pool maintains + * its current state. After stopping, the Pool stabilizes at the number of Compute + * Nodes it was at when the stop operation was done. During the stop operation, + * the Pool allocation state changes first to stopping and then to steady. A + * resize operation need not be an explicit resize Pool request; this API can also + * be used to halt the initial sizing of the Pool when it is created. + * + * @param poolId The ID of the Pool to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void stopPoolResize(String poolId) { + // Generated convenience method for stopPoolResizeWithResponse + RequestOptions requestOptions = new RequestOptions(); + stopPoolResizeWithResponse(poolId, requestOptions).getValue(); + } + + /** + * Lists all Virtual Machine Images supported by the Azure Batch service. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of listing the supported Virtual Machine Images as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSupportedImages() { + // Generated convenience method for listSupportedImages + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listSupportedImages(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(BatchSupportedImage.class)); + } + + /** + * Gets the number of Compute Nodes in each state, grouped by Pool. Note that the + * numbers returned may not always be up to date. If you need exact node counts, + * use a list query. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the number of Compute Nodes in each state, grouped by Pool as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listPoolNodeCounts() { + // Generated convenience method for listPoolNodeCounts + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listPoolNodeCounts(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(BatchPoolNodeCounts.class)); + } + + /** + * Deletes a Job. + * + * Deleting a Job also deletes all Tasks that are part of that Job, and all Job + * statistics. This also overrides the retention period for Task data; that is, if + * the Job contains Tasks which are still retained on Compute Nodes, the Batch + * services deletes those Tasks' working directories and all their contents. When + * a Delete Job request is received, the Batch service sets the Job to the + * deleting state. All update operations on a Job that is in deleting state will + * fail with status code 409 (Conflict), with additional information indicating + * that the Job is being deleted. + * + * @param jobId The ID of the Job to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteJob(String jobId) { + // Generated convenience method for deleteJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteJobWithResponse(jobId, requestOptions).getValue(); + } + + /** + * Gets information about the specified Job. + * + * @param jobId The ID of the Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified Job. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public BatchJob getJob(String jobId) { + // Generated convenience method for getJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getJobWithResponse(jobId, requestOptions).getValue().toObject(BatchJob.class); + } + + /** + * Updates the properties of the specified Job. + * + * This fully replaces all the updatable properties of the Job. For example, if + * the Job has constraints associated with it and if constraints is not specified + * with this request, then the Batch service will remove the existing constraints. + * + * @param jobId The ID of the Job whose properties you want to update. + * @param job A job with updated properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void replaceJob(String jobId, BatchJob job) { + // Generated convenience method for replaceJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + replaceJobWithResponse(jobId, BinaryData.fromObject(job), requestOptions).getValue(); + } + + /** + * Enables the specified Job, allowing new Tasks to run. + * + * When you call this API, the Batch service sets a disabled Job to the enabling + * state. After the this operation is completed, the Job moves to the active + * state, and scheduling of new Tasks under the Job resumes. The Batch service + * does not allow a Task to remain in the active state for more than 180 days. + * Therefore, if you enable a Job containing active Tasks which were added more + * than 180 days ago, those Tasks will not run. + * + * @param jobId The ID of the Job to enable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void enableJob(String jobId) { + // Generated convenience method for enableJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + enableJobWithResponse(jobId, requestOptions).getValue(); + } + + /** + * Terminates the specified Job, marking it as completed. + * + * When a Terminate Job request is received, the Batch service sets the Job to the + * terminating state. The Batch service then terminates any running Tasks + * associated with the Job and runs any required Job release Tasks. Then the Job + * moves into the completed state. If there are any Tasks in the Job in the active + * state, they will remain in the active state. Once a Job is terminated, new + * Tasks cannot be added and any remaining active Tasks will not be scheduled. + * + * @param jobId The ID of the Job to terminate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void terminateJob(String jobId) { + // Generated convenience method for terminateJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + terminateJobWithResponse(jobId, requestOptions).getValue(); + } + + /** + * Lists all of the Jobs in the specified Account. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of listing the Jobs in an Account as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listJobs() { + // Generated convenience method for listJobs + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listJobs(requestOptions).mapPage(bodyItemValue -> bodyItemValue.toObject(BatchJob.class)); + } + + /** + * Lists the Jobs that have been created under the specified Job Schedule. + * + * @param jobScheduleId The ID of the Job Schedule from which you want to get a list of Jobs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of listing the Jobs in an Account as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listJobsFromSchedule(String jobScheduleId) { + // Generated convenience method for listJobsFromSchedule + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listJobsFromSchedule(jobScheduleId, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(BatchJob.class)); + } + + /** + * Lists the execution status of the Job Preparation and Job Release Task for the + * specified Job across the Compute Nodes where the Job has run. + * + * This API returns the Job Preparation and Job Release Task status on all Compute + * Nodes that have run the Job Preparation or Job Release Task. This includes + * Compute Nodes which have since been removed from the Pool. If this API is + * invoked on a Job which has no Job Preparation or Job Release Task, the Batch + * service returns HTTP status code 409 (Conflict) with an error code of + * JobPreparationTaskNotSpecified. + * + * @param jobId The ID of the Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of listing the status of the Job Preparation and Job Release Tasks + * for a Job as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listJobPreparationAndReleaseTaskStatus(String jobId) { + // Generated convenience method for listJobPreparationAndReleaseTaskStatus + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listJobPreparationAndReleaseTaskStatus(jobId, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(BatchJobPreparationAndReleaseTaskStatus.class)); + } + + /** + * Gets the Task counts for the specified Job. + * + * Task counts provide a count of the Tasks by active, running or completed Task + * state, and a count of Tasks which succeeded or failed. Tasks in the preparing + * state are counted as running. Note that the numbers returned may not always be + * up to date. If you need exact task counts, use a list query. + * + * @param jobId The ID of the Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Task counts for the specified Job. + * + * Task counts provide a count of the Tasks by active, running or completed Task + * state, and a count of Tasks which succeeded or failed. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public BatchTaskCountsResult getJobTaskCounts(String jobId) { + // Generated convenience method for getJobTaskCountsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getJobTaskCountsWithResponse(jobId, requestOptions).getValue().toObject(BatchTaskCountsResult.class); + } + + /** + * Creates a Certificate to the specified Account. + * + * @param certificate The Certificate to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void createCertificate(BatchCertificate certificate) { + // Generated convenience method for createCertificateWithResponse + RequestOptions requestOptions = new RequestOptions(); + createCertificateWithResponse(BinaryData.fromObject(certificate), requestOptions).getValue(); + } + + /** + * Lists all of the Certificates that have been added to the specified Account. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of listing the Certificates in the Account as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listCertificates() { + // Generated convenience method for listCertificates + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listCertificates(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(BatchCertificate.class)); + } + + /** + * Cancels a failed deletion of a Certificate from the specified Account. + * + * If you try to delete a Certificate that is being used by a Pool or Compute + * Node, the status of the Certificate changes to deleteFailed. If you decide that + * you want to continue using the Certificate, you can use this operation to set + * the status of the Certificate back to active. If you intend to delete the + * Certificate, you do not need to run this operation after the deletion failed. + * You must make sure that the Certificate is not being used by any resources, and + * then you can try again to delete the Certificate. + * + * @param thumbprintAlgorithm The algorithm used to derive the thumbprint parameter. This must be sha1. + * @param thumbprint The thumbprint of the Certificate being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void cancelCertificateDeletion(String thumbprintAlgorithm, String thumbprint) { + // Generated convenience method for cancelCertificateDeletionWithResponse + RequestOptions requestOptions = new RequestOptions(); + cancelCertificateDeletionWithResponse(thumbprintAlgorithm, thumbprint, requestOptions).getValue(); + } + + /** + * Deletes a Certificate from the specified Account. + * + * You cannot delete a Certificate if a resource (Pool or Compute Node) is using + * it. Before you can delete a Certificate, you must therefore make sure that the + * Certificate is not associated with any existing Pools, the Certificate is not + * installed on any Nodes (even if you remove a Certificate from a Pool, it is not + * removed from existing Compute Nodes in that Pool until they restart), and no + * running Tasks depend on the Certificate. If you try to delete a Certificate + * that is in use, the deletion fails. The Certificate status changes to + * deleteFailed. You can use Cancel Delete Certificate to set the status back to + * active if you decide that you want to continue using the Certificate. + * + * @param thumbprintAlgorithm The algorithm used to derive the thumbprint parameter. This must be sha1. + * @param thumbprint The thumbprint of the Certificate to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteCertificate(String thumbprintAlgorithm, String thumbprint) { + // Generated convenience method for deleteCertificateWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteCertificateWithResponse(thumbprintAlgorithm, thumbprint, requestOptions).getValue(); + } + + /** + * Gets information about the specified Certificate. + * + * @param thumbprintAlgorithm The algorithm used to derive the thumbprint parameter. This must be sha1. + * @param thumbprint The thumbprint of the Certificate to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified Certificate. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public BatchCertificate getCertificate(String thumbprintAlgorithm, String thumbprint) { + // Generated convenience method for getCertificateWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getCertificateWithResponse(thumbprintAlgorithm, thumbprint, requestOptions).getValue() + .toObject(BatchCertificate.class); + } + + /** + * Checks the specified Job Schedule exists. + * + * @param jobScheduleId The ID of the Job Schedule which you want to check. + * @param options Optional parameters for Job Schedule Exists operation. + * @param requestConditions Specifies HTTP options for conditional requests based on modification time. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public boolean jobScheduleExists(String jobScheduleId, BatchJobScheduleExistsOptions options, + RequestConditions requestConditions) { + // Generated convenience method for jobScheduleExistsWithResponse + RequestOptions requestOptions = new RequestOptions(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); + OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); + String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); + String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); + if (timeOutInSeconds != null) { + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); + } + if (ifModifiedSince != null) { + requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, + String.valueOf(new DateTimeRfc1123(ifModifiedSince))); + } + if (ifUnmodifiedSince != null) { + requestOptions.setHeader(HttpHeaderName.IF_UNMODIFIED_SINCE, + String.valueOf(new DateTimeRfc1123(ifUnmodifiedSince))); + } + if (ifMatch != null) { + requestOptions.setHeader(HttpHeaderName.IF_MATCH, ifMatch); + } + if (ifNoneMatch != null) { + requestOptions.setHeader(HttpHeaderName.IF_NONE_MATCH, ifNoneMatch); + } + return jobScheduleExistsWithResponse(jobScheduleId, requestOptions).getValue(); + } + + /** + * Checks the specified Job Schedule exists. + * + * @param jobScheduleId The ID of the Job Schedule which you want to check. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public boolean jobScheduleExists(String jobScheduleId) { + // Generated convenience method for jobScheduleExistsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return jobScheduleExistsWithResponse(jobScheduleId, requestOptions).getValue(); + } + + /** + * Deletes a Job Schedule from the specified Account. + * + * When you delete a Job Schedule, this also deletes all Jobs and Tasks under that + * schedule. When Tasks are deleted, all the files in their working directories on + * the Compute Nodes are also deleted (the retention period is ignored). The Job + * Schedule statistics are no longer accessible once the Job Schedule is deleted, + * though they are still counted towards Account lifetime statistics. + * + * @param jobScheduleId The ID of the Job Schedule to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteJobSchedule(String jobScheduleId) { + // Generated convenience method for deleteJobScheduleWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteJobScheduleWithResponse(jobScheduleId, requestOptions).getValue(); + } + + /** + * Gets information about the specified Job Schedule. + * + * @param jobScheduleId The ID of the Job Schedule to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified Job Schedule. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public BatchJobSchedule getJobSchedule(String jobScheduleId) { + // Generated convenience method for getJobScheduleWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getJobScheduleWithResponse(jobScheduleId, requestOptions).getValue().toObject(BatchJobSchedule.class); + } + + /** + * Updates the properties of the specified Job Schedule. + * + * This fully replaces all the updatable properties of the Job Schedule. For + * example, if the schedule property is not specified with this request, then the + * Batch service will remove the existing schedule. Changes to a Job Schedule only + * impact Jobs created by the schedule after the update has taken place; currently + * running Jobs are unaffected. + * + * @param jobScheduleId The ID of the Job Schedule to update. + * @param jobSchedule A Job Schedule with updated properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void replaceJobSchedule(String jobScheduleId, BatchJobSchedule jobSchedule) { + // Generated convenience method for replaceJobScheduleWithResponse + RequestOptions requestOptions = new RequestOptions(); + replaceJobScheduleWithResponse(jobScheduleId, BinaryData.fromObject(jobSchedule), requestOptions).getValue(); + } + + /** + * Disables a Job Schedule. + * + * No new Jobs will be created until the Job Schedule is enabled again. + * + * @param jobScheduleId The ID of the Job Schedule to disable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void disableJobSchedule(String jobScheduleId) { + // Generated convenience method for disableJobScheduleWithResponse + RequestOptions requestOptions = new RequestOptions(); + disableJobScheduleWithResponse(jobScheduleId, requestOptions).getValue(); + } + + /** + * Enables a Job Schedule. + * + * @param jobScheduleId The ID of the Job Schedule to enable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void enableJobSchedule(String jobScheduleId) { + // Generated convenience method for enableJobScheduleWithResponse + RequestOptions requestOptions = new RequestOptions(); + enableJobScheduleWithResponse(jobScheduleId, requestOptions).getValue(); + } + + /** + * Terminates a Job Schedule. + * + * @param jobScheduleId The ID of the Job Schedule to terminates. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void terminateJobSchedule(String jobScheduleId) { + // Generated convenience method for terminateJobScheduleWithResponse + RequestOptions requestOptions = new RequestOptions(); + terminateJobScheduleWithResponse(jobScheduleId, requestOptions).getValue(); + } + + /** + * Lists all of the Job Schedules in the specified Account. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of listing the Job Schedules in an Account as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listJobSchedules() { + // Generated convenience method for listJobSchedules + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listJobSchedules(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(BatchJobSchedule.class)); + } + + /** + * Lists all of the Tasks that are associated with the specified Job. + * + * For multi-instance Tasks, information such as affinityId, executionInfo and + * nodeInfo refer to the primary Task. Use the list subtasks API to retrieve + * information about subtasks. + * + * @param jobId The ID of the Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of listing the Tasks in a Job as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTasks(String jobId) { + // Generated convenience method for listTasks + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listTasks(jobId, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(BatchTask.class)); + } + + /** + * Adds a collection of Tasks to the specified Job. + * + * Note that each Task must have a unique ID. The Batch service may not return the + * results for each Task in the same order the Tasks were submitted in this + * request. If the server times out or the connection is closed during the + * request, the request may have been partially or fully processed, or not at all. + * In such cases, the user should re-issue the request. Note that it is up to the + * user to correctly handle failures when re-issuing a request. For example, you + * should use the same Task IDs during a retry so that if the prior operation + * succeeded, the retry will not create extra Tasks unexpectedly. If the response + * contains any Tasks which failed to add, a client can retry the request. In a + * retry, it is most efficient to resubmit only Tasks that failed to add, and to + * omit Tasks that were successfully added on the first attempt. The maximum + * lifetime of a Task from addition to completion is 180 days. If a Task has not + * completed within 180 days of being added it will be terminated by the Batch + * service and left in whatever state it was in at that time. + * + * @param jobId The ID of the Job to which the Task collection is to be added. + * @param taskCollection The Tasks to be added. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of creating a collection of Tasks to a Job. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public BatchCreateTaskCollectionResult createTaskCollection(String jobId, BatchTaskGroup taskCollection) { + // Generated convenience method for createTaskCollectionWithResponse + RequestOptions requestOptions = new RequestOptions(); + return createTaskCollectionWithResponse(jobId, BinaryData.fromObject(taskCollection), requestOptions).getValue() + .toObject(BatchCreateTaskCollectionResult.class); + } + + /** + * Deletes a Task from the specified Job. + * + * When a Task is deleted, all of the files in its directory on the Compute Node + * where it ran are also deleted (regardless of the retention time). For + * multi-instance Tasks, the delete Task operation applies synchronously to the + * primary task; subtasks and their files are then deleted asynchronously in the + * background. + * + * @param jobId The ID of the Job from which to delete the Task. + * @param taskId The ID of the Task to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteTask(String jobId, String taskId) { + // Generated convenience method for deleteTaskWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteTaskWithResponse(jobId, taskId, requestOptions).getValue(); + } + + /** + * Gets information about the specified Task. + * + * For multi-instance Tasks, information such as affinityId, executionInfo and + * nodeInfo refer to the primary Task. Use the list subtasks API to retrieve + * information about subtasks. + * + * @param jobId The ID of the Job that contains the Task. + * @param taskId The ID of the Task to get information about. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified Task. + * + * For multi-instance Tasks, information such as affinityId, executionInfo and + * nodeInfo refer to the primary Task. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public BatchTask getTask(String jobId, String taskId) { + // Generated convenience method for getTaskWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getTaskWithResponse(jobId, taskId, requestOptions).getValue().toObject(BatchTask.class); + } + + /** + * Updates the properties of the specified Task. + * + * @param jobId The ID of the Job containing the Task. + * @param taskId The ID of the Task to update. + * @param task The Task to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void replaceTask(String jobId, String taskId, BatchTask task) { + // Generated convenience method for replaceTaskWithResponse + RequestOptions requestOptions = new RequestOptions(); + replaceTaskWithResponse(jobId, taskId, BinaryData.fromObject(task), requestOptions).getValue(); + } + + /** + * Lists all of the subtasks that are associated with the specified multi-instance + * Task. + * + * If the Task is not a multi-instance Task then this returns an empty collection. + * + * @param jobId The ID of the Job. + * @param taskId The ID of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of listing the subtasks of a Task as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSubTasks(String jobId, String taskId) { + // Generated convenience method for listSubTasks + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listSubTasks(jobId, taskId, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(BatchSubtask.class)); + } + + /** + * Terminates the specified Task. + * + * When the Task has been terminated, it moves to the completed state. For + * multi-instance Tasks, the terminate Task operation applies synchronously to the + * primary task; subtasks are then terminated asynchronously in the background. + * + * @param jobId The ID of the Job containing the Task. + * @param taskId The ID of the Task to terminate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void terminateTask(String jobId, String taskId) { + // Generated convenience method for terminateTaskWithResponse + RequestOptions requestOptions = new RequestOptions(); + terminateTaskWithResponse(jobId, taskId, requestOptions).getValue(); + } + + /** + * Reactivates a Task, allowing it to run again even if its retry count has been + * exhausted. + * + * Reactivation makes a Task eligible to be retried again up to its maximum retry + * count. The Task's state is changed to active. As the Task is no longer in the + * completed state, any previous exit code or failure information is no longer + * available after reactivation. Each time a Task is reactivated, its retry count + * is reset to 0. Reactivation will fail for Tasks that are not completed or that + * previously completed successfully (with an exit code of 0). Additionally, it + * will fail if the Job has completed (or is terminating or deleting). + * + * @param jobId The ID of the Job containing the Task. + * @param taskId The ID of the Task to reactivate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void reactivateTask(String jobId, String taskId) { + // Generated convenience method for reactivateTaskWithResponse + RequestOptions requestOptions = new RequestOptions(); + reactivateTaskWithResponse(jobId, taskId, requestOptions).getValue(); + } + + /** + * Deletes the specified Task file from the Compute Node where the Task ran. + * + * @param jobId The ID of the Job that contains the Task. + * @param taskId The ID of the Task whose file you want to retrieve. + * @param filePath The path to the Task file that you want to get the content of. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteTaskFile(String jobId, String taskId, String filePath) { + // Generated convenience method for deleteTaskFileWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteTaskFileWithResponse(jobId, taskId, filePath, requestOptions).getValue(); + } + + /** + * Returns the content of the specified Task file. + * + * @param jobId The ID of the Job that contains the Task. + * @param taskId The ID of the Task whose file you want to retrieve. + * @param filePath The path to the Task file that you want to get the content of. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public BinaryData getTaskFile(String jobId, String taskId, String filePath) { + // Generated convenience method for getTaskFileWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getTaskFileWithResponse(jobId, taskId, filePath, requestOptions).getValue(); + } + + /** + * Gets the properties of the specified Task file. + * + * @param jobId The ID of the Job that contains the Task. + * @param taskId The ID of the Task whose file you want to retrieve. + * @param filePath The path to the Task file that you want to get the content of. + * @param options Optional parameters for Get Task File Properties operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return The {@link FileResponseHeaderProperties} object containing the properties retrieved from the response + * headers. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FileResponseHeaderProperties getTaskFileProperties(String jobId, String taskId, String filePath, + GetBatchTaskFilePropertiesOptions options) { + RequestOptions requestOptions = new RequestOptions(); + Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + OffsetDateTime ifModifiedSince = options == null ? null : options.getIfModifiedSince(); + OffsetDateTime ifUnmodifiedSince = options == null ? null : options.getIfUnmodifiedSince(); + if (timeOutInSeconds != null) { + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + } + if (ifModifiedSince != null) { + requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, + String.valueOf(new DateTimeRfc1123(ifModifiedSince))); + } + if (ifUnmodifiedSince != null) { + requestOptions.setHeader(HttpHeaderName.IF_UNMODIFIED_SINCE, + String.valueOf(new DateTimeRfc1123(ifUnmodifiedSince))); + } + // Retrieve response from getTaskFilePropertiesWithResponse and construct FileResponseHeaderProperties from its + // headers + Response response = getTaskFilePropertiesWithResponse(jobId, taskId, filePath, requestOptions); + return new FileResponseHeaderProperties(response.getHeaders()); + } + + /** + * Gets the properties of the specified Task file. + * + * @param jobId The ID of the Job that contains the Task. + * @param taskId The ID of the Task whose file you want to retrieve. + * @param filePath The path to the Task file that you want to get the content of. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return The {@link FileResponseHeaderProperties} object containing the properties retrieved from the response + * headers. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FileResponseHeaderProperties getTaskFileProperties(String jobId, String taskId, String filePath) { + Response response = getTaskFilePropertiesWithResponse(jobId, taskId, filePath, new RequestOptions()); + return new FileResponseHeaderProperties(response.getHeaders()); + } + + /** + * Lists the files in a Task's directory on its Compute Node. + * + * @param jobId The ID of the Job that contains the Task. + * @param taskId The ID of the Task whose files you want to list. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of listing the files on a Compute Node, or the files associated with + * a Task on a Compute Node as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTaskFiles(String jobId, String taskId) { + // Generated convenience method for listTaskFiles + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listTaskFiles(jobId, taskId, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(BatchNodeFile.class)); + } + + /** + * Deletes a user Account from the specified Compute Node. + * + * You can delete a user Account to a Compute Node only when it is in the idle or + * running state. + * + * @param poolId The ID of the Pool that contains the Compute Node. + * @param nodeId The ID of the machine on which you want to delete a user Account. + * @param userName The name of the user Account to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteNodeUser(String poolId, String nodeId, String userName) { + // Generated convenience method for deleteNodeUserWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteNodeUserWithResponse(poolId, nodeId, userName, requestOptions).getValue(); + } + + /** + * Gets information about the specified Compute Node. + * + * @param poolId The ID of the Pool that contains the Compute Node. + * @param nodeId The ID of the Compute Node that you want to get information about. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified Compute Node. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public BatchNode getNode(String poolId, String nodeId) { + // Generated convenience method for getNodeWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getNodeWithResponse(poolId, nodeId, requestOptions).getValue().toObject(BatchNode.class); + } + + /** + * Restarts the specified Compute Node. + * + * You can restart a Compute Node only if it is in an idle or running state. + * + * @param poolId The ID of the Pool that contains the Compute Node. + * @param nodeId The ID of the Compute Node that you want to restart. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void rebootNode(String poolId, String nodeId) { + // Generated convenience method for rebootNodeWithResponse + RequestOptions requestOptions = new RequestOptions(); + rebootNodeWithResponse(poolId, nodeId, requestOptions).getValue(); + } + + /** + * Starts the specified Compute Node. + * + * You can start a Compute Node only if it has been deallocated. + * + * @param poolId The ID of the Pool that contains the Compute Node. + * @param nodeId The ID of the Compute Node that you want to restart. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void startNode(String poolId, String nodeId) { + // Generated convenience method for startNodeWithResponse + RequestOptions requestOptions = new RequestOptions(); + startNodeWithResponse(poolId, nodeId, requestOptions).getValue(); + } + + /** + * Reinstalls the operating system on the specified Compute Node. + * + * You can reinstall the operating system on a Compute Node only if it is in an + * idle or running state. This API can be invoked only on Pools created with the + * cloud service configuration property. + * + * @param poolId The ID of the Pool that contains the Compute Node. + * @param nodeId The ID of the Compute Node that you want to restart. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void reimageNode(String poolId, String nodeId) { + // Generated convenience method for reimageNodeWithResponse + RequestOptions requestOptions = new RequestOptions(); + reimageNodeWithResponse(poolId, nodeId, requestOptions).getValue(); + } + + /** + * Deallocates the specified Compute Node. + * + * You can deallocate a Compute Node only if it is in an idle or running state. + * + * @param poolId The ID of the Pool that contains the Compute Node. + * @param nodeId The ID of the Compute Node that you want to restart. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deallocateNode(String poolId, String nodeId) { + // Generated convenience method for deallocateNodeWithResponse + RequestOptions requestOptions = new RequestOptions(); + deallocateNodeWithResponse(poolId, nodeId, requestOptions).getValue(); + } + + /** + * Disables Task scheduling on the specified Compute Node. + * + * You can disable Task scheduling on a Compute Node only if its current + * scheduling state is enabled. + * + * @param poolId The ID of the Pool that contains the Compute Node. + * @param nodeId The ID of the Compute Node on which you want to disable Task scheduling. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void disableNodeScheduling(String poolId, String nodeId) { + // Generated convenience method for disableNodeSchedulingWithResponse + RequestOptions requestOptions = new RequestOptions(); + disableNodeSchedulingWithResponse(poolId, nodeId, requestOptions).getValue(); + } + + /** + * Enables Task scheduling on the specified Compute Node. + * + * You can enable Task scheduling on a Compute Node only if its current scheduling + * state is disabled. + * + * @param poolId The ID of the Pool that contains the Compute Node. + * @param nodeId The ID of the Compute Node on which you want to enable Task scheduling. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void enableNodeScheduling(String poolId, String nodeId) { + // Generated convenience method for enableNodeSchedulingWithResponse + RequestOptions requestOptions = new RequestOptions(); + enableNodeSchedulingWithResponse(poolId, nodeId, requestOptions).getValue(); + } + + /** + * Gets the settings required for remote login to a Compute Node. + * + * Before you can remotely login to a Compute Node using the remote login settings, + * you must create a user Account on the Compute Node. + * + * @param poolId The ID of the Pool that contains the Compute Node. + * @param nodeId The ID of the Compute Node for which to obtain the remote login settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the settings required for remote login to a Compute Node. + * + * Before you can remotely login to a Compute Node using the remote login settings, + * you must create a user Account on the Compute Node. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public BatchNodeRemoteLoginSettings getNodeRemoteLoginSettings(String poolId, String nodeId) { + // Generated convenience method for getNodeRemoteLoginSettingsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getNodeRemoteLoginSettingsWithResponse(poolId, nodeId, requestOptions).getValue() + .toObject(BatchNodeRemoteLoginSettings.class); + } + + /** + * Lists the Compute Nodes in the specified Pool. + * + * @param poolId The ID of the Pool from which you want to list Compute Nodes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of listing the Compute Nodes in a Pool as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listNodes(String poolId) { + // Generated convenience method for listNodes + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listNodes(poolId, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(BatchNode.class)); + } + + /** + * Gets information about the specified Compute Node Extension. + * + * @param poolId The ID of the Pool that contains the Compute Node. + * @param nodeId The ID of the Compute Node that contains the extensions. + * @param extensionName The name of the Compute Node Extension that you want to get information about. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified Compute Node Extension. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public BatchNodeVMExtension getNodeExtension(String poolId, String nodeId, String extensionName) { + // Generated convenience method for getNodeExtensionWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getNodeExtensionWithResponse(poolId, nodeId, extensionName, requestOptions).getValue() + .toObject(BatchNodeVMExtension.class); + } + + /** + * Lists the Compute Nodes Extensions in the specified Pool. + * + * @param poolId The ID of the Pool that contains Compute Node. + * @param nodeId The ID of the Compute Node that you want to list extensions. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of listing the Compute Node extensions in a Node as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listNodeExtensions(String poolId, String nodeId) { + // Generated convenience method for listNodeExtensions + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listNodeExtensions(poolId, nodeId, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(BatchNodeVMExtension.class)); + } + + /** + * Deletes the specified file from the Compute Node. + * + * @param poolId The ID of the Pool that contains the Compute Node. + * @param nodeId The ID of the Compute Node. + * @param filePath The path to the file or directory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteNodeFile(String poolId, String nodeId, String filePath) { + // Generated convenience method for deleteNodeFileWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteNodeFileWithResponse(poolId, nodeId, filePath, requestOptions).getValue(); + } + + /** + * Returns the content of the specified Compute Node file. + * + * @param poolId The ID of the Pool that contains the Compute Node. + * @param nodeId The ID of the Compute Node. + * @param filePath The path to the file or directory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public BinaryData getNodeFile(String poolId, String nodeId, String filePath) { + // Generated convenience method for getNodeFileWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getNodeFileWithResponse(poolId, nodeId, filePath, requestOptions).getValue(); + } + + /** + * Gets the properties of the specified Compute Node file. + * + * @param poolId The ID of the Pool that contains the Compute Node. + * @param nodeId The ID of the Compute Node. + * @param filePath The path to the file or directory. + * @param options Optional parameters for Get Node File Properties operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return The {@link FileResponseHeaderProperties} object containing the properties retrieved from the response + * headers. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FileResponseHeaderProperties getNodeFileProperties(String poolId, String nodeId, String filePath, + GetBatchNodeFilePropertiesOptions options) { + RequestOptions requestOptions = new RequestOptions(); + Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + OffsetDateTime ifModifiedSince = options == null ? null : options.getIfModifiedSince(); + OffsetDateTime ifUnmodifiedSince = options == null ? null : options.getIfUnmodifiedSince(); + if (timeOutInSeconds != null) { + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + } + if (ifModifiedSince != null) { + requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, + String.valueOf(new DateTimeRfc1123(ifModifiedSince))); + } + if (ifUnmodifiedSince != null) { + requestOptions.setHeader(HttpHeaderName.IF_UNMODIFIED_SINCE, + String.valueOf(new DateTimeRfc1123(ifUnmodifiedSince))); + } + // Retrieve response from getNodeFilePropertiesWithResponse and construct NodeFileProperties from its headers + Response response = getNodeFilePropertiesWithResponse(poolId, nodeId, filePath, requestOptions); + return new FileResponseHeaderProperties(response.getHeaders()); + } + + /** + * Gets the properties of the specified Compute Node file. + * + * @param poolId The ID of the Pool that contains the Compute Node. + * @param nodeId The ID of the Compute Node. + * @param filePath The path to the file or directory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return The {@link FileResponseHeaderProperties} object containing the properties retrieved from the response + * headers. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FileResponseHeaderProperties getNodeFileProperties(String poolId, String nodeId, String filePath) { + Response response = getNodeFilePropertiesWithResponse(poolId, nodeId, filePath, new RequestOptions()); + return new FileResponseHeaderProperties(response.getHeaders()); + } + + /** + * Lists all of the files in Task directories on the specified Compute Node. + * + * @param poolId The ID of the Pool that contains the Compute Node. + * @param nodeId The ID of the Compute Node whose files you want to list. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of listing the files on a Compute Node, or the files associated with + * a Task on a Compute Node as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listNodeFiles(String poolId, String nodeId) { + // Generated convenience method for listNodeFiles + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listNodeFiles(poolId, nodeId, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(BatchNodeFile.class)); + } + + /** + * Lists all of the applications available in the specified Account. + * + * This operation returns only Applications and versions that are available for + * use on Compute Nodes; that is, that can be used in an Package reference. For + * administrator information about applications and versions that are not yet + * available to Compute Nodes, use the Azure portal or the Azure Resource Manager + * API. + * + * @param options Optional parameters for List Applications operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of listing the applications available in an Account as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listApplications(BatchApplicationsListOptions options) { + // Generated convenience method for listApplications + RequestOptions requestOptions = new RequestOptions(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + if (timeOutInSeconds != null) { + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); + } + return serviceClient.listApplications(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(BatchApplication.class)); + } + + /** + * Gets information about the specified Application. + * + * This operation returns only Applications and versions that are available for + * use on Compute Nodes; that is, that can be used in an Package reference. For + * administrator information about Applications and versions that are not yet + * available to Compute Nodes, use the Azure portal or the Azure Resource Manager + * API. + * + * @param applicationId The ID of the Application. + * @param options Optional parameters for Get Application operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified Application. + * + * This operation returns only Applications and versions that are available for + * use on Compute Nodes; that is, that can be used in an Package reference. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public BatchApplication getApplication(String applicationId, BatchApplicationGetOptions options) { + // Generated convenience method for getApplicationWithResponse + RequestOptions requestOptions = new RequestOptions(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + if (timeOutInSeconds != null) { + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); + } + return getApplicationWithResponse(applicationId, requestOptions).getValue().toObject(BatchApplication.class); + } + + /** + * Lists the usage metrics, aggregated by Pool across individual time intervals, + * for the specified Account. + * + * If you do not specify a $filter clause including a poolId, the response + * includes all Pools that existed in the Account in the time range of the + * returned aggregation intervals. If you do not specify a $filter clause + * including a startTime or endTime these filters default to the start and end + * times of the last aggregation interval currently available; that is, only the + * last aggregation interval is returned. + * + * @param options Optional parameters for List Pool Usage Metrics operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a listing the usage metrics for an Account as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listPoolUsageMetrics(BatchPoolUsageMetricsListOptions options) { + // Generated convenience method for listPoolUsageMetrics + RequestOptions requestOptions = new RequestOptions(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + OffsetDateTime startTime = options == null ? null : options.getStartTime(); + OffsetDateTime endtime = options == null ? null : options.getEndtime(); + String filter = options == null ? null : options.getFilter(); + if (timeOutInSeconds != null) { + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); + } + if (startTime != null) { + requestOptions.addQueryParam("startTime", String.valueOf(startTime), false); + } + if (endtime != null) { + requestOptions.addQueryParam("endtime", String.valueOf(endtime), false); + } + if (filter != null) { + requestOptions.addQueryParam("$filter", filter, false); + } + return serviceClient.listPoolUsageMetrics(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(BatchPoolUsageMetrics.class)); + } + + /** + * Creates a Pool to the specified Account. + * + * When naming Pools, avoid including sensitive information such as user names or + * secret project names. This information may appear in telemetry logs accessible + * to Microsoft Support engineers. + * + * @param pool The Pool to be created. + * @param options Optional parameters for Create Pool operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void createPool(BatchPoolCreateParameters pool, BatchPoolCreateOptions options) { + // Generated convenience method for createPoolWithResponse + RequestOptions requestOptions = new RequestOptions(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + if (timeOutInSeconds != null) { + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); + } + createPoolWithResponse(BinaryData.fromObject(pool), requestOptions).getValue(); + } + + /** + * Creates a Pool to the specified Account. + * + * When naming Pools, avoid including sensitive information such as user names or + * secret project names. This information may appear in telemetry logs accessible + * to Microsoft Support engineers. + * + * @param pool The Pool to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void createPool(BatchPoolCreateParameters pool) { + // Generated convenience method for createPoolWithResponse + RequestOptions requestOptions = new RequestOptions(); + createPoolWithResponse(BinaryData.fromObject(pool), requestOptions).getValue(); } /** - * Deletes a Pool from the specified Account. - * - * When you request that a Pool be deleted, the following actions occur: the Pool - * state is set to deleting; any ongoing resize operation on the Pool are stopped; - * the Batch service starts resizing the Pool to zero Compute Nodes; any Tasks - * running on existing Compute Nodes are terminated and requeued (as if a resize - * Pool operation had been requested with the default requeue option); finally, - * the Pool is removed from the system. Because running Tasks are requeued, the - * user can rerun these Tasks by updating their Job to target a different Pool. - * The Tasks can then run on the new Pool. If you want to override the requeue - * behavior, then you should call resize Pool explicitly to shrink the Pool to - * zero size before deleting the Pool. If you call an Update, Patch or Delete API - * on a Pool in the deleting state, it will fail with HTTP status code 409 with - * error code PoolBeingDeleted. + * Lists all of the Pools which be mounted. * - * @param poolId The ID of the Pool to get. - * @param options Optional parameters for Delete Pool operation. - * @param requestConditions Specifies HTTP options for conditional requests based on modification time. + * @param options Optional parameters for List Pools operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of listing the Pools in an Account as paginated response with {@link PagedIterable}. */ @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void deletePool(String poolId, DeleteBatchPoolOptions options, RequestConditions requestConditions) { - // Generated convenience method for deletePoolWithResponse + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listPools(BatchPoolsListOptions options) { + // Generated convenience method for listPools RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); - OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); - OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); - String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); - String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + String filter = options == null ? null : options.getFilter(); + List select = options == null ? null : options.getSelect(); + List expand = options == null ? null : options.getExpand(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); - } - if (ifModifiedSince != null) { - requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, - String.valueOf(new DateTimeRfc1123(ifModifiedSince))); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } - if (ifUnmodifiedSince != null) { - requestOptions.setHeader(HttpHeaderName.IF_UNMODIFIED_SINCE, - String.valueOf(new DateTimeRfc1123(ifUnmodifiedSince))); + if (filter != null) { + requestOptions.addQueryParam("$filter", filter, false); } - if (ifMatch != null) { - requestOptions.setHeader(HttpHeaderName.IF_MATCH, ifMatch); + if (select != null) { + requestOptions.addQueryParam("$select", + select.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")), + false); } - if (ifNoneMatch != null) { - requestOptions.setHeader(HttpHeaderName.IF_NONE_MATCH, ifNoneMatch); + if (expand != null) { + requestOptions.addQueryParam("$expand", + expand.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")), + false); } - deletePoolWithResponse(poolId, requestOptions).getValue(); + return serviceClient.listPools(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(BatchPool.class)); } /** @@ -11484,6 +12929,8 @@ public void deletePool(String poolId, DeleteBatchPoolOptions options, RequestCon * error code PoolBeingDeleted. * * @param poolId The ID of the Pool to get. + * @param options Optional parameters for Delete Pool operation. + * @param requestConditions Specifies HTTP options for conditional requests based on modification time. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -11493,37 +12940,16 @@ public void deletePool(String poolId, DeleteBatchPoolOptions options, RequestCon */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void deletePool(String poolId) { + public void deletePool(String poolId, BatchPoolDeleteOptions options, RequestConditions requestConditions) { // Generated convenience method for deletePoolWithResponse RequestOptions requestOptions = new RequestOptions(); - deletePoolWithResponse(poolId, requestOptions).getValue(); - } - - /** - * Gets basic properties of a Pool. - * - * @param poolId The ID of the Pool to get. - * @param options Optional parameters for Pool Exists operation. - * @param requestConditions Specifies HTTP options for conditional requests based on modification time. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return basic properties of a Pool. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public boolean poolExists(String poolId, BatchPoolExistsOptions options, RequestConditions requestConditions) { - // Generated convenience method for poolExistsWithResponse - RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (ifModifiedSince != null) { requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, @@ -11539,26 +12965,7 @@ public boolean poolExists(String poolId, BatchPoolExistsOptions options, Request if (ifNoneMatch != null) { requestOptions.setHeader(HttpHeaderName.IF_NONE_MATCH, ifNoneMatch); } - return poolExistsWithResponse(poolId, requestOptions).getValue(); - } - - /** - * Gets basic properties of a Pool. - * - * @param poolId The ID of the Pool to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return basic properties of a Pool. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public boolean poolExists(String poolId) { - // Generated convenience method for poolExistsWithResponse - RequestOptions requestOptions = new RequestOptions(); - return poolExistsWithResponse(poolId, requestOptions).getValue(); + deletePoolWithResponse(poolId, requestOptions).getValue(); } /** @@ -11577,10 +12984,10 @@ public boolean poolExists(String poolId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public BatchPool getPool(String poolId, GetBatchPoolOptions options, RequestConditions requestConditions) { + public BatchPool getPool(String poolId, BatchPoolGetOptions options, RequestConditions requestConditions) { // Generated convenience method for getPoolWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); List select = options == null ? null : options.getSelect(); List expand = options == null ? null : options.getExpand(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); @@ -11588,7 +12995,7 @@ public BatchPool getPool(String poolId, GetBatchPoolOptions options, RequestCond String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (select != null) { requestOptions.addQueryParam("$select", @@ -11621,26 +13028,6 @@ public BatchPool getPool(String poolId, GetBatchPoolOptions options, RequestCond return getPoolWithResponse(poolId, requestOptions).getValue().toObject(BatchPool.class); } - /** - * Gets information about the specified Pool. - * - * @param poolId The ID of the Pool to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified Pool. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public BatchPool getPool(String poolId) { - // Generated convenience method for getPoolWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getPoolWithResponse(poolId, requestOptions).getValue().toObject(BatchPool.class); - } - /** * Updates the properties of the specified Pool. * @@ -11661,17 +13048,17 @@ public BatchPool getPool(String poolId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void updatePool(String poolId, BatchPoolUpdateContent pool, UpdateBatchPoolOptions options, + public void updatePool(String poolId, BatchPoolUpdateParameters pool, BatchPoolUpdateOptions options, RequestConditions requestConditions) { // Generated convenience method for updatePoolWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (ifModifiedSince != null) { requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, @@ -11708,7 +13095,7 @@ public void updatePool(String poolId, BatchPoolUpdateContent pool, UpdateBatchPo */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void updatePool(String poolId, BatchPoolUpdateContent pool) { + public void updatePool(String poolId, BatchPoolUpdateParameters pool) { // Generated convenience method for updatePoolWithResponse RequestOptions requestOptions = new RequestOptions(); updatePoolWithResponse(poolId, BinaryData.fromObject(pool), requestOptions).getValue(); @@ -11728,35 +13115,16 @@ public void updatePool(String poolId, BatchPoolUpdateContent pool) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void disablePoolAutoScale(String poolId, DisableBatchPoolAutoScaleOptions options) { + public void disablePoolAutoScale(String poolId, BatchPoolAutoScaleDisableOptions options) { // Generated convenience method for disablePoolAutoScaleWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } disablePoolAutoScaleWithResponse(poolId, requestOptions).getValue(); } - /** - * Disables automatic scaling for a Pool. - * - * @param poolId The ID of the Pool on which to disable automatic scaling. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void disablePoolAutoScale(String poolId) { - // Generated convenience method for disablePoolAutoScaleWithResponse - RequestOptions requestOptions = new RequestOptions(); - disablePoolAutoScaleWithResponse(poolId, requestOptions).getValue(); - } - /** * Enables automatic scaling for a Pool. * @@ -11768,7 +13136,7 @@ public void disablePoolAutoScale(String poolId) { * more than once every 30 seconds. * * @param poolId The ID of the Pool to get. - * @param content The options to use for enabling automatic scaling. + * @param parameters The options to use for enabling automatic scaling. * @param options Optional parameters for Enable Pool AutoScale operation. * @param requestConditions Specifies HTTP options for conditional requests based on modification time. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -11780,17 +13148,17 @@ public void disablePoolAutoScale(String poolId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void enablePoolAutoScale(String poolId, BatchPoolEnableAutoScaleContent content, - EnableBatchPoolAutoScaleOptions options, RequestConditions requestConditions) { + public void enablePoolAutoScale(String poolId, BatchPoolAutoScaleEnableParameters parameters, + BatchPoolAutoScaleEnableOptions options, RequestConditions requestConditions) { // Generated convenience method for enablePoolAutoScaleWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (ifModifiedSince != null) { requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, @@ -11806,7 +13174,7 @@ public void enablePoolAutoScale(String poolId, BatchPoolEnableAutoScaleContent c if (ifNoneMatch != null) { requestOptions.setHeader(HttpHeaderName.IF_NONE_MATCH, ifNoneMatch); } - enablePoolAutoScaleWithResponse(poolId, BinaryData.fromObject(content), requestOptions).getValue(); + enablePoolAutoScaleWithResponse(poolId, BinaryData.fromObject(parameters), requestOptions).getValue(); } /** @@ -11820,7 +13188,7 @@ public void enablePoolAutoScale(String poolId, BatchPoolEnableAutoScaleContent c * more than once every 30 seconds. * * @param poolId The ID of the Pool to get. - * @param content The options to use for enabling automatic scaling. + * @param parameters The options to use for enabling automatic scaling. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -11830,10 +13198,10 @@ public void enablePoolAutoScale(String poolId, BatchPoolEnableAutoScaleContent c */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void enablePoolAutoScale(String poolId, BatchPoolEnableAutoScaleContent content) { + public void enablePoolAutoScale(String poolId, BatchPoolAutoScaleEnableParameters parameters) { // Generated convenience method for enablePoolAutoScaleWithResponse RequestOptions requestOptions = new RequestOptions(); - enablePoolAutoScaleWithResponse(poolId, BinaryData.fromObject(content), requestOptions).getValue(); + enablePoolAutoScaleWithResponse(poolId, BinaryData.fromObject(parameters), requestOptions).getValue(); } /** @@ -11844,7 +13212,7 @@ public void enablePoolAutoScale(String poolId, BatchPoolEnableAutoScaleContent c * scaling enabled in order to evaluate a formula. * * @param poolId The ID of the Pool on which to evaluate the automatic scaling formula. - * @param content The options to use for evaluating the automatic scaling formula. + * @param parameters The options to use for evaluating the automatic scaling formula. * @param options Optional parameters for Evaluate Pool AutoScale operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -11859,15 +13227,15 @@ public void enablePoolAutoScale(String poolId, BatchPoolEnableAutoScaleContent c */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public AutoScaleRun evaluatePoolAutoScale(String poolId, BatchPoolEvaluateAutoScaleContent content, - EvaluateBatchPoolAutoScaleOptions options) { + public AutoScaleRun evaluatePoolAutoScale(String poolId, BatchPoolAutoScaleEvaluateParameters parameters, + BatchPoolAutoScaleEvaluateOptions options) { // Generated convenience method for evaluatePoolAutoScaleWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } - return evaluatePoolAutoScaleWithResponse(poolId, BinaryData.fromObject(content), requestOptions).getValue() + return evaluatePoolAutoScaleWithResponse(poolId, BinaryData.fromObject(parameters), requestOptions).getValue() .toObject(AutoScaleRun.class); } @@ -11879,7 +13247,7 @@ public AutoScaleRun evaluatePoolAutoScale(String poolId, BatchPoolEvaluateAutoSc * scaling enabled in order to evaluate a formula. * * @param poolId The ID of the Pool on which to evaluate the automatic scaling formula. - * @param content The options to use for evaluating the automatic scaling formula. + * @param parameters The options to use for evaluating the automatic scaling formula. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -11893,10 +13261,10 @@ public AutoScaleRun evaluatePoolAutoScale(String poolId, BatchPoolEvaluateAutoSc */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public AutoScaleRun evaluatePoolAutoScale(String poolId, BatchPoolEvaluateAutoScaleContent content) { + public AutoScaleRun evaluatePoolAutoScale(String poolId, BatchPoolAutoScaleEvaluateParameters parameters) { // Generated convenience method for evaluatePoolAutoScaleWithResponse RequestOptions requestOptions = new RequestOptions(); - return evaluatePoolAutoScaleWithResponse(poolId, BinaryData.fromObject(content), requestOptions).getValue() + return evaluatePoolAutoScaleWithResponse(poolId, BinaryData.fromObject(parameters), requestOptions).getValue() .toObject(AutoScaleRun.class); } @@ -11912,7 +13280,7 @@ public AutoScaleRun evaluatePoolAutoScale(String poolId, BatchPoolEvaluateAutoSc * Nodes, use the Pool remove Compute Nodes API instead. * * @param poolId The ID of the Pool to get. - * @param content The options to use for resizing the pool. + * @param parameters The options to use for resizing the pool. * @param options Optional parameters for Resize Pool operation. * @param requestConditions Specifies HTTP options for conditional requests based on modification time. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -11924,17 +13292,17 @@ public AutoScaleRun evaluatePoolAutoScale(String poolId, BatchPoolEvaluateAutoSc */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void resizePool(String poolId, BatchPoolResizeContent content, ResizeBatchPoolOptions options, + public void resizePool(String poolId, BatchPoolResizeParameters parameters, BatchPoolResizeOptions options, RequestConditions requestConditions) { // Generated convenience method for resizePoolWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (ifModifiedSince != null) { requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, @@ -11950,7 +13318,7 @@ public void resizePool(String poolId, BatchPoolResizeContent content, ResizeBatc if (ifNoneMatch != null) { requestOptions.setHeader(HttpHeaderName.IF_NONE_MATCH, ifNoneMatch); } - resizePoolWithResponse(poolId, BinaryData.fromObject(content), requestOptions).getValue(); + resizePoolWithResponse(poolId, BinaryData.fromObject(parameters), requestOptions).getValue(); } /** @@ -11965,7 +13333,7 @@ public void resizePool(String poolId, BatchPoolResizeContent content, ResizeBatc * Nodes, use the Pool remove Compute Nodes API instead. * * @param poolId The ID of the Pool to get. - * @param content The options to use for resizing the pool. + * @param parameters The options to use for resizing the pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -11975,10 +13343,10 @@ public void resizePool(String poolId, BatchPoolResizeContent content, ResizeBatc */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void resizePool(String poolId, BatchPoolResizeContent content) { + public void resizePool(String poolId, BatchPoolResizeParameters parameters) { // Generated convenience method for resizePoolWithResponse RequestOptions requestOptions = new RequestOptions(); - resizePoolWithResponse(poolId, BinaryData.fromObject(content), requestOptions).getValue(); + resizePoolWithResponse(poolId, BinaryData.fromObject(parameters), requestOptions).getValue(); } /** @@ -12004,16 +13372,16 @@ public void resizePool(String poolId, BatchPoolResizeContent content) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void stopPoolResize(String poolId, StopBatchPoolResizeOptions options, RequestConditions requestConditions) { + public void stopPoolResize(String poolId, BatchPoolResizeStopOptions options, RequestConditions requestConditions) { // Generated convenience method for stopPoolResizeWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (ifModifiedSince != null) { requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, @@ -12032,33 +13400,6 @@ public void stopPoolResize(String poolId, StopBatchPoolResizeOptions options, Re stopPoolResizeWithResponse(poolId, requestOptions).getValue(); } - /** - * Stops an ongoing resize operation on the Pool. - * - * This does not restore the Pool to its previous state before the resize - * operation: it only stops any further changes being made, and the Pool maintains - * its current state. After stopping, the Pool stabilizes at the number of Compute - * Nodes it was at when the stop operation was done. During the stop operation, - * the Pool allocation state changes first to stopping and then to steady. A - * resize operation need not be an explicit resize Pool request; this API can also - * be used to halt the initial sizing of the Pool when it is created. - * - * @param poolId The ID of the Pool to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void stopPoolResize(String poolId) { - // Generated convenience method for stopPoolResizeWithResponse - RequestOptions requestOptions = new RequestOptions(); - stopPoolResizeWithResponse(poolId, requestOptions).getValue(); - } - /** * Updates the properties of the specified Pool. * @@ -12078,13 +13419,13 @@ public void stopPoolResize(String poolId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void replacePoolProperties(String poolId, BatchPoolReplaceContent pool, - ReplaceBatchPoolPropertiesOptions options) { + public void replacePoolProperties(String poolId, BatchPoolReplaceParameters pool, + BatchPoolPropertiesReplaceOptions options) { // Generated convenience method for replacePoolPropertiesWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } replacePoolPropertiesWithResponse(poolId, BinaryData.fromObject(pool), requestOptions).getValue(); } @@ -12107,7 +13448,7 @@ public void replacePoolProperties(String poolId, BatchPoolReplaceContent pool, */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void replacePoolProperties(String poolId, BatchPoolReplaceContent pool) { + public void replacePoolProperties(String poolId, BatchPoolReplaceParameters pool) { // Generated convenience method for replacePoolPropertiesWithResponse RequestOptions requestOptions = new RequestOptions(); replacePoolPropertiesWithResponse(poolId, BinaryData.fromObject(pool), requestOptions).getValue(); @@ -12121,7 +13462,7 @@ public void replacePoolProperties(String poolId, BatchPoolReplaceContent pool) { * Each request may remove up to 100 nodes. * * @param poolId The ID of the Pool to get. - * @param content The options to use for removing the node. + * @param parameters The options to use for removing the node. * @param options Optional parameters for Remove Nodes operation. * @param requestConditions Specifies HTTP options for conditional requests based on modification time. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -12133,17 +13474,17 @@ public void replacePoolProperties(String poolId, BatchPoolReplaceContent pool) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void removeNodes(String poolId, BatchNodeRemoveContent content, RemoveBatchNodesOptions options, + public void removeNodes(String poolId, BatchNodeRemoveParameters parameters, BatchNodesRemoveOptions options, RequestConditions requestConditions) { // Generated convenience method for removeNodesWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (ifModifiedSince != null) { requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, @@ -12159,7 +13500,7 @@ public void removeNodes(String poolId, BatchNodeRemoveContent content, RemoveBat if (ifNoneMatch != null) { requestOptions.setHeader(HttpHeaderName.IF_NONE_MATCH, ifNoneMatch); } - removeNodesWithResponse(poolId, BinaryData.fromObject(content), requestOptions).getValue(); + removeNodesWithResponse(poolId, BinaryData.fromObject(parameters), requestOptions).getValue(); } /** @@ -12170,7 +13511,7 @@ public void removeNodes(String poolId, BatchNodeRemoveContent content, RemoveBat * Each request may remove up to 100 nodes. * * @param poolId The ID of the Pool to get. - * @param content The options to use for removing the node. + * @param parameters The options to use for removing the node. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -12180,10 +13521,10 @@ public void removeNodes(String poolId, BatchNodeRemoveContent content, RemoveBat */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void removeNodes(String poolId, BatchNodeRemoveContent content) { + public void removeNodes(String poolId, BatchNodeRemoveParameters parameters) { // Generated convenience method for removeNodesWithResponse RequestOptions requestOptions = new RequestOptions(); - removeNodesWithResponse(poolId, BinaryData.fromObject(content), requestOptions).getValue(); + removeNodesWithResponse(poolId, BinaryData.fromObject(parameters), requestOptions).getValue(); } /** @@ -12201,13 +13542,13 @@ public void removeNodes(String poolId, BatchNodeRemoveContent content) { */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSupportedImages(ListSupportedBatchImagesOptions options) { + public PagedIterable listSupportedImages(SupportedBatchImagesListOptions options) { // Generated convenience method for listSupportedImages RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); String filter = options == null ? null : options.getFilter(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (filter != null) { requestOptions.addQueryParam("$filter", filter, false); @@ -12216,63 +13557,13 @@ public PagedIterable listSupportedImages(ListSupportedBatch .mapPage(bodyItemValue -> bodyItemValue.toObject(BatchSupportedImage.class)); } - /** - * Lists all Virtual Machine Images supported by the Azure Batch service. - * - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of listing the supported Virtual Machine Images as paginated response with - * {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSupportedImages() { - // Generated convenience method for listSupportedImages - RequestOptions requestOptions = new RequestOptions(); - return serviceClient.listSupportedImages(requestOptions) - .mapPage(bodyItemValue -> bodyItemValue.toObject(BatchSupportedImage.class)); - } - /** * Gets the number of Compute Nodes in each state, grouped by Pool. Note that the * numbers returned may not always be up to date. If you need exact node counts, * use a list query. * * @param options Optional parameters for List Pool Node Counts operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the number of Compute Nodes in each state, grouped by Pool as paginated response with - * {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listPoolNodeCounts(ListBatchPoolNodeCountsOptions options) { - // Generated convenience method for listPoolNodeCounts - RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); - String filter = options == null ? null : options.getFilter(); - if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); - } - if (filter != null) { - requestOptions.addQueryParam("$filter", filter, false); - } - return serviceClient.listPoolNodeCounts(requestOptions) - .mapPage(bodyItemValue -> bodyItemValue.toObject(BatchPoolNodeCounts.class)); - } - - /** - * Gets the number of Compute Nodes in each state, grouped by Pool. Note that the - * numbers returned may not always be up to date. If you need exact node counts, - * use a list query. - * + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. @@ -12283,9 +13574,17 @@ public PagedIterable listPoolNodeCounts(ListBatchPoolNodeCo */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listPoolNodeCounts() { + public PagedIterable listPoolNodeCounts(BatchPoolNodeCountsListOptions options) { // Generated convenience method for listPoolNodeCounts RequestOptions requestOptions = new RequestOptions(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + String filter = options == null ? null : options.getFilter(); + if (timeOutInSeconds != null) { + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); + } + if (filter != null) { + requestOptions.addQueryParam("$filter", filter, false); + } return serviceClient.listPoolNodeCounts(requestOptions) .mapPage(bodyItemValue -> bodyItemValue.toObject(BatchPoolNodeCounts.class)); } @@ -12314,17 +13613,17 @@ public PagedIterable listPoolNodeCounts() { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteJob(String jobId, DeleteBatchJobOptions options, RequestConditions requestConditions) { + public void deleteJob(String jobId, BatchJobDeleteOptions options, RequestConditions requestConditions) { // Generated convenience method for deleteJobWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); Boolean force = options == null ? null : options.isForce(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (force != null) { requestOptions.addQueryParam("force", String.valueOf(force), false); @@ -12346,34 +13645,6 @@ public void deleteJob(String jobId, DeleteBatchJobOptions options, RequestCondit deleteJobWithResponse(jobId, requestOptions).getValue(); } - /** - * Deletes a Job. - * - * Deleting a Job also deletes all Tasks that are part of that Job, and all Job - * statistics. This also overrides the retention period for Task data; that is, if - * the Job contains Tasks which are still retained on Compute Nodes, the Batch - * services deletes those Tasks' working directories and all their contents. When - * a Delete Job request is received, the Batch service sets the Job to the - * deleting state. All update operations on a Job that is in deleting state will - * fail with status code 409 (Conflict), with additional information indicating - * that the Job is being deleted. - * - * @param jobId The ID of the Job to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteJob(String jobId) { - // Generated convenience method for deleteJobWithResponse - RequestOptions requestOptions = new RequestOptions(); - deleteJobWithResponse(jobId, requestOptions).getValue(); - } - /** * Gets information about the specified Job. * @@ -12390,10 +13661,10 @@ public void deleteJob(String jobId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public BatchJob getJob(String jobId, GetBatchJobOptions options, RequestConditions requestConditions) { + public BatchJob getJob(String jobId, BatchJobGetOptions options, RequestConditions requestConditions) { // Generated convenience method for getJobWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); List select = options == null ? null : options.getSelect(); List expand = options == null ? null : options.getExpand(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); @@ -12401,7 +13672,7 @@ public BatchJob getJob(String jobId, GetBatchJobOptions options, RequestConditio String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (select != null) { requestOptions.addQueryParam("$select", @@ -12434,26 +13705,6 @@ public BatchJob getJob(String jobId, GetBatchJobOptions options, RequestConditio return getJobWithResponse(jobId, requestOptions).getValue().toObject(BatchJob.class); } - /** - * Gets information about the specified Job. - * - * @param jobId The ID of the Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified Job. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public BatchJob getJob(String jobId) { - // Generated convenience method for getJobWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getJobWithResponse(jobId, requestOptions).getValue().toObject(BatchJob.class); - } - /** * Updates the properties of the specified Job. * @@ -12474,17 +13725,17 @@ public BatchJob getJob(String jobId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void updateJob(String jobId, BatchJobUpdateContent job, UpdateBatchJobOptions options, + public void updateJob(String jobId, BatchJobUpdateParameters job, BatchJobUpdateOptions options, RequestConditions requestConditions) { // Generated convenience method for updateJobWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (ifModifiedSince != null) { requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, @@ -12521,7 +13772,7 @@ public void updateJob(String jobId, BatchJobUpdateContent job, UpdateBatchJobOpt */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void updateJob(String jobId, BatchJobUpdateContent job) { + public void updateJob(String jobId, BatchJobUpdateParameters job) { // Generated convenience method for updateJobWithResponse RequestOptions requestOptions = new RequestOptions(); updateJobWithResponse(jobId, BinaryData.fromObject(job), requestOptions).getValue(); @@ -12547,17 +13798,17 @@ public void updateJob(String jobId, BatchJobUpdateContent job) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void replaceJob(String jobId, BatchJob job, ReplaceBatchJobOptions options, + public void replaceJob(String jobId, BatchJob job, BatchJobReplaceOptions options, RequestConditions requestConditions) { // Generated convenience method for replaceJobWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (ifModifiedSince != null) { requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, @@ -12576,30 +13827,6 @@ public void replaceJob(String jobId, BatchJob job, ReplaceBatchJobOptions option replaceJobWithResponse(jobId, BinaryData.fromObject(job), requestOptions).getValue(); } - /** - * Updates the properties of the specified Job. - * - * This fully replaces all the updatable properties of the Job. For example, if - * the Job has constraints associated with it and if constraints is not specified - * with this request, then the Batch service will remove the existing constraints. - * - * @param jobId The ID of the Job whose properties you want to update. - * @param job A job with updated properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void replaceJob(String jobId, BatchJob job) { - // Generated convenience method for replaceJobWithResponse - RequestOptions requestOptions = new RequestOptions(); - replaceJobWithResponse(jobId, BinaryData.fromObject(job), requestOptions).getValue(); - } - /** * Disables the specified Job, preventing new Tasks from running. * @@ -12613,7 +13840,7 @@ public void replaceJob(String jobId, BatchJob job) { * the request fails with status code 409. * * @param jobId The ID of the Job to disable. - * @param content The options to use for disabling the Job. + * @param parameters The options to use for disabling the Job. * @param options Optional parameters for Disable Job operation. * @param requestConditions Specifies HTTP options for conditional requests based on modification time. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -12625,17 +13852,17 @@ public void replaceJob(String jobId, BatchJob job) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void disableJob(String jobId, BatchJobDisableContent content, DisableBatchJobOptions options, + public void disableJob(String jobId, BatchJobDisableParameters parameters, BatchJobDisableOptions options, RequestConditions requestConditions) { // Generated convenience method for disableJobWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (ifModifiedSince != null) { requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, @@ -12651,7 +13878,7 @@ public void disableJob(String jobId, BatchJobDisableContent content, DisableBatc if (ifNoneMatch != null) { requestOptions.setHeader(HttpHeaderName.IF_NONE_MATCH, ifNoneMatch); } - disableJobWithResponse(jobId, BinaryData.fromObject(content), requestOptions).getValue(); + disableJobWithResponse(jobId, BinaryData.fromObject(parameters), requestOptions).getValue(); } /** @@ -12667,7 +13894,7 @@ public void disableJob(String jobId, BatchJobDisableContent content, DisableBatc * the request fails with status code 409. * * @param jobId The ID of the Job to disable. - * @param content The options to use for disabling the Job. + * @param parameters The options to use for disabling the Job. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -12677,10 +13904,10 @@ public void disableJob(String jobId, BatchJobDisableContent content, DisableBatc */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void disableJob(String jobId, BatchJobDisableContent content) { + public void disableJob(String jobId, BatchJobDisableParameters parameters) { // Generated convenience method for disableJobWithResponse RequestOptions requestOptions = new RequestOptions(); - disableJobWithResponse(jobId, BinaryData.fromObject(content), requestOptions).getValue(); + disableJobWithResponse(jobId, BinaryData.fromObject(parameters), requestOptions).getValue(); } /** @@ -12705,16 +13932,16 @@ public void disableJob(String jobId, BatchJobDisableContent content) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void enableJob(String jobId, EnableBatchJobOptions options, RequestConditions requestConditions) { + public void enableJob(String jobId, BatchJobEnableOptions options, RequestConditions requestConditions) { // Generated convenience method for enableJobWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (ifModifiedSince != null) { requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, @@ -12733,32 +13960,6 @@ public void enableJob(String jobId, EnableBatchJobOptions options, RequestCondit enableJobWithResponse(jobId, requestOptions).getValue(); } - /** - * Enables the specified Job, allowing new Tasks to run. - * - * When you call this API, the Batch service sets a disabled Job to the enabling - * state. After the this operation is completed, the Job moves to the active - * state, and scheduling of new Tasks under the Job resumes. The Batch service - * does not allow a Task to remain in the active state for more than 180 days. - * Therefore, if you enable a Job containing active Tasks which were added more - * than 180 days ago, those Tasks will not run. - * - * @param jobId The ID of the Job to enable. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void enableJob(String jobId) { - // Generated convenience method for enableJobWithResponse - RequestOptions requestOptions = new RequestOptions(); - enableJobWithResponse(jobId, requestOptions).getValue(); - } - /** * Terminates the specified Job, marking it as completed. * @@ -12781,18 +13982,18 @@ public void enableJob(String jobId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void terminateJob(String jobId, TerminateBatchJobOptions options, RequestConditions requestConditions) { + public void terminateJob(String jobId, BatchJobTerminateOptions options, RequestConditions requestConditions) { // Generated convenience method for terminateJobWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); - BatchJobTerminateContent parameters = options == null ? null : options.getParameters(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + BatchJobTerminateParameters parameters = options == null ? null : options.getParameters(); Boolean force = options == null ? null : options.isForce(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (parameters != null) { requestOptions.setBody(BinaryData.fromObject(parameters)); @@ -12817,32 +14018,6 @@ public void terminateJob(String jobId, TerminateBatchJobOptions options, Request terminateJobWithResponse(jobId, requestOptions).getValue(); } - /** - * Terminates the specified Job, marking it as completed. - * - * When a Terminate Job request is received, the Batch service sets the Job to the - * terminating state. The Batch service then terminates any running Tasks - * associated with the Job and runs any required Job release Tasks. Then the Job - * moves into the completed state. If there are any Tasks in the Job in the active - * state, they will remain in the active state. Once a Job is terminated, new - * Tasks cannot be added and any remaining active Tasks will not be scheduled. - * - * @param jobId The ID of the Job to terminate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void terminateJob(String jobId) { - // Generated convenience method for terminateJobWithResponse - RequestOptions requestOptions = new RequestOptions(); - terminateJobWithResponse(jobId, requestOptions).getValue(); - } - /** * Creates a Job to the specified Account. * @@ -12867,12 +14042,12 @@ public void terminateJob(String jobId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void createJob(BatchJobCreateContent job, CreateBatchJobOptions options) { + public void createJob(BatchJobCreateParameters job, BatchJobCreateOptions options) { // Generated convenience method for createJobWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } createJobWithResponse(BinaryData.fromObject(job), requestOptions).getValue(); } @@ -12900,7 +14075,7 @@ public void createJob(BatchJobCreateContent job, CreateBatchJobOptions options) */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void createJob(BatchJobCreateContent job) { + public void createJob(BatchJobCreateParameters job) { // Generated convenience method for createJobWithResponse RequestOptions requestOptions = new RequestOptions(); createJobWithResponse(BinaryData.fromObject(job), requestOptions).getValue(); @@ -12920,15 +14095,15 @@ public void createJob(BatchJobCreateContent job) { */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listJobs(ListBatchJobsOptions options) { + public PagedIterable listJobs(BatchJobsListOptions options) { // Generated convenience method for listJobs RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); String filter = options == null ? null : options.getFilter(); List select = options == null ? null : options.getSelect(); List expand = options == null ? null : options.getExpand(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (filter != null) { requestOptions.addQueryParam("$filter", filter, false); @@ -12950,24 +14125,6 @@ public PagedIterable listJobs(ListBatchJobsOptions options) { return serviceClient.listJobs(requestOptions).mapPage(bodyItemValue -> bodyItemValue.toObject(BatchJob.class)); } - /** - * Lists all of the Jobs in the specified Account. - * - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of listing the Jobs in an Account as paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listJobs() { - // Generated convenience method for listJobs - RequestOptions requestOptions = new RequestOptions(); - return serviceClient.listJobs(requestOptions).mapPage(bodyItemValue -> bodyItemValue.toObject(BatchJob.class)); - } - /** * Lists the Jobs that have been created under the specified Job Schedule. * @@ -12984,15 +14141,15 @@ public PagedIterable listJobs() { @Generated @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listJobsFromSchedule(String jobScheduleId, - ListBatchJobsFromScheduleOptions options) { + BatchJobsFromScheduleListOptions options) { // Generated convenience method for listJobsFromSchedule RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); String filter = options == null ? null : options.getFilter(); List select = options == null ? null : options.getSelect(); List expand = options == null ? null : options.getExpand(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (filter != null) { requestOptions.addQueryParam("$filter", filter, false); @@ -13015,27 +14172,6 @@ public PagedIterable listJobsFromSchedule(String jobScheduleId, .mapPage(bodyItemValue -> bodyItemValue.toObject(BatchJob.class)); } - /** - * Lists the Jobs that have been created under the specified Job Schedule. - * - * @param jobScheduleId The ID of the Job Schedule from which you want to get a list of Jobs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of listing the Jobs in an Account as paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listJobsFromSchedule(String jobScheduleId) { - // Generated convenience method for listJobsFromSchedule - RequestOptions requestOptions = new RequestOptions(); - return serviceClient.listJobsFromSchedule(jobScheduleId, requestOptions) - .mapPage(bodyItemValue -> bodyItemValue.toObject(BatchJob.class)); - } - /** * Lists the execution status of the Job Preparation and Job Release Task for the * specified Job across the Compute Nodes where the Job has run. @@ -13061,14 +14197,14 @@ public PagedIterable listJobsFromSchedule(String jobScheduleId) { @Generated @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listJobPreparationAndReleaseTaskStatus(String jobId, - ListBatchJobPreparationAndReleaseTaskStatusOptions options) { + BatchJobPreparationAndReleaseTaskStatusListOptions options) { // Generated convenience method for listJobPreparationAndReleaseTaskStatus RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); String filter = options == null ? null : options.getFilter(); List select = options == null ? null : options.getSelect(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (filter != null) { requestOptions.addQueryParam("$filter", filter, false); @@ -13081,70 +14217,7 @@ public PagedIterable listJobPreparation false); } return serviceClient.listJobPreparationAndReleaseTaskStatus(jobId, requestOptions) - .mapPage(bodyItemValue -> bodyItemValue.toObject(BatchJobPreparationAndReleaseTaskStatus.class)); - } - - /** - * Lists the execution status of the Job Preparation and Job Release Task for the - * specified Job across the Compute Nodes where the Job has run. - * - * This API returns the Job Preparation and Job Release Task status on all Compute - * Nodes that have run the Job Preparation or Job Release Task. This includes - * Compute Nodes which have since been removed from the Pool. If this API is - * invoked on a Job which has no Job Preparation or Job Release Task, the Batch - * service returns HTTP status code 409 (Conflict) with an error code of - * JobPreparationTaskNotSpecified. - * - * @param jobId The ID of the Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of listing the status of the Job Preparation and Job Release Tasks - * for a Job as paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listJobPreparationAndReleaseTaskStatus(String jobId) { - // Generated convenience method for listJobPreparationAndReleaseTaskStatus - RequestOptions requestOptions = new RequestOptions(); - return serviceClient.listJobPreparationAndReleaseTaskStatus(jobId, requestOptions) - .mapPage(bodyItemValue -> bodyItemValue.toObject(BatchJobPreparationAndReleaseTaskStatus.class)); - } - - /** - * Gets the Task counts for the specified Job. - * - * Task counts provide a count of the Tasks by active, running or completed Task - * state, and a count of Tasks which succeeded or failed. Tasks in the preparing - * state are counted as running. Note that the numbers returned may not always be - * up to date. If you need exact task counts, use a list query. - * - * @param jobId The ID of the Job. - * @param options Optional parameters for Get Job Task Counts operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Task counts for the specified Job. - * - * Task counts provide a count of the Tasks by active, running or completed Task - * state, and a count of Tasks which succeeded or failed. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public BatchTaskCountsResult getJobTaskCounts(String jobId, GetBatchJobTaskCountsOptions options) { - // Generated convenience method for getJobTaskCountsWithResponse - RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); - if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); - } - return getJobTaskCountsWithResponse(jobId, requestOptions).getValue().toObject(BatchTaskCountsResult.class); + .mapPage(bodyItemValue -> bodyItemValue.toObject(BatchJobPreparationAndReleaseTaskStatus.class)); } /** @@ -13156,6 +14229,7 @@ public BatchTaskCountsResult getJobTaskCounts(String jobId, GetBatchJobTaskCount * up to date. If you need exact task counts, use a list query. * * @param jobId The ID of the Job. + * @param options Optional parameters for Get Job Task Counts operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -13169,9 +14243,13 @@ public BatchTaskCountsResult getJobTaskCounts(String jobId, GetBatchJobTaskCount */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public BatchTaskCountsResult getJobTaskCounts(String jobId) { + public BatchTaskCountsResult getJobTaskCounts(String jobId, BatchJobTaskCountsGetOptions options) { // Generated convenience method for getJobTaskCountsWithResponse RequestOptions requestOptions = new RequestOptions(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + if (timeOutInSeconds != null) { + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); + } return getJobTaskCountsWithResponse(jobId, requestOptions).getValue().toObject(BatchTaskCountsResult.class); } @@ -13189,35 +14267,16 @@ public BatchTaskCountsResult getJobTaskCounts(String jobId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void createCertificate(BatchCertificate certificate, CreateBatchCertificateOptions options) { + public void createCertificate(BatchCertificate certificate, BatchCertificateCreateOptions options) { // Generated convenience method for createCertificateWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } createCertificateWithResponse(BinaryData.fromObject(certificate), requestOptions).getValue(); } - /** - * Creates a Certificate to the specified Account. - * - * @param certificate The Certificate to be created. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void createCertificate(BatchCertificate certificate) { - // Generated convenience method for createCertificateWithResponse - RequestOptions requestOptions = new RequestOptions(); - createCertificateWithResponse(BinaryData.fromObject(certificate), requestOptions).getValue(); - } - /** * Lists all of the Certificates that have been added to the specified Account. * @@ -13232,14 +14291,14 @@ public void createCertificate(BatchCertificate certificate) { */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listCertificates(ListBatchCertificatesOptions options) { + public PagedIterable listCertificates(BatchCertificatesListOptions options) { // Generated convenience method for listCertificates RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); String filter = options == null ? null : options.getFilter(); List select = options == null ? null : options.getSelect(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (filter != null) { requestOptions.addQueryParam("$filter", filter, false); @@ -13255,25 +14314,6 @@ public PagedIterable listCertificates(ListBatchCertificatesOpt .mapPage(bodyItemValue -> bodyItemValue.toObject(BatchCertificate.class)); } - /** - * Lists all of the Certificates that have been added to the specified Account. - * - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of listing the Certificates in the Account as paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listCertificates() { - // Generated convenience method for listCertificates - RequestOptions requestOptions = new RequestOptions(); - return serviceClient.listCertificates(requestOptions) - .mapPage(bodyItemValue -> bodyItemValue.toObject(BatchCertificate.class)); - } - /** * Cancels a failed deletion of a Certificate from the specified Account. * @@ -13298,44 +14338,16 @@ public PagedIterable listCertificates() { @Generated @ServiceMethod(returns = ReturnType.SINGLE) public void cancelCertificateDeletion(String thumbprintAlgorithm, String thumbprint, - CancelBatchCertificateDeletionOptions options) { + BatchCertificateCancelDeletionOptions options) { // Generated convenience method for cancelCertificateDeletionWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } cancelCertificateDeletionWithResponse(thumbprintAlgorithm, thumbprint, requestOptions).getValue(); } - /** - * Cancels a failed deletion of a Certificate from the specified Account. - * - * If you try to delete a Certificate that is being used by a Pool or Compute - * Node, the status of the Certificate changes to deleteFailed. If you decide that - * you want to continue using the Certificate, you can use this operation to set - * the status of the Certificate back to active. If you intend to delete the - * Certificate, you do not need to run this operation after the deletion failed. - * You must make sure that the Certificate is not being used by any resources, and - * then you can try again to delete the Certificate. - * - * @param thumbprintAlgorithm The algorithm used to derive the thumbprint parameter. This must be sha1. - * @param thumbprint The thumbprint of the Certificate being deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void cancelCertificateDeletion(String thumbprintAlgorithm, String thumbprint) { - // Generated convenience method for cancelCertificateDeletionWithResponse - RequestOptions requestOptions = new RequestOptions(); - cancelCertificateDeletionWithResponse(thumbprintAlgorithm, thumbprint, requestOptions).getValue(); - } - /** * Deletes a Certificate from the specified Account. * @@ -13362,46 +14374,16 @@ public void cancelCertificateDeletion(String thumbprintAlgorithm, String thumbpr @Generated @ServiceMethod(returns = ReturnType.SINGLE) public void deleteCertificate(String thumbprintAlgorithm, String thumbprint, - DeleteBatchCertificateOptions options) { + BatchCertificateDeleteOptions options) { // Generated convenience method for deleteCertificateWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } deleteCertificateWithResponse(thumbprintAlgorithm, thumbprint, requestOptions).getValue(); } - /** - * Deletes a Certificate from the specified Account. - * - * You cannot delete a Certificate if a resource (Pool or Compute Node) is using - * it. Before you can delete a Certificate, you must therefore make sure that the - * Certificate is not associated with any existing Pools, the Certificate is not - * installed on any Nodes (even if you remove a Certificate from a Pool, it is not - * removed from existing Compute Nodes in that Pool until they restart), and no - * running Tasks depend on the Certificate. If you try to delete a Certificate - * that is in use, the deletion fails. The Certificate status changes to - * deleteFailed. You can use Cancel Delete Certificate to set the status back to - * active if you decide that you want to continue using the Certificate. - * - * @param thumbprintAlgorithm The algorithm used to derive the thumbprint parameter. This must be sha1. - * @param thumbprint The thumbprint of the Certificate to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteCertificate(String thumbprintAlgorithm, String thumbprint) { - // Generated convenience method for deleteCertificateWithResponse - RequestOptions requestOptions = new RequestOptions(); - deleteCertificateWithResponse(thumbprintAlgorithm, thumbprint, requestOptions).getValue(); - } - /** * Gets information about the specified Certificate. * @@ -13418,14 +14400,14 @@ public void deleteCertificate(String thumbprintAlgorithm, String thumbprint) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public GetCertificateResponse getCertificate(String thumbprintAlgorithm, String thumbprint, - GetBatchCertificateOptions options) { + public BatchCertificate getCertificate(String thumbprintAlgorithm, String thumbprint, + BatchCertificateGetOptions options) { // Generated convenience method for getCertificateWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); List select = options == null ? null : options.getSelect(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (select != null) { requestOptions.addQueryParam("$select", @@ -13435,92 +14417,7 @@ public GetCertificateResponse getCertificate(String thumbprintAlgorithm, String false); } return getCertificateWithResponse(thumbprintAlgorithm, thumbprint, requestOptions).getValue() - .toObject(GetCertificateResponse.class); - } - - /** - * Gets information about the specified Certificate. - * - * @param thumbprintAlgorithm The algorithm used to derive the thumbprint parameter. This must be sha1. - * @param thumbprint The thumbprint of the Certificate to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified Certificate. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public GetCertificateResponse getCertificate(String thumbprintAlgorithm, String thumbprint) { - // Generated convenience method for getCertificateWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getCertificateWithResponse(thumbprintAlgorithm, thumbprint, requestOptions).getValue() - .toObject(GetCertificateResponse.class); - } - - /** - * Checks the specified Job Schedule exists. - * - * @param jobScheduleId The ID of the Job Schedule which you want to check. - * @param options Optional parameters for Job Schedule Exists operation. - * @param requestConditions Specifies HTTP options for conditional requests based on modification time. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public boolean jobScheduleExists(String jobScheduleId, BatchJobScheduleExistsOptions options, - RequestConditions requestConditions) { - // Generated convenience method for jobScheduleExistsWithResponse - RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); - OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); - OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); - String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); - String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); - if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); - } - if (ifModifiedSince != null) { - requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, - String.valueOf(new DateTimeRfc1123(ifModifiedSince))); - } - if (ifUnmodifiedSince != null) { - requestOptions.setHeader(HttpHeaderName.IF_UNMODIFIED_SINCE, - String.valueOf(new DateTimeRfc1123(ifUnmodifiedSince))); - } - if (ifMatch != null) { - requestOptions.setHeader(HttpHeaderName.IF_MATCH, ifMatch); - } - if (ifNoneMatch != null) { - requestOptions.setHeader(HttpHeaderName.IF_NONE_MATCH, ifNoneMatch); - } - return jobScheduleExistsWithResponse(jobScheduleId, requestOptions).getValue(); - } - - /** - * Checks the specified Job Schedule exists. - * - * @param jobScheduleId The ID of the Job Schedule which you want to check. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public boolean jobScheduleExists(String jobScheduleId) { - // Generated convenience method for jobScheduleExistsWithResponse - RequestOptions requestOptions = new RequestOptions(); - return jobScheduleExistsWithResponse(jobScheduleId, requestOptions).getValue(); + .toObject(BatchCertificate.class); } /** @@ -13544,18 +14441,18 @@ public boolean jobScheduleExists(String jobScheduleId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteJobSchedule(String jobScheduleId, DeleteBatchJobScheduleOptions options, + public void deleteJobSchedule(String jobScheduleId, BatchJobScheduleDeleteOptions options, RequestConditions requestConditions) { // Generated convenience method for deleteJobScheduleWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); Boolean force = options == null ? null : options.isForce(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (force != null) { requestOptions.addQueryParam("force", String.valueOf(force), false); @@ -13577,31 +14474,6 @@ public void deleteJobSchedule(String jobScheduleId, DeleteBatchJobScheduleOption deleteJobScheduleWithResponse(jobScheduleId, requestOptions).getValue(); } - /** - * Deletes a Job Schedule from the specified Account. - * - * When you delete a Job Schedule, this also deletes all Jobs and Tasks under that - * schedule. When Tasks are deleted, all the files in their working directories on - * the Compute Nodes are also deleted (the retention period is ignored). The Job - * Schedule statistics are no longer accessible once the Job Schedule is deleted, - * though they are still counted towards Account lifetime statistics. - * - * @param jobScheduleId The ID of the Job Schedule to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteJobSchedule(String jobScheduleId) { - // Generated convenience method for deleteJobScheduleWithResponse - RequestOptions requestOptions = new RequestOptions(); - deleteJobScheduleWithResponse(jobScheduleId, requestOptions).getValue(); - } - /** * Gets information about the specified Job Schedule. * @@ -13618,11 +14490,11 @@ public void deleteJobSchedule(String jobScheduleId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public BatchJobSchedule getJobSchedule(String jobScheduleId, GetBatchJobScheduleOptions options, + public BatchJobSchedule getJobSchedule(String jobScheduleId, BatchJobScheduleGetOptions options, RequestConditions requestConditions) { // Generated convenience method for getJobScheduleWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); List select = options == null ? null : options.getSelect(); List expand = options == null ? null : options.getExpand(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); @@ -13630,7 +14502,7 @@ public BatchJobSchedule getJobSchedule(String jobScheduleId, GetBatchJobSchedule String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (select != null) { requestOptions.addQueryParam("$select", @@ -13647,39 +14519,19 @@ public BatchJobSchedule getJobSchedule(String jobScheduleId, GetBatchJobSchedule false); } if (ifModifiedSince != null) { - requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, - String.valueOf(new DateTimeRfc1123(ifModifiedSince))); - } - if (ifUnmodifiedSince != null) { - requestOptions.setHeader(HttpHeaderName.IF_UNMODIFIED_SINCE, - String.valueOf(new DateTimeRfc1123(ifUnmodifiedSince))); - } - if (ifMatch != null) { - requestOptions.setHeader(HttpHeaderName.IF_MATCH, ifMatch); - } - if (ifNoneMatch != null) { - requestOptions.setHeader(HttpHeaderName.IF_NONE_MATCH, ifNoneMatch); - } - return getJobScheduleWithResponse(jobScheduleId, requestOptions).getValue().toObject(BatchJobSchedule.class); - } - - /** - * Gets information about the specified Job Schedule. - * - * @param jobScheduleId The ID of the Job Schedule to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified Job Schedule. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public BatchJobSchedule getJobSchedule(String jobScheduleId) { - // Generated convenience method for getJobScheduleWithResponse - RequestOptions requestOptions = new RequestOptions(); + requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, + String.valueOf(new DateTimeRfc1123(ifModifiedSince))); + } + if (ifUnmodifiedSince != null) { + requestOptions.setHeader(HttpHeaderName.IF_UNMODIFIED_SINCE, + String.valueOf(new DateTimeRfc1123(ifUnmodifiedSince))); + } + if (ifMatch != null) { + requestOptions.setHeader(HttpHeaderName.IF_MATCH, ifMatch); + } + if (ifNoneMatch != null) { + requestOptions.setHeader(HttpHeaderName.IF_NONE_MATCH, ifNoneMatch); + } return getJobScheduleWithResponse(jobScheduleId, requestOptions).getValue().toObject(BatchJobSchedule.class); } @@ -13705,17 +14557,17 @@ public BatchJobSchedule getJobSchedule(String jobScheduleId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void updateJobSchedule(String jobScheduleId, BatchJobScheduleUpdateContent jobSchedule, - UpdateBatchJobScheduleOptions options, RequestConditions requestConditions) { + public void updateJobSchedule(String jobScheduleId, BatchJobScheduleUpdateParameters jobSchedule, + BatchJobScheduleUpdateOptions options, RequestConditions requestConditions) { // Generated convenience method for updateJobScheduleWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (ifModifiedSince != null) { requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, @@ -13754,7 +14606,7 @@ public void updateJobSchedule(String jobScheduleId, BatchJobScheduleUpdateConten */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void updateJobSchedule(String jobScheduleId, BatchJobScheduleUpdateContent jobSchedule) { + public void updateJobSchedule(String jobScheduleId, BatchJobScheduleUpdateParameters jobSchedule) { // Generated convenience method for updateJobScheduleWithResponse RequestOptions requestOptions = new RequestOptions(); updateJobScheduleWithResponse(jobScheduleId, BinaryData.fromObject(jobSchedule), requestOptions).getValue(); @@ -13783,16 +14635,16 @@ public void updateJobSchedule(String jobScheduleId, BatchJobScheduleUpdateConten @Generated @ServiceMethod(returns = ReturnType.SINGLE) public void replaceJobSchedule(String jobScheduleId, BatchJobSchedule jobSchedule, - ReplaceBatchJobScheduleOptions options, RequestConditions requestConditions) { + BatchJobScheduleReplaceOptions options, RequestConditions requestConditions) { // Generated convenience method for replaceJobScheduleWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (ifModifiedSince != null) { requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, @@ -13811,32 +14663,6 @@ public void replaceJobSchedule(String jobScheduleId, BatchJobSchedule jobSchedul replaceJobScheduleWithResponse(jobScheduleId, BinaryData.fromObject(jobSchedule), requestOptions).getValue(); } - /** - * Updates the properties of the specified Job Schedule. - * - * This fully replaces all the updatable properties of the Job Schedule. For - * example, if the schedule property is not specified with this request, then the - * Batch service will remove the existing schedule. Changes to a Job Schedule only - * impact Jobs created by the schedule after the update has taken place; currently - * running Jobs are unaffected. - * - * @param jobScheduleId The ID of the Job Schedule to update. - * @param jobSchedule A Job Schedule with updated properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void replaceJobSchedule(String jobScheduleId, BatchJobSchedule jobSchedule) { - // Generated convenience method for replaceJobScheduleWithResponse - RequestOptions requestOptions = new RequestOptions(); - replaceJobScheduleWithResponse(jobScheduleId, BinaryData.fromObject(jobSchedule), requestOptions).getValue(); - } - /** * Disables a Job Schedule. * @@ -13854,17 +14680,17 @@ public void replaceJobSchedule(String jobScheduleId, BatchJobSchedule jobSchedul */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void disableJobSchedule(String jobScheduleId, DisableBatchJobScheduleOptions options, + public void disableJobSchedule(String jobScheduleId, BatchJobScheduleDisableOptions options, RequestConditions requestConditions) { // Generated convenience method for disableJobScheduleWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (ifModifiedSince != null) { requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, @@ -13883,27 +14709,6 @@ public void disableJobSchedule(String jobScheduleId, DisableBatchJobScheduleOpti disableJobScheduleWithResponse(jobScheduleId, requestOptions).getValue(); } - /** - * Disables a Job Schedule. - * - * No new Jobs will be created until the Job Schedule is enabled again. - * - * @param jobScheduleId The ID of the Job Schedule to disable. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void disableJobSchedule(String jobScheduleId) { - // Generated convenience method for disableJobScheduleWithResponse - RequestOptions requestOptions = new RequestOptions(); - disableJobScheduleWithResponse(jobScheduleId, requestOptions).getValue(); - } - /** * Enables a Job Schedule. * @@ -13919,17 +14724,17 @@ public void disableJobSchedule(String jobScheduleId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void enableJobSchedule(String jobScheduleId, EnableBatchJobScheduleOptions options, + public void enableJobSchedule(String jobScheduleId, BatchJobScheduleEnableOptions options, RequestConditions requestConditions) { // Generated convenience method for enableJobScheduleWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (ifModifiedSince != null) { requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, @@ -13948,25 +14753,6 @@ public void enableJobSchedule(String jobScheduleId, EnableBatchJobScheduleOption enableJobScheduleWithResponse(jobScheduleId, requestOptions).getValue(); } - /** - * Enables a Job Schedule. - * - * @param jobScheduleId The ID of the Job Schedule to enable. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void enableJobSchedule(String jobScheduleId) { - // Generated convenience method for enableJobScheduleWithResponse - RequestOptions requestOptions = new RequestOptions(); - enableJobScheduleWithResponse(jobScheduleId, requestOptions).getValue(); - } - /** * Terminates a Job Schedule. * @@ -13982,18 +14768,18 @@ public void enableJobSchedule(String jobScheduleId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void terminateJobSchedule(String jobScheduleId, TerminateBatchJobScheduleOptions options, + public void terminateJobSchedule(String jobScheduleId, BatchJobScheduleTerminateOptions options, RequestConditions requestConditions) { // Generated convenience method for terminateJobScheduleWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); Boolean force = options == null ? null : options.isForce(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (force != null) { requestOptions.addQueryParam("force", String.valueOf(force), false); @@ -14015,25 +14801,6 @@ public void terminateJobSchedule(String jobScheduleId, TerminateBatchJobSchedule terminateJobScheduleWithResponse(jobScheduleId, requestOptions).getValue(); } - /** - * Terminates a Job Schedule. - * - * @param jobScheduleId The ID of the Job Schedule to terminates. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void terminateJobSchedule(String jobScheduleId) { - // Generated convenience method for terminateJobScheduleWithResponse - RequestOptions requestOptions = new RequestOptions(); - terminateJobScheduleWithResponse(jobScheduleId, requestOptions).getValue(); - } - /** * Creates a Job Schedule to the specified Account. * @@ -14048,12 +14815,12 @@ public void terminateJobSchedule(String jobScheduleId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void createJobSchedule(BatchJobScheduleCreateContent jobSchedule, CreateBatchJobScheduleOptions options) { + public void createJobSchedule(BatchJobScheduleCreateParameters jobSchedule, BatchJobScheduleCreateOptions options) { // Generated convenience method for createJobScheduleWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } createJobScheduleWithResponse(BinaryData.fromObject(jobSchedule), requestOptions).getValue(); } @@ -14071,7 +14838,7 @@ public void createJobSchedule(BatchJobScheduleCreateContent jobSchedule, CreateB */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void createJobSchedule(BatchJobScheduleCreateContent jobSchedule) { + public void createJobSchedule(BatchJobScheduleCreateParameters jobSchedule) { // Generated convenience method for createJobScheduleWithResponse RequestOptions requestOptions = new RequestOptions(); createJobScheduleWithResponse(BinaryData.fromObject(jobSchedule), requestOptions).getValue(); @@ -14091,15 +14858,15 @@ public void createJobSchedule(BatchJobScheduleCreateContent jobSchedule) { */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listJobSchedules(ListBatchJobSchedulesOptions options) { + public PagedIterable listJobSchedules(BatchJobSchedulesListOptions options) { // Generated convenience method for listJobSchedules RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); String filter = options == null ? null : options.getFilter(); List select = options == null ? null : options.getSelect(); List expand = options == null ? null : options.getExpand(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (filter != null) { requestOptions.addQueryParam("$filter", filter, false); @@ -14122,25 +14889,6 @@ public PagedIterable listJobSchedules(ListBatchJobSchedulesOpt .mapPage(bodyItemValue -> bodyItemValue.toObject(BatchJobSchedule.class)); } - /** - * Lists all of the Job Schedules in the specified Account. - * - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of listing the Job Schedules in an Account as paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listJobSchedules() { - // Generated convenience method for listJobSchedules - RequestOptions requestOptions = new RequestOptions(); - return serviceClient.listJobSchedules(requestOptions) - .mapPage(bodyItemValue -> bodyItemValue.toObject(BatchJobSchedule.class)); - } - /** * Creates a Task to the specified Job. * @@ -14160,12 +14908,12 @@ public PagedIterable listJobSchedules() { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void createTask(String jobId, BatchTaskCreateContent task, CreateBatchTaskOptions options) { + public void createTask(String jobId, BatchTaskCreateParameters task, BatchTaskCreateOptions options) { // Generated convenience method for createTaskWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } createTaskWithResponse(jobId, BinaryData.fromObject(task), requestOptions).getValue(); } @@ -14188,7 +14936,7 @@ public void createTask(String jobId, BatchTaskCreateContent task, CreateBatchTas */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void createTask(String jobId, BatchTaskCreateContent task) { + public void createTask(String jobId, BatchTaskCreateParameters task) { // Generated convenience method for createTaskWithResponse RequestOptions requestOptions = new RequestOptions(); createTaskWithResponse(jobId, BinaryData.fromObject(task), requestOptions).getValue(); @@ -14213,15 +14961,15 @@ public void createTask(String jobId, BatchTaskCreateContent task) { */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listTasks(String jobId, ListBatchTasksOptions options) { + public PagedIterable listTasks(String jobId, BatchTasksListOptions options) { // Generated convenience method for listTasks RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); String filter = options == null ? null : options.getFilter(); List select = options == null ? null : options.getSelect(); List expand = options == null ? null : options.getExpand(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (filter != null) { requestOptions.addQueryParam("$filter", filter, false); @@ -14244,31 +14992,6 @@ public PagedIterable listTasks(String jobId, ListBatchTasksOptions op .mapPage(bodyItemValue -> bodyItemValue.toObject(BatchTask.class)); } - /** - * Lists all of the Tasks that are associated with the specified Job. - * - * For multi-instance Tasks, information such as affinityId, executionInfo and - * nodeInfo refer to the primary Task. Use the list subtasks API to retrieve - * information about subtasks. - * - * @param jobId The ID of the Job. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of listing the Tasks in a Job as paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listTasks(String jobId) { - // Generated convenience method for listTasks - RequestOptions requestOptions = new RequestOptions(); - return serviceClient.listTasks(jobId, requestOptions) - .mapPage(bodyItemValue -> bodyItemValue.toObject(BatchTask.class)); - } - /** * Adds a collection of Tasks to the specified Job. * @@ -14296,57 +15019,20 @@ public PagedIterable listTasks(String jobId) { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of adding a collection of Tasks to a Job. + * @return the result of creating a collection of Tasks to a Job. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public BatchTaskAddCollectionResult createTaskCollection(String jobId, BatchTaskGroup taskCollection, - CreateBatchTaskCollectionOptions options) { + public BatchCreateTaskCollectionResult createTaskCollection(String jobId, BatchTaskGroup taskCollection, + BatchTaskCollectionCreateOptions options) { // Generated convenience method for createTaskCollectionWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } return createTaskCollectionWithResponse(jobId, BinaryData.fromObject(taskCollection), requestOptions).getValue() - .toObject(BatchTaskAddCollectionResult.class); - } - - /** - * Adds a collection of Tasks to the specified Job. - * - * Note that each Task must have a unique ID. The Batch service may not return the - * results for each Task in the same order the Tasks were submitted in this - * request. If the server times out or the connection is closed during the - * request, the request may have been partially or fully processed, or not at all. - * In such cases, the user should re-issue the request. Note that it is up to the - * user to correctly handle failures when re-issuing a request. For example, you - * should use the same Task IDs during a retry so that if the prior operation - * succeeded, the retry will not create extra Tasks unexpectedly. If the response - * contains any Tasks which failed to add, a client can retry the request. In a - * retry, it is most efficient to resubmit only Tasks that failed to add, and to - * omit Tasks that were successfully added on the first attempt. The maximum - * lifetime of a Task from addition to completion is 180 days. If a Task has not - * completed within 180 days of being added it will be terminated by the Batch - * service and left in whatever state it was in at that time. - * - * @param jobId The ID of the Job to which the Task collection is to be added. - * @param taskCollection The Tasks to be added. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of adding a collection of Tasks to a Job. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public BatchTaskAddCollectionResult createTaskCollection(String jobId, BatchTaskGroup taskCollection) { - // Generated convenience method for createTaskCollectionWithResponse - RequestOptions requestOptions = new RequestOptions(); - return createTaskCollectionWithResponse(jobId, BinaryData.fromObject(taskCollection), requestOptions).getValue() - .toObject(BatchTaskAddCollectionResult.class); + .toObject(BatchCreateTaskCollectionResult.class); } /** @@ -14371,17 +15057,17 @@ public BatchTaskAddCollectionResult createTaskCollection(String jobId, BatchTask */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteTask(String jobId, String taskId, DeleteBatchTaskOptions options, + public void deleteTask(String jobId, String taskId, BatchTaskDeleteOptions options, RequestConditions requestConditions) { // Generated convenience method for deleteTaskWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (ifModifiedSince != null) { requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, @@ -14400,32 +15086,6 @@ public void deleteTask(String jobId, String taskId, DeleteBatchTaskOptions optio deleteTaskWithResponse(jobId, taskId, requestOptions).getValue(); } - /** - * Deletes a Task from the specified Job. - * - * When a Task is deleted, all of the files in its directory on the Compute Node - * where it ran are also deleted (regardless of the retention time). For - * multi-instance Tasks, the delete Task operation applies synchronously to the - * primary task; subtasks and their files are then deleted asynchronously in the - * background. - * - * @param jobId The ID of the Job from which to delete the Task. - * @param taskId The ID of the Task to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteTask(String jobId, String taskId) { - // Generated convenience method for deleteTaskWithResponse - RequestOptions requestOptions = new RequestOptions(); - deleteTaskWithResponse(jobId, taskId, requestOptions).getValue(); - } - /** * Gets information about the specified Task. * @@ -14450,11 +15110,11 @@ public void deleteTask(String jobId, String taskId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public BatchTask getTask(String jobId, String taskId, GetBatchTaskOptions options, + public BatchTask getTask(String jobId, String taskId, BatchTaskGetOptions options, RequestConditions requestConditions) { // Generated convenience method for getTaskWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); List select = options == null ? null : options.getSelect(); List expand = options == null ? null : options.getExpand(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); @@ -14462,7 +15122,7 @@ public BatchTask getTask(String jobId, String taskId, GetBatchTaskOptions option String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (select != null) { requestOptions.addQueryParam("$select", @@ -14490,36 +15150,8 @@ public BatchTask getTask(String jobId, String taskId, GetBatchTaskOptions option requestOptions.setHeader(HttpHeaderName.IF_MATCH, ifMatch); } if (ifNoneMatch != null) { - requestOptions.setHeader(HttpHeaderName.IF_NONE_MATCH, ifNoneMatch); - } - return getTaskWithResponse(jobId, taskId, requestOptions).getValue().toObject(BatchTask.class); - } - - /** - * Gets information about the specified Task. - * - * For multi-instance Tasks, information such as affinityId, executionInfo and - * nodeInfo refer to the primary Task. Use the list subtasks API to retrieve - * information about subtasks. - * - * @param jobId The ID of the Job that contains the Task. - * @param taskId The ID of the Task to get information about. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified Task. - * - * For multi-instance Tasks, information such as affinityId, executionInfo and - * nodeInfo refer to the primary Task. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public BatchTask getTask(String jobId, String taskId) { - // Generated convenience method for getTaskWithResponse - RequestOptions requestOptions = new RequestOptions(); + requestOptions.setHeader(HttpHeaderName.IF_NONE_MATCH, ifNoneMatch); + } return getTaskWithResponse(jobId, taskId, requestOptions).getValue().toObject(BatchTask.class); } @@ -14540,17 +15172,17 @@ public BatchTask getTask(String jobId, String taskId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void replaceTask(String jobId, String taskId, BatchTask task, ReplaceBatchTaskOptions options, + public void replaceTask(String jobId, String taskId, BatchTask task, BatchTaskReplaceOptions options, RequestConditions requestConditions) { // Generated convenience method for replaceTaskWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (ifModifiedSince != null) { requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, @@ -14569,27 +15201,6 @@ public void replaceTask(String jobId, String taskId, BatchTask task, ReplaceBatc replaceTaskWithResponse(jobId, taskId, BinaryData.fromObject(task), requestOptions).getValue(); } - /** - * Updates the properties of the specified Task. - * - * @param jobId The ID of the Job containing the Task. - * @param taskId The ID of the Task to update. - * @param task The Task to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void replaceTask(String jobId, String taskId, BatchTask task) { - // Generated convenience method for replaceTaskWithResponse - RequestOptions requestOptions = new RequestOptions(); - replaceTaskWithResponse(jobId, taskId, BinaryData.fromObject(task), requestOptions).getValue(); - } - /** * Lists all of the subtasks that are associated with the specified multi-instance * Task. @@ -14609,13 +15220,13 @@ public void replaceTask(String jobId, String taskId, BatchTask task) { */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSubTasks(String jobId, String taskId, ListBatchSubTasksOptions options) { + public PagedIterable listSubTasks(String jobId, String taskId, BatchSubTasksListOptions options) { // Generated convenience method for listSubTasks RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); List select = options == null ? null : options.getSelect(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (select != null) { requestOptions.addQueryParam("$select", @@ -14628,31 +15239,6 @@ public PagedIterable listSubTasks(String jobId, String taskId, Lis .mapPage(bodyItemValue -> bodyItemValue.toObject(BatchSubtask.class)); } - /** - * Lists all of the subtasks that are associated with the specified multi-instance - * Task. - * - * If the Task is not a multi-instance Task then this returns an empty collection. - * - * @param jobId The ID of the Job. - * @param taskId The ID of the Task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of listing the subtasks of a Task as paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSubTasks(String jobId, String taskId) { - // Generated convenience method for listSubTasks - RequestOptions requestOptions = new RequestOptions(); - return serviceClient.listSubTasks(jobId, taskId, requestOptions) - .mapPage(bodyItemValue -> bodyItemValue.toObject(BatchSubtask.class)); - } - /** * Terminates the specified Task. * @@ -14673,17 +15259,17 @@ public PagedIterable listSubTasks(String jobId, String taskId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void terminateTask(String jobId, String taskId, TerminateBatchTaskOptions options, + public void terminateTask(String jobId, String taskId, BatchTaskTerminateOptions options, RequestConditions requestConditions) { // Generated convenience method for terminateTaskWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (ifModifiedSince != null) { requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, @@ -14702,30 +15288,6 @@ public void terminateTask(String jobId, String taskId, TerminateBatchTaskOptions terminateTaskWithResponse(jobId, taskId, requestOptions).getValue(); } - /** - * Terminates the specified Task. - * - * When the Task has been terminated, it moves to the completed state. For - * multi-instance Tasks, the terminate Task operation applies synchronously to the - * primary task; subtasks are then terminated asynchronously in the background. - * - * @param jobId The ID of the Job containing the Task. - * @param taskId The ID of the Task to terminate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void terminateTask(String jobId, String taskId) { - // Generated convenience method for terminateTaskWithResponse - RequestOptions requestOptions = new RequestOptions(); - terminateTaskWithResponse(jobId, taskId, requestOptions).getValue(); - } - /** * Reactivates a Task, allowing it to run again even if its retry count has been * exhausted. @@ -14751,17 +15313,17 @@ public void terminateTask(String jobId, String taskId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void reactivateTask(String jobId, String taskId, ReactivateBatchTaskOptions options, + public void reactivateTask(String jobId, String taskId, BatchTaskReactivateOptions options, RequestConditions requestConditions) { // Generated convenience method for reactivateTaskWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); OffsetDateTime ifModifiedSince = requestConditions == null ? null : requestConditions.getIfModifiedSince(); OffsetDateTime ifUnmodifiedSince = requestConditions == null ? null : requestConditions.getIfUnmodifiedSince(); String ifMatch = requestConditions == null ? null : requestConditions.getIfMatch(); String ifNoneMatch = requestConditions == null ? null : requestConditions.getIfNoneMatch(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (ifModifiedSince != null) { requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, @@ -14780,35 +15342,6 @@ public void reactivateTask(String jobId, String taskId, ReactivateBatchTaskOptio reactivateTaskWithResponse(jobId, taskId, requestOptions).getValue(); } - /** - * Reactivates a Task, allowing it to run again even if its retry count has been - * exhausted. - * - * Reactivation makes a Task eligible to be retried again up to its maximum retry - * count. The Task's state is changed to active. As the Task is no longer in the - * completed state, any previous exit code or failure information is no longer - * available after reactivation. Each time a Task is reactivated, its retry count - * is reset to 0. Reactivation will fail for Tasks that are not completed or that - * previously completed successfully (with an exit code of 0). Additionally, it - * will fail if the Job has completed (or is terminating or deleting). - * - * @param jobId The ID of the Job containing the Task. - * @param taskId The ID of the Task to reactivate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void reactivateTask(String jobId, String taskId) { - // Generated convenience method for reactivateTaskWithResponse - RequestOptions requestOptions = new RequestOptions(); - reactivateTaskWithResponse(jobId, taskId, requestOptions).getValue(); - } - /** * Deletes the specified Task file from the Compute Node where the Task ran. * @@ -14825,199 +15358,59 @@ public void reactivateTask(String jobId, String taskId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteTaskFile(String jobId, String taskId, String filePath, DeleteBatchTaskFileOptions options) { + public void deleteTaskFile(String jobId, String taskId, String filePath, BatchTaskFileDeleteOptions options) { // Generated convenience method for deleteTaskFileWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); Boolean recursive = options == null ? null : options.isRecursive(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (recursive != null) { requestOptions.addQueryParam("recursive", String.valueOf(recursive), false); } - deleteTaskFileWithResponse(jobId, taskId, filePath, requestOptions).getValue(); - } - - /** - * Deletes the specified Task file from the Compute Node where the Task ran. - * - * @param jobId The ID of the Job that contains the Task. - * @param taskId The ID of the Task whose file you want to retrieve. - * @param filePath The path to the Task file that you want to get the content of. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteTaskFile(String jobId, String taskId, String filePath) { - // Generated convenience method for deleteTaskFileWithResponse - RequestOptions requestOptions = new RequestOptions(); - deleteTaskFileWithResponse(jobId, taskId, filePath, requestOptions).getValue(); - } - - /** - * Returns the content of the specified Task file. - * - * @param jobId The ID of the Job that contains the Task. - * @param taskId The ID of the Task whose file you want to retrieve. - * @param filePath The path to the Task file that you want to get the content of. - * @param options Optional parameters for Get Task File operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public BinaryData getTaskFile(String jobId, String taskId, String filePath, GetBatchTaskFileOptions options) { - // Generated convenience method for getTaskFileWithResponse - RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); - OffsetDateTime ifModifiedSince = options == null ? null : options.getIfModifiedSince(); - OffsetDateTime ifUnmodifiedSince = options == null ? null : options.getIfUnmodifiedSince(); - String ocpRange = options == null ? null : options.getOcpRange(); - if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); - } - if (ifModifiedSince != null) { - requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, - String.valueOf(new DateTimeRfc1123(ifModifiedSince))); - } - if (ifUnmodifiedSince != null) { - requestOptions.setHeader(HttpHeaderName.IF_UNMODIFIED_SINCE, - String.valueOf(new DateTimeRfc1123(ifUnmodifiedSince))); - } - if (ocpRange != null) { - requestOptions.setHeader(HttpHeaderName.fromString("ocp-range"), ocpRange); - } - return getTaskFileWithResponse(jobId, taskId, filePath, requestOptions).getValue(); - } - - /** - * Returns the content of the specified Task file. - * - * @param jobId The ID of the Job that contains the Task. - * @param taskId The ID of the Task whose file you want to retrieve. - * @param filePath The path to the Task file that you want to get the content of. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public BinaryData getTaskFile(String jobId, String taskId, String filePath) { - // Generated convenience method for getTaskFileWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getTaskFileWithResponse(jobId, taskId, filePath, requestOptions).getValue(); - } - - /** - * Gets the properties of the specified Task file. - * - * @param jobId The ID of the Job that contains the Task. - * @param taskId The ID of the Task whose file you want to retrieve. - * @param filePath The path to the Task file that you want to get the content of. - * @param options Optional parameters for Get Task File Properties operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return The {@link FileResponseHeaderProperties} object containing the properties retrieved from the response - * headers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public FileResponseHeaderProperties getTaskFileProperties(String jobId, String taskId, String filePath, - GetBatchTaskFilePropertiesOptions options) { - RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); - OffsetDateTime ifModifiedSince = options == null ? null : options.getIfModifiedSince(); - OffsetDateTime ifUnmodifiedSince = options == null ? null : options.getIfUnmodifiedSince(); - if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); - } - if (ifModifiedSince != null) { - requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, - String.valueOf(new DateTimeRfc1123(ifModifiedSince))); - } - if (ifUnmodifiedSince != null) { - requestOptions.setHeader(HttpHeaderName.IF_UNMODIFIED_SINCE, - String.valueOf(new DateTimeRfc1123(ifUnmodifiedSince))); - } - // Retrieve response from getTaskFilePropertiesWithResponse and construct FileResponseHeaderProperties from its - // headers - Response response = getTaskFilePropertiesWithResponse(jobId, taskId, filePath, requestOptions); - return new FileResponseHeaderProperties(response.getHeaders()); - } - - /** - * Gets the properties of the specified Task file. - * - * @param jobId The ID of the Job that contains the Task. - * @param taskId The ID of the Task whose file you want to retrieve. - * @param filePath The path to the Task file that you want to get the content of. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return The {@link FileResponseHeaderProperties} object containing the properties retrieved from the response - * headers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public FileResponseHeaderProperties getTaskFileProperties(String jobId, String taskId, String filePath) { - Response response = getTaskFilePropertiesWithResponse(jobId, taskId, filePath, new RequestOptions()); - return new FileResponseHeaderProperties(response.getHeaders()); + deleteTaskFileWithResponse(jobId, taskId, filePath, requestOptions).getValue(); } /** - * Lists the files in a Task's directory on its Compute Node. + * Returns the content of the specified Task file. * * @param jobId The ID of the Job that contains the Task. - * @param taskId The ID of the Task whose files you want to list. - * @param options Optional parameters for List Task Files operation. + * @param taskId The ID of the Task whose file you want to retrieve. + * @param filePath The path to the Task file that you want to get the content of. + * @param options Optional parameters for Get Task File operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of listing the files on a Compute Node, or the files associated with - * a Task on a Compute Node as paginated response with {@link PagedIterable}. + * @return the response. */ @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listTaskFiles(String jobId, String taskId, ListBatchTaskFilesOptions options) { - // Generated convenience method for listTaskFiles + @ServiceMethod(returns = ReturnType.SINGLE) + public BinaryData getTaskFile(String jobId, String taskId, String filePath, BatchTaskFileGetOptions options) { + // Generated convenience method for getTaskFileWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); - String filter = options == null ? null : options.getFilter(); - Boolean recursive = options == null ? null : options.isRecursive(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + OffsetDateTime ifModifiedSince = options == null ? null : options.getIfModifiedSince(); + OffsetDateTime ifUnmodifiedSince = options == null ? null : options.getIfUnmodifiedSince(); + String ocpRange = options == null ? null : options.getOcpRange(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } - if (filter != null) { - requestOptions.addQueryParam("$filter", filter, false); + if (ifModifiedSince != null) { + requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, + String.valueOf(new DateTimeRfc1123(ifModifiedSince))); } - if (recursive != null) { - requestOptions.addQueryParam("recursive", String.valueOf(recursive), false); + if (ifUnmodifiedSince != null) { + requestOptions.setHeader(HttpHeaderName.IF_UNMODIFIED_SINCE, + String.valueOf(new DateTimeRfc1123(ifUnmodifiedSince))); } - return serviceClient.listTaskFiles(jobId, taskId, requestOptions) - .mapPage(bodyItemValue -> bodyItemValue.toObject(BatchNodeFile.class)); + if (ocpRange != null) { + requestOptions.setHeader(HttpHeaderName.fromString("ocp-range"), ocpRange); + } + return getTaskFileWithResponse(jobId, taskId, filePath, requestOptions).getValue(); } /** @@ -15025,6 +15418,7 @@ public PagedIterable listTaskFiles(String jobId, String taskId, L * * @param jobId The ID of the Job that contains the Task. * @param taskId The ID of the Task whose files you want to list. + * @param options Optional parameters for List Task Files operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -15036,9 +15430,21 @@ public PagedIterable listTaskFiles(String jobId, String taskId, L */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listTaskFiles(String jobId, String taskId) { + public PagedIterable listTaskFiles(String jobId, String taskId, BatchTaskFilesListOptions options) { // Generated convenience method for listTaskFiles RequestOptions requestOptions = new RequestOptions(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + String filter = options == null ? null : options.getFilter(); + Boolean recursive = options == null ? null : options.isRecursive(); + if (timeOutInSeconds != null) { + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); + } + if (filter != null) { + requestOptions.addQueryParam("$filter", filter, false); + } + if (recursive != null) { + requestOptions.addQueryParam("recursive", String.valueOf(recursive), false); + } return serviceClient.listTaskFiles(jobId, taskId, requestOptions) .mapPage(bodyItemValue -> bodyItemValue.toObject(BatchNodeFile.class)); } @@ -15062,13 +15468,13 @@ public PagedIterable listTaskFiles(String jobId, String taskId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void createNodeUser(String poolId, String nodeId, BatchNodeUserCreateContent user, - CreateBatchNodeUserOptions options) { + public void createNodeUser(String poolId, String nodeId, BatchNodeUserCreateParameters user, + BatchNodeUserCreateOptions options) { // Generated convenience method for createNodeUserWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } createNodeUserWithResponse(poolId, nodeId, BinaryData.fromObject(user), requestOptions).getValue(); } @@ -15091,7 +15497,7 @@ public void createNodeUser(String poolId, String nodeId, BatchNodeUserCreateCont */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void createNodeUser(String poolId, String nodeId, BatchNodeUserCreateContent user) { + public void createNodeUser(String poolId, String nodeId, BatchNodeUserCreateParameters user) { // Generated convenience method for createNodeUserWithResponse RequestOptions requestOptions = new RequestOptions(); createNodeUserWithResponse(poolId, nodeId, BinaryData.fromObject(user), requestOptions).getValue(); @@ -15116,40 +15522,16 @@ public void createNodeUser(String poolId, String nodeId, BatchNodeUserCreateCont */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteNodeUser(String poolId, String nodeId, String userName, DeleteBatchNodeUserOptions options) { + public void deleteNodeUser(String poolId, String nodeId, String userName, BatchNodeUserDeleteOptions options) { // Generated convenience method for deleteNodeUserWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } deleteNodeUserWithResponse(poolId, nodeId, userName, requestOptions).getValue(); } - /** - * Deletes a user Account from the specified Compute Node. - * - * You can delete a user Account to a Compute Node only when it is in the idle or - * running state. - * - * @param poolId The ID of the Pool that contains the Compute Node. - * @param nodeId The ID of the machine on which you want to delete a user Account. - * @param userName The name of the user Account to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteNodeUser(String poolId, String nodeId, String userName) { - // Generated convenience method for deleteNodeUserWithResponse - RequestOptions requestOptions = new RequestOptions(); - deleteNodeUserWithResponse(poolId, nodeId, userName, requestOptions).getValue(); - } - /** * Updates the password and expiration time of a user Account on the specified Compute Node. * @@ -15161,7 +15543,7 @@ public void deleteNodeUser(String poolId, String nodeId, String userName) { * @param poolId The ID of the Pool that contains the Compute Node. * @param nodeId The ID of the machine on which you want to update a user Account. * @param userName The name of the user Account to update. - * @param content The options to use for updating the user. + * @param parameters The options to use for updating the user. * @param options Optional parameters for Replace Node User operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -15172,15 +15554,15 @@ public void deleteNodeUser(String poolId, String nodeId, String userName) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void replaceNodeUser(String poolId, String nodeId, String userName, BatchNodeUserUpdateContent content, - ReplaceBatchNodeUserOptions options) { + public void replaceNodeUser(String poolId, String nodeId, String userName, BatchNodeUserUpdateParameters parameters, + BatchNodeUserReplaceOptions options) { // Generated convenience method for replaceNodeUserWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } - replaceNodeUserWithResponse(poolId, nodeId, userName, BinaryData.fromObject(content), requestOptions) + replaceNodeUserWithResponse(poolId, nodeId, userName, BinaryData.fromObject(parameters), requestOptions) .getValue(); } @@ -15195,7 +15577,7 @@ public void replaceNodeUser(String poolId, String nodeId, String userName, Batch * @param poolId The ID of the Pool that contains the Compute Node. * @param nodeId The ID of the machine on which you want to update a user Account. * @param userName The name of the user Account to update. - * @param content The options to use for updating the user. + * @param parameters The options to use for updating the user. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -15205,10 +15587,11 @@ public void replaceNodeUser(String poolId, String nodeId, String userName, Batch */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void replaceNodeUser(String poolId, String nodeId, String userName, BatchNodeUserUpdateContent content) { + public void replaceNodeUser(String poolId, String nodeId, String userName, + BatchNodeUserUpdateParameters parameters) { // Generated convenience method for replaceNodeUserWithResponse RequestOptions requestOptions = new RequestOptions(); - replaceNodeUserWithResponse(poolId, nodeId, userName, BinaryData.fromObject(content), requestOptions) + replaceNodeUserWithResponse(poolId, nodeId, userName, BinaryData.fromObject(parameters), requestOptions) .getValue(); } @@ -15228,13 +15611,13 @@ public void replaceNodeUser(String poolId, String nodeId, String userName, Batch */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public BatchNode getNode(String poolId, String nodeId, GetBatchNodeOptions options) { + public BatchNode getNode(String poolId, String nodeId, BatchNodeGetOptions options) { // Generated convenience method for getNodeWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); List select = options == null ? null : options.getSelect(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (select != null) { requestOptions.addQueryParam("$select", @@ -15246,27 +15629,6 @@ public BatchNode getNode(String poolId, String nodeId, GetBatchNodeOptions optio return getNodeWithResponse(poolId, nodeId, requestOptions).getValue().toObject(BatchNode.class); } - /** - * Gets information about the specified Compute Node. - * - * @param poolId The ID of the Pool that contains the Compute Node. - * @param nodeId The ID of the Compute Node that you want to get information about. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified Compute Node. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public BatchNode getNode(String poolId, String nodeId) { - // Generated convenience method for getNodeWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getNodeWithResponse(poolId, nodeId, requestOptions).getValue().toObject(BatchNode.class); - } - /** * Restarts the specified Compute Node. * @@ -15284,13 +15646,13 @@ public BatchNode getNode(String poolId, String nodeId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void rebootNode(String poolId, String nodeId, RebootBatchNodeOptions options) { + public void rebootNode(String poolId, String nodeId, BatchNodeRebootOptions options) { // Generated convenience method for rebootNodeWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); - BatchNodeRebootContent parameters = options == null ? null : options.getParameters(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + BatchNodeRebootParameters parameters = options == null ? null : options.getParameters(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (parameters != null) { requestOptions.setBody(BinaryData.fromObject(parameters)); @@ -15298,28 +15660,6 @@ public void rebootNode(String poolId, String nodeId, RebootBatchNodeOptions opti rebootNodeWithResponse(poolId, nodeId, requestOptions).getValue(); } - /** - * Restarts the specified Compute Node. - * - * You can restart a Compute Node only if it is in an idle or running state. - * - * @param poolId The ID of the Pool that contains the Compute Node. - * @param nodeId The ID of the Compute Node that you want to restart. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void rebootNode(String poolId, String nodeId) { - // Generated convenience method for rebootNodeWithResponse - RequestOptions requestOptions = new RequestOptions(); - rebootNodeWithResponse(poolId, nodeId, requestOptions).getValue(); - } - /** * Starts the specified Compute Node. * @@ -15337,38 +15677,16 @@ public void rebootNode(String poolId, String nodeId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void startNode(String poolId, String nodeId, StartBatchNodeOptions options) { + public void startNode(String poolId, String nodeId, BatchNodeStartOptions options) { // Generated convenience method for startNodeWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } startNodeWithResponse(poolId, nodeId, requestOptions).getValue(); } - /** - * Starts the specified Compute Node. - * - * You can start a Compute Node only if it has been deallocated. - * - * @param poolId The ID of the Pool that contains the Compute Node. - * @param nodeId The ID of the Compute Node that you want to restart. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void startNode(String poolId, String nodeId) { - // Generated convenience method for startNodeWithResponse - RequestOptions requestOptions = new RequestOptions(); - startNodeWithResponse(poolId, nodeId, requestOptions).getValue(); - } - /** * Reinstalls the operating system on the specified Compute Node. * @@ -15388,13 +15706,13 @@ public void startNode(String poolId, String nodeId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void reimageNode(String poolId, String nodeId, ReimageBatchNodeOptions options) { + public void reimageNode(String poolId, String nodeId, BatchNodeReimageOptions options) { // Generated convenience method for reimageNodeWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); - BatchNodeReimageContent parameters = options == null ? null : options.getParameters(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + BatchNodeReimageParameters parameters = options == null ? null : options.getParameters(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (parameters != null) { requestOptions.setBody(BinaryData.fromObject(parameters)); @@ -15402,30 +15720,6 @@ public void reimageNode(String poolId, String nodeId, ReimageBatchNodeOptions op reimageNodeWithResponse(poolId, nodeId, requestOptions).getValue(); } - /** - * Reinstalls the operating system on the specified Compute Node. - * - * You can reinstall the operating system on a Compute Node only if it is in an - * idle or running state. This API can be invoked only on Pools created with the - * cloud service configuration property. - * - * @param poolId The ID of the Pool that contains the Compute Node. - * @param nodeId The ID of the Compute Node that you want to restart. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void reimageNode(String poolId, String nodeId) { - // Generated convenience method for reimageNodeWithResponse - RequestOptions requestOptions = new RequestOptions(); - reimageNodeWithResponse(poolId, nodeId, requestOptions).getValue(); - } - /** * Deallocates the specified Compute Node. * @@ -15443,13 +15737,13 @@ public void reimageNode(String poolId, String nodeId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void deallocateNode(String poolId, String nodeId, DeallocateBatchNodeOptions options) { + public void deallocateNode(String poolId, String nodeId, BatchNodeDeallocateOptions options) { // Generated convenience method for deallocateNodeWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); - BatchNodeDeallocateContent parameters = options == null ? null : options.getParameters(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + BatchNodeDeallocateParameters parameters = options == null ? null : options.getParameters(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (parameters != null) { requestOptions.setBody(BinaryData.fromObject(parameters)); @@ -15457,92 +15751,15 @@ public void deallocateNode(String poolId, String nodeId, DeallocateBatchNodeOpti deallocateNodeWithResponse(poolId, nodeId, requestOptions).getValue(); } - /** - * Deallocates the specified Compute Node. - * - * You can deallocate a Compute Node only if it is in an idle or running state. - * - * @param poolId The ID of the Pool that contains the Compute Node. - * @param nodeId The ID of the Compute Node that you want to restart. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void deallocateNode(String poolId, String nodeId) { - // Generated convenience method for deallocateNodeWithResponse - RequestOptions requestOptions = new RequestOptions(); - deallocateNodeWithResponse(poolId, nodeId, requestOptions).getValue(); - } - - /** - * Disables Task scheduling on the specified Compute Node. - * - * You can disable Task scheduling on a Compute Node only if its current - * scheduling state is enabled. - * - * @param poolId The ID of the Pool that contains the Compute Node. - * @param nodeId The ID of the Compute Node on which you want to disable Task scheduling. - * @param options Optional parameters for Disable Node Scheduling operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void disableNodeScheduling(String poolId, String nodeId, DisableBatchNodeSchedulingOptions options) { - // Generated convenience method for disableNodeSchedulingWithResponse - RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); - BatchNodeDisableSchedulingContent parameters = options == null ? null : options.getParameters(); - if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); - } - if (parameters != null) { - requestOptions.setBody(BinaryData.fromObject(parameters)); - } - disableNodeSchedulingWithResponse(poolId, nodeId, requestOptions).getValue(); - } - /** * Disables Task scheduling on the specified Compute Node. * - * You can disable Task scheduling on a Compute Node only if its current - * scheduling state is enabled. - * - * @param poolId The ID of the Pool that contains the Compute Node. - * @param nodeId The ID of the Compute Node on which you want to disable Task scheduling. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void disableNodeScheduling(String poolId, String nodeId) { - // Generated convenience method for disableNodeSchedulingWithResponse - RequestOptions requestOptions = new RequestOptions(); - disableNodeSchedulingWithResponse(poolId, nodeId, requestOptions).getValue(); - } - - /** - * Enables Task scheduling on the specified Compute Node. - * - * You can enable Task scheduling on a Compute Node only if its current scheduling - * state is disabled. + * You can disable Task scheduling on a Compute Node only if its current + * scheduling state is enabled. * * @param poolId The ID of the Pool that contains the Compute Node. - * @param nodeId The ID of the Compute Node on which you want to enable Task scheduling. - * @param options Optional parameters for Enable Node Scheduling operation. + * @param nodeId The ID of the Compute Node on which you want to disable Task scheduling. + * @param options Optional parameters for Disable Node Scheduling operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -15552,14 +15769,18 @@ public void disableNodeScheduling(String poolId, String nodeId) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void enableNodeScheduling(String poolId, String nodeId, EnableBatchNodeSchedulingOptions options) { - // Generated convenience method for enableNodeSchedulingWithResponse + public void disableNodeScheduling(String poolId, String nodeId, BatchNodeSchedulingDisableOptions options) { + // Generated convenience method for disableNodeSchedulingWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + BatchNodeDisableSchedulingParameters parameters = options == null ? null : options.getParameters(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } - enableNodeSchedulingWithResponse(poolId, nodeId, requestOptions).getValue(); + if (parameters != null) { + requestOptions.setBody(BinaryData.fromObject(parameters)); + } + disableNodeSchedulingWithResponse(poolId, nodeId, requestOptions).getValue(); } /** @@ -15570,6 +15791,7 @@ public void enableNodeScheduling(String poolId, String nodeId, EnableBatchNodeSc * * @param poolId The ID of the Pool that contains the Compute Node. * @param nodeId The ID of the Compute Node on which you want to enable Task scheduling. + * @param options Optional parameters for Enable Node Scheduling operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -15579,9 +15801,13 @@ public void enableNodeScheduling(String poolId, String nodeId, EnableBatchNodeSc */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void enableNodeScheduling(String poolId, String nodeId) { + public void enableNodeScheduling(String poolId, String nodeId, BatchNodeSchedulingEnableOptions options) { // Generated convenience method for enableNodeSchedulingWithResponse RequestOptions requestOptions = new RequestOptions(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + if (timeOutInSeconds != null) { + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); + } enableNodeSchedulingWithResponse(poolId, nodeId, requestOptions).getValue(); } @@ -15608,45 +15834,17 @@ public void enableNodeScheduling(String poolId, String nodeId) { @Generated @ServiceMethod(returns = ReturnType.SINGLE) public BatchNodeRemoteLoginSettings getNodeRemoteLoginSettings(String poolId, String nodeId, - GetBatchNodeRemoteLoginSettingsOptions options) { + BatchNodeRemoteLoginSettingsGetOptions options) { // Generated convenience method for getNodeRemoteLoginSettingsWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } return getNodeRemoteLoginSettingsWithResponse(poolId, nodeId, requestOptions).getValue() .toObject(BatchNodeRemoteLoginSettings.class); } - /** - * Gets the settings required for remote login to a Compute Node. - * - * Before you can remotely login to a Compute Node using the remote login settings, - * you must create a user Account on the Compute Node. - * - * @param poolId The ID of the Pool that contains the Compute Node. - * @param nodeId The ID of the Compute Node for which to obtain the remote login settings. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the settings required for remote login to a Compute Node. - * - * Before you can remotely login to a Compute Node using the remote login settings, - * you must create a user Account on the Compute Node. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public BatchNodeRemoteLoginSettings getNodeRemoteLoginSettings(String poolId, String nodeId) { - // Generated convenience method for getNodeRemoteLoginSettingsWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getNodeRemoteLoginSettingsWithResponse(poolId, nodeId, requestOptions).getValue() - .toObject(BatchNodeRemoteLoginSettings.class); - } - /** * Upload Azure Batch service log files from the specified Compute Node to Azure * Blob Storage. @@ -15659,7 +15857,7 @@ public BatchNodeRemoteLoginSettings getNodeRemoteLoginSettings(String poolId, St * @param poolId The ID of the Pool that contains the Compute Node. * @param nodeId The ID of the Compute Node for which you want to get the Remote Desktop * Protocol file. - * @param content The Azure Batch service log files upload options. + * @param parameters The Azure Batch service log files upload options. * @param options Optional parameters for Upload Node Logs operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -15672,14 +15870,14 @@ public BatchNodeRemoteLoginSettings getNodeRemoteLoginSettings(String poolId, St @Generated @ServiceMethod(returns = ReturnType.SINGLE) public UploadBatchServiceLogsResult uploadNodeLogs(String poolId, String nodeId, - UploadBatchServiceLogsContent content, UploadBatchNodeLogsOptions options) { + UploadBatchServiceLogsParameters parameters, BatchNodeLogsUploadOptions options) { // Generated convenience method for uploadNodeLogsWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } - return uploadNodeLogsWithResponse(poolId, nodeId, BinaryData.fromObject(content), requestOptions).getValue() + return uploadNodeLogsWithResponse(poolId, nodeId, BinaryData.fromObject(parameters), requestOptions).getValue() .toObject(UploadBatchServiceLogsResult.class); } @@ -15695,7 +15893,7 @@ public UploadBatchServiceLogsResult uploadNodeLogs(String poolId, String nodeId, * @param poolId The ID of the Pool that contains the Compute Node. * @param nodeId The ID of the Compute Node for which you want to get the Remote Desktop * Protocol file. - * @param content The Azure Batch service log files upload options. + * @param parameters The Azure Batch service log files upload options. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -15707,10 +15905,10 @@ public UploadBatchServiceLogsResult uploadNodeLogs(String poolId, String nodeId, @Generated @ServiceMethod(returns = ReturnType.SINGLE) public UploadBatchServiceLogsResult uploadNodeLogs(String poolId, String nodeId, - UploadBatchServiceLogsContent content) { + UploadBatchServiceLogsParameters parameters) { // Generated convenience method for uploadNodeLogsWithResponse RequestOptions requestOptions = new RequestOptions(); - return uploadNodeLogsWithResponse(poolId, nodeId, BinaryData.fromObject(content), requestOptions).getValue() + return uploadNodeLogsWithResponse(poolId, nodeId, BinaryData.fromObject(parameters), requestOptions).getValue() .toObject(UploadBatchServiceLogsResult.class); } @@ -15729,14 +15927,14 @@ public UploadBatchServiceLogsResult uploadNodeLogs(String poolId, String nodeId, */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listNodes(String poolId, ListBatchNodesOptions options) { + public PagedIterable listNodes(String poolId, BatchNodesListOptions options) { // Generated convenience method for listNodes RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); String filter = options == null ? null : options.getFilter(); List select = options == null ? null : options.getSelect(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (filter != null) { requestOptions.addQueryParam("$filter", filter, false); @@ -15752,27 +15950,6 @@ public PagedIterable listNodes(String poolId, ListBatchNodesOptions o .mapPage(bodyItemValue -> bodyItemValue.toObject(BatchNode.class)); } - /** - * Lists the Compute Nodes in the specified Pool. - * - * @param poolId The ID of the Pool from which you want to list Compute Nodes. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of listing the Compute Nodes in a Pool as paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listNodes(String poolId) { - // Generated convenience method for listNodes - RequestOptions requestOptions = new RequestOptions(); - return serviceClient.listNodes(poolId, requestOptions) - .mapPage(bodyItemValue -> bodyItemValue.toObject(BatchNode.class)); - } - /** * Gets information about the specified Compute Node Extension. * @@ -15791,13 +15968,13 @@ public PagedIterable listNodes(String poolId) { @Generated @ServiceMethod(returns = ReturnType.SINGLE) public BatchNodeVMExtension getNodeExtension(String poolId, String nodeId, String extensionName, - GetBatchNodeExtensionOptions options) { + BatchNodeExtensionGetOptions options) { // Generated convenience method for getNodeExtensionWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); List select = options == null ? null : options.getSelect(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (select != null) { requestOptions.addQueryParam("$select", @@ -15810,29 +15987,6 @@ public BatchNodeVMExtension getNodeExtension(String poolId, String nodeId, Strin .toObject(BatchNodeVMExtension.class); } - /** - * Gets information about the specified Compute Node Extension. - * - * @param poolId The ID of the Pool that contains the Compute Node. - * @param nodeId The ID of the Compute Node that contains the extensions. - * @param extensionName The name of the Compute Node Extension that you want to get information about. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the specified Compute Node Extension. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public BatchNodeVMExtension getNodeExtension(String poolId, String nodeId, String extensionName) { - // Generated convenience method for getNodeExtensionWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getNodeExtensionWithResponse(poolId, nodeId, extensionName, requestOptions).getValue() - .toObject(BatchNodeVMExtension.class); - } - /** * Lists the Compute Nodes Extensions in the specified Pool. * @@ -15851,13 +16005,13 @@ public BatchNodeVMExtension getNodeExtension(String poolId, String nodeId, Strin @Generated @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listNodeExtensions(String poolId, String nodeId, - ListBatchNodeExtensionsOptions options) { + BatchNodeExtensionsListOptions options) { // Generated convenience method for listNodeExtensions RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); List select = options == null ? null : options.getSelect(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (select != null) { requestOptions.addQueryParam("$select", @@ -15870,29 +16024,6 @@ public PagedIterable listNodeExtensions(String poolId, Str .mapPage(bodyItemValue -> bodyItemValue.toObject(BatchNodeVMExtension.class)); } - /** - * Lists the Compute Nodes Extensions in the specified Pool. - * - * @param poolId The ID of the Pool that contains Compute Node. - * @param nodeId The ID of the Compute Node that you want to list extensions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of listing the Compute Node extensions in a Node as paginated response with - * {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listNodeExtensions(String poolId, String nodeId) { - // Generated convenience method for listNodeExtensions - RequestOptions requestOptions = new RequestOptions(); - return serviceClient.listNodeExtensions(poolId, nodeId, requestOptions) - .mapPage(bodyItemValue -> bodyItemValue.toObject(BatchNodeVMExtension.class)); - } - /** * Deletes the specified file from the Compute Node. * @@ -15909,13 +16040,13 @@ public PagedIterable listNodeExtensions(String poolId, Str */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteNodeFile(String poolId, String nodeId, String filePath, DeleteBatchNodeFileOptions options) { + public void deleteNodeFile(String poolId, String nodeId, String filePath, BatchNodeFileDeleteOptions options) { // Generated convenience method for deleteNodeFileWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); Boolean recursive = options == null ? null : options.isRecursive(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (recursive != null) { requestOptions.addQueryParam("recursive", String.valueOf(recursive), false); @@ -15923,27 +16054,6 @@ public void deleteNodeFile(String poolId, String nodeId, String filePath, Delete deleteNodeFileWithResponse(poolId, nodeId, filePath, requestOptions).getValue(); } - /** - * Deletes the specified file from the Compute Node. - * - * @param poolId The ID of the Pool that contains the Compute Node. - * @param nodeId The ID of the Compute Node. - * @param filePath The path to the file or directory. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteNodeFile(String poolId, String nodeId, String filePath) { - // Generated convenience method for deleteNodeFileWithResponse - RequestOptions requestOptions = new RequestOptions(); - deleteNodeFileWithResponse(poolId, nodeId, filePath, requestOptions).getValue(); - } - /** * Returns the content of the specified Compute Node file. * @@ -15961,15 +16071,15 @@ public void deleteNodeFile(String poolId, String nodeId, String filePath) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public BinaryData getNodeFile(String poolId, String nodeId, String filePath, GetBatchNodeFileOptions options) { + public BinaryData getNodeFile(String poolId, String nodeId, String filePath, BatchNodeFileGetOptions options) { // Generated convenience method for getNodeFileWithResponse RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); OffsetDateTime ifModifiedSince = options == null ? null : options.getIfModifiedSince(); OffsetDateTime ifUnmodifiedSince = options == null ? null : options.getIfUnmodifiedSince(); String ocpRange = options == null ? null : options.getOcpRange(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (ifModifiedSince != null) { requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, @@ -15985,88 +16095,6 @@ public BinaryData getNodeFile(String poolId, String nodeId, String filePath, Get return getNodeFileWithResponse(poolId, nodeId, filePath, requestOptions).getValue(); } - /** - * Returns the content of the specified Compute Node file. - * - * @param poolId The ID of the Pool that contains the Compute Node. - * @param nodeId The ID of the Compute Node. - * @param filePath The path to the file or directory. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public BinaryData getNodeFile(String poolId, String nodeId, String filePath) { - // Generated convenience method for getNodeFileWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getNodeFileWithResponse(poolId, nodeId, filePath, requestOptions).getValue(); - } - - /** - * Gets the properties of the specified Compute Node file. - * - * @param poolId The ID of the Pool that contains the Compute Node. - * @param nodeId The ID of the Compute Node. - * @param filePath The path to the file or directory. - * @param options Optional parameters for Get Node File Properties operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return The {@link FileResponseHeaderProperties} object containing the properties retrieved from the response - * headers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public FileResponseHeaderProperties getNodeFileProperties(String poolId, String nodeId, String filePath, - GetBatchNodeFilePropertiesOptions options) { - RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); - OffsetDateTime ifModifiedSince = options == null ? null : options.getIfModifiedSince(); - OffsetDateTime ifUnmodifiedSince = options == null ? null : options.getIfUnmodifiedSince(); - if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); - } - if (ifModifiedSince != null) { - requestOptions.setHeader(HttpHeaderName.IF_MODIFIED_SINCE, - String.valueOf(new DateTimeRfc1123(ifModifiedSince))); - } - if (ifUnmodifiedSince != null) { - requestOptions.setHeader(HttpHeaderName.IF_UNMODIFIED_SINCE, - String.valueOf(new DateTimeRfc1123(ifUnmodifiedSince))); - } - // Retrieve response from getNodeFilePropertiesWithResponse and construct NodeFileProperties from its headers - Response response = getNodeFilePropertiesWithResponse(poolId, nodeId, filePath, requestOptions); - return new FileResponseHeaderProperties(response.getHeaders()); - } - - /** - * Gets the properties of the specified Compute Node file. - * - * @param poolId The ID of the Pool that contains the Compute Node. - * @param nodeId The ID of the Compute Node. - * @param filePath The path to the file or directory. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return The {@link FileResponseHeaderProperties} object containing the properties retrieved from the response - * headers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public FileResponseHeaderProperties getNodeFileProperties(String poolId, String nodeId, String filePath) { - Response response = getNodeFilePropertiesWithResponse(poolId, nodeId, filePath, new RequestOptions()); - return new FileResponseHeaderProperties(response.getHeaders()); - } - /** * Lists all of the files in Task directories on the specified Compute Node. * @@ -16084,14 +16112,14 @@ public FileResponseHeaderProperties getNodeFileProperties(String poolId, String */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listNodeFiles(String poolId, String nodeId, ListBatchNodeFilesOptions options) { + public PagedIterable listNodeFiles(String poolId, String nodeId, BatchNodeFilesListOptions options) { // Generated convenience method for listNodeFiles RequestOptions requestOptions = new RequestOptions(); - Integer timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); + Duration timeOutInSeconds = options == null ? null : options.getTimeOutInSeconds(); String filter = options == null ? null : options.getFilter(); Boolean recursive = options == null ? null : options.isRecursive(); if (timeOutInSeconds != null) { - requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false); + requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds.getSeconds()), false); } if (filter != null) { requestOptions.addQueryParam("$filter", filter, false); @@ -16102,27 +16130,4 @@ public PagedIterable listNodeFiles(String poolId, String nodeId, return serviceClient.listNodeFiles(poolId, nodeId, requestOptions) .mapPage(bodyItemValue -> bodyItemValue.toObject(BatchNodeFile.class)); } - - /** - * Lists all of the files in Task directories on the specified Compute Node. - * - * @param poolId The ID of the Pool that contains the Compute Node. - * @param nodeId The ID of the Compute Node whose files you want to list. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of listing the files on a Compute Node, or the files associated with - * a Task on a Compute Node as paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listNodeFiles(String poolId, String nodeId) { - // Generated convenience method for listNodeFiles - RequestOptions requestOptions = new RequestOptions(); - return serviceClient.listNodeFiles(poolId, nodeId, requestOptions) - .mapPage(bodyItemValue -> bodyItemValue.toObject(BatchNodeFile.class)); - } } diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/implementation/BatchClientImpl.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/implementation/BatchClientImpl.java index ac94e0786cb7..4f0cd04cd327 100644 --- a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/implementation/BatchClientImpl.java +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/implementation/BatchClientImpl.java @@ -372,7 +372,7 @@ Response disablePoolAutoScaleSync(@HostParam("endpoint") String endpoint, Mono> enablePoolAutoScale(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType, @PathParam("poolId") String poolId, @HeaderParam("Accept") String accept, - @BodyParam("application/json; odata=minimalmetadata") BinaryData content, RequestOptions requestOptions, + @BodyParam("application/json; odata=minimalmetadata") BinaryData parameters, RequestOptions requestOptions, Context context); @Post("/pools/{poolId}/enableautoscale") @@ -384,7 +384,7 @@ Mono> enablePoolAutoScale(@HostParam("endpoint") String endpoint, Response enablePoolAutoScaleSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType, @PathParam("poolId") String poolId, @HeaderParam("Accept") String accept, - @BodyParam("application/json; odata=minimalmetadata") BinaryData content, RequestOptions requestOptions, + @BodyParam("application/json; odata=minimalmetadata") BinaryData parameters, RequestOptions requestOptions, Context context); @Post("/pools/{poolId}/evaluateautoscale") @@ -396,7 +396,7 @@ Response enablePoolAutoScaleSync(@HostParam("endpoint") String endpoint, Mono> evaluatePoolAutoScale(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType, @PathParam("poolId") String poolId, @HeaderParam("Accept") String accept, - @BodyParam("application/json; odata=minimalmetadata") BinaryData content, RequestOptions requestOptions, + @BodyParam("application/json; odata=minimalmetadata") BinaryData parameters, RequestOptions requestOptions, Context context); @Post("/pools/{poolId}/evaluateautoscale") @@ -408,7 +408,7 @@ Mono> evaluatePoolAutoScale(@HostParam("endpoint") String e Response evaluatePoolAutoScaleSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType, @PathParam("poolId") String poolId, @HeaderParam("Accept") String accept, - @BodyParam("application/json; odata=minimalmetadata") BinaryData content, RequestOptions requestOptions, + @BodyParam("application/json; odata=minimalmetadata") BinaryData parameters, RequestOptions requestOptions, Context context); @Post("/pools/{poolId}/resize") @@ -420,7 +420,7 @@ Response evaluatePoolAutoScaleSync(@HostParam("endpoint") String end Mono> resizePool(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType, @PathParam("poolId") String poolId, @HeaderParam("Accept") String accept, - @BodyParam("application/json; odata=minimalmetadata") BinaryData content, RequestOptions requestOptions, + @BodyParam("application/json; odata=minimalmetadata") BinaryData parameters, RequestOptions requestOptions, Context context); @Post("/pools/{poolId}/resize") @@ -432,7 +432,7 @@ Mono> resizePool(@HostParam("endpoint") String endpoint, Response resizePoolSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType, @PathParam("poolId") String poolId, @HeaderParam("Accept") String accept, - @BodyParam("application/json; odata=minimalmetadata") BinaryData content, RequestOptions requestOptions, + @BodyParam("application/json; odata=minimalmetadata") BinaryData parameters, RequestOptions requestOptions, Context context); @Post("/pools/{poolId}/stopresize") @@ -488,7 +488,7 @@ Response replacePoolPropertiesSync(@HostParam("endpoint") String endpoint, Mono> removeNodes(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType, @PathParam("poolId") String poolId, @HeaderParam("Accept") String accept, - @BodyParam("application/json; odata=minimalmetadata") BinaryData content, RequestOptions requestOptions, + @BodyParam("application/json; odata=minimalmetadata") BinaryData parameters, RequestOptions requestOptions, Context context); @Post("/pools/{poolId}/removenodes") @@ -500,7 +500,7 @@ Mono> removeNodes(@HostParam("endpoint") String endpoint, Response removeNodesSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType, @PathParam("poolId") String poolId, @HeaderParam("Accept") String accept, - @BodyParam("application/json; odata=minimalmetadata") BinaryData content, RequestOptions requestOptions, + @BodyParam("application/json; odata=minimalmetadata") BinaryData parameters, RequestOptions requestOptions, Context context); @Get("/supportedimages") @@ -640,7 +640,7 @@ Response replaceJobSync(@HostParam("endpoint") String endpoint, Mono> disableJob(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType, @PathParam("jobId") String jobId, @HeaderParam("Accept") String accept, - @BodyParam("application/json; odata=minimalmetadata") BinaryData content, RequestOptions requestOptions, + @BodyParam("application/json; odata=minimalmetadata") BinaryData parameters, RequestOptions requestOptions, Context context); @Post("/jobs/{jobId}/disable") @@ -652,7 +652,7 @@ Mono> disableJob(@HostParam("endpoint") String endpoint, Response disableJobSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType, @PathParam("jobId") String jobId, @HeaderParam("Accept") String accept, - @BodyParam("application/json; odata=minimalmetadata") BinaryData content, RequestOptions requestOptions, + @BodyParam("application/json; odata=minimalmetadata") BinaryData parameters, RequestOptions requestOptions, Context context); @Post("/jobs/{jobId}/enable") @@ -1463,7 +1463,7 @@ Mono> replaceNodeUser(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType, @PathParam("poolId") String poolId, @PathParam("nodeId") String nodeId, @PathParam("userName") String userName, @HeaderParam("Accept") String accept, - @BodyParam("application/json; odata=minimalmetadata") BinaryData content, RequestOptions requestOptions, + @BodyParam("application/json; odata=minimalmetadata") BinaryData parameters, RequestOptions requestOptions, Context context); @Put("/pools/{poolId}/nodes/{nodeId}/users/{userName}") @@ -1476,7 +1476,7 @@ Response replaceNodeUserSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType, @PathParam("poolId") String poolId, @PathParam("nodeId") String nodeId, @PathParam("userName") String userName, @HeaderParam("Accept") String accept, - @BodyParam("application/json; odata=minimalmetadata") BinaryData content, RequestOptions requestOptions, + @BodyParam("application/json; odata=minimalmetadata") BinaryData parameters, RequestOptions requestOptions, Context context); @Get("/pools/{poolId}/nodes/{nodeId}") @@ -1665,7 +1665,7 @@ Mono> uploadNodeLogs(@HostParam("endpoint") String endpoint @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType, @PathParam("poolId") String poolId, @PathParam("nodeId") String nodeId, @HeaderParam("Accept") String accept, - @BodyParam("application/json; odata=minimalmetadata") BinaryData content, RequestOptions requestOptions, + @BodyParam("application/json; odata=minimalmetadata") BinaryData parameters, RequestOptions requestOptions, Context context); @Post("/pools/{poolId}/nodes/{nodeId}/uploadbatchservicelogs") @@ -1678,7 +1678,7 @@ Response uploadNodeLogsSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType, @PathParam("poolId") String poolId, @PathParam("nodeId") String nodeId, @HeaderParam("Accept") String accept, - @BodyParam("application/json; odata=minimalmetadata") BinaryData content, RequestOptions requestOptions, + @BodyParam("application/json; odata=minimalmetadata") BinaryData parameters, RequestOptions requestOptions, Context context); @Get("/pools/{poolId}/nodes") @@ -2166,7 +2166,7 @@ Response listNodeFilesNextSync(@PathParam(value = "nextLink", encode * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -2218,7 +2218,7 @@ private Mono> listApplicationsSinglePageAsync(RequestO * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -2289,7 +2289,7 @@ public PagedFlux listApplicationsAsync(RequestOptions requestOptions * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -2339,7 +2339,7 @@ private PagedResponse listApplicationsSinglePage(RequestOptions requ * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -2410,7 +2410,7 @@ public PagedIterable listApplications(RequestOptions requestOptions) * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -2461,7 +2461,7 @@ public Mono> getApplicationWithResponseAsync(String applica * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -2512,7 +2512,7 @@ public Response getApplicationWithResponse(String applicationId, Req * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -2577,7 +2577,7 @@ private Mono> listPoolUsageMetricsSinglePageAsync(Requ * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -2660,7 +2660,7 @@ public PagedFlux listPoolUsageMetricsAsync(RequestOptions requestOpt * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -2723,7 +2723,7 @@ private PagedResponse listPoolUsageMetricsSinglePage(RequestOptions * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -2803,7 +2803,7 @@ public PagedIterable listPoolUsageMetrics(RequestOptions requestOpti * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -3059,8 +3059,8 @@ public PagedIterable listPoolUsageMetrics(RequestOptions requestOpti * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -3115,7 +3115,7 @@ public Mono> createPoolWithResponseAsync(BinaryData pool, Request * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -3371,8 +3371,8 @@ public Mono> createPoolWithResponseAsync(BinaryData pool, Request * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -3423,7 +3423,7 @@ public Response createPoolWithResponse(BinaryData pool, RequestOptions req * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -3747,8 +3747,8 @@ public Response createPoolWithResponse(BinaryData pool, RequestOptions req * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -3812,7 +3812,7 @@ private Mono> listPoolsSinglePageAsync(RequestOptions * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -4136,8 +4136,8 @@ private Mono> listPoolsSinglePageAsync(RequestOptions * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -4219,7 +4219,7 @@ public PagedFlux listPoolsAsync(RequestOptions requestOptions) { * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -4543,8 +4543,8 @@ public PagedFlux listPoolsAsync(RequestOptions requestOptions) { * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -4606,7 +4606,7 @@ private PagedResponse listPoolsSinglePage(RequestOptions requestOpti * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -4930,8 +4930,8 @@ private PagedResponse listPoolsSinglePage(RequestOptions requestOpti * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -5026,7 +5026,7 @@ public PagedIterable listPools(RequestOptions requestOptions) { * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -5088,7 +5088,7 @@ public Mono> deletePoolWithResponseAsync(String poolId, RequestOp * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -5137,7 +5137,7 @@ public Response deletePoolWithResponse(String poolId, RequestOptions reque * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -5192,7 +5192,7 @@ public Mono> poolExistsWithResponseAsync(String poolId, Reques * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -5247,7 +5247,7 @@ public Response poolExistsWithResponse(String poolId, RequestOptions re * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
$selectList<String>NoAn OData $select clause. In the form of "," @@ -5587,8 +5587,8 @@ public Response poolExistsWithResponse(String poolId, RequestOptions re * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -5650,7 +5650,7 @@ public Mono> getPoolWithResponseAsync(String poolId, Reques * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
$selectList<String>NoAn OData $select clause. In the form of "," @@ -5990,8 +5990,8 @@ public Mono> getPoolWithResponseAsync(String poolId, Reques * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -6056,7 +6056,7 @@ public Response getPoolWithResponse(String poolId, RequestOptions re * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -6328,8 +6328,8 @@ public Response getPoolWithResponse(String poolId, RequestOptions re * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -6385,7 +6385,7 @@ public Mono> updatePoolWithResponseAsync(String poolId, BinaryDat * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -6657,8 +6657,8 @@ public Mono> updatePoolWithResponseAsync(String poolId, BinaryDat * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -6709,7 +6709,7 @@ public Response updatePoolWithResponse(String poolId, BinaryData pool, Req * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -6736,7 +6736,7 @@ public Mono> disablePoolAutoScaleWithResponseAsync(String poolId, * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -6770,7 +6770,7 @@ public Response disablePoolAutoScaleWithResponse(String poolId, RequestOpt * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -6809,7 +6809,7 @@ public Response disablePoolAutoScaleWithResponse(String poolId, RequestOpt * * * @param poolId The ID of the Pool to get. - * @param content The options to use for enabling automatic scaling. + * @param parameters The options to use for enabling automatic scaling. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -6818,12 +6818,12 @@ public Response disablePoolAutoScaleWithResponse(String poolId, RequestOpt * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> enablePoolAutoScaleWithResponseAsync(String poolId, BinaryData content, + public Mono> enablePoolAutoScaleWithResponseAsync(String poolId, BinaryData parameters, RequestOptions requestOptions) { final String contentType = "application/json; odata=minimalmetadata"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.enablePoolAutoScale(this.getEndpoint(), - this.getServiceVersion().getVersion(), contentType, poolId, accept, content, requestOptions, context)); + this.getServiceVersion().getVersion(), contentType, poolId, accept, parameters, requestOptions, context)); } /** @@ -6839,7 +6839,7 @@ public Mono> enablePoolAutoScaleWithResponseAsync(String poolId, * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -6878,7 +6878,7 @@ public Mono> enablePoolAutoScaleWithResponseAsync(String poolId, * * * @param poolId The ID of the Pool to get. - * @param content The options to use for enabling automatic scaling. + * @param parameters The options to use for enabling automatic scaling. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -6887,12 +6887,12 @@ public Mono> enablePoolAutoScaleWithResponseAsync(String poolId, * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response enablePoolAutoScaleWithResponse(String poolId, BinaryData content, + public Response enablePoolAutoScaleWithResponse(String poolId, BinaryData parameters, RequestOptions requestOptions) { final String contentType = "application/json; odata=minimalmetadata"; final String accept = "application/json"; return service.enablePoolAutoScaleSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, - poolId, accept, content, requestOptions, Context.NONE); + poolId, accept, parameters, requestOptions, Context.NONE); } /** @@ -6905,7 +6905,7 @@ public Response enablePoolAutoScaleWithResponse(String poolId, BinaryData * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -6942,7 +6942,7 @@ public Response enablePoolAutoScaleWithResponse(String poolId, BinaryData * * * @param poolId The ID of the Pool on which to evaluate the automatic scaling formula. - * @param content The options to use for evaluating the automatic scaling formula. + * @param parameters The options to use for evaluating the automatic scaling formula. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -6955,12 +6955,12 @@ public Response enablePoolAutoScaleWithResponse(String poolId, BinaryData * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> evaluatePoolAutoScaleWithResponseAsync(String poolId, BinaryData content, + public Mono> evaluatePoolAutoScaleWithResponseAsync(String poolId, BinaryData parameters, RequestOptions requestOptions) { final String contentType = "application/json; odata=minimalmetadata"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.evaluatePoolAutoScale(this.getEndpoint(), - this.getServiceVersion().getVersion(), contentType, poolId, accept, content, requestOptions, context)); + this.getServiceVersion().getVersion(), contentType, poolId, accept, parameters, requestOptions, context)); } /** @@ -6973,7 +6973,7 @@ public Mono> evaluatePoolAutoScaleWithResponseAsync(String * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -7010,7 +7010,7 @@ public Mono> evaluatePoolAutoScaleWithResponseAsync(String * * * @param poolId The ID of the Pool on which to evaluate the automatic scaling formula. - * @param content The options to use for evaluating the automatic scaling formula. + * @param parameters The options to use for evaluating the automatic scaling formula. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -7022,12 +7022,12 @@ public Mono> evaluatePoolAutoScaleWithResponseAsync(String * the result without applying the formula to the Pool along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response evaluatePoolAutoScaleWithResponse(String poolId, BinaryData content, + public Response evaluatePoolAutoScaleWithResponse(String poolId, BinaryData parameters, RequestOptions requestOptions) { final String contentType = "application/json; odata=minimalmetadata"; final String accept = "application/json"; return service.evaluatePoolAutoScaleSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, - poolId, accept, content, requestOptions, Context.NONE); + poolId, accept, parameters, requestOptions, Context.NONE); } /** @@ -7044,7 +7044,7 @@ public Response evaluatePoolAutoScaleWithResponse(String poolId, Bin * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -7085,7 +7085,7 @@ public Response evaluatePoolAutoScaleWithResponse(String poolId, Bin * * * @param poolId The ID of the Pool to get. - * @param content The options to use for resizing the pool. + * @param parameters The options to use for resizing the pool. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -7094,12 +7094,12 @@ public Response evaluatePoolAutoScaleWithResponse(String poolId, Bin * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> resizePoolWithResponseAsync(String poolId, BinaryData content, + public Mono> resizePoolWithResponseAsync(String poolId, BinaryData parameters, RequestOptions requestOptions) { final String contentType = "application/json; odata=minimalmetadata"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.resizePool(this.getEndpoint(), - this.getServiceVersion().getVersion(), contentType, poolId, accept, content, requestOptions, context)); + this.getServiceVersion().getVersion(), contentType, poolId, accept, parameters, requestOptions, context)); } /** @@ -7116,7 +7116,7 @@ public Mono> resizePoolWithResponseAsync(String poolId, BinaryDat * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -7157,7 +7157,7 @@ public Mono> resizePoolWithResponseAsync(String poolId, BinaryDat * * * @param poolId The ID of the Pool to get. - * @param content The options to use for resizing the pool. + * @param parameters The options to use for resizing the pool. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -7166,11 +7166,11 @@ public Mono> resizePoolWithResponseAsync(String poolId, BinaryDat * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response resizePoolWithResponse(String poolId, BinaryData content, RequestOptions requestOptions) { + public Response resizePoolWithResponse(String poolId, BinaryData parameters, RequestOptions requestOptions) { final String contentType = "application/json; odata=minimalmetadata"; final String accept = "application/json"; return service.resizePoolSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, poolId, - accept, content, requestOptions, Context.NONE); + accept, parameters, requestOptions, Context.NONE); } /** @@ -7187,7 +7187,7 @@ public Response resizePoolWithResponse(String poolId, BinaryData content, * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -7244,7 +7244,7 @@ public Mono> stopPoolResizeWithResponseAsync(String poolId, Reque * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -7297,7 +7297,7 @@ public Response stopPoolResizeWithResponse(String poolId, RequestOptions r * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -7411,7 +7411,7 @@ public Mono> replacePoolPropertiesWithResponseAsync(String poolId * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -7525,7 +7525,7 @@ public Response replacePoolPropertiesWithResponse(String poolId, BinaryDat * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -7567,7 +7567,7 @@ public Response replacePoolPropertiesWithResponse(String poolId, BinaryDat * * * @param poolId The ID of the Pool to get. - * @param content The options to use for removing the node. + * @param parameters The options to use for removing the node. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -7576,12 +7576,12 @@ public Response replacePoolPropertiesWithResponse(String poolId, BinaryDat * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> removeNodesWithResponseAsync(String poolId, BinaryData content, + public Mono> removeNodesWithResponseAsync(String poolId, BinaryData parameters, RequestOptions requestOptions) { final String contentType = "application/json; odata=minimalmetadata"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.removeNodes(this.getEndpoint(), - this.getServiceVersion().getVersion(), contentType, poolId, accept, content, requestOptions, context)); + this.getServiceVersion().getVersion(), contentType, poolId, accept, parameters, requestOptions, context)); } /** @@ -7594,7 +7594,7 @@ public Mono> removeNodesWithResponseAsync(String poolId, BinaryDa * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -7636,7 +7636,7 @@ public Mono> removeNodesWithResponseAsync(String poolId, BinaryDa * * * @param poolId The ID of the Pool to get. - * @param content The options to use for removing the node. + * @param parameters The options to use for removing the node. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -7645,11 +7645,11 @@ public Mono> removeNodesWithResponseAsync(String poolId, BinaryDa * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response removeNodesWithResponse(String poolId, BinaryData content, RequestOptions requestOptions) { + public Response removeNodesWithResponse(String poolId, BinaryData parameters, RequestOptions requestOptions) { final String contentType = "application/json; odata=minimalmetadata"; final String accept = "application/json"; return service.removeNodesSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, poolId, - accept, content, requestOptions, Context.NONE); + accept, parameters, requestOptions, Context.NONE); } /** @@ -7658,7 +7658,7 @@ public Response removeNodesWithResponse(String poolId, BinaryData content, * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -7719,7 +7719,7 @@ private Mono> listSupportedImagesSinglePageAsync(Reque * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -7798,7 +7798,7 @@ public PagedFlux listSupportedImagesAsync(RequestOptions requestOpti * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -7857,7 +7857,7 @@ private PagedResponse listSupportedImagesSinglePage(RequestOptions r * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -7939,7 +7939,7 @@ public PagedIterable listSupportedImages(RequestOptions requestOptio * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -8006,7 +8006,7 @@ private Mono> listPoolNodeCountsSinglePageAsync(Reques * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -8091,7 +8091,7 @@ public PagedFlux listPoolNodeCountsAsync(RequestOptions requestOptio * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -8156,7 +8156,7 @@ private PagedResponse listPoolNodeCountsSinglePage(RequestOptions re * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -8249,7 +8249,7 @@ public PagedIterable listPoolNodeCounts(RequestOptions requestOption * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
forceBooleanNoIf true, the server will delete the Job even if the @@ -8309,7 +8309,7 @@ public Mono> deleteJobWithResponseAsync(String jobId, RequestOpti * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
forceBooleanNoIf true, the server will delete the Job even if the @@ -8360,7 +8360,7 @@ public Response deleteJobWithResponse(String jobId, RequestOptions request * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
$selectList<String>NoAn OData $select clause. In the form of "," @@ -8747,8 +8747,8 @@ public Response deleteJobWithResponse(String jobId, RequestOptions request * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -8843,7 +8843,7 @@ public Mono> getJobWithResponseAsync(String jobId, RequestO * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
$selectList<String>NoAn OData $select clause. In the form of "," @@ -9230,8 +9230,8 @@ public Mono> getJobWithResponseAsync(String jobId, RequestO * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -9330,7 +9330,7 @@ public Response getJobWithResponse(String jobId, RequestOptions requ * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -9619,8 +9619,8 @@ public Response getJobWithResponse(String jobId, RequestOptions requ * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -9688,7 +9688,7 @@ public Mono> updateJobWithResponseAsync(String jobId, BinaryData * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -9977,8 +9977,8 @@ public Mono> updateJobWithResponseAsync(String jobId, BinaryData * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -10045,7 +10045,7 @@ public Response updateJobWithResponse(String jobId, BinaryData job, Reques * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -10428,8 +10428,8 @@ public Response updateJobWithResponse(String jobId, BinaryData job, Reques * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -10531,7 +10531,7 @@ public Mono> replaceJobWithResponseAsync(String jobId, BinaryData * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -10914,8 +10914,8 @@ public Mono> replaceJobWithResponseAsync(String jobId, BinaryData * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -11021,7 +11021,7 @@ public Response replaceJobWithResponse(String jobId, BinaryData job, Reque * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -11059,7 +11059,7 @@ public Response replaceJobWithResponse(String jobId, BinaryData job, Reque * * * @param jobId The ID of the Job to disable. - * @param content The options to use for disabling the Job. + * @param parameters The options to use for disabling the Job. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -11068,12 +11068,12 @@ public Response replaceJobWithResponse(String jobId, BinaryData job, Reque * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> disableJobWithResponseAsync(String jobId, BinaryData content, + public Mono> disableJobWithResponseAsync(String jobId, BinaryData parameters, RequestOptions requestOptions) { final String contentType = "application/json; odata=minimalmetadata"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.disableJob(this.getEndpoint(), - this.getServiceVersion().getVersion(), contentType, jobId, accept, content, requestOptions, context)); + this.getServiceVersion().getVersion(), contentType, jobId, accept, parameters, requestOptions, context)); } /** @@ -11091,7 +11091,7 @@ public Mono> disableJobWithResponseAsync(String jobId, BinaryData * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -11129,7 +11129,7 @@ public Mono> disableJobWithResponseAsync(String jobId, BinaryData * * * @param jobId The ID of the Job to disable. - * @param content The options to use for disabling the Job. + * @param parameters The options to use for disabling the Job. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -11138,11 +11138,11 @@ public Mono> disableJobWithResponseAsync(String jobId, BinaryData * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response disableJobWithResponse(String jobId, BinaryData content, RequestOptions requestOptions) { + public Response disableJobWithResponse(String jobId, BinaryData parameters, RequestOptions requestOptions) { final String contentType = "application/json; odata=minimalmetadata"; final String accept = "application/json"; return service.disableJobSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, jobId, - accept, content, requestOptions, Context.NONE); + accept, parameters, requestOptions, Context.NONE); } /** @@ -11158,7 +11158,7 @@ public Response disableJobWithResponse(String jobId, BinaryData content, R * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -11214,7 +11214,7 @@ public Mono> enableJobWithResponseAsync(String jobId, RequestOpti * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -11270,7 +11270,7 @@ public Response enableJobWithResponse(String jobId, RequestOptions request * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
forceBooleanNoIf true, the server will terminate the Job even if the @@ -11345,7 +11345,7 @@ public Mono> terminateJobWithResponseAsync(String jobId, RequestO * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
forceBooleanNoIf true, the server will terminate the Job even if the @@ -11423,7 +11423,7 @@ public Response terminateJobWithResponse(String jobId, RequestOptions requ * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -11776,8 +11776,8 @@ public Response terminateJobWithResponse(String jobId, RequestOptions requ * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -11850,7 +11850,7 @@ public Mono> createJobWithResponseAsync(BinaryData job, RequestOp * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -12203,8 +12203,8 @@ public Mono> createJobWithResponseAsync(BinaryData job, RequestOp * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -12267,7 +12267,7 @@ public Response createJobWithResponse(BinaryData job, RequestOptions reque * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -12638,8 +12638,8 @@ public Response createJobWithResponse(BinaryData job, RequestOptions reque * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -12737,7 +12737,7 @@ private Mono> listJobsSinglePageAsync(RequestOptions r * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -13108,8 +13108,8 @@ private Mono> listJobsSinglePageAsync(RequestOptions r * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -13225,7 +13225,7 @@ public PagedFlux listJobsAsync(RequestOptions requestOptions) { * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -13596,8 +13596,8 @@ public PagedFlux listJobsAsync(RequestOptions requestOptions) { * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -13693,7 +13693,7 @@ private PagedResponse listJobsSinglePage(RequestOptions requestOptio * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -14064,8 +14064,8 @@ private PagedResponse listJobsSinglePage(RequestOptions requestOptio * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -14181,7 +14181,7 @@ public PagedIterable listJobs(RequestOptions requestOptions) { * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -14552,8 +14552,8 @@ public PagedIterable listJobs(RequestOptions requestOptions) { * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -14653,7 +14653,7 @@ private Mono> listJobsFromScheduleSinglePageAsync(Stri * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -15024,8 +15024,8 @@ private Mono> listJobsFromScheduleSinglePageAsync(Stri * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -15142,7 +15142,7 @@ public PagedFlux listJobsFromScheduleAsync(String jobScheduleId, Req * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -15513,8 +15513,8 @@ public PagedFlux listJobsFromScheduleAsync(String jobScheduleId, Req * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -15612,7 +15612,7 @@ private PagedResponse listJobsFromScheduleSinglePage(String jobSched * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -15983,8 +15983,8 @@ private PagedResponse listJobsFromScheduleSinglePage(String jobSched * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -16109,7 +16109,7 @@ public PagedIterable listJobsFromSchedule(String jobScheduleId, Requ * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -16206,7 +16206,7 @@ private Mono> listJobPreparationAndReleaseTaskStatusSi * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -16322,7 +16322,7 @@ public PagedFlux listJobPreparationAndReleaseTaskStatusAsync(String * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -16418,7 +16418,7 @@ private PagedResponse listJobPreparationAndReleaseTaskStatusSinglePa * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -16531,7 +16531,7 @@ public PagedIterable listJobPreparationAndReleaseTaskStatus(String j * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -16589,7 +16589,7 @@ public Mono> getJobTaskCountsWithResponseAsync(String jobId * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -16641,7 +16641,7 @@ public Response getJobTaskCountsWithResponse(String jobId, RequestOp * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -16669,7 +16669,7 @@ public Response getJobTaskCountsWithResponse(String jobId, RequestOp * } * ] * } - * data: String (Required) + * data: byte[] (Required) * certificateFormat: String(pfx/cer) (Optional) * password: String (Optional) * } @@ -16699,7 +16699,7 @@ public Mono> createCertificateWithResponseAsync(BinaryData certif * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -16727,7 +16727,7 @@ public Mono> createCertificateWithResponseAsync(BinaryData certif * } * ] * } - * data: String (Required) + * data: byte[] (Required) * certificateFormat: String(pfx/cer) (Optional) * password: String (Optional) * } @@ -16756,7 +16756,7 @@ public Response createCertificateWithResponse(BinaryData certificate, Requ * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -16792,7 +16792,7 @@ public Response createCertificateWithResponse(BinaryData certificate, Requ * } * ] * } - * data: String (Required) + * data: byte[] (Required) * certificateFormat: String(pfx/cer) (Optional) * password: String (Optional) * } @@ -16823,7 +16823,7 @@ private Mono> listCertificatesSinglePageAsync(RequestO * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -16859,7 +16859,7 @@ private Mono> listCertificatesSinglePageAsync(RequestO * } * ] * } - * data: String (Required) + * data: byte[] (Required) * certificateFormat: String(pfx/cer) (Optional) * password: String (Optional) * } @@ -16908,7 +16908,7 @@ public PagedFlux listCertificatesAsync(RequestOptions requestOptions * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -16944,7 +16944,7 @@ public PagedFlux listCertificatesAsync(RequestOptions requestOptions * } * ] * } - * data: String (Required) + * data: byte[] (Required) * certificateFormat: String(pfx/cer) (Optional) * password: String (Optional) * } @@ -16973,7 +16973,7 @@ private PagedResponse listCertificatesSinglePage(RequestOptions requ * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -17009,7 +17009,7 @@ private PagedResponse listCertificatesSinglePage(RequestOptions requ * } * ] * } - * data: String (Required) + * data: byte[] (Required) * certificateFormat: String(pfx/cer) (Optional) * password: String (Optional) * } @@ -17066,7 +17066,7 @@ public PagedIterable listCertificates(RequestOptions requestOptions) * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -17103,7 +17103,7 @@ public Mono> cancelCertificateDeletionWithResponseAsync(String th * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -17142,7 +17142,7 @@ public Response cancelCertificateDeletionWithResponse(String thumbprintAlg * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -17181,7 +17181,7 @@ public Mono> deleteCertificateWithResponseAsync(String thumbprint * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -17210,7 +17210,7 @@ public Response deleteCertificateWithResponse(String thumbprintAlgorithm, * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
$selectList<String>NoAn OData $select clause. In the form of "," @@ -17240,6 +17240,9 @@ public Response deleteCertificateWithResponse(String thumbprintAlgorithm, * } * ] * } + * data: byte[] (Required) + * certificateFormat: String(pfx/cer) (Optional) + * password: String (Optional) * } * } * @@ -17268,7 +17271,7 @@ public Mono> getCertificateWithResponseAsync(String thumbpr * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
$selectList<String>NoAn OData $select clause. In the form of "," @@ -17298,6 +17301,9 @@ public Mono> getCertificateWithResponseAsync(String thumbpr * } * ] * } + * data: byte[] (Required) + * certificateFormat: String(pfx/cer) (Optional) + * password: String (Optional) * } * } * @@ -17325,7 +17331,7 @@ public Response getCertificateWithResponse(String thumbprintAlgorith * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -17381,7 +17387,7 @@ public Mono> jobScheduleExistsWithResponseAsync(String jobSche * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -17442,7 +17448,7 @@ public Response jobScheduleExistsWithResponse(String jobScheduleId, Req * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
forceBooleanNoIf true, the server will delete the JobSchedule even if the @@ -17500,7 +17506,7 @@ public Mono> deleteJobScheduleWithResponseAsync(String jobSchedul * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
forceBooleanNoIf true, the server will delete the JobSchedule even if the @@ -17551,7 +17557,7 @@ public Response deleteJobScheduleWithResponse(String jobScheduleId, Reques * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
$selectList<String>NoAn OData $select clause. In the form of "," @@ -17952,8 +17958,8 @@ public Response deleteJobScheduleWithResponse(String jobScheduleId, Reques * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -18039,7 +18045,7 @@ public Mono> getJobScheduleWithResponseAsync(String jobSche * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
$selectList<String>NoAn OData $select clause. In the form of "," @@ -18440,8 +18446,8 @@ public Mono> getJobScheduleWithResponseAsync(String jobSche * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -18531,7 +18537,7 @@ public Response getJobScheduleWithResponse(String jobScheduleId, Req * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -18918,8 +18924,8 @@ public Response getJobScheduleWithResponse(String jobScheduleId, Req * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -18989,7 +18995,7 @@ public Mono> updateJobScheduleWithResponseAsync(String jobSchedul * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -19376,8 +19382,8 @@ public Mono> updateJobScheduleWithResponseAsync(String jobSchedul * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -19446,7 +19452,7 @@ public Response updateJobScheduleWithResponse(String jobScheduleId, Binary * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -19843,8 +19849,8 @@ public Response updateJobScheduleWithResponse(String jobScheduleId, Binary * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -19938,7 +19944,7 @@ public Mono> replaceJobScheduleWithResponseAsync(String jobSchedu * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -20335,8 +20341,8 @@ public Mono> replaceJobScheduleWithResponseAsync(String jobSchedu * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -20425,7 +20431,7 @@ public Response replaceJobScheduleWithResponse(String jobScheduleId, Binar * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -20477,7 +20483,7 @@ public Mono> disableJobScheduleWithResponseAsync(String jobSchedu * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -20526,7 +20532,7 @@ public Response disableJobScheduleWithResponse(String jobScheduleId, Reque * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -20576,7 +20582,7 @@ public Mono> enableJobScheduleWithResponseAsync(String jobSchedul * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -20625,7 +20631,7 @@ public Response enableJobScheduleWithResponse(String jobScheduleId, Reques * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
forceBooleanNoIf true, the server will terminate the JobSchedule even if the @@ -20677,7 +20683,7 @@ public Mono> terminateJobScheduleWithResponseAsync(String jobSche * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
forceBooleanNoIf true, the server will terminate the JobSchedule even if the @@ -20728,7 +20734,7 @@ public Response terminateJobScheduleWithResponse(String jobScheduleId, Req * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -21095,8 +21101,8 @@ public Response terminateJobScheduleWithResponse(String jobScheduleId, Req * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -21158,7 +21164,7 @@ public Mono> createJobScheduleWithResponseAsync(BinaryData jobSch * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -21525,8 +21531,8 @@ public Mono> createJobScheduleWithResponseAsync(BinaryData jobSch * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -21587,7 +21593,7 @@ public Response createJobScheduleWithResponse(BinaryData jobSchedule, Requ * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -21972,8 +21978,8 @@ public Response createJobScheduleWithResponse(BinaryData jobSchedule, Requ * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -22060,7 +22066,7 @@ private Mono> listJobSchedulesSinglePageAsync(RequestO * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -22445,8 +22451,8 @@ private Mono> listJobSchedulesSinglePageAsync(RequestO * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -22551,7 +22557,7 @@ public PagedFlux listJobSchedulesAsync(RequestOptions requestOptions * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -22936,8 +22942,8 @@ public PagedFlux listJobSchedulesAsync(RequestOptions requestOptions * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -23022,7 +23028,7 @@ private PagedResponse listJobSchedulesSinglePage(RequestOptions requ * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -23407,8 +23413,8 @@ private PagedResponse listJobSchedulesSinglePage(RequestOptions requ * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -23517,7 +23523,7 @@ public PagedIterable listJobSchedules(RequestOptions requestOptions) * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -23685,7 +23691,7 @@ public Mono> createTaskWithResponseAsync(String jobId, BinaryData * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -23852,7 +23858,7 @@ public Response createTaskWithResponse(String jobId, BinaryData task, Requ * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -24086,7 +24092,7 @@ private Mono> listTasksSinglePageAsync(String jobId, R * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -24338,7 +24344,7 @@ public PagedFlux listTasksAsync(String jobId, RequestOptions request * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -24570,7 +24576,7 @@ private PagedResponse listTasksSinglePage(String jobId, RequestOptio * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -24833,7 +24839,7 @@ public PagedIterable listTasks(String jobId, RequestOptions requestO * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -25015,8 +25021,8 @@ public PagedIterable listTasks(String jobId, RequestOptions requestO * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the result of adding a collection of Tasks to a Job along with {@link Response} on successful completion - * of {@link Mono}. + * @return the result of creating a collection of Tasks to a Job along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createTaskCollectionWithResponseAsync(String jobId, BinaryData taskCollection, @@ -25049,7 +25055,7 @@ public Mono> createTaskCollectionWithResponseAsync(String j * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -25231,7 +25237,7 @@ public Mono> createTaskCollectionWithResponseAsync(String j * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the result of adding a collection of Tasks to a Job along with {@link Response}. + * @return the result of creating a collection of Tasks to a Job along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createTaskCollectionWithResponse(String jobId, BinaryData taskCollection, @@ -25254,7 +25260,7 @@ public Response createTaskCollectionWithResponse(String jobId, Binar * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -25311,7 +25317,7 @@ public Mono> deleteTaskWithResponseAsync(String jobId, String tas * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -25365,7 +25371,7 @@ public Response deleteTaskWithResponse(String jobId, String taskId, Reques * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
$selectList<String>NoAn OData $select clause. In the form of "," @@ -25616,7 +25622,7 @@ public Mono> getTaskWithResponseAsync(String jobId, String * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
$selectList<String>NoAn OData $select clause. In the form of "," @@ -25862,7 +25868,7 @@ public Response getTaskWithResponse(String jobId, String taskId, Req * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -26104,7 +26110,7 @@ public Mono> replaceTaskWithResponseAsync(String jobId, String ta * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -26349,7 +26355,7 @@ public Response replaceTaskWithResponse(String jobId, String taskId, Binar * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
$selectList<String>NoAn OData $select clause. In the form of "," @@ -26428,7 +26434,7 @@ private Mono> listSubTasksSinglePageAsync(String jobId * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
$selectList<String>NoAn OData $select clause. In the form of "," @@ -26504,7 +26510,7 @@ public PagedFlux listSubTasksAsync(String jobId, String taskId, Requ * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
$selectList<String>NoAn OData $select clause. In the form of "," @@ -26581,7 +26587,7 @@ private PagedResponse listSubTasksSinglePage(String jobId, String ta * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
$selectList<String>NoAn OData $select clause. In the form of "," @@ -26658,7 +26664,7 @@ public PagedIterable listSubTasks(String jobId, String taskId, Reque * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -26713,7 +26719,7 @@ public Mono> terminateTaskWithResponseAsync(String jobId, String * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -26772,7 +26778,7 @@ public Response terminateTaskWithResponse(String jobId, String taskId, Req * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -26832,7 +26838,7 @@ public Mono> reactivateTaskWithResponseAsync(String jobId, String * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -26882,7 +26888,7 @@ public Response reactivateTaskWithResponse(String jobId, String taskId, Re * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
recursiveBooleanNoWhether to delete children of a directory. If the filePath @@ -26917,7 +26923,7 @@ public Mono> deleteTaskFileWithResponseAsync(String jobId, String * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
recursiveBooleanNoWhether to delete children of a directory. If the filePath @@ -26952,7 +26958,7 @@ public Response deleteTaskFileWithResponse(String jobId, String taskId, St * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -27006,7 +27012,7 @@ public Mono> getTaskFileWithResponseAsync(String jobId, Str * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -27060,7 +27066,7 @@ public Response getTaskFileWithResponse(String jobId, String taskId, * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -27105,7 +27111,7 @@ public Mono> getTaskFilePropertiesWithResponseAsync(String jobId, * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -27149,7 +27155,7 @@ public Response getTaskFilePropertiesWithResponse(String jobId, String tas * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -27209,7 +27215,7 @@ private Mono> listTaskFilesSinglePageAsync(String jobI * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -27287,7 +27293,7 @@ public PagedFlux listTaskFilesAsync(String jobId, String taskId, Req * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -27346,7 +27352,7 @@ private PagedResponse listTaskFilesSinglePage(String jobId, String t * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -27427,7 +27433,7 @@ public PagedIterable listTaskFiles(String jobId, String taskId, Requ * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -27474,7 +27480,7 @@ public Mono> createNodeUserWithResponseAsync(String poolId, Strin * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -27521,7 +27527,7 @@ public Response createNodeUserWithResponse(String poolId, String nodeId, B * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -27554,7 +27560,7 @@ public Mono> deleteNodeUserWithResponseAsync(String poolId, Strin * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -27589,7 +27595,7 @@ public Response deleteNodeUserWithResponse(String poolId, String nodeId, S * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -27609,7 +27615,7 @@ public Response deleteNodeUserWithResponse(String poolId, String nodeId, S * @param poolId The ID of the Pool that contains the Compute Node. * @param nodeId The ID of the machine on which you want to update a user Account. * @param userName The name of the user Account to update. - * @param content The options to use for updating the user. + * @param parameters The options to use for updating the user. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -27619,12 +27625,12 @@ public Response deleteNodeUserWithResponse(String poolId, String nodeId, S */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> replaceNodeUserWithResponseAsync(String poolId, String nodeId, String userName, - BinaryData content, RequestOptions requestOptions) { + BinaryData parameters, RequestOptions requestOptions) { final String contentType = "application/json; odata=minimalmetadata"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.replaceNodeUser(this.getEndpoint(), this.getServiceVersion().getVersion(), - contentType, poolId, nodeId, userName, accept, content, requestOptions, context)); + contentType, poolId, nodeId, userName, accept, parameters, requestOptions, context)); } /** @@ -27638,7 +27644,7 @@ public Mono> replaceNodeUserWithResponseAsync(String poolId, Stri * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -27658,7 +27664,7 @@ public Mono> replaceNodeUserWithResponseAsync(String poolId, Stri * @param poolId The ID of the Pool that contains the Compute Node. * @param nodeId The ID of the machine on which you want to update a user Account. * @param userName The name of the user Account to update. - * @param content The options to use for updating the user. + * @param parameters The options to use for updating the user. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -27667,12 +27673,12 @@ public Mono> replaceNodeUserWithResponseAsync(String poolId, Stri * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response replaceNodeUserWithResponse(String poolId, String nodeId, String userName, BinaryData content, - RequestOptions requestOptions) { + public Response replaceNodeUserWithResponse(String poolId, String nodeId, String userName, + BinaryData parameters, RequestOptions requestOptions) { final String contentType = "application/json; odata=minimalmetadata"; final String accept = "application/json"; return service.replaceNodeUserSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, - poolId, nodeId, userName, accept, content, requestOptions, Context.NONE); + poolId, nodeId, userName, accept, parameters, requestOptions, Context.NONE); } /** @@ -27681,7 +27687,7 @@ public Response replaceNodeUserWithResponse(String poolId, String nodeId, * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
$selectList<String>NoAn OData $select clause. In the form of "," @@ -27879,7 +27885,7 @@ public Mono> getNodeWithResponseAsync(String poolId, String * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
$selectList<String>NoAn OData $select clause. In the form of "," @@ -28077,7 +28083,7 @@ public Response getNodeWithResponse(String poolId, String nodeId, Re * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -28131,7 +28137,7 @@ public Mono> rebootNodeWithResponseAsync(String poolId, String no * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -28184,7 +28190,7 @@ public Response rebootNodeWithResponse(String poolId, String nodeId, Reque * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -28215,7 +28221,7 @@ public Mono> startNodeWithResponseAsync(String poolId, String nod * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -28247,7 +28253,7 @@ public Response startNodeWithResponse(String poolId, String nodeId, Reques * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -28303,7 +28309,7 @@ public Mono> reimageNodeWithResponseAsync(String poolId, String n * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -28356,7 +28362,7 @@ public Response reimageNodeWithResponse(String poolId, String nodeId, Requ * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -28410,7 +28416,7 @@ public Mono> deallocateNodeWithResponseAsync(String poolId, Strin * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -28464,7 +28470,7 @@ public Response deallocateNodeWithResponse(String poolId, String nodeId, R * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -28519,7 +28525,7 @@ public Mono> disableNodeSchedulingWithResponseAsync(String poolId * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -28574,7 +28580,7 @@ public Response disableNodeSchedulingWithResponse(String poolId, String no * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -28606,7 +28612,7 @@ public Mono> enableNodeSchedulingWithResponseAsync(String poolId, * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -28638,7 +28644,7 @@ public Response enableNodeSchedulingWithResponse(String poolId, String nod * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -28684,7 +28690,7 @@ public Mono> getNodeRemoteLoginSettingsWithResponseAsync(St * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -28732,7 +28738,7 @@ public Response getNodeRemoteLoginSettingsWithResponse(String poolId * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -28766,7 +28772,7 @@ public Response getNodeRemoteLoginSettingsWithResponse(String poolId * @param poolId The ID of the Pool that contains the Compute Node. * @param nodeId The ID of the Compute Node for which you want to get the Remote Desktop * Protocol file. - * @param content The Azure Batch service log files upload options. + * @param parameters The Azure Batch service log files upload options. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -28776,13 +28782,13 @@ public Response getNodeRemoteLoginSettingsWithResponse(String poolId * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> uploadNodeLogsWithResponseAsync(String poolId, String nodeId, BinaryData content, - RequestOptions requestOptions) { + public Mono> uploadNodeLogsWithResponseAsync(String poolId, String nodeId, + BinaryData parameters, RequestOptions requestOptions) { final String contentType = "application/json; odata=minimalmetadata"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.uploadNodeLogs(this.getEndpoint(), this.getServiceVersion().getVersion(), - contentType, poolId, nodeId, accept, content, requestOptions, context)); + contentType, poolId, nodeId, accept, parameters, requestOptions, context)); } /** @@ -28797,7 +28803,7 @@ public Mono> uploadNodeLogsWithResponseAsync(String poolId, * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -28831,7 +28837,7 @@ public Mono> uploadNodeLogsWithResponseAsync(String poolId, * @param poolId The ID of the Pool that contains the Compute Node. * @param nodeId The ID of the Compute Node for which you want to get the Remote Desktop * Protocol file. - * @param content The Azure Batch service log files upload options. + * @param parameters The Azure Batch service log files upload options. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -28840,12 +28846,12 @@ public Mono> uploadNodeLogsWithResponseAsync(String poolId, * @return the result of uploading Batch service log files from a specific Compute Node along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response uploadNodeLogsWithResponse(String poolId, String nodeId, BinaryData content, + public Response uploadNodeLogsWithResponse(String poolId, String nodeId, BinaryData parameters, RequestOptions requestOptions) { final String contentType = "application/json; odata=minimalmetadata"; final String accept = "application/json"; return service.uploadNodeLogsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, - poolId, nodeId, accept, content, requestOptions, Context.NONE); + poolId, nodeId, accept, parameters, requestOptions, Context.NONE); } /** @@ -28854,7 +28860,7 @@ public Response uploadNodeLogsWithResponse(String poolId, String nod * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -29059,7 +29065,7 @@ private Mono> listNodesSinglePageAsync(String poolId, * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -29282,7 +29288,7 @@ public PagedFlux listNodesAsync(String poolId, RequestOptions reques * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -29485,7 +29491,7 @@ private PagedResponse listNodesSinglePage(String poolId, RequestOpti * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -29708,7 +29714,7 @@ public PagedIterable listNodes(String poolId, RequestOptions request * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
$selectList<String>NoAn OData $select clause. In the form of "," @@ -29782,7 +29788,7 @@ public Mono> getNodeExtensionWithResponseAsync(String poolI * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
$selectList<String>NoAn OData $select clause. In the form of "," @@ -29855,7 +29861,7 @@ public Response getNodeExtensionWithResponse(String poolId, String n * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -29934,7 +29940,7 @@ private Mono> listNodeExtensionsSinglePageAsync(String * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -30030,7 +30036,7 @@ public PagedFlux listNodeExtensionsAsync(String poolId, String nodeI * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -30107,7 +30113,7 @@ private PagedResponse listNodeExtensionsSinglePage(String poolId, St * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -30204,7 +30210,7 @@ public PagedIterable listNodeExtensions(String poolId, String nodeId * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
recursiveBooleanNoWhether to delete children of a directory. If the filePath @@ -30239,7 +30245,7 @@ public Mono> deleteNodeFileWithResponseAsync(String poolId, Strin * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
recursiveBooleanNoWhether to delete children of a directory. If the filePath @@ -30274,7 +30280,7 @@ public Response deleteNodeFileWithResponse(String poolId, String nodeId, S * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -30328,7 +30334,7 @@ public Mono> getNodeFileWithResponseAsync(String poolId, St * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -30382,7 +30388,7 @@ public Response getNodeFileWithResponse(String poolId, String nodeId * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -30427,7 +30433,7 @@ public Mono> getNodeFilePropertiesWithResponseAsync(String poolId * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
@@ -30471,7 +30477,7 @@ public Response getNodeFilePropertiesWithResponse(String poolId, String no * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -30529,7 +30535,7 @@ private Mono> listNodeFilesSinglePageAsync(String pool * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -30605,7 +30611,7 @@ public PagedFlux listNodeFilesAsync(String poolId, String nodeId, Re * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -30662,7 +30668,7 @@ private PagedResponse listNodeFilesSinglePage(String poolId, String * * * - * *
Query Parameters
NameTypeRequiredDescription
timeOutIntegerNoThe maximum time that the server can spend processing the + *
timeOutDurationNoThe maximum time that the server can spend processing the * request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used * instead.".
maxresultsIntegerNoThe maximum number of items to return in the response. A @@ -31193,8 +31199,8 @@ private PagedResponse listPoolUsageMetricsNextSinglePage(String next * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -31567,8 +31573,8 @@ private Mono> listPoolsNextSinglePageAsync(String next * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -32182,8 +32188,8 @@ private PagedResponse listPoolNodeCountsNextSinglePage(String nextLi * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -32636,8 +32642,8 @@ private Mono> listJobsNextSinglePageAsync(String nextL * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -33088,8 +33094,8 @@ private PagedResponse listJobsNextSinglePage(String nextLink, Reques * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -33542,8 +33548,8 @@ private Mono> listJobsFromScheduleNextSinglePageAsync( * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -33811,7 +33817,7 @@ private PagedResponse listJobPreparationAndReleaseTaskStatusNextSing * } * ] * } - * data: String (Required) + * data: byte[] (Required) * certificateFormat: String(pfx/cer) (Optional) * password: String (Optional) * } @@ -33865,7 +33871,7 @@ private Mono> listCertificatesNextSinglePageAsync(Stri * } * ] * } - * data: String (Required) + * data: byte[] (Required) * certificateFormat: String(pfx/cer) (Optional) * password: String (Optional) * } @@ -34263,8 +34269,8 @@ private PagedResponse listCertificatesNextSinglePage(String nextLink * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } @@ -34721,8 +34727,8 @@ private Mono> listJobSchedulesNextSinglePageAsync(Stri * } * azureFileShareConfiguration (Optional): { * accountName: String (Required) - * azureFileUrl: String (Required) * accountKey: String (Required) + * azureFileUrl: String (Required) * relativeMountPath: String (Required) * mountOptions: String (Optional) * } diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/AuthenticationTokenSettings.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/AuthenticationTokenSettings.java index 79bc2b678aa2..4440ea76a16a 100644 --- a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/AuthenticationTokenSettings.java +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/AuthenticationTokenSettings.java @@ -25,7 +25,7 @@ public final class AuthenticationTokenSettings implements JsonSerializable access; + private List access; /** * Creates an instance of AuthenticationTokenSettings class. @@ -42,7 +42,7 @@ public AuthenticationTokenSettings() { * @return the access value. */ @Generated - public List getAccess() { + public List getAccess() { return this.access; } @@ -55,7 +55,7 @@ public List getAccess() { * @return the AuthenticationTokenSettings object itself. */ @Generated - public AuthenticationTokenSettings setAccess(List access) { + public AuthenticationTokenSettings setAccess(List access) { this.access = access; return this; } @@ -88,7 +88,8 @@ public static AuthenticationTokenSettings fromJson(JsonReader jsonReader) throws String fieldName = reader.getFieldName(); reader.nextToken(); if ("access".equals(fieldName)) { - List access = reader.readArray(reader1 -> AccessScope.fromString(reader1.getString())); + List access + = reader.readArray(reader1 -> BatchAccessScope.fromString(reader1.getString())); deserializedAuthenticationTokenSettings.access = access; } else { reader.skipChildren(); diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/AzureFileShareConfiguration.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/AzureFileShareConfiguration.java index 6e59d8e9c05c..0ff866acc85c 100644 --- a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/AzureFileShareConfiguration.java +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/AzureFileShareConfiguration.java @@ -53,16 +53,16 @@ public final class AzureFileShareConfiguration implements JsonSerializable { String accountName = null; - String azureFileUrl = null; String accountKey = null; + String azureFileUrl = null; String relativeMountPath = null; String mountOptions = null; while (reader.nextToken() != JsonToken.END_OBJECT) { @@ -170,10 +170,10 @@ public static AzureFileShareConfiguration fromJson(JsonReader jsonReader) throws reader.nextToken(); if ("accountName".equals(fieldName)) { accountName = reader.getString(); - } else if ("azureFileUrl".equals(fieldName)) { - azureFileUrl = reader.getString(); } else if ("accountKey".equals(fieldName)) { accountKey = reader.getString(); + } else if ("azureFileUrl".equals(fieldName)) { + azureFileUrl = reader.getString(); } else if ("relativeMountPath".equals(fieldName)) { relativeMountPath = reader.getString(); } else if ("mountOptions".equals(fieldName)) { @@ -183,7 +183,7 @@ public static AzureFileShareConfiguration fromJson(JsonReader jsonReader) throws } } AzureFileShareConfiguration deserializedAzureFileShareConfiguration - = new AzureFileShareConfiguration(accountName, azureFileUrl, accountKey, relativeMountPath); + = new AzureFileShareConfiguration(accountName, accountKey, azureFileUrl, relativeMountPath); deserializedAzureFileShareConfiguration.mountOptions = mountOptions; return deserializedAzureFileShareConfiguration; }); diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchAccessScope.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchAccessScope.java new file mode 100644 index 000000000000..9b367cacce29 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchAccessScope.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * BatchAccessScope enums. + */ +public final class BatchAccessScope extends ExpandableStringEnum { + /** + * Grants access to perform all operations on the Job containing the Task. + */ + @Generated + public static final BatchAccessScope JOB = fromString("job"); + + /** + * Creates a new instance of BatchAccessScope value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public BatchAccessScope() { + } + + /** + * Creates or finds a BatchAccessScope from its string representation. + * + * @param name a name to look for. + * @return the corresponding BatchAccessScope. + */ + @Generated + public static BatchAccessScope fromString(String name) { + return fromString(name, BatchAccessScope.class); + } + + /** + * Gets known BatchAccessScope values. + * + * @return known BatchAccessScope values. + */ + @Generated + public static Collection values() { + return values(BatchAccessScope.class); + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchAffinityInfo.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchAffinityInfo.java new file mode 100644 index 000000000000..bf4302cbfa82 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchAffinityInfo.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A locality hint that can be used by the Batch service to select a Compute Node + * on which to start a Task. + */ +@Immutable +public final class BatchAffinityInfo implements JsonSerializable { + /* + * An opaque string representing the location of a Compute Node or a Task that has run previously. You can pass the + * affinityId of a Node to indicate that this Task needs to run on that Compute Node. Note that this is just a soft + * affinity. If the target Compute Node is busy or unavailable at the time the Task is scheduled, then the Task will + * be scheduled elsewhere. + */ + @Generated + private final String affinityId; + + /** + * Creates an instance of BatchAffinityInfo class. + * + * @param affinityId the affinityId value to set. + */ + @Generated + public BatchAffinityInfo(String affinityId) { + this.affinityId = affinityId; + } + + /** + * Get the affinityId property: An opaque string representing the location of a Compute Node or a Task that has run + * previously. You can pass the affinityId of a Node to indicate that this Task needs to run on that Compute Node. + * Note that this is just a soft affinity. If the target Compute Node is busy or unavailable at the time the Task is + * scheduled, then the Task will be scheduled elsewhere. + * + * @return the affinityId value. + */ + @Generated + public String getAffinityId() { + return this.affinityId; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("affinityId", this.affinityId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BatchAffinityInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BatchAffinityInfo if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BatchAffinityInfo. + */ + @Generated + public static BatchAffinityInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String affinityId = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("affinityId".equals(fieldName)) { + affinityId = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new BatchAffinityInfo(affinityId); + }); + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchAllTasksCompleteMode.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchAllTasksCompleteMode.java new file mode 100644 index 000000000000..5660399fc3b2 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchAllTasksCompleteMode.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The action the Batch service should take when all Tasks in the Job are in the completed state. + */ +public final class BatchAllTasksCompleteMode extends ExpandableStringEnum { + /** + * Do nothing. The Job remains active unless terminated or disabled by some other means. + */ + @Generated + public static final BatchAllTasksCompleteMode NO_ACTION = fromString("noaction"); + + /** + * Terminate the Job. The Job's terminationReason is set to 'AllTasksComplete'. + */ + @Generated + public static final BatchAllTasksCompleteMode TERMINATE_JOB = fromString("terminatejob"); + + /** + * Creates a new instance of BatchAllTasksCompleteMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public BatchAllTasksCompleteMode() { + } + + /** + * Creates or finds a BatchAllTasksCompleteMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding BatchAllTasksCompleteMode. + */ + @Generated + public static BatchAllTasksCompleteMode fromString(String name) { + return fromString(name, BatchAllTasksCompleteMode.class); + } + + /** + * Gets known BatchAllTasksCompleteMode values. + * + * @return known BatchAllTasksCompleteMode values. + */ + @Generated + public static Collection values() { + return values(BatchAllTasksCompleteMode.class); + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchApplicationGetOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchApplicationGetOptions.java new file mode 100644 index 000000000000..fb7bf6ca5e14 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchApplicationGetOptions.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Get Application operation. + */ +@Fluent +public final class BatchApplicationGetOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /** + * Creates an instance of BatchApplicationGetOptions class. + */ + @Generated + public BatchApplicationGetOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchApplicationGetOptions object itself. + */ + @Generated + public BatchApplicationGetOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchApplicationsListOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchApplicationsListOptions.java new file mode 100644 index 000000000000..8952a33a1120 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchApplicationsListOptions.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for List Applications operation. + */ +@Fluent +public final class BatchApplicationsListOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /* + * The maximum number of items to return in the response. A maximum of 1000 + * applications can be returned. + */ + @Generated + private Integer maxPageSize; + + /** + * Creates an instance of BatchApplicationsListOptions class. + */ + @Generated + public BatchApplicationsListOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchApplicationsListOptions object itself. + */ + @Generated + public BatchApplicationsListOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } + + /** + * Get the maxPageSize property: The maximum number of items to return in the response. A maximum of 1000 + * applications can be returned. + * + * @return the maxPageSize value. + */ + @Generated + public Integer getMaxPageSize() { + return this.maxPageSize; + } + + /** + * Set the maxPageSize property: The maximum number of items to return in the response. A maximum of 1000 + * applications can be returned. + * + * @param maxPageSize the maxPageSize value to set. + * @return the BatchApplicationsListOptions object itself. + */ + @Generated + public BatchApplicationsListOptions setMaxPageSize(Integer maxPageSize) { + this.maxPageSize = maxPageSize; + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchCertificate.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchCertificate.java index 431699142bee..dd2bc6fc6cb7 100644 --- a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchCertificate.java +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchCertificate.java @@ -76,13 +76,13 @@ public final class BatchCertificate implements JsonSerializable { String thumbprint = null; String thumbprintAlgorithm = null; - String data = null; + byte[] data = null; String url = null; BatchCertificateState state = null; OffsetDateTime stateTransitionTime = null; BatchCertificateState previousState = null; OffsetDateTime previousStateTransitionTime = null; String publicData = null; - DeleteBatchCertificateError deleteCertificateError = null; + BatchCertificateDeleteError deleteCertificateError = null; BatchCertificateFormat certificateFormat = null; String password = null; while (reader.nextToken() != JsonToken.END_OBJECT) { @@ -308,7 +294,7 @@ public static BatchCertificate fromJson(JsonReader jsonReader) throws IOExceptio } else if ("thumbprintAlgorithm".equals(fieldName)) { thumbprintAlgorithm = reader.getString(); } else if ("data".equals(fieldName)) { - data = reader.getString(); + data = reader.getBinary(); } else if ("url".equals(fieldName)) { url = reader.getString(); } else if ("state".equals(fieldName)) { @@ -324,7 +310,7 @@ public static BatchCertificate fromJson(JsonReader jsonReader) throws IOExceptio } else if ("publicData".equals(fieldName)) { publicData = reader.getString(); } else if ("deleteCertificateError".equals(fieldName)) { - deleteCertificateError = DeleteBatchCertificateError.fromJson(reader); + deleteCertificateError = BatchCertificateDeleteError.fromJson(reader); } else if ("certificateFormat".equals(fieldName)) { certificateFormat = BatchCertificateFormat.fromString(reader.getString()); } else if ("password".equals(fieldName)) { @@ -346,4 +332,18 @@ public static BatchCertificate fromJson(JsonReader jsonReader) throws IOExceptio return deserializedBatchCertificate; }); } + + /** + * Creates an instance of BatchCertificate class. + * + * @param thumbprint the thumbprint value to set. + * @param thumbprintAlgorithm the thumbprintAlgorithm value to set. + * @param data the data value to set. + */ + @Generated + public BatchCertificate(String thumbprint, String thumbprintAlgorithm, byte[] data) { + this.thumbprint = thumbprint; + this.thumbprintAlgorithm = thumbprintAlgorithm; + this.data = data; + } } diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchCertificateCancelDeletionOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchCertificateCancelDeletionOptions.java new file mode 100644 index 000000000000..62dfc09938d9 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchCertificateCancelDeletionOptions.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Cancel Certificate Deletion operation. + */ +@Fluent +public final class BatchCertificateCancelDeletionOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /** + * Creates an instance of BatchCertificateCancelDeletionOptions class. + */ + @Generated + public BatchCertificateCancelDeletionOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchCertificateCancelDeletionOptions object itself. + */ + @Generated + public BatchCertificateCancelDeletionOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchCertificateCreateOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchCertificateCreateOptions.java new file mode 100644 index 000000000000..0566057d0fbd --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchCertificateCreateOptions.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Create Certificate operation. + */ +@Fluent +public final class BatchCertificateCreateOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /** + * Creates an instance of BatchCertificateCreateOptions class. + */ + @Generated + public BatchCertificateCreateOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchCertificateCreateOptions object itself. + */ + @Generated + public BatchCertificateCreateOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchCertificateDeleteError.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchCertificateDeleteError.java new file mode 100644 index 000000000000..3ef245486b44 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchCertificateDeleteError.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * An error encountered by the Batch service when deleting a Certificate. + */ +@Immutable +public final class BatchCertificateDeleteError implements JsonSerializable { + /* + * An identifier for the Certificate deletion error. Codes are invariant and are intended to be consumed + * programmatically. + */ + @Generated + private String code; + + /* + * A message describing the Certificate deletion error, intended to be suitable for display in a user interface. + */ + @Generated + private String message; + + /* + * A list of additional error details related to the Certificate deletion error. This list includes details such as + * the active Pools and Compute Nodes referencing this Certificate. However, if a large number of resources + * reference the Certificate, the list contains only about the first hundred. + */ + @Generated + private List values; + + /** + * Creates an instance of BatchCertificateDeleteError class. + */ + @Generated + private BatchCertificateDeleteError() { + } + + /** + * Get the code property: An identifier for the Certificate deletion error. Codes are invariant and are intended to + * be consumed programmatically. + * + * @return the code value. + */ + @Generated + public String getCode() { + return this.code; + } + + /** + * Get the message property: A message describing the Certificate deletion error, intended to be suitable for + * display in a user interface. + * + * @return the message value. + */ + @Generated + public String getMessage() { + return this.message; + } + + /** + * Get the values property: A list of additional error details related to the Certificate deletion error. This list + * includes details such as the active Pools and Compute Nodes referencing this Certificate. However, if a large + * number of resources reference the Certificate, the list contains only about the first hundred. + * + * @return the values value. + */ + @Generated + public List getValues() { + return this.values; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("code", this.code); + jsonWriter.writeStringField("message", this.message); + jsonWriter.writeArrayField("values", this.values, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BatchCertificateDeleteError from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BatchCertificateDeleteError if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BatchCertificateDeleteError. + */ + @Generated + public static BatchCertificateDeleteError fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BatchCertificateDeleteError deserializedBatchCertificateDeleteError = new BatchCertificateDeleteError(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + deserializedBatchCertificateDeleteError.code = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedBatchCertificateDeleteError.message = reader.getString(); + } else if ("values".equals(fieldName)) { + List values = reader.readArray(reader1 -> NameValuePair.fromJson(reader1)); + deserializedBatchCertificateDeleteError.values = values; + } else { + reader.skipChildren(); + } + } + + return deserializedBatchCertificateDeleteError; + }); + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchCertificateDeleteOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchCertificateDeleteOptions.java new file mode 100644 index 000000000000..83dd0dbd7d35 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchCertificateDeleteOptions.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Delete Certificate operation. + */ +@Fluent +public final class BatchCertificateDeleteOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /** + * Creates an instance of BatchCertificateDeleteOptions class. + */ + @Generated + public BatchCertificateDeleteOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchCertificateDeleteOptions object itself. + */ + @Generated + public BatchCertificateDeleteOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchCertificateGetOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchCertificateGetOptions.java new file mode 100644 index 000000000000..f630bd188ea0 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchCertificateGetOptions.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; +import java.util.List; + +/** + * Optional parameters for Get Certificate operation. + */ +@Fluent +public final class BatchCertificateGetOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /* + * An OData $select clause. + */ + @Generated + private List select; + + /** + * Creates an instance of BatchCertificateGetOptions class. + */ + @Generated + public BatchCertificateGetOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchCertificateGetOptions object itself. + */ + @Generated + public BatchCertificateGetOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } + + /** + * Get the select property: An OData $select clause. + * + * @return the select value. + */ + @Generated + public List getSelect() { + return this.select; + } + + /** + * Set the select property: An OData $select clause. + * + * @param select the select value to set. + * @return the BatchCertificateGetOptions object itself. + */ + @Generated + public BatchCertificateGetOptions setSelect(List select) { + this.select = select; + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchCertificatesListOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchCertificatesListOptions.java new file mode 100644 index 000000000000..136ef7283363 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchCertificatesListOptions.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; +import java.util.List; + +/** + * Optional parameters for List Certificates operation. + */ +@Fluent +public final class BatchCertificatesListOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /* + * The maximum number of items to return in the response. A maximum of 1000 + * applications can be returned. + */ + @Generated + private Integer maxPageSize; + + /* + * An OData $filter clause. For more information on constructing this filter, see + * https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-certificates. + */ + @Generated + private String filter; + + /* + * An OData $select clause. + */ + @Generated + private List select; + + /** + * Creates an instance of BatchCertificatesListOptions class. + */ + @Generated + public BatchCertificatesListOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchCertificatesListOptions object itself. + */ + @Generated + public BatchCertificatesListOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } + + /** + * Get the maxPageSize property: The maximum number of items to return in the response. A maximum of 1000 + * applications can be returned. + * + * @return the maxPageSize value. + */ + @Generated + public Integer getMaxPageSize() { + return this.maxPageSize; + } + + /** + * Set the maxPageSize property: The maximum number of items to return in the response. A maximum of 1000 + * applications can be returned. + * + * @param maxPageSize the maxPageSize value to set. + * @return the BatchCertificatesListOptions object itself. + */ + @Generated + public BatchCertificatesListOptions setMaxPageSize(Integer maxPageSize) { + this.maxPageSize = maxPageSize; + return this; + } + + /** + * Get the filter property: An OData $filter clause. For more information on constructing this filter, see + * https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-certificates. + * + * @return the filter value. + */ + @Generated + public String getFilter() { + return this.filter; + } + + /** + * Set the filter property: An OData $filter clause. For more information on constructing this filter, see + * https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-certificates. + * + * @param filter the filter value to set. + * @return the BatchCertificatesListOptions object itself. + */ + @Generated + public BatchCertificatesListOptions setFilter(String filter) { + this.filter = filter; + return this; + } + + /** + * Get the select property: An OData $select clause. + * + * @return the select value. + */ + @Generated + public List getSelect() { + return this.select; + } + + /** + * Set the select property: An OData $select clause. + * + * @param select the select value to set. + * @return the BatchCertificatesListOptions object itself. + */ + @Generated + public BatchCertificatesListOptions setSelect(List select) { + this.select = select; + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchContainerConfiguration.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchContainerConfiguration.java new file mode 100644 index 000000000000..0cf023f8bbbe --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchContainerConfiguration.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The configuration for container-enabled Pools. + */ +@Fluent +public final class BatchContainerConfiguration implements JsonSerializable { + /* + * The container technology to be used. + */ + @Generated + private final ContainerType type; + + /* + * The collection of container Image names. This is the full Image reference, as would be specified to + * "docker pull". An Image will be sourced from the default Docker registry unless the Image is fully qualified with + * an alternative registry. + */ + @Generated + private List containerImageNames; + + /* + * Additional private registries from which containers can be pulled. If any Images must be downloaded from a + * private registry which requires credentials, then those credentials must be provided here. + */ + @Generated + private List containerRegistries; + + /** + * Creates an instance of BatchContainerConfiguration class. + * + * @param type the type value to set. + */ + @Generated + public BatchContainerConfiguration(ContainerType type) { + this.type = type; + } + + /** + * Get the type property: The container technology to be used. + * + * @return the type value. + */ + @Generated + public ContainerType getType() { + return this.type; + } + + /** + * Get the containerImageNames property: The collection of container Image names. This is the full Image reference, + * as would be specified to "docker pull". An Image will be sourced from the default Docker registry unless the + * Image is fully qualified with an alternative registry. + * + * @return the containerImageNames value. + */ + @Generated + public List getContainerImageNames() { + return this.containerImageNames; + } + + /** + * Set the containerImageNames property: The collection of container Image names. This is the full Image reference, + * as would be specified to "docker pull". An Image will be sourced from the default Docker registry unless the + * Image is fully qualified with an alternative registry. + * + * @param containerImageNames the containerImageNames value to set. + * @return the BatchContainerConfiguration object itself. + */ + @Generated + public BatchContainerConfiguration setContainerImageNames(List containerImageNames) { + this.containerImageNames = containerImageNames; + return this; + } + + /** + * Get the containerRegistries property: Additional private registries from which containers can be pulled. If any + * Images must be downloaded from a private registry which requires credentials, then those credentials must be + * provided here. + * + * @return the containerRegistries value. + */ + @Generated + public List getContainerRegistries() { + return this.containerRegistries; + } + + /** + * Set the containerRegistries property: Additional private registries from which containers can be pulled. If any + * Images must be downloaded from a private registry which requires credentials, then those credentials must be + * provided here. + * + * @param containerRegistries the containerRegistries value to set. + * @return the BatchContainerConfiguration object itself. + */ + @Generated + public BatchContainerConfiguration setContainerRegistries(List containerRegistries) { + this.containerRegistries = containerRegistries; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeArrayField("containerImageNames", this.containerImageNames, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("containerRegistries", this.containerRegistries, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BatchContainerConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BatchContainerConfiguration if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BatchContainerConfiguration. + */ + @Generated + public static BatchContainerConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerType type = null; + List containerImageNames = null; + List containerRegistries = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + type = ContainerType.fromString(reader.getString()); + } else if ("containerImageNames".equals(fieldName)) { + containerImageNames = reader.readArray(reader1 -> reader1.getString()); + } else if ("containerRegistries".equals(fieldName)) { + containerRegistries = reader.readArray(reader1 -> ContainerRegistryReference.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + BatchContainerConfiguration deserializedBatchContainerConfiguration = new BatchContainerConfiguration(type); + deserializedBatchContainerConfiguration.containerImageNames = containerImageNames; + deserializedBatchContainerConfiguration.containerRegistries = containerRegistries; + + return deserializedBatchContainerConfiguration; + }); + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchCreateTaskCollectionResult.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchCreateTaskCollectionResult.java new file mode 100644 index 000000000000..8407f133d3fd --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchCreateTaskCollectionResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The result of creating a collection of Tasks to a Job. + */ +@Immutable +public final class BatchCreateTaskCollectionResult implements JsonSerializable { + /* + * The results of the create Task collection operation. + */ + @Generated + private List values; + + /** + * Creates an instance of BatchCreateTaskCollectionResult class. + */ + @Generated + private BatchCreateTaskCollectionResult() { + } + + /** + * Get the values property: The results of the create Task collection operation. + * + * @return the values value. + */ + @Generated + public List getValues() { + return this.values; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.values, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BatchCreateTaskCollectionResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BatchCreateTaskCollectionResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BatchCreateTaskCollectionResult. + */ + @Generated + public static BatchCreateTaskCollectionResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BatchCreateTaskCollectionResult deserializedBatchCreateTaskCollectionResult + = new BatchCreateTaskCollectionResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List values + = reader.readArray(reader1 -> BatchTaskCreateResult.fromJson(reader1)); + deserializedBatchCreateTaskCollectionResult.values = values; + } else { + reader.skipChildren(); + } + } + + return deserializedBatchCreateTaskCollectionResult; + }); + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchDiffDiskSettings.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchDiffDiskSettings.java new file mode 100644 index 000000000000..253793df8039 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchDiffDiskSettings.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Specifies the ephemeral Disk Settings for the operating system disk used by the + * compute node (VM). + */ +@Fluent +public final class BatchDiffDiskSettings implements JsonSerializable { + /* + * Specifies the ephemeral disk placement for operating system disk for all VMs in the pool. This property can be + * used by user in the request to choose the location e.g., cache disk space for Ephemeral OS disk provisioning. For + * more information on Ephemeral OS disk size requirements, please refer to Ephemeral OS disk size requirements for + * Windows VMs at https://learn.microsoft.com/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements + * and Linux VMs at https://learn.microsoft.com/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements. + */ + @Generated + private DiffDiskPlacement placement; + + /** + * Creates an instance of BatchDiffDiskSettings class. + */ + @Generated + public BatchDiffDiskSettings() { + } + + /** + * Get the placement property: Specifies the ephemeral disk placement for operating system disk for all VMs in the + * pool. This property can be used by user in the request to choose the location e.g., cache disk space for + * Ephemeral OS disk provisioning. For more information on Ephemeral OS disk size requirements, please refer to + * Ephemeral OS disk size requirements for Windows VMs at + * https://learn.microsoft.com/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements and Linux VMs at + * https://learn.microsoft.com/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements. + * + * @return the placement value. + */ + @Generated + public DiffDiskPlacement getPlacement() { + return this.placement; + } + + /** + * Set the placement property: Specifies the ephemeral disk placement for operating system disk for all VMs in the + * pool. This property can be used by user in the request to choose the location e.g., cache disk space for + * Ephemeral OS disk provisioning. For more information on Ephemeral OS disk size requirements, please refer to + * Ephemeral OS disk size requirements for Windows VMs at + * https://learn.microsoft.com/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements and Linux VMs at + * https://learn.microsoft.com/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements. + * + * @param placement the placement value to set. + * @return the BatchDiffDiskSettings object itself. + */ + @Generated + public BatchDiffDiskSettings setPlacement(DiffDiskPlacement placement) { + this.placement = placement; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("placement", this.placement == null ? null : this.placement.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BatchDiffDiskSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BatchDiffDiskSettings if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the BatchDiffDiskSettings. + */ + @Generated + public static BatchDiffDiskSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BatchDiffDiskSettings deserializedBatchDiffDiskSettings = new BatchDiffDiskSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("placement".equals(fieldName)) { + deserializedBatchDiffDiskSettings.placement = DiffDiskPlacement.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedBatchDiffDiskSettings; + }); + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchErrorSourceCategory.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchErrorSourceCategory.java new file mode 100644 index 000000000000..930afac4b4f5 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchErrorSourceCategory.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * BatchErrorSourceCategory enums. + */ +public final class BatchErrorSourceCategory extends ExpandableStringEnum { + /** + * The error is due to a user issue, such as misconfiguration. + */ + @Generated + public static final BatchErrorSourceCategory USER_ERROR = fromString("usererror"); + + /** + * The error is due to an internal server issue. + */ + @Generated + public static final BatchErrorSourceCategory SERVER_ERROR = fromString("servererror"); + + /** + * Creates a new instance of BatchErrorSourceCategory value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public BatchErrorSourceCategory() { + } + + /** + * Creates or finds a BatchErrorSourceCategory from its string representation. + * + * @param name a name to look for. + * @return the corresponding BatchErrorSourceCategory. + */ + @Generated + public static BatchErrorSourceCategory fromString(String name) { + return fromString(name, BatchErrorSourceCategory.class); + } + + /** + * Gets known BatchErrorSourceCategory values. + * + * @return known BatchErrorSourceCategory values. + */ + @Generated + public static Collection values() { + return values(BatchErrorSourceCategory.class); + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchInboundNatPool.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchInboundNatPool.java new file mode 100644 index 000000000000..6a02bc848d51 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchInboundNatPool.java @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * A inbound NAT Pool that can be used to address specific ports on Compute Nodes + * in a Batch Pool externally. + */ +@Fluent +public final class BatchInboundNatPool implements JsonSerializable { + /* + * The name of the endpoint. The name must be unique within a Batch Pool, can contain letters, numbers, underscores, + * periods, and hyphens. Names must start with a letter or number, must end with a letter, number, or underscore, + * and cannot exceed 77 characters. If any invalid values are provided the request fails with HTTP status code 400. + */ + @Generated + private final String name; + + /* + * The protocol of the endpoint. + */ + @Generated + private final InboundEndpointProtocol protocol; + + /* + * The port number on the Compute Node. This must be unique within a Batch Pool. Acceptable values are between 1 and + * 65535 except for 29876 and 29877 as these are reserved. If any reserved values are provided the request fails + * with HTTP status code 400. + */ + @Generated + private final int backendPort; + + /* + * The first port number in the range of external ports that will be used to provide inbound access to the + * backendPort on individual Compute Nodes. Acceptable values range between 1 and 65534 except ports from 50000 to + * 55000 which are reserved. All ranges within a Pool must be distinct and cannot overlap. Each range must contain + * at least 40 ports. If any reserved or overlapping values are provided the request fails with HTTP status code + * 400. + */ + @Generated + private final int frontendPortRangeStart; + + /* + * The last port number in the range of external ports that will be used to provide inbound access to the + * backendPort on individual Compute Nodes. Acceptable values range between 1 and 65534 except ports from 50000 to + * 55000 which are reserved by the Batch service. All ranges within a Pool must be distinct and cannot overlap. Each + * range must contain at least 40 ports. If any reserved or overlapping values are provided the request fails with + * HTTP status code 400. + */ + @Generated + private final int frontendPortRangeEnd; + + /* + * A list of network security group rules that will be applied to the endpoint. The maximum number of rules that can + * be specified across all the endpoints on a Batch Pool is 25. If no network security group rules are specified, a + * default rule will be created to allow inbound access to the specified backendPort. If the maximum number of + * network security group rules is exceeded the request fails with HTTP status code 400. + */ + @Generated + private List networkSecurityGroupRules; + + /** + * Creates an instance of BatchInboundNatPool class. + * + * @param name the name value to set. + * @param protocol the protocol value to set. + * @param backendPort the backendPort value to set. + * @param frontendPortRangeStart the frontendPortRangeStart value to set. + * @param frontendPortRangeEnd the frontendPortRangeEnd value to set. + */ + @Generated + public BatchInboundNatPool(String name, InboundEndpointProtocol protocol, int backendPort, + int frontendPortRangeStart, int frontendPortRangeEnd) { + this.name = name; + this.protocol = protocol; + this.backendPort = backendPort; + this.frontendPortRangeStart = frontendPortRangeStart; + this.frontendPortRangeEnd = frontendPortRangeEnd; + } + + /** + * Get the name property: The name of the endpoint. The name must be unique within a Batch Pool, can contain + * letters, numbers, underscores, periods, and hyphens. Names must start with a letter or number, must end with a + * letter, number, or underscore, and cannot exceed 77 characters. If any invalid values are provided the request + * fails with HTTP status code 400. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the protocol property: The protocol of the endpoint. + * + * @return the protocol value. + */ + @Generated + public InboundEndpointProtocol getProtocol() { + return this.protocol; + } + + /** + * Get the backendPort property: The port number on the Compute Node. This must be unique within a Batch Pool. + * Acceptable values are between 1 and 65535 except for 29876 and 29877 as these are reserved. If any reserved + * values are provided the request fails with HTTP status code 400. + * + * @return the backendPort value. + */ + @Generated + public int getBackendPort() { + return this.backendPort; + } + + /** + * Get the frontendPortRangeStart property: The first port number in the range of external ports that will be used + * to provide inbound access to the backendPort on individual Compute Nodes. Acceptable values range between 1 and + * 65534 except ports from 50000 to 55000 which are reserved. All ranges within a Pool must be distinct and cannot + * overlap. Each range must contain at least 40 ports. If any reserved or overlapping values are provided the + * request fails with HTTP status code 400. + * + * @return the frontendPortRangeStart value. + */ + @Generated + public int getFrontendPortRangeStart() { + return this.frontendPortRangeStart; + } + + /** + * Get the frontendPortRangeEnd property: The last port number in the range of external ports that will be used to + * provide inbound access to the backendPort on individual Compute Nodes. Acceptable values range between 1 and + * 65534 except ports from 50000 to 55000 which are reserved by the Batch service. All ranges within a Pool must be + * distinct and cannot overlap. Each range must contain at least 40 ports. If any reserved or overlapping values are + * provided the request fails with HTTP status code 400. + * + * @return the frontendPortRangeEnd value. + */ + @Generated + public int getFrontendPortRangeEnd() { + return this.frontendPortRangeEnd; + } + + /** + * Get the networkSecurityGroupRules property: A list of network security group rules that will be applied to the + * endpoint. The maximum number of rules that can be specified across all the endpoints on a Batch Pool is 25. If no + * network security group rules are specified, a default rule will be created to allow inbound access to the + * specified backendPort. If the maximum number of network security group rules is exceeded the request fails with + * HTTP status code 400. + * + * @return the networkSecurityGroupRules value. + */ + @Generated + public List getNetworkSecurityGroupRules() { + return this.networkSecurityGroupRules; + } + + /** + * Set the networkSecurityGroupRules property: A list of network security group rules that will be applied to the + * endpoint. The maximum number of rules that can be specified across all the endpoints on a Batch Pool is 25. If no + * network security group rules are specified, a default rule will be created to allow inbound access to the + * specified backendPort. If the maximum number of network security group rules is exceeded the request fails with + * HTTP status code 400. + * + * @param networkSecurityGroupRules the networkSecurityGroupRules value to set. + * @return the BatchInboundNatPool object itself. + */ + @Generated + public BatchInboundNatPool setNetworkSecurityGroupRules(List networkSecurityGroupRules) { + this.networkSecurityGroupRules = networkSecurityGroupRules; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("protocol", this.protocol == null ? null : this.protocol.toString()); + jsonWriter.writeIntField("backendPort", this.backendPort); + jsonWriter.writeIntField("frontendPortRangeStart", this.frontendPortRangeStart); + jsonWriter.writeIntField("frontendPortRangeEnd", this.frontendPortRangeEnd); + jsonWriter.writeArrayField("networkSecurityGroupRules", this.networkSecurityGroupRules, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BatchInboundNatPool from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BatchInboundNatPool if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BatchInboundNatPool. + */ + @Generated + public static BatchInboundNatPool fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String name = null; + InboundEndpointProtocol protocol = null; + int backendPort = 0; + int frontendPortRangeStart = 0; + int frontendPortRangeEnd = 0; + List networkSecurityGroupRules = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("protocol".equals(fieldName)) { + protocol = InboundEndpointProtocol.fromString(reader.getString()); + } else if ("backendPort".equals(fieldName)) { + backendPort = reader.getInt(); + } else if ("frontendPortRangeStart".equals(fieldName)) { + frontendPortRangeStart = reader.getInt(); + } else if ("frontendPortRangeEnd".equals(fieldName)) { + frontendPortRangeEnd = reader.getInt(); + } else if ("networkSecurityGroupRules".equals(fieldName)) { + networkSecurityGroupRules = reader.readArray(reader1 -> NetworkSecurityGroupRule.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + BatchInboundNatPool deserializedBatchInboundNatPool + = new BatchInboundNatPool(name, protocol, backendPort, frontendPortRangeStart, frontendPortRangeEnd); + deserializedBatchInboundNatPool.networkSecurityGroupRules = networkSecurityGroupRules; + + return deserializedBatchInboundNatPool; + }); + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJob.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJob.java index 50e0aa3deda0..b1c06ddd012f 100644 --- a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJob.java +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJob.java @@ -155,22 +155,6 @@ public final class BatchJob implements JsonSerializable { @Generated private final BatchPoolInfo poolInfo; - /* - * The action the Batch service should take when all Tasks in the Job are in the completed state. The default is - * noaction. - */ - @Generated - private OnAllBatchTasksComplete onAllTasksComplete; - - /* - * The action the Batch service should take when any Task in the Job fails. A Task is considered to have failed if - * has a failureInfo. A failureInfo is set if the Task completes with a non-zero exit code after exhausting its - * retry count, or if there was an error starting the Task, for example due to a resource file download error. The - * default is noaction. - */ - @Generated - private OnBatchTaskFailure onTaskFailure; - /* * The network configuration for the Job. */ @@ -182,7 +166,7 @@ public final class BatchJob implements JsonSerializable { * metadata; it is solely for the use of user code. */ @Generated - private List metadata; + private List metadata; /* * The execution information for the Job. @@ -190,15 +174,6 @@ public final class BatchJob implements JsonSerializable { @Generated private BatchJobExecutionInfo executionInfo; - /* - * Resource usage statistics for the entire lifetime of the Job. This property is populated only if the BatchJob was - * retrieved with an expand clause including the 'stats' attribute; otherwise it is null. The statistics may not be - * immediately available. The Batch service performs periodic roll-up of statistics. The typical delay is about 30 - * minutes. - */ - @Generated - private BatchJobStatistics stats; - /** * Creates an instance of BatchJob class. * @@ -484,43 +459,6 @@ public BatchPoolInfo getPoolInfo() { return this.poolInfo; } - /** - * Get the onAllTasksComplete property: The action the Batch service should take when all Tasks in the Job are in - * the completed state. The default is noaction. - * - * @return the onAllTasksComplete value. - */ - @Generated - public OnAllBatchTasksComplete getOnAllTasksComplete() { - return this.onAllTasksComplete; - } - - /** - * Set the onAllTasksComplete property: The action the Batch service should take when all Tasks in the Job are in - * the completed state. The default is noaction. - * - * @param onAllTasksComplete the onAllTasksComplete value to set. - * @return the BatchJob object itself. - */ - @Generated - public BatchJob setOnAllTasksComplete(OnAllBatchTasksComplete onAllTasksComplete) { - this.onAllTasksComplete = onAllTasksComplete; - return this; - } - - /** - * Get the onTaskFailure property: The action the Batch service should take when any Task in the Job fails. A Task - * is considered to have failed if has a failureInfo. A failureInfo is set if the Task completes with a non-zero - * exit code after exhausting its retry count, or if there was an error starting the Task, for example due to a - * resource file download error. The default is noaction. - * - * @return the onTaskFailure value. - */ - @Generated - public OnBatchTaskFailure getOnTaskFailure() { - return this.onTaskFailure; - } - /** * Get the networkConfiguration property: The network configuration for the Job. * @@ -538,7 +476,7 @@ public BatchJobNetworkConfiguration getNetworkConfiguration() { * @return the metadata value. */ @Generated - public List getMetadata() { + public List getMetadata() { return this.metadata; } @@ -550,7 +488,7 @@ public List getMetadata() { * @return the BatchJob object itself. */ @Generated - public BatchJob setMetadata(List metadata) { + public BatchJob setMetadata(List metadata) { this.metadata = metadata; return this; } @@ -565,19 +503,6 @@ public BatchJobExecutionInfo getExecutionInfo() { return this.executionInfo; } - /** - * Get the stats property: Resource usage statistics for the entire lifetime of the Job. This property is populated - * only if the BatchJob was retrieved with an expand clause including the 'stats' attribute; otherwise it is null. - * The statistics may not be immediately available. The Batch service performs periodic roll-up of statistics. The - * typical delay is about 30 minutes. - * - * @return the stats value. - */ - @Generated - public BatchJobStatistics getStats() { - return this.stats; - } - /** * {@inheritDoc} */ @@ -591,7 +516,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeNumberField("maxParallelTasks", this.maxParallelTasks); jsonWriter.writeJsonField("constraints", this.constraints); jsonWriter.writeStringField("onAllTasksComplete", - this.onAllTasksComplete == null ? null : this.onAllTasksComplete.toString()); + this.allTasksCompleteMode == null ? null : this.allTasksCompleteMode.toString()); jsonWriter.writeArrayField("metadata", this.metadata, (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -628,12 +553,12 @@ public static BatchJob fromJson(JsonReader jsonReader) throws IOException { BatchJobPreparationTask jobPreparationTask = null; BatchJobReleaseTask jobReleaseTask = null; List commonEnvironmentSettings = null; - OnAllBatchTasksComplete onAllTasksComplete = null; - OnBatchTaskFailure onTaskFailure = null; + BatchAllTasksCompleteMode allTasksCompleteMode = null; + BatchTaskFailureMode taskFailureMode = null; BatchJobNetworkConfiguration networkConfiguration = null; - List metadata = null; + List metadata = null; BatchJobExecutionInfo executionInfo = null; - BatchJobStatistics stats = null; + BatchJobStatistics jobStatistics = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -682,17 +607,17 @@ public static BatchJob fromJson(JsonReader jsonReader) throws IOException { } else if ("commonEnvironmentSettings".equals(fieldName)) { commonEnvironmentSettings = reader.readArray(reader1 -> EnvironmentSetting.fromJson(reader1)); } else if ("onAllTasksComplete".equals(fieldName)) { - onAllTasksComplete = OnAllBatchTasksComplete.fromString(reader.getString()); + allTasksCompleteMode = BatchAllTasksCompleteMode.fromString(reader.getString()); } else if ("onTaskFailure".equals(fieldName)) { - onTaskFailure = OnBatchTaskFailure.fromString(reader.getString()); + taskFailureMode = BatchTaskFailureMode.fromString(reader.getString()); } else if ("networkConfiguration".equals(fieldName)) { networkConfiguration = BatchJobNetworkConfiguration.fromJson(reader); } else if ("metadata".equals(fieldName)) { - metadata = reader.readArray(reader1 -> MetadataItem.fromJson(reader1)); + metadata = reader.readArray(reader1 -> BatchMetadataItem.fromJson(reader1)); } else if ("executionInfo".equals(fieldName)) { executionInfo = BatchJobExecutionInfo.fromJson(reader); } else if ("stats".equals(fieldName)) { - stats = BatchJobStatistics.fromJson(reader); + jobStatistics = BatchJobStatistics.fromJson(reader); } else { reader.skipChildren(); } @@ -717,13 +642,88 @@ public static BatchJob fromJson(JsonReader jsonReader) throws IOException { deserializedBatchJob.jobPreparationTask = jobPreparationTask; deserializedBatchJob.jobReleaseTask = jobReleaseTask; deserializedBatchJob.commonEnvironmentSettings = commonEnvironmentSettings; - deserializedBatchJob.onAllTasksComplete = onAllTasksComplete; - deserializedBatchJob.onTaskFailure = onTaskFailure; + deserializedBatchJob.allTasksCompleteMode = allTasksCompleteMode; + deserializedBatchJob.taskFailureMode = taskFailureMode; deserializedBatchJob.networkConfiguration = networkConfiguration; deserializedBatchJob.metadata = metadata; deserializedBatchJob.executionInfo = executionInfo; - deserializedBatchJob.stats = stats; + deserializedBatchJob.jobStatistics = jobStatistics; return deserializedBatchJob; }); } + + /* + * The action the Batch service should take when all Tasks in the Job are in the completed state. The default is + * noaction. + */ + @Generated + private BatchAllTasksCompleteMode allTasksCompleteMode; + + /* + * The action the Batch service should take when any Task in the Job fails. A Task is considered to have failed if + * has a failureInfo. A failureInfo is set if the Task completes with a non-zero exit code after exhausting its + * retry count, or if there was an error starting the Task, for example due to a resource file download error. The + * default is noaction. + */ + @Generated + private BatchTaskFailureMode taskFailureMode; + + /* + * Resource usage statistics for the entire lifetime of the Job. This property is populated only if the BatchJob was + * retrieved with an expand clause including the 'stats' attribute; otherwise it is null. The statistics may not be + * immediately available. The Batch service performs periodic roll-up of statistics. The typical delay is about 30 + * minutes. + */ + @Generated + private BatchJobStatistics jobStatistics; + + /** + * Get the allTasksCompleteMode property: The action the Batch service should take when all Tasks in the Job are in + * the completed state. The default is noaction. + * + * @return the allTasksCompleteMode value. + */ + @Generated + public BatchAllTasksCompleteMode getAllTasksCompleteMode() { + return this.allTasksCompleteMode; + } + + /** + * Set the allTasksCompleteMode property: The action the Batch service should take when all Tasks in the Job are in + * the completed state. The default is noaction. + * + * @param allTasksCompleteMode the allTasksCompleteMode value to set. + * @return the BatchJob object itself. + */ + @Generated + public BatchJob setAllTasksCompleteMode(BatchAllTasksCompleteMode allTasksCompleteMode) { + this.allTasksCompleteMode = allTasksCompleteMode; + return this; + } + + /** + * Get the taskFailureMode property: The action the Batch service should take when any Task in the Job fails. A Task + * is considered to have failed if has a failureInfo. A failureInfo is set if the Task completes with a non-zero + * exit code after exhausting its retry count, or if there was an error starting the Task, for example due to a + * resource file download error. The default is noaction. + * + * @return the taskFailureMode value. + */ + @Generated + public BatchTaskFailureMode getTaskFailureMode() { + return this.taskFailureMode; + } + + /** + * Get the jobStatistics property: Resource usage statistics for the entire lifetime of the Job. This property is + * populated only if the BatchJob was retrieved with an expand clause including the 'stats' attribute; otherwise it + * is null. The statistics may not be immediately available. The Batch service performs periodic roll-up of + * statistics. The typical delay is about 30 minutes. + * + * @return the jobStatistics value. + */ + @Generated + public BatchJobStatistics getJobStatistics() { + return this.jobStatistics; + } } diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobActionKind.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobActionKind.java new file mode 100644 index 000000000000..1bb5861b7edc --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobActionKind.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * BatchJobAction enums. + */ +public final class BatchJobActionKind extends ExpandableStringEnum { + /** + * Take no action. + */ + @Generated + public static final BatchJobActionKind NONE = fromString("none"); + + /** + * Disable the Job. This is equivalent to calling the disable Job API, with a disableTasks value of requeue. + */ + @Generated + public static final BatchJobActionKind DISABLE = fromString("disable"); + + /** + * Terminate the Job. The terminationReason in the Job's executionInfo is set to "TaskFailed". + */ + @Generated + public static final BatchJobActionKind TERMINATE = fromString("terminate"); + + /** + * Creates a new instance of BatchJobActionKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public BatchJobActionKind() { + } + + /** + * Creates or finds a BatchJobActionKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding BatchJobActionKind. + */ + @Generated + public static BatchJobActionKind fromString(String name) { + return fromString(name, BatchJobActionKind.class); + } + + /** + * Gets known BatchJobActionKind values. + * + * @return known BatchJobActionKind values. + */ + @Generated + public static Collection values() { + return values(BatchJobActionKind.class); + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobCreateOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobCreateOptions.java new file mode 100644 index 000000000000..5c36b12f6b29 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobCreateOptions.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Create Job operation. + */ +@Fluent +public final class BatchJobCreateOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /** + * Creates an instance of BatchJobCreateOptions class. + */ + @Generated + public BatchJobCreateOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchJobCreateOptions object itself. + */ + @Generated + public BatchJobCreateOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobCreateParameters.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobCreateParameters.java new file mode 100644 index 000000000000..717471645893 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobCreateParameters.java @@ -0,0 +1,674 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Parameters for creating an Azure Batch Job. + */ +@Fluent +public final class BatchJobCreateParameters implements JsonSerializable { + /* + * A string that uniquely identifies the Job within the Account. The ID can contain any combination of alphanumeric + * characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is + * case-preserving and case-insensitive (that is, you may not have two IDs within an Account that differ only by + * case). + */ + @Generated + private final String id; + + /* + * The display name for the Job. The display name need not be unique and can contain any Unicode characters up to a + * maximum length of 1024. + */ + @Generated + private String displayName; + + /* + * Whether Tasks in the Job can define dependencies on each other. The default is false. + */ + @Generated + private Boolean usesTaskDependencies; + + /* + * The priority of the Job. Priority values can range from -1000 to 1000, with -1000 being the lowest priority and + * 1000 being the highest priority. The default value is 0. + */ + @Generated + private Integer priority; + + /* + * Whether Tasks in this job can be preempted by other high priority jobs. If the value is set to True, other high + * priority jobs submitted to the system will take precedence and will be able requeue tasks from this job. You can + * update a job's allowTaskPreemption after it has been created using the update job API. + */ + @Generated + private Boolean allowTaskPreemption; + + /* + * The maximum number of tasks that can be executed in parallel for the job. The value of maxParallelTasks must be + * -1 or greater than 0 if specified. If not specified, the default value is -1, which means there's no limit to the + * number of tasks that can be run at once. You can update a job's maxParallelTasks after it has been created using + * the update job API. + */ + @Generated + private Integer maxParallelTasks; + + /* + * The execution constraints for the Job. + */ + @Generated + private BatchJobConstraints constraints; + + /* + * Details of a Job Manager Task to be launched when the Job is started. If the Job does not specify a Job Manager + * Task, the user must explicitly add Tasks to the Job. If the Job does specify a Job Manager Task, the Batch + * service creates the Job Manager Task when the Job is created, and will try to schedule the Job Manager Task + * before scheduling other Tasks in the Job. The Job Manager Task's typical purpose is to control and/or monitor Job + * execution, for example by deciding what additional Tasks to run, determining when the work is complete, etc. + * (However, a Job Manager Task is not restricted to these activities - it is a fully-fledged Task in the system and + * perform whatever actions are required for the Job.) For example, a Job Manager Task might download a file + * specified as a parameter, analyze the contents of that file and submit additional Tasks based on those contents. + */ + @Generated + private BatchJobManagerTask jobManagerTask; + + /* + * The Job Preparation Task. If a Job has a Job Preparation Task, the Batch service will run the Job Preparation + * Task on a Node before starting any Tasks of that Job on that Compute Node. + */ + @Generated + private BatchJobPreparationTask jobPreparationTask; + + /* + * The Job Release Task. A Job Release Task cannot be specified without also specifying a Job Preparation Task for + * the Job. The Batch service runs the Job Release Task on the Nodes that have run the Job Preparation Task. The + * primary purpose of the Job Release Task is to undo changes to Compute Nodes made by the Job Preparation Task. + * Example activities include deleting local files, or shutting down services that were started as part of Job + * preparation. + */ + @Generated + private BatchJobReleaseTask jobReleaseTask; + + /* + * The list of common environment variable settings. These environment variables are set for all Tasks in the Job + * (including the Job Manager, Job Preparation and Job Release Tasks). Individual Tasks can override an environment + * setting specified here by specifying the same setting name with a different value. + */ + @Generated + private List commonEnvironmentSettings; + + /* + * The Pool on which the Batch service runs the Job's Tasks. + */ + @Generated + private final BatchPoolInfo poolInfo; + + /* + * The action the Batch service should take when all Tasks in the Job are in the completed state. Note that if a Job + * contains no Tasks, then all Tasks are considered complete. This option is therefore most commonly used with a Job + * Manager task; if you want to use automatic Job termination without a Job Manager, you should initially set + * onAllTasksComplete to noaction and update the Job properties to set onAllTasksComplete to terminatejob once you + * have finished adding Tasks. The default is noaction. + */ + @Generated + private BatchAllTasksCompleteMode allTasksCompleteMode; + + /* + * The action the Batch service should take when any Task in the Job fails. A Task is considered to have failed if + * has a failureInfo. A failureInfo is set if the Task completes with a non-zero exit code after exhausting its + * retry count, or if there was an error starting the Task, for example due to a resource file download error. The + * default is noaction. + */ + @Generated + private BatchTaskFailureMode taskFailureMode; + + /* + * The network configuration for the Job. + */ + @Generated + private BatchJobNetworkConfiguration networkConfiguration; + + /* + * A list of name-value pairs associated with the Job as metadata. The Batch service does not assign any meaning to + * metadata; it is solely for the use of user code. + */ + @Generated + private List metadata; + + /** + * Creates an instance of BatchJobCreateParameters class. + * + * @param id the id value to set. + * @param poolInfo the poolInfo value to set. + */ + @Generated + public BatchJobCreateParameters(String id, BatchPoolInfo poolInfo) { + this.id = id; + this.poolInfo = poolInfo; + } + + /** + * Get the id property: A string that uniquely identifies the Job within the Account. The ID can contain any + * combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 + * characters. The ID is case-preserving and case-insensitive (that is, you may not have two IDs within an Account + * that differ only by case). + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the displayName property: The display name for the Job. The display name need not be unique and can contain + * any Unicode characters up to a maximum length of 1024. + * + * @return the displayName value. + */ + @Generated + public String getDisplayName() { + return this.displayName; + } + + /** + * Set the displayName property: The display name for the Job. The display name need not be unique and can contain + * any Unicode characters up to a maximum length of 1024. + * + * @param displayName the displayName value to set. + * @return the BatchJobCreateParameters object itself. + */ + @Generated + public BatchJobCreateParameters setDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the usesTaskDependencies property: Whether Tasks in the Job can define dependencies on each other. The + * default is false. + * + * @return the usesTaskDependencies value. + */ + @Generated + public Boolean isUsesTaskDependencies() { + return this.usesTaskDependencies; + } + + /** + * Set the usesTaskDependencies property: Whether Tasks in the Job can define dependencies on each other. The + * default is false. + * + * @param usesTaskDependencies the usesTaskDependencies value to set. + * @return the BatchJobCreateParameters object itself. + */ + @Generated + public BatchJobCreateParameters setUsesTaskDependencies(Boolean usesTaskDependencies) { + this.usesTaskDependencies = usesTaskDependencies; + return this; + } + + /** + * Get the priority property: The priority of the Job. Priority values can range from -1000 to 1000, with -1000 + * being the lowest priority and 1000 being the highest priority. The default value is 0. + * + * @return the priority value. + */ + @Generated + public Integer getPriority() { + return this.priority; + } + + /** + * Set the priority property: The priority of the Job. Priority values can range from -1000 to 1000, with -1000 + * being the lowest priority and 1000 being the highest priority. The default value is 0. + * + * @param priority the priority value to set. + * @return the BatchJobCreateParameters object itself. + */ + @Generated + public BatchJobCreateParameters setPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Get the allowTaskPreemption property: Whether Tasks in this job can be preempted by other high priority jobs. If + * the value is set to True, other high priority jobs submitted to the system will take precedence and will be able + * requeue tasks from this job. You can update a job's allowTaskPreemption after it has been created using the + * update job API. + * + * @return the allowTaskPreemption value. + */ + @Generated + public Boolean isAllowTaskPreemption() { + return this.allowTaskPreemption; + } + + /** + * Set the allowTaskPreemption property: Whether Tasks in this job can be preempted by other high priority jobs. If + * the value is set to True, other high priority jobs submitted to the system will take precedence and will be able + * requeue tasks from this job. You can update a job's allowTaskPreemption after it has been created using the + * update job API. + * + * @param allowTaskPreemption the allowTaskPreemption value to set. + * @return the BatchJobCreateParameters object itself. + */ + @Generated + public BatchJobCreateParameters setAllowTaskPreemption(Boolean allowTaskPreemption) { + this.allowTaskPreemption = allowTaskPreemption; + return this; + } + + /** + * Get the maxParallelTasks property: The maximum number of tasks that can be executed in parallel for the job. The + * value of maxParallelTasks must be -1 or greater than 0 if specified. If not specified, the default value is -1, + * which means there's no limit to the number of tasks that can be run at once. You can update a job's + * maxParallelTasks after it has been created using the update job API. + * + * @return the maxParallelTasks value. + */ + @Generated + public Integer getMaxParallelTasks() { + return this.maxParallelTasks; + } + + /** + * Set the maxParallelTasks property: The maximum number of tasks that can be executed in parallel for the job. The + * value of maxParallelTasks must be -1 or greater than 0 if specified. If not specified, the default value is -1, + * which means there's no limit to the number of tasks that can be run at once. You can update a job's + * maxParallelTasks after it has been created using the update job API. + * + * @param maxParallelTasks the maxParallelTasks value to set. + * @return the BatchJobCreateParameters object itself. + */ + @Generated + public BatchJobCreateParameters setMaxParallelTasks(Integer maxParallelTasks) { + this.maxParallelTasks = maxParallelTasks; + return this; + } + + /** + * Get the constraints property: The execution constraints for the Job. + * + * @return the constraints value. + */ + @Generated + public BatchJobConstraints getConstraints() { + return this.constraints; + } + + /** + * Set the constraints property: The execution constraints for the Job. + * + * @param constraints the constraints value to set. + * @return the BatchJobCreateParameters object itself. + */ + @Generated + public BatchJobCreateParameters setConstraints(BatchJobConstraints constraints) { + this.constraints = constraints; + return this; + } + + /** + * Get the jobManagerTask property: Details of a Job Manager Task to be launched when the Job is started. If the Job + * does not specify a Job Manager Task, the user must explicitly add Tasks to the Job. If the Job does specify a Job + * Manager Task, the Batch service creates the Job Manager Task when the Job is created, and will try to schedule + * the Job Manager Task before scheduling other Tasks in the Job. The Job Manager Task's typical purpose is to + * control and/or monitor Job execution, for example by deciding what additional Tasks to run, determining when the + * work is complete, etc. (However, a Job Manager Task is not restricted to these activities - it is a fully-fledged + * Task in the system and perform whatever actions are required for the Job.) For example, a Job Manager Task might + * download a file specified as a parameter, analyze the contents of that file and submit additional Tasks based on + * those contents. + * + * @return the jobManagerTask value. + */ + @Generated + public BatchJobManagerTask getJobManagerTask() { + return this.jobManagerTask; + } + + /** + * Set the jobManagerTask property: Details of a Job Manager Task to be launched when the Job is started. If the Job + * does not specify a Job Manager Task, the user must explicitly add Tasks to the Job. If the Job does specify a Job + * Manager Task, the Batch service creates the Job Manager Task when the Job is created, and will try to schedule + * the Job Manager Task before scheduling other Tasks in the Job. The Job Manager Task's typical purpose is to + * control and/or monitor Job execution, for example by deciding what additional Tasks to run, determining when the + * work is complete, etc. (However, a Job Manager Task is not restricted to these activities - it is a fully-fledged + * Task in the system and perform whatever actions are required for the Job.) For example, a Job Manager Task might + * download a file specified as a parameter, analyze the contents of that file and submit additional Tasks based on + * those contents. + * + * @param jobManagerTask the jobManagerTask value to set. + * @return the BatchJobCreateParameters object itself. + */ + @Generated + public BatchJobCreateParameters setJobManagerTask(BatchJobManagerTask jobManagerTask) { + this.jobManagerTask = jobManagerTask; + return this; + } + + /** + * Get the jobPreparationTask property: The Job Preparation Task. If a Job has a Job Preparation Task, the Batch + * service will run the Job Preparation Task on a Node before starting any Tasks of that Job on that Compute Node. + * + * @return the jobPreparationTask value. + */ + @Generated + public BatchJobPreparationTask getJobPreparationTask() { + return this.jobPreparationTask; + } + + /** + * Set the jobPreparationTask property: The Job Preparation Task. If a Job has a Job Preparation Task, the Batch + * service will run the Job Preparation Task on a Node before starting any Tasks of that Job on that Compute Node. + * + * @param jobPreparationTask the jobPreparationTask value to set. + * @return the BatchJobCreateParameters object itself. + */ + @Generated + public BatchJobCreateParameters setJobPreparationTask(BatchJobPreparationTask jobPreparationTask) { + this.jobPreparationTask = jobPreparationTask; + return this; + } + + /** + * Get the jobReleaseTask property: The Job Release Task. A Job Release Task cannot be specified without also + * specifying a Job Preparation Task for the Job. The Batch service runs the Job Release Task on the Nodes that have + * run the Job Preparation Task. The primary purpose of the Job Release Task is to undo changes to Compute Nodes + * made by the Job Preparation Task. Example activities include deleting local files, or shutting down services that + * were started as part of Job preparation. + * + * @return the jobReleaseTask value. + */ + @Generated + public BatchJobReleaseTask getJobReleaseTask() { + return this.jobReleaseTask; + } + + /** + * Set the jobReleaseTask property: The Job Release Task. A Job Release Task cannot be specified without also + * specifying a Job Preparation Task for the Job. The Batch service runs the Job Release Task on the Nodes that have + * run the Job Preparation Task. The primary purpose of the Job Release Task is to undo changes to Compute Nodes + * made by the Job Preparation Task. Example activities include deleting local files, or shutting down services that + * were started as part of Job preparation. + * + * @param jobReleaseTask the jobReleaseTask value to set. + * @return the BatchJobCreateParameters object itself. + */ + @Generated + public BatchJobCreateParameters setJobReleaseTask(BatchJobReleaseTask jobReleaseTask) { + this.jobReleaseTask = jobReleaseTask; + return this; + } + + /** + * Get the commonEnvironmentSettings property: The list of common environment variable settings. These environment + * variables are set for all Tasks in the Job (including the Job Manager, Job Preparation and Job Release Tasks). + * Individual Tasks can override an environment setting specified here by specifying the same setting name with a + * different value. + * + * @return the commonEnvironmentSettings value. + */ + @Generated + public List getCommonEnvironmentSettings() { + return this.commonEnvironmentSettings; + } + + /** + * Set the commonEnvironmentSettings property: The list of common environment variable settings. These environment + * variables are set for all Tasks in the Job (including the Job Manager, Job Preparation and Job Release Tasks). + * Individual Tasks can override an environment setting specified here by specifying the same setting name with a + * different value. + * + * @param commonEnvironmentSettings the commonEnvironmentSettings value to set. + * @return the BatchJobCreateParameters object itself. + */ + @Generated + public BatchJobCreateParameters setCommonEnvironmentSettings(List commonEnvironmentSettings) { + this.commonEnvironmentSettings = commonEnvironmentSettings; + return this; + } + + /** + * Get the poolInfo property: The Pool on which the Batch service runs the Job's Tasks. + * + * @return the poolInfo value. + */ + @Generated + public BatchPoolInfo getPoolInfo() { + return this.poolInfo; + } + + /** + * Get the allTasksCompleteMode property: The action the Batch service should take when all Tasks in the Job are in + * the completed state. Note that if a Job contains no Tasks, then all Tasks are considered complete. This option is + * therefore most commonly used with a Job Manager task; if you want to use automatic Job termination without a Job + * Manager, you should initially set onAllTasksComplete to noaction and update the Job properties to set + * onAllTasksComplete to terminatejob once you have finished adding Tasks. The default is noaction. + * + * @return the allTasksCompleteMode value. + */ + @Generated + public BatchAllTasksCompleteMode getAllTasksCompleteMode() { + return this.allTasksCompleteMode; + } + + /** + * Set the allTasksCompleteMode property: The action the Batch service should take when all Tasks in the Job are in + * the completed state. Note that if a Job contains no Tasks, then all Tasks are considered complete. This option is + * therefore most commonly used with a Job Manager task; if you want to use automatic Job termination without a Job + * Manager, you should initially set onAllTasksComplete to noaction and update the Job properties to set + * onAllTasksComplete to terminatejob once you have finished adding Tasks. The default is noaction. + * + * @param allTasksCompleteMode the allTasksCompleteMode value to set. + * @return the BatchJobCreateParameters object itself. + */ + @Generated + public BatchJobCreateParameters setAllTasksCompleteMode(BatchAllTasksCompleteMode allTasksCompleteMode) { + this.allTasksCompleteMode = allTasksCompleteMode; + return this; + } + + /** + * Get the taskFailureMode property: The action the Batch service should take when any Task in the Job fails. A Task + * is considered to have failed if has a failureInfo. A failureInfo is set if the Task completes with a non-zero + * exit code after exhausting its retry count, or if there was an error starting the Task, for example due to a + * resource file download error. The default is noaction. + * + * @return the taskFailureMode value. + */ + @Generated + public BatchTaskFailureMode getTaskFailureMode() { + return this.taskFailureMode; + } + + /** + * Set the taskFailureMode property: The action the Batch service should take when any Task in the Job fails. A Task + * is considered to have failed if has a failureInfo. A failureInfo is set if the Task completes with a non-zero + * exit code after exhausting its retry count, or if there was an error starting the Task, for example due to a + * resource file download error. The default is noaction. + * + * @param taskFailureMode the taskFailureMode value to set. + * @return the BatchJobCreateParameters object itself. + */ + @Generated + public BatchJobCreateParameters setTaskFailureMode(BatchTaskFailureMode taskFailureMode) { + this.taskFailureMode = taskFailureMode; + return this; + } + + /** + * Get the networkConfiguration property: The network configuration for the Job. + * + * @return the networkConfiguration value. + */ + @Generated + public BatchJobNetworkConfiguration getNetworkConfiguration() { + return this.networkConfiguration; + } + + /** + * Set the networkConfiguration property: The network configuration for the Job. + * + * @param networkConfiguration the networkConfiguration value to set. + * @return the BatchJobCreateParameters object itself. + */ + @Generated + public BatchJobCreateParameters setNetworkConfiguration(BatchJobNetworkConfiguration networkConfiguration) { + this.networkConfiguration = networkConfiguration; + return this; + } + + /** + * Get the metadata property: A list of name-value pairs associated with the Job as metadata. The Batch service does + * not assign any meaning to metadata; it is solely for the use of user code. + * + * @return the metadata value. + */ + @Generated + public List getMetadata() { + return this.metadata; + } + + /** + * Set the metadata property: A list of name-value pairs associated with the Job as metadata. The Batch service does + * not assign any meaning to metadata; it is solely for the use of user code. + * + * @param metadata the metadata value to set. + * @return the BatchJobCreateParameters object itself. + */ + @Generated + public BatchJobCreateParameters setMetadata(List metadata) { + this.metadata = metadata; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeJsonField("poolInfo", this.poolInfo); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeBooleanField("usesTaskDependencies", this.usesTaskDependencies); + jsonWriter.writeNumberField("priority", this.priority); + jsonWriter.writeBooleanField("allowTaskPreemption", this.allowTaskPreemption); + jsonWriter.writeNumberField("maxParallelTasks", this.maxParallelTasks); + jsonWriter.writeJsonField("constraints", this.constraints); + jsonWriter.writeJsonField("jobManagerTask", this.jobManagerTask); + jsonWriter.writeJsonField("jobPreparationTask", this.jobPreparationTask); + jsonWriter.writeJsonField("jobReleaseTask", this.jobReleaseTask); + jsonWriter.writeArrayField("commonEnvironmentSettings", this.commonEnvironmentSettings, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("onAllTasksComplete", + this.allTasksCompleteMode == null ? null : this.allTasksCompleteMode.toString()); + jsonWriter.writeStringField("onTaskFailure", + this.taskFailureMode == null ? null : this.taskFailureMode.toString()); + jsonWriter.writeJsonField("networkConfiguration", this.networkConfiguration); + jsonWriter.writeArrayField("metadata", this.metadata, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BatchJobCreateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BatchJobCreateParameters if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BatchJobCreateParameters. + */ + @Generated + public static BatchJobCreateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + BatchPoolInfo poolInfo = null; + String displayName = null; + Boolean usesTaskDependencies = null; + Integer priority = null; + Boolean allowTaskPreemption = null; + Integer maxParallelTasks = null; + BatchJobConstraints constraints = null; + BatchJobManagerTask jobManagerTask = null; + BatchJobPreparationTask jobPreparationTask = null; + BatchJobReleaseTask jobReleaseTask = null; + List commonEnvironmentSettings = null; + BatchAllTasksCompleteMode allTasksCompleteMode = null; + BatchTaskFailureMode taskFailureMode = null; + BatchJobNetworkConfiguration networkConfiguration = null; + List metadata = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("poolInfo".equals(fieldName)) { + poolInfo = BatchPoolInfo.fromJson(reader); + } else if ("displayName".equals(fieldName)) { + displayName = reader.getString(); + } else if ("usesTaskDependencies".equals(fieldName)) { + usesTaskDependencies = reader.getNullable(JsonReader::getBoolean); + } else if ("priority".equals(fieldName)) { + priority = reader.getNullable(JsonReader::getInt); + } else if ("allowTaskPreemption".equals(fieldName)) { + allowTaskPreemption = reader.getNullable(JsonReader::getBoolean); + } else if ("maxParallelTasks".equals(fieldName)) { + maxParallelTasks = reader.getNullable(JsonReader::getInt); + } else if ("constraints".equals(fieldName)) { + constraints = BatchJobConstraints.fromJson(reader); + } else if ("jobManagerTask".equals(fieldName)) { + jobManagerTask = BatchJobManagerTask.fromJson(reader); + } else if ("jobPreparationTask".equals(fieldName)) { + jobPreparationTask = BatchJobPreparationTask.fromJson(reader); + } else if ("jobReleaseTask".equals(fieldName)) { + jobReleaseTask = BatchJobReleaseTask.fromJson(reader); + } else if ("commonEnvironmentSettings".equals(fieldName)) { + commonEnvironmentSettings = reader.readArray(reader1 -> EnvironmentSetting.fromJson(reader1)); + } else if ("onAllTasksComplete".equals(fieldName)) { + allTasksCompleteMode = BatchAllTasksCompleteMode.fromString(reader.getString()); + } else if ("onTaskFailure".equals(fieldName)) { + taskFailureMode = BatchTaskFailureMode.fromString(reader.getString()); + } else if ("networkConfiguration".equals(fieldName)) { + networkConfiguration = BatchJobNetworkConfiguration.fromJson(reader); + } else if ("metadata".equals(fieldName)) { + metadata = reader.readArray(reader1 -> BatchMetadataItem.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + BatchJobCreateParameters deserializedBatchJobCreateParameters = new BatchJobCreateParameters(id, poolInfo); + deserializedBatchJobCreateParameters.displayName = displayName; + deserializedBatchJobCreateParameters.usesTaskDependencies = usesTaskDependencies; + deserializedBatchJobCreateParameters.priority = priority; + deserializedBatchJobCreateParameters.allowTaskPreemption = allowTaskPreemption; + deserializedBatchJobCreateParameters.maxParallelTasks = maxParallelTasks; + deserializedBatchJobCreateParameters.constraints = constraints; + deserializedBatchJobCreateParameters.jobManagerTask = jobManagerTask; + deserializedBatchJobCreateParameters.jobPreparationTask = jobPreparationTask; + deserializedBatchJobCreateParameters.jobReleaseTask = jobReleaseTask; + deserializedBatchJobCreateParameters.commonEnvironmentSettings = commonEnvironmentSettings; + deserializedBatchJobCreateParameters.allTasksCompleteMode = allTasksCompleteMode; + deserializedBatchJobCreateParameters.taskFailureMode = taskFailureMode; + deserializedBatchJobCreateParameters.networkConfiguration = networkConfiguration; + deserializedBatchJobCreateParameters.metadata = metadata; + + return deserializedBatchJobCreateParameters; + }); + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobDeleteOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobDeleteOptions.java new file mode 100644 index 000000000000..da85b3da0a3e --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobDeleteOptions.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Delete Job operation. + */ +@Fluent +public final class BatchJobDeleteOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /* + * If true, the server will delete the Job even if the corresponding nodes have not fully processed the deletion. + * The default value is false. + */ + @Generated + private Boolean force; + + /** + * Creates an instance of BatchJobDeleteOptions class. + */ + @Generated + public BatchJobDeleteOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchJobDeleteOptions object itself. + */ + @Generated + public BatchJobDeleteOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } + + /** + * Get the force property: If true, the server will delete the Job even if the corresponding nodes have not fully + * processed the deletion. The default value is false. + * + * @return the force value. + */ + @Generated + public Boolean isForce() { + return this.force; + } + + /** + * Set the force property: If true, the server will delete the Job even if the corresponding nodes have not fully + * processed the deletion. The default value is false. + * + * @param force the force value to set. + * @return the BatchJobDeleteOptions object itself. + */ + @Generated + public BatchJobDeleteOptions setForce(Boolean force) { + this.force = force; + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobDisableOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobDisableOptions.java new file mode 100644 index 000000000000..e28e4480756e --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobDisableOptions.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Disable Job operation. + */ +@Fluent +public final class BatchJobDisableOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /** + * Creates an instance of BatchJobDisableOptions class. + */ + @Generated + public BatchJobDisableOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchJobDisableOptions object itself. + */ + @Generated + public BatchJobDisableOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobDisableParameters.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobDisableParameters.java new file mode 100644 index 000000000000..b4c4e2daaef6 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobDisableParameters.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters for disabling an Azure Batch Job. + */ +@Immutable +public final class BatchJobDisableParameters implements JsonSerializable { + /* + * What to do with active Tasks associated with the Job. + */ + @Generated + private final DisableBatchJobOption disableTasks; + + /** + * Creates an instance of BatchJobDisableParameters class. + * + * @param disableTasks the disableTasks value to set. + */ + @Generated + public BatchJobDisableParameters(DisableBatchJobOption disableTasks) { + this.disableTasks = disableTasks; + } + + /** + * Get the disableTasks property: What to do with active Tasks associated with the Job. + * + * @return the disableTasks value. + */ + @Generated + public DisableBatchJobOption getDisableTasks() { + return this.disableTasks; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("disableTasks", this.disableTasks == null ? null : this.disableTasks.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BatchJobDisableParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BatchJobDisableParameters if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BatchJobDisableParameters. + */ + @Generated + public static BatchJobDisableParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DisableBatchJobOption disableTasks = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("disableTasks".equals(fieldName)) { + disableTasks = DisableBatchJobOption.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + return new BatchJobDisableParameters(disableTasks); + }); + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobEnableOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobEnableOptions.java new file mode 100644 index 000000000000..18ad5855801b --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobEnableOptions.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Enable Job operation. + */ +@Fluent +public final class BatchJobEnableOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /** + * Creates an instance of BatchJobEnableOptions class. + */ + @Generated + public BatchJobEnableOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchJobEnableOptions object itself. + */ + @Generated + public BatchJobEnableOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobGetOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobGetOptions.java new file mode 100644 index 000000000000..83142ebb212b --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobGetOptions.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; +import java.util.List; + +/** + * Optional parameters for Get Job operation. + */ +@Fluent +public final class BatchJobGetOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /* + * An OData $select clause. + */ + @Generated + private List select; + + /* + * An OData $expand clause. + */ + @Generated + private List expand; + + /** + * Creates an instance of BatchJobGetOptions class. + */ + @Generated + public BatchJobGetOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchJobGetOptions object itself. + */ + @Generated + public BatchJobGetOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } + + /** + * Get the select property: An OData $select clause. + * + * @return the select value. + */ + @Generated + public List getSelect() { + return this.select; + } + + /** + * Set the select property: An OData $select clause. + * + * @param select the select value to set. + * @return the BatchJobGetOptions object itself. + */ + @Generated + public BatchJobGetOptions setSelect(List select) { + this.select = select; + return this; + } + + /** + * Get the expand property: An OData $expand clause. + * + * @return the expand value. + */ + @Generated + public List getExpand() { + return this.expand; + } + + /** + * Set the expand property: An OData $expand clause. + * + * @param expand the expand value to set. + * @return the BatchJobGetOptions object itself. + */ + @Generated + public BatchJobGetOptions setExpand(List expand) { + this.expand = expand; + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobNetworkConfiguration.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobNetworkConfiguration.java index 1e0a9507e4b9..2fd4c4185619 100644 --- a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobNetworkConfiguration.java +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobNetworkConfiguration.java @@ -37,24 +37,16 @@ public final class BatchJobNetworkConfiguration implements JsonSerializable { String subnetId = null; - boolean skipWithdrawFromVNet = false; + boolean skipWithdrawFromVnet = false; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("subnetId".equals(fieldName)) { subnetId = reader.getString(); } else if ("skipWithdrawFromVNet".equals(fieldName)) { - skipWithdrawFromVNet = reader.getBoolean(); + skipWithdrawFromVnet = reader.getBoolean(); } else { reader.skipChildren(); } } - return new BatchJobNetworkConfiguration(subnetId, skipWithdrawFromVNet); + return new BatchJobNetworkConfiguration(subnetId, skipWithdrawFromVnet); }); } + + /* + * Whether to withdraw Compute Nodes from the virtual network to DNC when the job is terminated or deleted. If true, + * nodes will remain joined to the virtual network to DNC. If false, nodes will automatically withdraw when the job + * ends. Defaults to false. + */ + @Generated + private final boolean skipWithdrawFromVnet; + + /** + * Get the skipWithdrawFromVnet property: Whether to withdraw Compute Nodes from the virtual network to DNC when the + * job is terminated or deleted. If true, nodes will remain joined to the virtual network to DNC. If false, nodes + * will automatically withdraw when the job ends. Defaults to false. + * + * @return the skipWithdrawFromVnet value. + */ + @Generated + public boolean isSkipWithdrawFromVnet() { + return this.skipWithdrawFromVnet; + } } diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobPreparationAndReleaseTaskStatusListOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobPreparationAndReleaseTaskStatusListOptions.java new file mode 100644 index 000000000000..3e8a489e2bf1 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobPreparationAndReleaseTaskStatusListOptions.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; +import java.util.List; + +/** + * Optional parameters for List Jobs From Schedule operation. + */ +@Fluent +public final class BatchJobPreparationAndReleaseTaskStatusListOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /* + * The maximum number of items to return in the response. A maximum of 1000 + * applications can be returned. + */ + @Generated + private Integer maxPageSize; + + /* + * An OData $filter clause. For more information on constructing this filter, see + * https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-job-preparation-and-release-status. + */ + @Generated + private String filter; + + /* + * An OData $select clause. + */ + @Generated + private List select; + + /** + * Creates an instance of BatchJobPreparationAndReleaseTaskStatusListOptions class. + */ + @Generated + public BatchJobPreparationAndReleaseTaskStatusListOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchJobPreparationAndReleaseTaskStatusListOptions object itself. + */ + @Generated + public BatchJobPreparationAndReleaseTaskStatusListOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } + + /** + * Get the maxPageSize property: The maximum number of items to return in the response. A maximum of 1000 + * applications can be returned. + * + * @return the maxPageSize value. + */ + @Generated + public Integer getMaxPageSize() { + return this.maxPageSize; + } + + /** + * Set the maxPageSize property: The maximum number of items to return in the response. A maximum of 1000 + * applications can be returned. + * + * @param maxPageSize the maxPageSize value to set. + * @return the BatchJobPreparationAndReleaseTaskStatusListOptions object itself. + */ + @Generated + public BatchJobPreparationAndReleaseTaskStatusListOptions setMaxPageSize(Integer maxPageSize) { + this.maxPageSize = maxPageSize; + return this; + } + + /** + * Get the filter property: An OData $filter clause. For more information on constructing this filter, see + * https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-job-preparation-and-release-status. + * + * @return the filter value. + */ + @Generated + public String getFilter() { + return this.filter; + } + + /** + * Set the filter property: An OData $filter clause. For more information on constructing this filter, see + * https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-job-preparation-and-release-status. + * + * @param filter the filter value to set. + * @return the BatchJobPreparationAndReleaseTaskStatusListOptions object itself. + */ + @Generated + public BatchJobPreparationAndReleaseTaskStatusListOptions setFilter(String filter) { + this.filter = filter; + return this; + } + + /** + * Get the select property: An OData $select clause. + * + * @return the select value. + */ + @Generated + public List getSelect() { + return this.select; + } + + /** + * Set the select property: An OData $select clause. + * + * @param select the select value to set. + * @return the BatchJobPreparationAndReleaseTaskStatusListOptions object itself. + */ + @Generated + public BatchJobPreparationAndReleaseTaskStatusListOptions setSelect(List select) { + this.select = select; + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobReplaceOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobReplaceOptions.java new file mode 100644 index 000000000000..3375cfa0b94b --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobReplaceOptions.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Replace Job operation. + */ +@Fluent +public final class BatchJobReplaceOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /** + * Creates an instance of BatchJobReplaceOptions class. + */ + @Generated + public BatchJobReplaceOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchJobReplaceOptions object itself. + */ + @Generated + public BatchJobReplaceOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobSchedule.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobSchedule.java index d1b838b80340..76e9ae433239 100644 --- a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobSchedule.java +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobSchedule.java @@ -111,14 +111,7 @@ public final class BatchJobSchedule implements JsonSerializable metadata; - - /* - * The lifetime resource usage statistics for the Job Schedule. The statistics may not be immediately available. The - * Batch service performs periodic roll-up of statistics. The typical delay is about 30 minutes. - */ - @Generated - private BatchJobScheduleStatistics stats; + private List metadata; /** * Creates an instance of BatchJobSchedule class. @@ -288,7 +281,7 @@ public BatchJobScheduleExecutionInfo getExecutionInfo() { * @return the metadata value. */ @Generated - public List getMetadata() { + public List getMetadata() { return this.metadata; } @@ -300,23 +293,11 @@ public List getMetadata() { * @return the BatchJobSchedule object itself. */ @Generated - public BatchJobSchedule setMetadata(List metadata) { + public BatchJobSchedule setMetadata(List metadata) { this.metadata = metadata; return this; } - /** - * Get the stats property: The lifetime resource usage statistics for the Job Schedule. The statistics may not be - * immediately available. The Batch service performs periodic roll-up of statistics. The typical delay is about 30 - * minutes. - * - * @return the stats value. - */ - @Generated - public BatchJobScheduleStatistics getStats() { - return this.stats; - } - /** * {@inheritDoc} */ @@ -355,8 +336,8 @@ public static BatchJobSchedule fromJson(JsonReader jsonReader) throws IOExceptio OffsetDateTime previousStateTransitionTime = null; BatchJobScheduleConfiguration schedule = null; BatchJobScheduleExecutionInfo executionInfo = null; - List metadata = null; - BatchJobScheduleStatistics stats = null; + List metadata = null; + BatchJobScheduleStatistics jobScheduleStatistics = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -391,9 +372,9 @@ public static BatchJobSchedule fromJson(JsonReader jsonReader) throws IOExceptio } else if ("executionInfo".equals(fieldName)) { executionInfo = BatchJobScheduleExecutionInfo.fromJson(reader); } else if ("metadata".equals(fieldName)) { - metadata = reader.readArray(reader1 -> MetadataItem.fromJson(reader1)); + metadata = reader.readArray(reader1 -> BatchMetadataItem.fromJson(reader1)); } else if ("stats".equals(fieldName)) { - stats = BatchJobScheduleStatistics.fromJson(reader); + jobScheduleStatistics = BatchJobScheduleStatistics.fromJson(reader); } else { reader.skipChildren(); } @@ -412,8 +393,27 @@ public static BatchJobSchedule fromJson(JsonReader jsonReader) throws IOExceptio deserializedBatchJobSchedule.schedule = schedule; deserializedBatchJobSchedule.executionInfo = executionInfo; deserializedBatchJobSchedule.metadata = metadata; - deserializedBatchJobSchedule.stats = stats; + deserializedBatchJobSchedule.jobScheduleStatistics = jobScheduleStatistics; return deserializedBatchJobSchedule; }); } + + /* + * The lifetime resource usage statistics for the Job Schedule. The statistics may not be immediately available. The + * Batch service performs periodic roll-up of statistics. The typical delay is about 30 minutes. + */ + @Generated + private BatchJobScheduleStatistics jobScheduleStatistics; + + /** + * Get the jobScheduleStatistics property: The lifetime resource usage statistics for the Job Schedule. The + * statistics may not be immediately available. The Batch service performs periodic roll-up of statistics. The + * typical delay is about 30 minutes. + * + * @return the jobScheduleStatistics value. + */ + @Generated + public BatchJobScheduleStatistics getJobScheduleStatistics() { + return this.jobScheduleStatistics; + } } diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleCreateOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleCreateOptions.java new file mode 100644 index 000000000000..536e3ac8e310 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleCreateOptions.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Create Job Schedule operation. + */ +@Fluent +public final class BatchJobScheduleCreateOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /** + * Creates an instance of BatchJobScheduleCreateOptions class. + */ + @Generated + public BatchJobScheduleCreateOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchJobScheduleCreateOptions object itself. + */ + @Generated + public BatchJobScheduleCreateOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleCreateParameters.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleCreateParameters.java new file mode 100644 index 000000000000..2302ab21c2fa --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleCreateParameters.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Parameters for creating an Azure Batch Job Schedule. + */ +@Fluent +public final class BatchJobScheduleCreateParameters implements JsonSerializable { + /* + * A string that uniquely identifies the schedule within the Account. The ID can contain any combination of + * alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is + * case-preserving and case-insensitive (that is, you may not have two IDs within an Account that differ only by + * case). + */ + @Generated + private final String id; + + /* + * The display name for the schedule. The display name need not be unique and can contain any Unicode characters up + * to a maximum length of 1024. + */ + @Generated + private String displayName; + + /* + * The schedule according to which Jobs will be created. All times are fixed respective to UTC and are not impacted + * by daylight saving time. + */ + @Generated + private final BatchJobScheduleConfiguration schedule; + + /* + * The details of the Jobs to be created on this schedule. + */ + @Generated + private final BatchJobSpecification jobSpecification; + + /* + * A list of name-value pairs associated with the schedule as metadata. The Batch service does not assign any + * meaning to metadata; it is solely for the use of user code. + */ + @Generated + private List metadata; + + /** + * Creates an instance of BatchJobScheduleCreateParameters class. + * + * @param id the id value to set. + * @param schedule the schedule value to set. + * @param jobSpecification the jobSpecification value to set. + */ + @Generated + public BatchJobScheduleCreateParameters(String id, BatchJobScheduleConfiguration schedule, + BatchJobSpecification jobSpecification) { + this.id = id; + this.schedule = schedule; + this.jobSpecification = jobSpecification; + } + + /** + * Get the id property: A string that uniquely identifies the schedule within the Account. The ID can contain any + * combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 + * characters. The ID is case-preserving and case-insensitive (that is, you may not have two IDs within an Account + * that differ only by case). + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the displayName property: The display name for the schedule. The display name need not be unique and can + * contain any Unicode characters up to a maximum length of 1024. + * + * @return the displayName value. + */ + @Generated + public String getDisplayName() { + return this.displayName; + } + + /** + * Set the displayName property: The display name for the schedule. The display name need not be unique and can + * contain any Unicode characters up to a maximum length of 1024. + * + * @param displayName the displayName value to set. + * @return the BatchJobScheduleCreateParameters object itself. + */ + @Generated + public BatchJobScheduleCreateParameters setDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the schedule property: The schedule according to which Jobs will be created. All times are fixed respective + * to UTC and are not impacted by daylight saving time. + * + * @return the schedule value. + */ + @Generated + public BatchJobScheduleConfiguration getSchedule() { + return this.schedule; + } + + /** + * Get the jobSpecification property: The details of the Jobs to be created on this schedule. + * + * @return the jobSpecification value. + */ + @Generated + public BatchJobSpecification getJobSpecification() { + return this.jobSpecification; + } + + /** + * Get the metadata property: A list of name-value pairs associated with the schedule as metadata. The Batch service + * does not assign any meaning to metadata; it is solely for the use of user code. + * + * @return the metadata value. + */ + @Generated + public List getMetadata() { + return this.metadata; + } + + /** + * Set the metadata property: A list of name-value pairs associated with the schedule as metadata. The Batch service + * does not assign any meaning to metadata; it is solely for the use of user code. + * + * @param metadata the metadata value to set. + * @return the BatchJobScheduleCreateParameters object itself. + */ + @Generated + public BatchJobScheduleCreateParameters setMetadata(List metadata) { + this.metadata = metadata; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeJsonField("schedule", this.schedule); + jsonWriter.writeJsonField("jobSpecification", this.jobSpecification); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeArrayField("metadata", this.metadata, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BatchJobScheduleCreateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BatchJobScheduleCreateParameters if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BatchJobScheduleCreateParameters. + */ + @Generated + public static BatchJobScheduleCreateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + BatchJobScheduleConfiguration schedule = null; + BatchJobSpecification jobSpecification = null; + String displayName = null; + List metadata = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("schedule".equals(fieldName)) { + schedule = BatchJobScheduleConfiguration.fromJson(reader); + } else if ("jobSpecification".equals(fieldName)) { + jobSpecification = BatchJobSpecification.fromJson(reader); + } else if ("displayName".equals(fieldName)) { + displayName = reader.getString(); + } else if ("metadata".equals(fieldName)) { + metadata = reader.readArray(reader1 -> BatchMetadataItem.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + BatchJobScheduleCreateParameters deserializedBatchJobScheduleCreateParameters + = new BatchJobScheduleCreateParameters(id, schedule, jobSpecification); + deserializedBatchJobScheduleCreateParameters.displayName = displayName; + deserializedBatchJobScheduleCreateParameters.metadata = metadata; + + return deserializedBatchJobScheduleCreateParameters; + }); + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleDeleteOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleDeleteOptions.java new file mode 100644 index 000000000000..dfbf2917a211 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleDeleteOptions.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Delete Job Schedule operation. + */ +@Fluent +public final class BatchJobScheduleDeleteOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /* + * If true, the server will delete the JobSchedule even if the corresponding nodes have not fully processed the + * deletion. The default value is false. + */ + @Generated + private Boolean force; + + /** + * Creates an instance of BatchJobScheduleDeleteOptions class. + */ + @Generated + public BatchJobScheduleDeleteOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchJobScheduleDeleteOptions object itself. + */ + @Generated + public BatchJobScheduleDeleteOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } + + /** + * Get the force property: If true, the server will delete the JobSchedule even if the corresponding nodes have not + * fully processed the deletion. The default value is false. + * + * @return the force value. + */ + @Generated + public Boolean isForce() { + return this.force; + } + + /** + * Set the force property: If true, the server will delete the JobSchedule even if the corresponding nodes have not + * fully processed the deletion. The default value is false. + * + * @param force the force value to set. + * @return the BatchJobScheduleDeleteOptions object itself. + */ + @Generated + public BatchJobScheduleDeleteOptions setForce(Boolean force) { + this.force = force; + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleDisableOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleDisableOptions.java new file mode 100644 index 000000000000..d8df12312453 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleDisableOptions.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Disable Job Schedule operation. + */ +@Fluent +public final class BatchJobScheduleDisableOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /** + * Creates an instance of BatchJobScheduleDisableOptions class. + */ + @Generated + public BatchJobScheduleDisableOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchJobScheduleDisableOptions object itself. + */ + @Generated + public BatchJobScheduleDisableOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleEnableOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleEnableOptions.java new file mode 100644 index 000000000000..097ae41585ca --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleEnableOptions.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Enable Job Schedule operation. + */ +@Fluent +public final class BatchJobScheduleEnableOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /** + * Creates an instance of BatchJobScheduleEnableOptions class. + */ + @Generated + public BatchJobScheduleEnableOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchJobScheduleEnableOptions object itself. + */ + @Generated + public BatchJobScheduleEnableOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleExistsOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleExistsOptions.java index eb178d9a419d..98423bef31a8 100644 --- a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleExistsOptions.java +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleExistsOptions.java @@ -5,6 +5,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; +import java.time.Duration; /** * Optional parameters for Job Schedule Exists operation. @@ -17,7 +18,7 @@ public final class BatchJobScheduleExistsOptions { * value is larger than 30, the default will be used instead.". */ @Generated - private Integer timeOutInSeconds; + private Long timeOutInSeconds; /** * Creates an instance of BatchJobScheduleExistsOptions class. @@ -33,8 +34,11 @@ public BatchJobScheduleExistsOptions() { * @return the timeOutInSeconds value. */ @Generated - public Integer getTimeOutInSeconds() { - return this.timeOutInSeconds; + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); } /** @@ -45,8 +49,12 @@ public Integer getTimeOutInSeconds() { * @return the BatchJobScheduleExistsOptions object itself. */ @Generated - public BatchJobScheduleExistsOptions setTimeOutInSeconds(Integer timeOutInSeconds) { - this.timeOutInSeconds = timeOutInSeconds; + public BatchJobScheduleExistsOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } return this; } } diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleGetOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleGetOptions.java new file mode 100644 index 000000000000..b5906ecca3bf --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleGetOptions.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; +import java.util.List; + +/** + * Optional parameters for Get Job Schedule operation. + */ +@Fluent +public final class BatchJobScheduleGetOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /* + * An OData $select clause. + */ + @Generated + private List select; + + /* + * An OData $expand clause. + */ + @Generated + private List expand; + + /** + * Creates an instance of BatchJobScheduleGetOptions class. + */ + @Generated + public BatchJobScheduleGetOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchJobScheduleGetOptions object itself. + */ + @Generated + public BatchJobScheduleGetOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } + + /** + * Get the select property: An OData $select clause. + * + * @return the select value. + */ + @Generated + public List getSelect() { + return this.select; + } + + /** + * Set the select property: An OData $select clause. + * + * @param select the select value to set. + * @return the BatchJobScheduleGetOptions object itself. + */ + @Generated + public BatchJobScheduleGetOptions setSelect(List select) { + this.select = select; + return this; + } + + /** + * Get the expand property: An OData $expand clause. + * + * @return the expand value. + */ + @Generated + public List getExpand() { + return this.expand; + } + + /** + * Set the expand property: An OData $expand clause. + * + * @param expand the expand value to set. + * @return the BatchJobScheduleGetOptions object itself. + */ + @Generated + public BatchJobScheduleGetOptions setExpand(List expand) { + this.expand = expand; + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleReplaceOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleReplaceOptions.java new file mode 100644 index 000000000000..32a34d5d282b --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleReplaceOptions.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Replace Job Schedule operation. + */ +@Fluent +public final class BatchJobScheduleReplaceOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /** + * Creates an instance of BatchJobScheduleReplaceOptions class. + */ + @Generated + public BatchJobScheduleReplaceOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchJobScheduleReplaceOptions object itself. + */ + @Generated + public BatchJobScheduleReplaceOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleStatistics.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleStatistics.java index 3193e5b1b68e..66c844700daa 100644 --- a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleStatistics.java +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleStatistics.java @@ -64,50 +64,6 @@ public final class BatchJobScheduleStatistics implements JsonSerializable Duration.parse(nonNullReader.getString())); } else if ("readIOps".equals(fieldName)) { - readIOps = reader.getNullable(nonNullReader -> Long.parseLong(nonNullReader.getString())); + readIops = reader.getNullable(nonNullReader -> Long.parseLong(nonNullReader.getString())); } else if ("writeIOps".equals(fieldName)) { - writeIOps = reader.getNullable(nonNullReader -> Long.parseLong(nonNullReader.getString())); + writeIops = reader.getNullable(nonNullReader -> Long.parseLong(nonNullReader.getString())); } else if ("readIOGiB".equals(fieldName)) { - readIOGiB = reader.getDouble(); + readIoGiB = reader.getDouble(); } else if ("writeIOGiB".equals(fieldName)) { - writeIOGiB = reader.getDouble(); + writeIoGiB = reader.getDouble(); } else if ("numSucceededTasks".equals(fieldName)) { - numSucceededTasks = reader.getNullable(nonNullReader -> Long.parseLong(nonNullReader.getString())); + succeededTasksCount + = reader.getNullable(nonNullReader -> Long.parseLong(nonNullReader.getString())); } else if ("numFailedTasks".equals(fieldName)) { - numFailedTasks = reader.getNullable(nonNullReader -> Long.parseLong(nonNullReader.getString())); + failedTasksCount = reader.getNullable(nonNullReader -> Long.parseLong(nonNullReader.getString())); } else if ("numTaskRetries".equals(fieldName)) { - numTaskRetries = reader.getNullable(nonNullReader -> Long.parseLong(nonNullReader.getString())); + taskRetriesCount = reader.getNullable(nonNullReader -> Long.parseLong(nonNullReader.getString())); } else if ("waitTime".equals(fieldName)) { waitTime = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); } else { @@ -402,8 +282,129 @@ public static BatchJobScheduleStatistics fromJson(JsonReader jsonReader) throws } } return new BatchJobScheduleStatistics(url, startTime, lastUpdateTime, userCpuTime, kernelCpuTime, - wallClockTime, readIOps, writeIOps, readIOGiB, writeIOGiB, numSucceededTasks, numFailedTasks, - numTaskRetries, waitTime); + wallClockTime, readIops, writeIops, readIoGiB, writeIoGiB, succeededTasksCount, failedTasksCount, + taskRetriesCount, waitTime); }); } + + /* + * The total number of disk read operations made by all Tasks in all Jobs created under the schedule. + */ + @Generated + private final long readIops; + + /* + * The total number of disk write operations made by all Tasks in all Jobs created under the schedule. + */ + @Generated + private final long writeIops; + + /* + * The total gibibytes read from disk by all Tasks in all Jobs created under the schedule. + */ + @Generated + private final double readIoGiB; + + /* + * The total gibibytes written to disk by all Tasks in all Jobs created under the schedule. + */ + @Generated + private final double writeIoGiB; + + /* + * The total number of Tasks successfully completed during the given time range in Jobs created under the schedule. + * A Task completes successfully if it returns exit code 0. + */ + @Generated + private final long succeededTasksCount; + + /* + * The total number of Tasks that failed during the given time range in Jobs created under the schedule. A Task + * fails if it exhausts its maximum retry count without returning exit code 0. + */ + @Generated + private final long failedTasksCount; + + /* + * The total number of retries during the given time range on all Tasks in all Jobs created under the schedule. + */ + @Generated + private final long taskRetriesCount; + + /** + * Get the readIops property: The total number of disk read operations made by all Tasks in all Jobs created under + * the schedule. + * + * @return the readIops value. + */ + @Generated + public long getReadIops() { + return this.readIops; + } + + /** + * Get the writeIops property: The total number of disk write operations made by all Tasks in all Jobs created under + * the schedule. + * + * @return the writeIops value. + */ + @Generated + public long getWriteIops() { + return this.writeIops; + } + + /** + * Get the readIoGiB property: The total gibibytes read from disk by all Tasks in all Jobs created under the + * schedule. + * + * @return the readIoGiB value. + */ + @Generated + public double getReadIoGiB() { + return this.readIoGiB; + } + + /** + * Get the writeIoGiB property: The total gibibytes written to disk by all Tasks in all Jobs created under the + * schedule. + * + * @return the writeIoGiB value. + */ + @Generated + public double getWriteIoGiB() { + return this.writeIoGiB; + } + + /** + * Get the succeededTasksCount property: The total number of Tasks successfully completed during the given time + * range in Jobs created under the schedule. A Task completes successfully if it returns exit code 0. + * + * @return the succeededTasksCount value. + */ + @Generated + public long getSucceededTasksCount() { + return this.succeededTasksCount; + } + + /** + * Get the failedTasksCount property: The total number of Tasks that failed during the given time range in Jobs + * created under the schedule. A Task fails if it exhausts its maximum retry count without returning exit code 0. + * + * @return the failedTasksCount value. + */ + @Generated + public long getFailedTasksCount() { + return this.failedTasksCount; + } + + /** + * Get the taskRetriesCount property: The total number of retries during the given time range on all Tasks in all + * Jobs created under the schedule. + * + * @return the taskRetriesCount value. + */ + @Generated + public long getTaskRetriesCount() { + return this.taskRetriesCount; + } } diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleTerminateOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleTerminateOptions.java new file mode 100644 index 000000000000..fe67e6bd52fb --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleTerminateOptions.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Terminate Job Schedule operation. + */ +@Fluent +public final class BatchJobScheduleTerminateOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /* + * If true, the server will terminate the JobSchedule even if the corresponding nodes have not fully processed the + * termination. The default value is false. + */ + @Generated + private Boolean force; + + /** + * Creates an instance of BatchJobScheduleTerminateOptions class. + */ + @Generated + public BatchJobScheduleTerminateOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchJobScheduleTerminateOptions object itself. + */ + @Generated + public BatchJobScheduleTerminateOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } + + /** + * Get the force property: If true, the server will terminate the JobSchedule even if the corresponding nodes have + * not fully processed the termination. The default value is false. + * + * @return the force value. + */ + @Generated + public Boolean isForce() { + return this.force; + } + + /** + * Set the force property: If true, the server will terminate the JobSchedule even if the corresponding nodes have + * not fully processed the termination. The default value is false. + * + * @param force the force value to set. + * @return the BatchJobScheduleTerminateOptions object itself. + */ + @Generated + public BatchJobScheduleTerminateOptions setForce(Boolean force) { + this.force = force; + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleUpdateOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleUpdateOptions.java new file mode 100644 index 000000000000..40e31d9bb58c --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleUpdateOptions.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Get Job Schedule operation. + */ +@Fluent +public final class BatchJobScheduleUpdateOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /** + * Creates an instance of BatchJobScheduleUpdateOptions class. + */ + @Generated + public BatchJobScheduleUpdateOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchJobScheduleUpdateOptions object itself. + */ + @Generated + public BatchJobScheduleUpdateOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleUpdateParameters.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleUpdateParameters.java new file mode 100644 index 000000000000..7958e25464ba --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleUpdateParameters.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Parameters for updating an Azure Batch Job Schedule. + */ +@Fluent +public final class BatchJobScheduleUpdateParameters implements JsonSerializable { + /* + * The schedule according to which Jobs will be created. All times are fixed respective to UTC and are not impacted + * by daylight saving time. If you do not specify this element, the existing schedule is left unchanged. + */ + @Generated + private BatchJobScheduleConfiguration schedule; + + /* + * The details of the Jobs to be created on this schedule. Updates affect only Jobs that are started after the + * update has taken place. Any currently active Job continues with the older specification. + */ + @Generated + private BatchJobSpecification jobSpecification; + + /* + * A list of name-value pairs associated with the Job Schedule as metadata. If you do not specify this element, + * existing metadata is left unchanged. + */ + @Generated + private List metadata; + + /** + * Creates an instance of BatchJobScheduleUpdateParameters class. + */ + @Generated + public BatchJobScheduleUpdateParameters() { + } + + /** + * Get the schedule property: The schedule according to which Jobs will be created. All times are fixed respective + * to UTC and are not impacted by daylight saving time. If you do not specify this element, the existing schedule is + * left unchanged. + * + * @return the schedule value. + */ + @Generated + public BatchJobScheduleConfiguration getSchedule() { + return this.schedule; + } + + /** + * Set the schedule property: The schedule according to which Jobs will be created. All times are fixed respective + * to UTC and are not impacted by daylight saving time. If you do not specify this element, the existing schedule is + * left unchanged. + * + * @param schedule the schedule value to set. + * @return the BatchJobScheduleUpdateParameters object itself. + */ + @Generated + public BatchJobScheduleUpdateParameters setSchedule(BatchJobScheduleConfiguration schedule) { + this.schedule = schedule; + return this; + } + + /** + * Get the jobSpecification property: The details of the Jobs to be created on this schedule. Updates affect only + * Jobs that are started after the update has taken place. Any currently active Job continues with the older + * specification. + * + * @return the jobSpecification value. + */ + @Generated + public BatchJobSpecification getJobSpecification() { + return this.jobSpecification; + } + + /** + * Set the jobSpecification property: The details of the Jobs to be created on this schedule. Updates affect only + * Jobs that are started after the update has taken place. Any currently active Job continues with the older + * specification. + * + * @param jobSpecification the jobSpecification value to set. + * @return the BatchJobScheduleUpdateParameters object itself. + */ + @Generated + public BatchJobScheduleUpdateParameters setJobSpecification(BatchJobSpecification jobSpecification) { + this.jobSpecification = jobSpecification; + return this; + } + + /** + * Get the metadata property: A list of name-value pairs associated with the Job Schedule as metadata. If you do not + * specify this element, existing metadata is left unchanged. + * + * @return the metadata value. + */ + @Generated + public List getMetadata() { + return this.metadata; + } + + /** + * Set the metadata property: A list of name-value pairs associated with the Job Schedule as metadata. If you do not + * specify this element, existing metadata is left unchanged. + * + * @param metadata the metadata value to set. + * @return the BatchJobScheduleUpdateParameters object itself. + */ + @Generated + public BatchJobScheduleUpdateParameters setMetadata(List metadata) { + this.metadata = metadata; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("schedule", this.schedule); + jsonWriter.writeJsonField("jobSpecification", this.jobSpecification); + jsonWriter.writeArrayField("metadata", this.metadata, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BatchJobScheduleUpdateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BatchJobScheduleUpdateParameters if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BatchJobScheduleUpdateParameters. + */ + @Generated + public static BatchJobScheduleUpdateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BatchJobScheduleUpdateParameters deserializedBatchJobScheduleUpdateParameters + = new BatchJobScheduleUpdateParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("schedule".equals(fieldName)) { + deserializedBatchJobScheduleUpdateParameters.schedule + = BatchJobScheduleConfiguration.fromJson(reader); + } else if ("jobSpecification".equals(fieldName)) { + deserializedBatchJobScheduleUpdateParameters.jobSpecification + = BatchJobSpecification.fromJson(reader); + } else if ("metadata".equals(fieldName)) { + List metadata = reader.readArray(reader1 -> BatchMetadataItem.fromJson(reader1)); + deserializedBatchJobScheduleUpdateParameters.metadata = metadata; + } else { + reader.skipChildren(); + } + } + + return deserializedBatchJobScheduleUpdateParameters; + }); + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobSchedulesListOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobSchedulesListOptions.java new file mode 100644 index 000000000000..6d3b79f291da --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobSchedulesListOptions.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; +import java.util.List; + +/** + * Optional parameters for List Job Schedules operation. + */ +@Fluent +public final class BatchJobSchedulesListOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /* + * The maximum number of items to return in the response. A maximum of 1000 + * applications can be returned. + */ + @Generated + private Integer maxPageSize; + + /* + * An OData $filter clause. For more information on constructing this filter, see + * https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-job-schedules. + */ + @Generated + private String filter; + + /* + * An OData $select clause. + */ + @Generated + private List select; + + /* + * An OData $expand clause. + */ + @Generated + private List expand; + + /** + * Creates an instance of BatchJobSchedulesListOptions class. + */ + @Generated + public BatchJobSchedulesListOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchJobSchedulesListOptions object itself. + */ + @Generated + public BatchJobSchedulesListOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } + + /** + * Get the maxPageSize property: The maximum number of items to return in the response. A maximum of 1000 + * applications can be returned. + * + * @return the maxPageSize value. + */ + @Generated + public Integer getMaxPageSize() { + return this.maxPageSize; + } + + /** + * Set the maxPageSize property: The maximum number of items to return in the response. A maximum of 1000 + * applications can be returned. + * + * @param maxPageSize the maxPageSize value to set. + * @return the BatchJobSchedulesListOptions object itself. + */ + @Generated + public BatchJobSchedulesListOptions setMaxPageSize(Integer maxPageSize) { + this.maxPageSize = maxPageSize; + return this; + } + + /** + * Get the filter property: An OData $filter clause. For more information on constructing this filter, see + * https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-job-schedules. + * + * @return the filter value. + */ + @Generated + public String getFilter() { + return this.filter; + } + + /** + * Set the filter property: An OData $filter clause. For more information on constructing this filter, see + * https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-job-schedules. + * + * @param filter the filter value to set. + * @return the BatchJobSchedulesListOptions object itself. + */ + @Generated + public BatchJobSchedulesListOptions setFilter(String filter) { + this.filter = filter; + return this; + } + + /** + * Get the select property: An OData $select clause. + * + * @return the select value. + */ + @Generated + public List getSelect() { + return this.select; + } + + /** + * Set the select property: An OData $select clause. + * + * @param select the select value to set. + * @return the BatchJobSchedulesListOptions object itself. + */ + @Generated + public BatchJobSchedulesListOptions setSelect(List select) { + this.select = select; + return this; + } + + /** + * Get the expand property: An OData $expand clause. + * + * @return the expand value. + */ + @Generated + public List getExpand() { + return this.expand; + } + + /** + * Set the expand property: An OData $expand clause. + * + * @param expand the expand value to set. + * @return the BatchJobSchedulesListOptions object itself. + */ + @Generated + public BatchJobSchedulesListOptions setExpand(List expand) { + this.expand = expand; + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobSchedulingError.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobSchedulingError.java index f76d2996c126..192a85b43586 100644 --- a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobSchedulingError.java +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobSchedulingError.java @@ -22,7 +22,7 @@ public final class BatchJobSchedulingError implements JsonSerializable details; - /** - * Creates an instance of BatchJobSchedulingError class. - * - * @param category the category value to set. - */ - @Generated - private BatchJobSchedulingError(ErrorCategory category) { - this.category = category; - } - /** * Get the category property: The category of the Job scheduling error. * * @return the category value. */ @Generated - public ErrorCategory getCategory() { + public BatchErrorSourceCategory getCategory() { return this.category; } @@ -120,7 +110,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { @Generated public static BatchJobSchedulingError fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - ErrorCategory category = null; + BatchErrorSourceCategory category = null; String code = null; String message = null; List details = null; @@ -128,7 +118,7 @@ public static BatchJobSchedulingError fromJson(JsonReader jsonReader) throws IOE String fieldName = reader.getFieldName(); reader.nextToken(); if ("category".equals(fieldName)) { - category = ErrorCategory.fromString(reader.getString()); + category = BatchErrorSourceCategory.fromString(reader.getString()); } else if ("code".equals(fieldName)) { code = reader.getString(); } else if ("message".equals(fieldName)) { @@ -146,4 +136,14 @@ public static BatchJobSchedulingError fromJson(JsonReader jsonReader) throws IOE return deserializedBatchJobSchedulingError; }); } + + /** + * Creates an instance of BatchJobSchedulingError class. + * + * @param category the category value to set. + */ + @Generated + private BatchJobSchedulingError(BatchErrorSourceCategory category) { + this.category = category; + } } diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobSpecification.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobSpecification.java index 0a25f3fbffe3..ca501766790e 100644 --- a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobSpecification.java +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobSpecification.java @@ -57,25 +57,6 @@ public final class BatchJobSpecification implements JsonSerializable metadata; + private List metadata; /** * Creates an instance of BatchJobSpecification class. @@ -277,66 +258,6 @@ public BatchJobSpecification setUsesTaskDependencies(Boolean usesTaskDependencie return this; } - /** - * Get the onAllTasksComplete property: The action the Batch service should take when all Tasks in a Job created - * under this schedule are in the completed state. Note that if a Job contains no Tasks, then all Tasks are - * considered complete. This option is therefore most commonly used with a Job Manager task; if you want to use - * automatic Job termination without a Job Manager, you should initially set onAllTasksComplete to noaction and - * update the Job properties to set onAllTasksComplete to terminatejob once you have finished adding Tasks. The - * default is noaction. - * - * @return the onAllTasksComplete value. - */ - @Generated - public OnAllBatchTasksComplete getOnAllTasksComplete() { - return this.onAllTasksComplete; - } - - /** - * Set the onAllTasksComplete property: The action the Batch service should take when all Tasks in a Job created - * under this schedule are in the completed state. Note that if a Job contains no Tasks, then all Tasks are - * considered complete. This option is therefore most commonly used with a Job Manager task; if you want to use - * automatic Job termination without a Job Manager, you should initially set onAllTasksComplete to noaction and - * update the Job properties to set onAllTasksComplete to terminatejob once you have finished adding Tasks. The - * default is noaction. - * - * @param onAllTasksComplete the onAllTasksComplete value to set. - * @return the BatchJobSpecification object itself. - */ - @Generated - public BatchJobSpecification setOnAllTasksComplete(OnAllBatchTasksComplete onAllTasksComplete) { - this.onAllTasksComplete = onAllTasksComplete; - return this; - } - - /** - * Get the onTaskFailure property: The action the Batch service should take when any Task fails in a Job created - * under this schedule. A Task is considered to have failed if it have failed if has a failureInfo. A failureInfo is - * set if the Task completes with a non-zero exit code after exhausting its retry count, or if there was an error - * starting the Task, for example due to a resource file download error. The default is noaction. - * - * @return the onTaskFailure value. - */ - @Generated - public OnBatchTaskFailure getOnTaskFailure() { - return this.onTaskFailure; - } - - /** - * Set the onTaskFailure property: The action the Batch service should take when any Task fails in a Job created - * under this schedule. A Task is considered to have failed if it have failed if has a failureInfo. A failureInfo is - * set if the Task completes with a non-zero exit code after exhausting its retry count, or if there was an error - * starting the Task, for example due to a resource file download error. The default is noaction. - * - * @param onTaskFailure the onTaskFailure value to set. - * @return the BatchJobSpecification object itself. - */ - @Generated - public BatchJobSpecification setOnTaskFailure(OnBatchTaskFailure onTaskFailure) { - this.onTaskFailure = onTaskFailure; - return this; - } - /** * Get the networkConfiguration property: The network configuration for the Job. * @@ -511,7 +432,7 @@ public BatchPoolInfo getPoolInfo() { * @return the metadata value. */ @Generated - public List getMetadata() { + public List getMetadata() { return this.metadata; } @@ -523,7 +444,7 @@ public List getMetadata() { * @return the BatchJobSpecification object itself. */ @Generated - public BatchJobSpecification setMetadata(List metadata) { + public BatchJobSpecification setMetadata(List metadata) { this.metadata = metadata; return this; } @@ -542,8 +463,9 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("displayName", this.displayName); jsonWriter.writeBooleanField("usesTaskDependencies", this.usesTaskDependencies); jsonWriter.writeStringField("onAllTasksComplete", - this.onAllTasksComplete == null ? null : this.onAllTasksComplete.toString()); - jsonWriter.writeStringField("onTaskFailure", this.onTaskFailure == null ? null : this.onTaskFailure.toString()); + this.allTasksCompleteMode == null ? null : this.allTasksCompleteMode.toString()); + jsonWriter.writeStringField("onTaskFailure", + this.taskFailureMode == null ? null : this.taskFailureMode.toString()); jsonWriter.writeJsonField("networkConfiguration", this.networkConfiguration); jsonWriter.writeJsonField("constraints", this.constraints); jsonWriter.writeJsonField("jobManagerTask", this.jobManagerTask); @@ -573,15 +495,15 @@ public static BatchJobSpecification fromJson(JsonReader jsonReader) throws IOExc Integer maxParallelTasks = null; String displayName = null; Boolean usesTaskDependencies = null; - OnAllBatchTasksComplete onAllTasksComplete = null; - OnBatchTaskFailure onTaskFailure = null; + BatchAllTasksCompleteMode allTasksCompleteMode = null; + BatchTaskFailureMode taskFailureMode = null; BatchJobNetworkConfiguration networkConfiguration = null; BatchJobConstraints constraints = null; BatchJobManagerTask jobManagerTask = null; BatchJobPreparationTask jobPreparationTask = null; BatchJobReleaseTask jobReleaseTask = null; List commonEnvironmentSettings = null; - List metadata = null; + List metadata = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -598,9 +520,9 @@ public static BatchJobSpecification fromJson(JsonReader jsonReader) throws IOExc } else if ("usesTaskDependencies".equals(fieldName)) { usesTaskDependencies = reader.getNullable(JsonReader::getBoolean); } else if ("onAllTasksComplete".equals(fieldName)) { - onAllTasksComplete = OnAllBatchTasksComplete.fromString(reader.getString()); + allTasksCompleteMode = BatchAllTasksCompleteMode.fromString(reader.getString()); } else if ("onTaskFailure".equals(fieldName)) { - onTaskFailure = OnBatchTaskFailure.fromString(reader.getString()); + taskFailureMode = BatchTaskFailureMode.fromString(reader.getString()); } else if ("networkConfiguration".equals(fieldName)) { networkConfiguration = BatchJobNetworkConfiguration.fromJson(reader); } else if ("constraints".equals(fieldName)) { @@ -614,7 +536,7 @@ public static BatchJobSpecification fromJson(JsonReader jsonReader) throws IOExc } else if ("commonEnvironmentSettings".equals(fieldName)) { commonEnvironmentSettings = reader.readArray(reader1 -> EnvironmentSetting.fromJson(reader1)); } else if ("metadata".equals(fieldName)) { - metadata = reader.readArray(reader1 -> MetadataItem.fromJson(reader1)); + metadata = reader.readArray(reader1 -> BatchMetadataItem.fromJson(reader1)); } else { reader.skipChildren(); } @@ -625,8 +547,8 @@ public static BatchJobSpecification fromJson(JsonReader jsonReader) throws IOExc deserializedBatchJobSpecification.maxParallelTasks = maxParallelTasks; deserializedBatchJobSpecification.displayName = displayName; deserializedBatchJobSpecification.usesTaskDependencies = usesTaskDependencies; - deserializedBatchJobSpecification.onAllTasksComplete = onAllTasksComplete; - deserializedBatchJobSpecification.onTaskFailure = onTaskFailure; + deserializedBatchJobSpecification.allTasksCompleteMode = allTasksCompleteMode; + deserializedBatchJobSpecification.taskFailureMode = taskFailureMode; deserializedBatchJobSpecification.networkConfiguration = networkConfiguration; deserializedBatchJobSpecification.constraints = constraints; deserializedBatchJobSpecification.jobManagerTask = jobManagerTask; @@ -637,4 +559,83 @@ public static BatchJobSpecification fromJson(JsonReader jsonReader) throws IOExc return deserializedBatchJobSpecification; }); } + + /* + * The action the Batch service should take when all Tasks in a Job created under this schedule are in the completed + * state. Note that if a Job contains no Tasks, then all Tasks are considered complete. This option is therefore + * most commonly used with a Job Manager task; if you want to use automatic Job termination without a Job Manager, + * you should initially set onAllTasksComplete to noaction and update the Job properties to set onAllTasksComplete + * to terminatejob once you have finished adding Tasks. The default is noaction. + */ + @Generated + private BatchAllTasksCompleteMode allTasksCompleteMode; + + /* + * The action the Batch service should take when any Task fails in a Job created under this schedule. A Task is + * considered to have failed if it have failed if has a failureInfo. A failureInfo is set if the Task completes with + * a non-zero exit code after exhausting its retry count, or if there was an error starting the Task, for example + * due to a resource file download error. The default is noaction. + */ + @Generated + private BatchTaskFailureMode taskFailureMode; + + /** + * Get the allTasksCompleteMode property: The action the Batch service should take when all Tasks in a Job created + * under this schedule are in the completed state. Note that if a Job contains no Tasks, then all Tasks are + * considered complete. This option is therefore most commonly used with a Job Manager task; if you want to use + * automatic Job termination without a Job Manager, you should initially set onAllTasksComplete to noaction and + * update the Job properties to set onAllTasksComplete to terminatejob once you have finished adding Tasks. The + * default is noaction. + * + * @return the allTasksCompleteMode value. + */ + @Generated + public BatchAllTasksCompleteMode getAllTasksCompleteMode() { + return this.allTasksCompleteMode; + } + + /** + * Set the allTasksCompleteMode property: The action the Batch service should take when all Tasks in a Job created + * under this schedule are in the completed state. Note that if a Job contains no Tasks, then all Tasks are + * considered complete. This option is therefore most commonly used with a Job Manager task; if you want to use + * automatic Job termination without a Job Manager, you should initially set onAllTasksComplete to noaction and + * update the Job properties to set onAllTasksComplete to terminatejob once you have finished adding Tasks. The + * default is noaction. + * + * @param allTasksCompleteMode the allTasksCompleteMode value to set. + * @return the BatchJobSpecification object itself. + */ + @Generated + public BatchJobSpecification setAllTasksCompleteMode(BatchAllTasksCompleteMode allTasksCompleteMode) { + this.allTasksCompleteMode = allTasksCompleteMode; + return this; + } + + /** + * Get the taskFailureMode property: The action the Batch service should take when any Task fails in a Job created + * under this schedule. A Task is considered to have failed if it have failed if has a failureInfo. A failureInfo is + * set if the Task completes with a non-zero exit code after exhausting its retry count, or if there was an error + * starting the Task, for example due to a resource file download error. The default is noaction. + * + * @return the taskFailureMode value. + */ + @Generated + public BatchTaskFailureMode getTaskFailureMode() { + return this.taskFailureMode; + } + + /** + * Set the taskFailureMode property: The action the Batch service should take when any Task fails in a Job created + * under this schedule. A Task is considered to have failed if it have failed if has a failureInfo. A failureInfo is + * set if the Task completes with a non-zero exit code after exhausting its retry count, or if there was an error + * starting the Task, for example due to a resource file download error. The default is noaction. + * + * @param taskFailureMode the taskFailureMode value to set. + * @return the BatchJobSpecification object itself. + */ + @Generated + public BatchJobSpecification setTaskFailureMode(BatchTaskFailureMode taskFailureMode) { + this.taskFailureMode = taskFailureMode; + return this; + } } diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobStatistics.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobStatistics.java index 32f1c03b457c..a80f1219c6b9 100644 --- a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobStatistics.java +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobStatistics.java @@ -61,50 +61,6 @@ public final class BatchJobStatistics implements JsonSerializable Duration.parse(nonNullReader.getString())); } else if ("readIOps".equals(fieldName)) { - readIOps = reader.getNullable(nonNullReader -> Long.parseLong(nonNullReader.getString())); + readIops = reader.getNullable(nonNullReader -> Long.parseLong(nonNullReader.getString())); } else if ("writeIOps".equals(fieldName)) { - writeIOps = reader.getNullable(nonNullReader -> Long.parseLong(nonNullReader.getString())); + writeIops = reader.getNullable(nonNullReader -> Long.parseLong(nonNullReader.getString())); } else if ("readIOGiB".equals(fieldName)) { - readIOGiB = reader.getDouble(); + readIoGiB = reader.getDouble(); } else if ("writeIOGiB".equals(fieldName)) { - writeIOGiB = reader.getDouble(); + writeIoGiB = reader.getDouble(); } else if ("numSucceededTasks".equals(fieldName)) { - numSucceededTasks = reader.getNullable(nonNullReader -> Long.parseLong(nonNullReader.getString())); + succeededTasksCount + = reader.getNullable(nonNullReader -> Long.parseLong(nonNullReader.getString())); } else if ("numFailedTasks".equals(fieldName)) { - numFailedTasks = reader.getNullable(nonNullReader -> Long.parseLong(nonNullReader.getString())); + failedTasksCount = reader.getNullable(nonNullReader -> Long.parseLong(nonNullReader.getString())); } else if ("numTaskRetries".equals(fieldName)) { - numTaskRetries = reader.getNullable(nonNullReader -> Long.parseLong(nonNullReader.getString())); + taskRetriesCount = reader.getNullable(nonNullReader -> Long.parseLong(nonNullReader.getString())); } else if ("waitTime".equals(fieldName)) { waitTime = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); } else { @@ -395,8 +279,125 @@ public static BatchJobStatistics fromJson(JsonReader jsonReader) throws IOExcept } } return new BatchJobStatistics(url, startTime, lastUpdateTime, userCpuTime, kernelCpuTime, wallClockTime, - readIOps, writeIOps, readIOGiB, writeIOGiB, numSucceededTasks, numFailedTasks, numTaskRetries, + readIops, writeIops, readIoGiB, writeIoGiB, succeededTasksCount, failedTasksCount, taskRetriesCount, waitTime); }); } + + /* + * The total number of disk read operations made by all Tasks in the Job. + */ + @Generated + private final long readIops; + + /* + * The total number of disk write operations made by all Tasks in the Job. + */ + @Generated + private final long writeIops; + + /* + * The total amount of data in GiB read from disk by all Tasks in the Job. + */ + @Generated + private final double readIoGiB; + + /* + * The total amount of data in GiB written to disk by all Tasks in the Job. + */ + @Generated + private final double writeIoGiB; + + /* + * The total number of Tasks successfully completed in the Job during the given time range. A Task completes + * successfully if it returns exit code 0. + */ + @Generated + private final long succeededTasksCount; + + /* + * The total number of Tasks in the Job that failed during the given time range. A Task fails if it exhausts its + * maximum retry count without returning exit code 0. + */ + @Generated + private final long failedTasksCount; + + /* + * The total number of retries on all the Tasks in the Job during the given time range. + */ + @Generated + private final long taskRetriesCount; + + /** + * Get the readIops property: The total number of disk read operations made by all Tasks in the Job. + * + * @return the readIops value. + */ + @Generated + public long getReadIops() { + return this.readIops; + } + + /** + * Get the writeIops property: The total number of disk write operations made by all Tasks in the Job. + * + * @return the writeIops value. + */ + @Generated + public long getWriteIops() { + return this.writeIops; + } + + /** + * Get the readIoGiB property: The total amount of data in GiB read from disk by all Tasks in the Job. + * + * @return the readIoGiB value. + */ + @Generated + public double getReadIoGiB() { + return this.readIoGiB; + } + + /** + * Get the writeIoGiB property: The total amount of data in GiB written to disk by all Tasks in the Job. + * + * @return the writeIoGiB value. + */ + @Generated + public double getWriteIoGiB() { + return this.writeIoGiB; + } + + /** + * Get the succeededTasksCount property: The total number of Tasks successfully completed in the Job during the + * given time range. A Task completes successfully if it returns exit code 0. + * + * @return the succeededTasksCount value. + */ + @Generated + public long getSucceededTasksCount() { + return this.succeededTasksCount; + } + + /** + * Get the failedTasksCount property: The total number of Tasks in the Job that failed during the given time range. + * A Task fails if it exhausts its maximum retry count without returning exit code 0. + * + * @return the failedTasksCount value. + */ + @Generated + public long getFailedTasksCount() { + return this.failedTasksCount; + } + + /** + * Get the taskRetriesCount property: The total number of retries on all the Tasks in the Job during the given time + * range. + * + * @return the taskRetriesCount value. + */ + @Generated + public long getTaskRetriesCount() { + return this.taskRetriesCount; + } } diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobTaskCountsGetOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobTaskCountsGetOptions.java new file mode 100644 index 000000000000..594580ac3ef8 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobTaskCountsGetOptions.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Get Job Task Counts operation. + */ +@Fluent +public final class BatchJobTaskCountsGetOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /** + * Creates an instance of BatchJobTaskCountsGetOptions class. + */ + @Generated + public BatchJobTaskCountsGetOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchJobTaskCountsGetOptions object itself. + */ + @Generated + public BatchJobTaskCountsGetOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobTerminateOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobTerminateOptions.java new file mode 100644 index 000000000000..d6a1e2851631 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobTerminateOptions.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Terminate Job operation. + */ +@Fluent +public final class BatchJobTerminateOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /* + * The options to use for terminating the Job. + */ + @Generated + private BatchJobTerminateParameters parameters; + + /* + * If true, the server will terminate the Job even if the corresponding nodes have not fully processed the + * termination. The default value is false. + */ + @Generated + private Boolean force; + + /** + * Creates an instance of BatchJobTerminateOptions class. + */ + @Generated + public BatchJobTerminateOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchJobTerminateOptions object itself. + */ + @Generated + public BatchJobTerminateOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } + + /** + * Get the parameters property: The options to use for terminating the Job. + * + * @return the parameters value. + */ + @Generated + public BatchJobTerminateParameters getParameters() { + return this.parameters; + } + + /** + * Set the parameters property: The options to use for terminating the Job. + * + * @param parameters the parameters value to set. + * @return the BatchJobTerminateOptions object itself. + */ + @Generated + public BatchJobTerminateOptions setParameters(BatchJobTerminateParameters parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the force property: If true, the server will terminate the Job even if the corresponding nodes have not fully + * processed the termination. The default value is false. + * + * @return the force value. + */ + @Generated + public Boolean isForce() { + return this.force; + } + + /** + * Set the force property: If true, the server will terminate the Job even if the corresponding nodes have not fully + * processed the termination. The default value is false. + * + * @param force the force value to set. + * @return the BatchJobTerminateOptions object itself. + */ + @Generated + public BatchJobTerminateOptions setForce(Boolean force) { + this.force = force; + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobTerminateParameters.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobTerminateParameters.java new file mode 100644 index 000000000000..7660bd7e32a5 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobTerminateParameters.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters for terminating an Azure Batch Job. + */ +@Fluent +public final class BatchJobTerminateParameters implements JsonSerializable { + /* + * The text you want to appear as the Job's TerminationReason. The default is 'UserTerminate'. + */ + @Generated + private String terminationReason; + + /** + * Creates an instance of BatchJobTerminateParameters class. + */ + @Generated + public BatchJobTerminateParameters() { + } + + /** + * Get the terminationReason property: The text you want to appear as the Job's TerminationReason. The default is + * 'UserTerminate'. + * + * @return the terminationReason value. + */ + @Generated + public String getTerminationReason() { + return this.terminationReason; + } + + /** + * Set the terminationReason property: The text you want to appear as the Job's TerminationReason. The default is + * 'UserTerminate'. + * + * @param terminationReason the terminationReason value to set. + * @return the BatchJobTerminateParameters object itself. + */ + @Generated + public BatchJobTerminateParameters setTerminationReason(String terminationReason) { + this.terminationReason = terminationReason; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("terminateReason", this.terminationReason); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BatchJobTerminateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BatchJobTerminateParameters if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BatchJobTerminateParameters. + */ + @Generated + public static BatchJobTerminateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BatchJobTerminateParameters deserializedBatchJobTerminateParameters = new BatchJobTerminateParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("terminateReason".equals(fieldName)) { + deserializedBatchJobTerminateParameters.terminationReason = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBatchJobTerminateParameters; + }); + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobUpdateOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobUpdateOptions.java new file mode 100644 index 000000000000..24aeee108845 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobUpdateOptions.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Update Job operation. + */ +@Fluent +public final class BatchJobUpdateOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /** + * Creates an instance of BatchJobUpdateOptions class. + */ + @Generated + public BatchJobUpdateOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchJobUpdateOptions object itself. + */ + @Generated + public BatchJobUpdateOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobUpdateParameters.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobUpdateParameters.java new file mode 100644 index 000000000000..468d0407f4a0 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobUpdateParameters.java @@ -0,0 +1,366 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Parameters for updating an Azure Batch Job. + */ +@Fluent +public final class BatchJobUpdateParameters implements JsonSerializable { + /* + * The priority of the Job. Priority values can range from -1000 to 1000, with -1000 being the lowest priority and + * 1000 being the highest priority. If omitted, the priority of the Job is left unchanged. + */ + @Generated + private Integer priority; + + /* + * Whether Tasks in this job can be preempted by other high priority jobs. If the value is set to True, other high + * priority jobs submitted to the system will take precedence and will be able requeue tasks from this job. You can + * update a job's allowTaskPreemption after it has been created using the update job API. + */ + @Generated + private Boolean allowTaskPreemption; + + /* + * The maximum number of tasks that can be executed in parallel for the job. The value of maxParallelTasks must be + * -1 or greater than 0 if specified. If not specified, the default value is -1, which means there's no limit to the + * number of tasks that can be run at once. You can update a job's maxParallelTasks after it has been created using + * the update job API. + */ + @Generated + private Integer maxParallelTasks; + + /* + * The execution constraints for the Job. If omitted, the existing execution constraints are left unchanged. + */ + @Generated + private BatchJobConstraints constraints; + + /* + * The Pool on which the Batch service runs the Job's Tasks. You may change the Pool for a Job only when the Job is + * disabled. The Patch Job call will fail if you include the poolInfo element and the Job is not disabled. If you + * specify an autoPoolSpecification in the poolInfo, only the keepAlive property of the autoPoolSpecification can be + * updated, and then only if the autoPoolSpecification has a poolLifetimeOption of Job (other job properties can be + * updated as normal). If omitted, the Job continues to run on its current Pool. + */ + @Generated + private BatchPoolInfo poolInfo; + + /* + * The action the Batch service should take when all Tasks in the Job are in the completed state. If omitted, the + * completion behavior is left unchanged. You may not change the value from terminatejob to noaction - that is, once + * you have engaged automatic Job termination, you cannot turn it off again. If you try to do this, the request + * fails with an 'invalid property value' error response; if you are calling the REST API directly, the HTTP status + * code is 400 (Bad Request). + */ + @Generated + private BatchAllTasksCompleteMode allTasksCompleteMode; + + /* + * A list of name-value pairs associated with the Job as metadata. If omitted, the existing Job metadata is left + * unchanged. + */ + @Generated + private List metadata; + + /* + * The network configuration for the Job. + */ + @Generated + private BatchJobNetworkConfiguration networkConfiguration; + + /** + * Creates an instance of BatchJobUpdateParameters class. + */ + @Generated + public BatchJobUpdateParameters() { + } + + /** + * Get the priority property: The priority of the Job. Priority values can range from -1000 to 1000, with -1000 + * being the lowest priority and 1000 being the highest priority. If omitted, the priority of the Job is left + * unchanged. + * + * @return the priority value. + */ + @Generated + public Integer getPriority() { + return this.priority; + } + + /** + * Set the priority property: The priority of the Job. Priority values can range from -1000 to 1000, with -1000 + * being the lowest priority and 1000 being the highest priority. If omitted, the priority of the Job is left + * unchanged. + * + * @param priority the priority value to set. + * @return the BatchJobUpdateParameters object itself. + */ + @Generated + public BatchJobUpdateParameters setPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Get the allowTaskPreemption property: Whether Tasks in this job can be preempted by other high priority jobs. If + * the value is set to True, other high priority jobs submitted to the system will take precedence and will be able + * requeue tasks from this job. You can update a job's allowTaskPreemption after it has been created using the + * update job API. + * + * @return the allowTaskPreemption value. + */ + @Generated + public Boolean isAllowTaskPreemption() { + return this.allowTaskPreemption; + } + + /** + * Set the allowTaskPreemption property: Whether Tasks in this job can be preempted by other high priority jobs. If + * the value is set to True, other high priority jobs submitted to the system will take precedence and will be able + * requeue tasks from this job. You can update a job's allowTaskPreemption after it has been created using the + * update job API. + * + * @param allowTaskPreemption the allowTaskPreemption value to set. + * @return the BatchJobUpdateParameters object itself. + */ + @Generated + public BatchJobUpdateParameters setAllowTaskPreemption(Boolean allowTaskPreemption) { + this.allowTaskPreemption = allowTaskPreemption; + return this; + } + + /** + * Get the maxParallelTasks property: The maximum number of tasks that can be executed in parallel for the job. The + * value of maxParallelTasks must be -1 or greater than 0 if specified. If not specified, the default value is -1, + * which means there's no limit to the number of tasks that can be run at once. You can update a job's + * maxParallelTasks after it has been created using the update job API. + * + * @return the maxParallelTasks value. + */ + @Generated + public Integer getMaxParallelTasks() { + return this.maxParallelTasks; + } + + /** + * Set the maxParallelTasks property: The maximum number of tasks that can be executed in parallel for the job. The + * value of maxParallelTasks must be -1 or greater than 0 if specified. If not specified, the default value is -1, + * which means there's no limit to the number of tasks that can be run at once. You can update a job's + * maxParallelTasks after it has been created using the update job API. + * + * @param maxParallelTasks the maxParallelTasks value to set. + * @return the BatchJobUpdateParameters object itself. + */ + @Generated + public BatchJobUpdateParameters setMaxParallelTasks(Integer maxParallelTasks) { + this.maxParallelTasks = maxParallelTasks; + return this; + } + + /** + * Get the constraints property: The execution constraints for the Job. If omitted, the existing execution + * constraints are left unchanged. + * + * @return the constraints value. + */ + @Generated + public BatchJobConstraints getConstraints() { + return this.constraints; + } + + /** + * Set the constraints property: The execution constraints for the Job. If omitted, the existing execution + * constraints are left unchanged. + * + * @param constraints the constraints value to set. + * @return the BatchJobUpdateParameters object itself. + */ + @Generated + public BatchJobUpdateParameters setConstraints(BatchJobConstraints constraints) { + this.constraints = constraints; + return this; + } + + /** + * Get the poolInfo property: The Pool on which the Batch service runs the Job's Tasks. You may change the Pool for + * a Job only when the Job is disabled. The Patch Job call will fail if you include the poolInfo element and the Job + * is not disabled. If you specify an autoPoolSpecification in the poolInfo, only the keepAlive property of the + * autoPoolSpecification can be updated, and then only if the autoPoolSpecification has a poolLifetimeOption of Job + * (other job properties can be updated as normal). If omitted, the Job continues to run on its current Pool. + * + * @return the poolInfo value. + */ + @Generated + public BatchPoolInfo getPoolInfo() { + return this.poolInfo; + } + + /** + * Set the poolInfo property: The Pool on which the Batch service runs the Job's Tasks. You may change the Pool for + * a Job only when the Job is disabled. The Patch Job call will fail if you include the poolInfo element and the Job + * is not disabled. If you specify an autoPoolSpecification in the poolInfo, only the keepAlive property of the + * autoPoolSpecification can be updated, and then only if the autoPoolSpecification has a poolLifetimeOption of Job + * (other job properties can be updated as normal). If omitted, the Job continues to run on its current Pool. + * + * @param poolInfo the poolInfo value to set. + * @return the BatchJobUpdateParameters object itself. + */ + @Generated + public BatchJobUpdateParameters setPoolInfo(BatchPoolInfo poolInfo) { + this.poolInfo = poolInfo; + return this; + } + + /** + * Get the allTasksCompleteMode property: The action the Batch service should take when all Tasks in the Job are in + * the completed state. If omitted, the completion behavior is left unchanged. You may not change the value from + * terminatejob to noaction - that is, once you have engaged automatic Job termination, you cannot turn it off + * again. If you try to do this, the request fails with an 'invalid property value' error response; if you are + * calling the REST API directly, the HTTP status code is 400 (Bad Request). + * + * @return the allTasksCompleteMode value. + */ + @Generated + public BatchAllTasksCompleteMode getAllTasksCompleteMode() { + return this.allTasksCompleteMode; + } + + /** + * Set the allTasksCompleteMode property: The action the Batch service should take when all Tasks in the Job are in + * the completed state. If omitted, the completion behavior is left unchanged. You may not change the value from + * terminatejob to noaction - that is, once you have engaged automatic Job termination, you cannot turn it off + * again. If you try to do this, the request fails with an 'invalid property value' error response; if you are + * calling the REST API directly, the HTTP status code is 400 (Bad Request). + * + * @param allTasksCompleteMode the allTasksCompleteMode value to set. + * @return the BatchJobUpdateParameters object itself. + */ + @Generated + public BatchJobUpdateParameters setAllTasksCompleteMode(BatchAllTasksCompleteMode allTasksCompleteMode) { + this.allTasksCompleteMode = allTasksCompleteMode; + return this; + } + + /** + * Get the metadata property: A list of name-value pairs associated with the Job as metadata. If omitted, the + * existing Job metadata is left unchanged. + * + * @return the metadata value. + */ + @Generated + public List getMetadata() { + return this.metadata; + } + + /** + * Set the metadata property: A list of name-value pairs associated with the Job as metadata. If omitted, the + * existing Job metadata is left unchanged. + * + * @param metadata the metadata value to set. + * @return the BatchJobUpdateParameters object itself. + */ + @Generated + public BatchJobUpdateParameters setMetadata(List metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the networkConfiguration property: The network configuration for the Job. + * + * @return the networkConfiguration value. + */ + @Generated + public BatchJobNetworkConfiguration getNetworkConfiguration() { + return this.networkConfiguration; + } + + /** + * Set the networkConfiguration property: The network configuration for the Job. + * + * @param networkConfiguration the networkConfiguration value to set. + * @return the BatchJobUpdateParameters object itself. + */ + @Generated + public BatchJobUpdateParameters setNetworkConfiguration(BatchJobNetworkConfiguration networkConfiguration) { + this.networkConfiguration = networkConfiguration; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("priority", this.priority); + jsonWriter.writeBooleanField("allowTaskPreemption", this.allowTaskPreemption); + jsonWriter.writeNumberField("maxParallelTasks", this.maxParallelTasks); + jsonWriter.writeJsonField("constraints", this.constraints); + jsonWriter.writeJsonField("poolInfo", this.poolInfo); + jsonWriter.writeStringField("onAllTasksComplete", + this.allTasksCompleteMode == null ? null : this.allTasksCompleteMode.toString()); + jsonWriter.writeArrayField("metadata", this.metadata, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("networkConfiguration", this.networkConfiguration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BatchJobUpdateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BatchJobUpdateParameters if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BatchJobUpdateParameters. + */ + @Generated + public static BatchJobUpdateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BatchJobUpdateParameters deserializedBatchJobUpdateParameters = new BatchJobUpdateParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("priority".equals(fieldName)) { + deserializedBatchJobUpdateParameters.priority = reader.getNullable(JsonReader::getInt); + } else if ("allowTaskPreemption".equals(fieldName)) { + deserializedBatchJobUpdateParameters.allowTaskPreemption + = reader.getNullable(JsonReader::getBoolean); + } else if ("maxParallelTasks".equals(fieldName)) { + deserializedBatchJobUpdateParameters.maxParallelTasks = reader.getNullable(JsonReader::getInt); + } else if ("constraints".equals(fieldName)) { + deserializedBatchJobUpdateParameters.constraints = BatchJobConstraints.fromJson(reader); + } else if ("poolInfo".equals(fieldName)) { + deserializedBatchJobUpdateParameters.poolInfo = BatchPoolInfo.fromJson(reader); + } else if ("onAllTasksComplete".equals(fieldName)) { + deserializedBatchJobUpdateParameters.allTasksCompleteMode + = BatchAllTasksCompleteMode.fromString(reader.getString()); + } else if ("metadata".equals(fieldName)) { + List metadata = reader.readArray(reader1 -> BatchMetadataItem.fromJson(reader1)); + deserializedBatchJobUpdateParameters.metadata = metadata; + } else if ("networkConfiguration".equals(fieldName)) { + deserializedBatchJobUpdateParameters.networkConfiguration + = BatchJobNetworkConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBatchJobUpdateParameters; + }); + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobsFromScheduleListOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobsFromScheduleListOptions.java new file mode 100644 index 000000000000..88e663190709 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobsFromScheduleListOptions.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; +import java.util.List; + +/** + * Optional parameters for List Jobs From Schedule operation. + */ +@Fluent +public final class BatchJobsFromScheduleListOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /* + * The maximum number of items to return in the response. A maximum of 1000 + * applications can be returned. + */ + @Generated + private Integer maxPageSize; + + /* + * An OData $filter clause. For more information on constructing this filter, see + * https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-jobs-in-a-job-schedule. + */ + @Generated + private String filter; + + /* + * An OData $select clause. + */ + @Generated + private List select; + + /* + * An OData $expand clause. + */ + @Generated + private List expand; + + /** + * Creates an instance of BatchJobsFromScheduleListOptions class. + */ + @Generated + public BatchJobsFromScheduleListOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchJobsFromScheduleListOptions object itself. + */ + @Generated + public BatchJobsFromScheduleListOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } + + /** + * Get the maxPageSize property: The maximum number of items to return in the response. A maximum of 1000 + * applications can be returned. + * + * @return the maxPageSize value. + */ + @Generated + public Integer getMaxPageSize() { + return this.maxPageSize; + } + + /** + * Set the maxPageSize property: The maximum number of items to return in the response. A maximum of 1000 + * applications can be returned. + * + * @param maxPageSize the maxPageSize value to set. + * @return the BatchJobsFromScheduleListOptions object itself. + */ + @Generated + public BatchJobsFromScheduleListOptions setMaxPageSize(Integer maxPageSize) { + this.maxPageSize = maxPageSize; + return this; + } + + /** + * Get the filter property: An OData $filter clause. For more information on constructing this filter, see + * https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-jobs-in-a-job-schedule. + * + * @return the filter value. + */ + @Generated + public String getFilter() { + return this.filter; + } + + /** + * Set the filter property: An OData $filter clause. For more information on constructing this filter, see + * https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-jobs-in-a-job-schedule. + * + * @param filter the filter value to set. + * @return the BatchJobsFromScheduleListOptions object itself. + */ + @Generated + public BatchJobsFromScheduleListOptions setFilter(String filter) { + this.filter = filter; + return this; + } + + /** + * Get the select property: An OData $select clause. + * + * @return the select value. + */ + @Generated + public List getSelect() { + return this.select; + } + + /** + * Set the select property: An OData $select clause. + * + * @param select the select value to set. + * @return the BatchJobsFromScheduleListOptions object itself. + */ + @Generated + public BatchJobsFromScheduleListOptions setSelect(List select) { + this.select = select; + return this; + } + + /** + * Get the expand property: An OData $expand clause. + * + * @return the expand value. + */ + @Generated + public List getExpand() { + return this.expand; + } + + /** + * Set the expand property: An OData $expand clause. + * + * @param expand the expand value to set. + * @return the BatchJobsFromScheduleListOptions object itself. + */ + @Generated + public BatchJobsFromScheduleListOptions setExpand(List expand) { + this.expand = expand; + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobsListOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobsListOptions.java new file mode 100644 index 000000000000..86af6ded8de5 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobsListOptions.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; +import java.util.List; + +/** + * Optional parameters for List Jobs operation. + */ +@Fluent +public final class BatchJobsListOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /* + * The maximum number of items to return in the response. A maximum of 1000 + * applications can be returned. + */ + @Generated + private Integer maxPageSize; + + /* + * An OData $filter clause. For more information on constructing this filter, see + * https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-jobs. + */ + @Generated + private String filter; + + /* + * An OData $select clause. + */ + @Generated + private List select; + + /* + * An OData $expand clause. + */ + @Generated + private List expand; + + /** + * Creates an instance of BatchJobsListOptions class. + */ + @Generated + public BatchJobsListOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchJobsListOptions object itself. + */ + @Generated + public BatchJobsListOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } + + /** + * Get the maxPageSize property: The maximum number of items to return in the response. A maximum of 1000 + * applications can be returned. + * + * @return the maxPageSize value. + */ + @Generated + public Integer getMaxPageSize() { + return this.maxPageSize; + } + + /** + * Set the maxPageSize property: The maximum number of items to return in the response. A maximum of 1000 + * applications can be returned. + * + * @param maxPageSize the maxPageSize value to set. + * @return the BatchJobsListOptions object itself. + */ + @Generated + public BatchJobsListOptions setMaxPageSize(Integer maxPageSize) { + this.maxPageSize = maxPageSize; + return this; + } + + /** + * Get the filter property: An OData $filter clause. For more information on constructing this filter, see + * https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-jobs. + * + * @return the filter value. + */ + @Generated + public String getFilter() { + return this.filter; + } + + /** + * Set the filter property: An OData $filter clause. For more information on constructing this filter, see + * https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-jobs. + * + * @param filter the filter value to set. + * @return the BatchJobsListOptions object itself. + */ + @Generated + public BatchJobsListOptions setFilter(String filter) { + this.filter = filter; + return this; + } + + /** + * Get the select property: An OData $select clause. + * + * @return the select value. + */ + @Generated + public List getSelect() { + return this.select; + } + + /** + * Set the select property: An OData $select clause. + * + * @param select the select value to set. + * @return the BatchJobsListOptions object itself. + */ + @Generated + public BatchJobsListOptions setSelect(List select) { + this.select = select; + return this; + } + + /** + * Get the expand property: An OData $expand clause. + * + * @return the expand value. + */ + @Generated + public List getExpand() { + return this.expand; + } + + /** + * Set the expand property: An OData $expand clause. + * + * @param expand the expand value to set. + * @return the BatchJobsListOptions object itself. + */ + @Generated + public BatchJobsListOptions setExpand(List expand) { + this.expand = expand; + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchMetadataItem.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchMetadataItem.java new file mode 100644 index 000000000000..dcaed2dab09f --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchMetadataItem.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The Batch service does not assign any meaning to this metadata; it is solely + * for the use of user code. + */ +@Immutable +public final class BatchMetadataItem implements JsonSerializable { + /* + * The name of the metadata item. + */ + @Generated + private final String name; + + /* + * The value of the metadata item. + */ + @Generated + private final String value; + + /** + * Creates an instance of BatchMetadataItem class. + * + * @param name the name value to set. + * @param value the value value to set. + */ + @Generated + public BatchMetadataItem(String name, String value) { + this.name = name; + this.value = value; + } + + /** + * Get the name property: The name of the metadata item. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the value property: The value of the metadata item. + * + * @return the value value. + */ + @Generated + public String getValue() { + return this.value; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BatchMetadataItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BatchMetadataItem if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BatchMetadataItem. + */ + @Generated + public static BatchMetadataItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String name = null; + String value = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("value".equals(fieldName)) { + value = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new BatchMetadataItem(name, value); + }); + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeDeallocateOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeDeallocateOptions.java new file mode 100644 index 000000000000..8e19d9448ded --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeDeallocateOptions.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Deallocate Node operation. + */ +@Fluent +public final class BatchNodeDeallocateOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /* + * The options to use for deallocating the Compute Node. + */ + @Generated + private BatchNodeDeallocateParameters parameters; + + /** + * Creates an instance of BatchNodeDeallocateOptions class. + */ + @Generated + public BatchNodeDeallocateOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchNodeDeallocateOptions object itself. + */ + @Generated + public BatchNodeDeallocateOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } + + /** + * Get the parameters property: The options to use for deallocating the Compute Node. + * + * @return the parameters value. + */ + @Generated + public BatchNodeDeallocateParameters getParameters() { + return this.parameters; + } + + /** + * Set the parameters property: The options to use for deallocating the Compute Node. + * + * @param parameters the parameters value to set. + * @return the BatchNodeDeallocateOptions object itself. + */ + @Generated + public BatchNodeDeallocateOptions setParameters(BatchNodeDeallocateParameters parameters) { + this.parameters = parameters; + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeDeallocateParameters.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeDeallocateParameters.java new file mode 100644 index 000000000000..80743a5fbd56 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeDeallocateParameters.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Options for deallocating a Compute Node. + */ +@Fluent +public final class BatchNodeDeallocateParameters implements JsonSerializable { + /* + * When to deallocate the Compute Node and what to do with currently running Tasks. The default value is requeue. + */ + @Generated + private BatchNodeDeallocateOption nodeDeallocateOption; + + /** + * Creates an instance of BatchNodeDeallocateParameters class. + */ + @Generated + public BatchNodeDeallocateParameters() { + } + + /** + * Get the nodeDeallocateOption property: When to deallocate the Compute Node and what to do with currently running + * Tasks. The default value is requeue. + * + * @return the nodeDeallocateOption value. + */ + @Generated + public BatchNodeDeallocateOption getNodeDeallocateOption() { + return this.nodeDeallocateOption; + } + + /** + * Set the nodeDeallocateOption property: When to deallocate the Compute Node and what to do with currently running + * Tasks. The default value is requeue. + * + * @param nodeDeallocateOption the nodeDeallocateOption value to set. + * @return the BatchNodeDeallocateParameters object itself. + */ + @Generated + public BatchNodeDeallocateParameters setNodeDeallocateOption(BatchNodeDeallocateOption nodeDeallocateOption) { + this.nodeDeallocateOption = nodeDeallocateOption; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nodeDeallocateOption", + this.nodeDeallocateOption == null ? null : this.nodeDeallocateOption.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BatchNodeDeallocateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BatchNodeDeallocateParameters if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BatchNodeDeallocateParameters. + */ + @Generated + public static BatchNodeDeallocateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BatchNodeDeallocateParameters deserializedBatchNodeDeallocateParameters + = new BatchNodeDeallocateParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nodeDeallocateOption".equals(fieldName)) { + deserializedBatchNodeDeallocateParameters.nodeDeallocateOption + = BatchNodeDeallocateOption.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedBatchNodeDeallocateParameters; + }); + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeDisableSchedulingParameters.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeDisableSchedulingParameters.java new file mode 100644 index 000000000000..09e4efd44d41 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeDisableSchedulingParameters.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters for disabling scheduling on an Azure Batch Compute Node. + */ +@Fluent +public final class BatchNodeDisableSchedulingParameters + implements JsonSerializable { + /* + * What to do with currently running Tasks when disabling Task scheduling on the Compute Node. The default value is + * requeue. + */ + @Generated + private BatchNodeDisableSchedulingOption nodeDisableSchedulingOption; + + /** + * Creates an instance of BatchNodeDisableSchedulingParameters class. + */ + @Generated + public BatchNodeDisableSchedulingParameters() { + } + + /** + * Get the nodeDisableSchedulingOption property: What to do with currently running Tasks when disabling Task + * scheduling on the Compute Node. The default value is requeue. + * + * @return the nodeDisableSchedulingOption value. + */ + @Generated + public BatchNodeDisableSchedulingOption getNodeDisableSchedulingOption() { + return this.nodeDisableSchedulingOption; + } + + /** + * Set the nodeDisableSchedulingOption property: What to do with currently running Tasks when disabling Task + * scheduling on the Compute Node. The default value is requeue. + * + * @param nodeDisableSchedulingOption the nodeDisableSchedulingOption value to set. + * @return the BatchNodeDisableSchedulingParameters object itself. + */ + @Generated + public BatchNodeDisableSchedulingParameters + setNodeDisableSchedulingOption(BatchNodeDisableSchedulingOption nodeDisableSchedulingOption) { + this.nodeDisableSchedulingOption = nodeDisableSchedulingOption; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nodeDisableSchedulingOption", + this.nodeDisableSchedulingOption == null ? null : this.nodeDisableSchedulingOption.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BatchNodeDisableSchedulingParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BatchNodeDisableSchedulingParameters if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BatchNodeDisableSchedulingParameters. + */ + @Generated + public static BatchNodeDisableSchedulingParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BatchNodeDisableSchedulingParameters deserializedBatchNodeDisableSchedulingParameters + = new BatchNodeDisableSchedulingParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nodeDisableSchedulingOption".equals(fieldName)) { + deserializedBatchNodeDisableSchedulingParameters.nodeDisableSchedulingOption + = BatchNodeDisableSchedulingOption.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedBatchNodeDisableSchedulingParameters; + }); + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeExtensionGetOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeExtensionGetOptions.java new file mode 100644 index 000000000000..750af4d3082c --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeExtensionGetOptions.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; +import java.util.List; + +/** + * Optional parameters for Get Node Extension operation. + */ +@Fluent +public final class BatchNodeExtensionGetOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /* + * An OData $select clause. + */ + @Generated + private List select; + + /** + * Creates an instance of BatchNodeExtensionGetOptions class. + */ + @Generated + public BatchNodeExtensionGetOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchNodeExtensionGetOptions object itself. + */ + @Generated + public BatchNodeExtensionGetOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } + + /** + * Get the select property: An OData $select clause. + * + * @return the select value. + */ + @Generated + public List getSelect() { + return this.select; + } + + /** + * Set the select property: An OData $select clause. + * + * @param select the select value to set. + * @return the BatchNodeExtensionGetOptions object itself. + */ + @Generated + public BatchNodeExtensionGetOptions setSelect(List select) { + this.select = select; + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeExtensionsListOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeExtensionsListOptions.java new file mode 100644 index 000000000000..4292bb71a6ce --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeExtensionsListOptions.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; +import java.util.List; + +/** + * Optional parameters for List Node Extensions operation. + */ +@Fluent +public final class BatchNodeExtensionsListOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /* + * The maximum number of items to return in the response. A maximum of 1000 + * applications can be returned. + */ + @Generated + private Integer maxPageSize; + + /* + * An OData $select clause. + */ + @Generated + private List select; + + /** + * Creates an instance of BatchNodeExtensionsListOptions class. + */ + @Generated + public BatchNodeExtensionsListOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchNodeExtensionsListOptions object itself. + */ + @Generated + public BatchNodeExtensionsListOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } + + /** + * Get the maxPageSize property: The maximum number of items to return in the response. A maximum of 1000 + * applications can be returned. + * + * @return the maxPageSize value. + */ + @Generated + public Integer getMaxPageSize() { + return this.maxPageSize; + } + + /** + * Set the maxPageSize property: The maximum number of items to return in the response. A maximum of 1000 + * applications can be returned. + * + * @param maxPageSize the maxPageSize value to set. + * @return the BatchNodeExtensionsListOptions object itself. + */ + @Generated + public BatchNodeExtensionsListOptions setMaxPageSize(Integer maxPageSize) { + this.maxPageSize = maxPageSize; + return this; + } + + /** + * Get the select property: An OData $select clause. + * + * @return the select value. + */ + @Generated + public List getSelect() { + return this.select; + } + + /** + * Set the select property: An OData $select clause. + * + * @param select the select value to set. + * @return the BatchNodeExtensionsListOptions object itself. + */ + @Generated + public BatchNodeExtensionsListOptions setSelect(List select) { + this.select = select; + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeFileDeleteOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeFileDeleteOptions.java new file mode 100644 index 000000000000..c5296015ed3b --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeFileDeleteOptions.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Delete Node File operation. + */ +@Fluent +public final class BatchNodeFileDeleteOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /* + * Whether to delete children of a directory. If the filePath parameter represents + * a directory instead of a file, you can set recursive to true to delete the + * directory and all of the files and subdirectories in it. If recursive is false + * then the directory must be empty or deletion will fail. + */ + @Generated + private Boolean recursive; + + /** + * Creates an instance of BatchNodeFileDeleteOptions class. + */ + @Generated + public BatchNodeFileDeleteOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchNodeFileDeleteOptions object itself. + */ + @Generated + public BatchNodeFileDeleteOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } + + /** + * Get the recursive property: Whether to delete children of a directory. If the filePath parameter represents + * a directory instead of a file, you can set recursive to true to delete the + * directory and all of the files and subdirectories in it. If recursive is false + * then the directory must be empty or deletion will fail. + * + * @return the recursive value. + */ + @Generated + public Boolean isRecursive() { + return this.recursive; + } + + /** + * Set the recursive property: Whether to delete children of a directory. If the filePath parameter represents + * a directory instead of a file, you can set recursive to true to delete the + * directory and all of the files and subdirectories in it. If recursive is false + * then the directory must be empty or deletion will fail. + * + * @param recursive the recursive value to set. + * @return the BatchNodeFileDeleteOptions object itself. + */ + @Generated + public BatchNodeFileDeleteOptions setRecursive(Boolean recursive) { + this.recursive = recursive; + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeFileGetOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeFileGetOptions.java new file mode 100644 index 000000000000..aa29a0bc0bd8 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeFileGetOptions.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.core.util.DateTimeRfc1123; +import java.time.Duration; +import java.time.OffsetDateTime; + +/** + * Optional parameters for Get Node File operation. + */ +@Fluent +public final class BatchNodeFileGetOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /* + * A timestamp indicating the last modified time of the resource known to the + * client. The operation will be performed only if the resource on the service has + * been modified since the specified time. + */ + @Generated + private DateTimeRfc1123 ifModifiedSince; + + /* + * A timestamp indicating the last modified time of the resource known to the + * client. The operation will be performed only if the resource on the service has + * not been modified since the specified time. + */ + @Generated + private DateTimeRfc1123 ifUnmodifiedSince; + + /* + * The byte range to be retrieved. The default is to retrieve the entire file. The + * format is bytes=startRange-endRange. + */ + @Generated + private String ocpRange; + + /** + * Creates an instance of BatchNodeFileGetOptions class. + */ + @Generated + public BatchNodeFileGetOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchNodeFileGetOptions object itself. + */ + @Generated + public BatchNodeFileGetOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } + + /** + * Get the ifModifiedSince property: A timestamp indicating the last modified time of the resource known to the + * client. The operation will be performed only if the resource on the service has + * been modified since the specified time. + * + * @return the ifModifiedSince value. + */ + @Generated + public OffsetDateTime getIfModifiedSince() { + if (this.ifModifiedSince == null) { + return null; + } + return this.ifModifiedSince.getDateTime(); + } + + /** + * Set the ifModifiedSince property: A timestamp indicating the last modified time of the resource known to the + * client. The operation will be performed only if the resource on the service has + * been modified since the specified time. + * + * @param ifModifiedSince the ifModifiedSince value to set. + * @return the BatchNodeFileGetOptions object itself. + */ + @Generated + public BatchNodeFileGetOptions setIfModifiedSince(OffsetDateTime ifModifiedSince) { + if (ifModifiedSince == null) { + this.ifModifiedSince = null; + } else { + this.ifModifiedSince = new DateTimeRfc1123(ifModifiedSince); + } + return this; + } + + /** + * Get the ifUnmodifiedSince property: A timestamp indicating the last modified time of the resource known to the + * client. The operation will be performed only if the resource on the service has + * not been modified since the specified time. + * + * @return the ifUnmodifiedSince value. + */ + @Generated + public OffsetDateTime getIfUnmodifiedSince() { + if (this.ifUnmodifiedSince == null) { + return null; + } + return this.ifUnmodifiedSince.getDateTime(); + } + + /** + * Set the ifUnmodifiedSince property: A timestamp indicating the last modified time of the resource known to the + * client. The operation will be performed only if the resource on the service has + * not been modified since the specified time. + * + * @param ifUnmodifiedSince the ifUnmodifiedSince value to set. + * @return the BatchNodeFileGetOptions object itself. + */ + @Generated + public BatchNodeFileGetOptions setIfUnmodifiedSince(OffsetDateTime ifUnmodifiedSince) { + if (ifUnmodifiedSince == null) { + this.ifUnmodifiedSince = null; + } else { + this.ifUnmodifiedSince = new DateTimeRfc1123(ifUnmodifiedSince); + } + return this; + } + + /** + * Get the ocpRange property: The byte range to be retrieved. The default is to retrieve the entire file. The + * format is bytes=startRange-endRange. + * + * @return the ocpRange value. + */ + @Generated + public String getOcpRange() { + return this.ocpRange; + } + + /** + * Set the ocpRange property: The byte range to be retrieved. The default is to retrieve the entire file. The + * format is bytes=startRange-endRange. + * + * @param ocpRange the ocpRange value to set. + * @return the BatchNodeFileGetOptions object itself. + */ + @Generated + public BatchNodeFileGetOptions setOcpRange(String ocpRange) { + this.ocpRange = ocpRange; + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeFilePropertiesGetOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeFilePropertiesGetOptions.java new file mode 100644 index 000000000000..518b6a27dfc7 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeFilePropertiesGetOptions.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.core.util.DateTimeRfc1123; +import java.time.Duration; +import java.time.OffsetDateTime; + +/** + * Optional parameters for Get Node File Properties operation. + */ +@Fluent +public final class BatchNodeFilePropertiesGetOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /* + * A timestamp indicating the last modified time of the resource known to the + * client. The operation will be performed only if the resource on the service has + * been modified since the specified time. + */ + @Generated + private DateTimeRfc1123 ifModifiedSince; + + /* + * A timestamp indicating the last modified time of the resource known to the + * client. The operation will be performed only if the resource on the service has + * not been modified since the specified time. + */ + @Generated + private DateTimeRfc1123 ifUnmodifiedSince; + + /** + * Creates an instance of BatchNodeFilePropertiesGetOptions class. + */ + @Generated + public BatchNodeFilePropertiesGetOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchNodeFilePropertiesGetOptions object itself. + */ + @Generated + public BatchNodeFilePropertiesGetOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } + + /** + * Get the ifModifiedSince property: A timestamp indicating the last modified time of the resource known to the + * client. The operation will be performed only if the resource on the service has + * been modified since the specified time. + * + * @return the ifModifiedSince value. + */ + @Generated + public OffsetDateTime getIfModifiedSince() { + if (this.ifModifiedSince == null) { + return null; + } + return this.ifModifiedSince.getDateTime(); + } + + /** + * Set the ifModifiedSince property: A timestamp indicating the last modified time of the resource known to the + * client. The operation will be performed only if the resource on the service has + * been modified since the specified time. + * + * @param ifModifiedSince the ifModifiedSince value to set. + * @return the BatchNodeFilePropertiesGetOptions object itself. + */ + @Generated + public BatchNodeFilePropertiesGetOptions setIfModifiedSince(OffsetDateTime ifModifiedSince) { + if (ifModifiedSince == null) { + this.ifModifiedSince = null; + } else { + this.ifModifiedSince = new DateTimeRfc1123(ifModifiedSince); + } + return this; + } + + /** + * Get the ifUnmodifiedSince property: A timestamp indicating the last modified time of the resource known to the + * client. The operation will be performed only if the resource on the service has + * not been modified since the specified time. + * + * @return the ifUnmodifiedSince value. + */ + @Generated + public OffsetDateTime getIfUnmodifiedSince() { + if (this.ifUnmodifiedSince == null) { + return null; + } + return this.ifUnmodifiedSince.getDateTime(); + } + + /** + * Set the ifUnmodifiedSince property: A timestamp indicating the last modified time of the resource known to the + * client. The operation will be performed only if the resource on the service has + * not been modified since the specified time. + * + * @param ifUnmodifiedSince the ifUnmodifiedSince value to set. + * @return the BatchNodeFilePropertiesGetOptions object itself. + */ + @Generated + public BatchNodeFilePropertiesGetOptions setIfUnmodifiedSince(OffsetDateTime ifUnmodifiedSince) { + if (ifUnmodifiedSince == null) { + this.ifUnmodifiedSince = null; + } else { + this.ifUnmodifiedSince = new DateTimeRfc1123(ifUnmodifiedSince); + } + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeFilesListOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeFilesListOptions.java new file mode 100644 index 000000000000..69f37add52c1 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeFilesListOptions.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for List Node Files operation. + */ +@Fluent +public final class BatchNodeFilesListOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /* + * The maximum number of items to return in the response. A maximum of 1000 + * applications can be returned. + */ + @Generated + private Integer maxPageSize; + + /* + * An OData $filter clause. For more information on constructing this filter, see + * https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-compute-node-files. + */ + @Generated + private String filter; + + /* + * Whether to list children of a directory. + */ + @Generated + private Boolean recursive; + + /** + * Creates an instance of BatchNodeFilesListOptions class. + */ + @Generated + public BatchNodeFilesListOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchNodeFilesListOptions object itself. + */ + @Generated + public BatchNodeFilesListOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } + + /** + * Get the maxPageSize property: The maximum number of items to return in the response. A maximum of 1000 + * applications can be returned. + * + * @return the maxPageSize value. + */ + @Generated + public Integer getMaxPageSize() { + return this.maxPageSize; + } + + /** + * Set the maxPageSize property: The maximum number of items to return in the response. A maximum of 1000 + * applications can be returned. + * + * @param maxPageSize the maxPageSize value to set. + * @return the BatchNodeFilesListOptions object itself. + */ + @Generated + public BatchNodeFilesListOptions setMaxPageSize(Integer maxPageSize) { + this.maxPageSize = maxPageSize; + return this; + } + + /** + * Get the filter property: An OData $filter clause. For more information on constructing this filter, see + * https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-compute-node-files. + * + * @return the filter value. + */ + @Generated + public String getFilter() { + return this.filter; + } + + /** + * Set the filter property: An OData $filter clause. For more information on constructing this filter, see + * https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-compute-node-files. + * + * @param filter the filter value to set. + * @return the BatchNodeFilesListOptions object itself. + */ + @Generated + public BatchNodeFilesListOptions setFilter(String filter) { + this.filter = filter; + return this; + } + + /** + * Get the recursive property: Whether to list children of a directory. + * + * @return the recursive value. + */ + @Generated + public Boolean isRecursive() { + return this.recursive; + } + + /** + * Set the recursive property: Whether to list children of a directory. + * + * @param recursive the recursive value to set. + * @return the BatchNodeFilesListOptions object itself. + */ + @Generated + public BatchNodeFilesListOptions setRecursive(Boolean recursive) { + this.recursive = recursive; + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeGetOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeGetOptions.java new file mode 100644 index 000000000000..3eee5639be64 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeGetOptions.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; +import java.util.List; + +/** + * Optional parameters for Get Node operation. + */ +@Fluent +public final class BatchNodeGetOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /* + * An OData $select clause. + */ + @Generated + private List select; + + /** + * Creates an instance of BatchNodeGetOptions class. + */ + @Generated + public BatchNodeGetOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchNodeGetOptions object itself. + */ + @Generated + public BatchNodeGetOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } + + /** + * Get the select property: An OData $select clause. + * + * @return the select value. + */ + @Generated + public List getSelect() { + return this.select; + } + + /** + * Set the select property: An OData $select clause. + * + * @param select the select value to set. + * @return the BatchNodeGetOptions object itself. + */ + @Generated + public BatchNodeGetOptions setSelect(List select) { + this.select = select; + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeLogsUploadOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeLogsUploadOptions.java new file mode 100644 index 000000000000..bbacdad64ece --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeLogsUploadOptions.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Upload Node Logs operation. + */ +@Fluent +public final class BatchNodeLogsUploadOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /** + * Creates an instance of BatchNodeLogsUploadOptions class. + */ + @Generated + public BatchNodeLogsUploadOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchNodeLogsUploadOptions object itself. + */ + @Generated + public BatchNodeLogsUploadOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeRebootKind.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeRebootKind.java new file mode 100644 index 000000000000..21b15d8145a5 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeRebootKind.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * BatchNodeRebootKind enums. + */ +public final class BatchNodeRebootKind extends ExpandableStringEnum { + /** + * Terminate running Task processes and requeue the Tasks. The Tasks will run again when a Compute Node is + * available. Restart the Compute Node as soon as Tasks have been terminated. + */ + @Generated + public static final BatchNodeRebootKind REQUEUE = fromString("requeue"); + + /** + * Terminate running Tasks. The Tasks will be completed with failureInfo indicating that they were terminated, and + * will not run again. Restart the Compute Node as soon as Tasks have been terminated. + */ + @Generated + public static final BatchNodeRebootKind TERMINATE = fromString("terminate"); + + /** + * Allow currently running Tasks to complete. Schedule no new Tasks while waiting. Restart the Compute Node when all + * Tasks have completed. + */ + @Generated + public static final BatchNodeRebootKind TASK_COMPLETION = fromString("taskcompletion"); + + /** + * Allow currently running Tasks to complete, then wait for all Task data retention periods to expire. Schedule no + * new Tasks while waiting. Restart the Compute Node when all Task retention periods have expired. + */ + @Generated + public static final BatchNodeRebootKind RETAINED_DATA = fromString("retaineddata"); + + /** + * Creates a new instance of BatchNodeRebootKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public BatchNodeRebootKind() { + } + + /** + * Creates or finds a BatchNodeRebootKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding BatchNodeRebootKind. + */ + @Generated + public static BatchNodeRebootKind fromString(String name) { + return fromString(name, BatchNodeRebootKind.class); + } + + /** + * Gets known BatchNodeRebootKind values. + * + * @return known BatchNodeRebootKind values. + */ + @Generated + public static Collection values() { + return values(BatchNodeRebootKind.class); + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeRebootOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeRebootOptions.java new file mode 100644 index 000000000000..b6cb0b614b96 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeRebootOptions.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Reboot Node operation. + */ +@Fluent +public final class BatchNodeRebootOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /* + * The options to use for rebooting the Compute Node. + */ + @Generated + private BatchNodeRebootParameters parameters; + + /** + * Creates an instance of BatchNodeRebootOptions class. + */ + @Generated + public BatchNodeRebootOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchNodeRebootOptions object itself. + */ + @Generated + public BatchNodeRebootOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } + + /** + * Get the parameters property: The options to use for rebooting the Compute Node. + * + * @return the parameters value. + */ + @Generated + public BatchNodeRebootParameters getParameters() { + return this.parameters; + } + + /** + * Set the parameters property: The options to use for rebooting the Compute Node. + * + * @param parameters the parameters value to set. + * @return the BatchNodeRebootOptions object itself. + */ + @Generated + public BatchNodeRebootOptions setParameters(BatchNodeRebootParameters parameters) { + this.parameters = parameters; + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeRebootParameters.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeRebootParameters.java new file mode 100644 index 000000000000..34365f855171 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeRebootParameters.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters for rebooting an Azure Batch Compute Node. + */ +@Fluent +public final class BatchNodeRebootParameters implements JsonSerializable { + /* + * When to reboot the Compute Node and what to do with currently running Tasks. The default value is requeue. + */ + @Generated + private BatchNodeRebootKind nodeRebootKind; + + /** + * Creates an instance of BatchNodeRebootParameters class. + */ + @Generated + public BatchNodeRebootParameters() { + } + + /** + * Get the nodeRebootKind property: When to reboot the Compute Node and what to do with currently running Tasks. The + * default value is requeue. + * + * @return the nodeRebootKind value. + */ + @Generated + public BatchNodeRebootKind getNodeRebootKind() { + return this.nodeRebootKind; + } + + /** + * Set the nodeRebootKind property: When to reboot the Compute Node and what to do with currently running Tasks. The + * default value is requeue. + * + * @param nodeRebootKind the nodeRebootKind value to set. + * @return the BatchNodeRebootParameters object itself. + */ + @Generated + public BatchNodeRebootParameters setNodeRebootKind(BatchNodeRebootKind nodeRebootKind) { + this.nodeRebootKind = nodeRebootKind; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nodeRebootOption", + this.nodeRebootKind == null ? null : this.nodeRebootKind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BatchNodeRebootParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BatchNodeRebootParameters if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BatchNodeRebootParameters. + */ + @Generated + public static BatchNodeRebootParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BatchNodeRebootParameters deserializedBatchNodeRebootParameters = new BatchNodeRebootParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nodeRebootOption".equals(fieldName)) { + deserializedBatchNodeRebootParameters.nodeRebootKind + = BatchNodeRebootKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedBatchNodeRebootParameters; + }); + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeReimageOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeReimageOptions.java new file mode 100644 index 000000000000..2a228aa24de8 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeReimageOptions.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Reimage Node operation. + */ +@Fluent +public final class BatchNodeReimageOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /* + * The options to use for reimaging the Compute Node. + */ + @Generated + private BatchNodeReimageParameters parameters; + + /** + * Creates an instance of BatchNodeReimageOptions class. + */ + @Generated + public BatchNodeReimageOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchNodeReimageOptions object itself. + */ + @Generated + public BatchNodeReimageOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } + + /** + * Get the parameters property: The options to use for reimaging the Compute Node. + * + * @return the parameters value. + */ + @Generated + public BatchNodeReimageParameters getParameters() { + return this.parameters; + } + + /** + * Set the parameters property: The options to use for reimaging the Compute Node. + * + * @param parameters the parameters value to set. + * @return the BatchNodeReimageOptions object itself. + */ + @Generated + public BatchNodeReimageOptions setParameters(BatchNodeReimageParameters parameters) { + this.parameters = parameters; + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeReimageParameters.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeReimageParameters.java new file mode 100644 index 000000000000..0f4fd1fe599c --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeReimageParameters.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters for reimaging an Azure Batch Compute Node. + */ +@Fluent +public final class BatchNodeReimageParameters implements JsonSerializable { + /* + * When to reimage the Compute Node and what to do with currently running Tasks. The default value is requeue. + */ + @Generated + private BatchNodeReimageOption nodeReimageOption; + + /** + * Creates an instance of BatchNodeReimageParameters class. + */ + @Generated + public BatchNodeReimageParameters() { + } + + /** + * Get the nodeReimageOption property: When to reimage the Compute Node and what to do with currently running Tasks. + * The default value is requeue. + * + * @return the nodeReimageOption value. + */ + @Generated + public BatchNodeReimageOption getNodeReimageOption() { + return this.nodeReimageOption; + } + + /** + * Set the nodeReimageOption property: When to reimage the Compute Node and what to do with currently running Tasks. + * The default value is requeue. + * + * @param nodeReimageOption the nodeReimageOption value to set. + * @return the BatchNodeReimageParameters object itself. + */ + @Generated + public BatchNodeReimageParameters setNodeReimageOption(BatchNodeReimageOption nodeReimageOption) { + this.nodeReimageOption = nodeReimageOption; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nodeReimageOption", + this.nodeReimageOption == null ? null : this.nodeReimageOption.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BatchNodeReimageParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BatchNodeReimageParameters if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BatchNodeReimageParameters. + */ + @Generated + public static BatchNodeReimageParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BatchNodeReimageParameters deserializedBatchNodeReimageParameters = new BatchNodeReimageParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nodeReimageOption".equals(fieldName)) { + deserializedBatchNodeReimageParameters.nodeReimageOption + = BatchNodeReimageOption.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedBatchNodeReimageParameters; + }); + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeRemoteLoginSettingsGetOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeRemoteLoginSettingsGetOptions.java new file mode 100644 index 000000000000..f4020e7d0fef --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeRemoteLoginSettingsGetOptions.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Get Node Remote Login Settings operation. + */ +@Fluent +public final class BatchNodeRemoteLoginSettingsGetOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /** + * Creates an instance of BatchNodeRemoteLoginSettingsGetOptions class. + */ + @Generated + public BatchNodeRemoteLoginSettingsGetOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchNodeRemoteLoginSettingsGetOptions object itself. + */ + @Generated + public BatchNodeRemoteLoginSettingsGetOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeRemoveParameters.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeRemoveParameters.java new file mode 100644 index 000000000000..b5931db99257 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeRemoveParameters.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Duration; +import java.util.List; + +/** + * Parameters for removing nodes from an Azure Batch Pool. + */ +@Fluent +public final class BatchNodeRemoveParameters implements JsonSerializable { + /* + * A list containing the IDs of the Compute Nodes to be removed from the specified Pool. A maximum of 100 nodes may + * be removed per request. + */ + @Generated + private final List nodeIds; + + /* + * The timeout for removal of Compute Nodes to the Pool. The default value is 15 minutes. The minimum value is 5 + * minutes. If you specify a value less than 5 minutes, the Batch service returns an error; if you are calling the + * REST API directly, the HTTP status code is 400 (Bad Request). + */ + @Generated + private Duration resizeTimeout; + + /* + * Determines what to do with a Compute Node and its running task(s) after it has been selected for deallocation. + * The default value is requeue. + */ + @Generated + private BatchNodeDeallocationOption nodeDeallocationOption; + + /** + * Creates an instance of BatchNodeRemoveParameters class. + * + * @param nodeIds the nodeIds value to set. + */ + @Generated + public BatchNodeRemoveParameters(List nodeIds) { + this.nodeIds = nodeIds; + } + + /** + * Get the nodeIds property: A list containing the IDs of the Compute Nodes to be removed from the specified Pool. A + * maximum of 100 nodes may be removed per request. + * + * @return the nodeIds value. + */ + @Generated + public List getNodeIds() { + return this.nodeIds; + } + + /** + * Get the resizeTimeout property: The timeout for removal of Compute Nodes to the Pool. The default value is 15 + * minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service returns an + * error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). + * + * @return the resizeTimeout value. + */ + @Generated + public Duration getResizeTimeout() { + return this.resizeTimeout; + } + + /** + * Set the resizeTimeout property: The timeout for removal of Compute Nodes to the Pool. The default value is 15 + * minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service returns an + * error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). + * + * @param resizeTimeout the resizeTimeout value to set. + * @return the BatchNodeRemoveParameters object itself. + */ + @Generated + public BatchNodeRemoveParameters setResizeTimeout(Duration resizeTimeout) { + this.resizeTimeout = resizeTimeout; + return this; + } + + /** + * Get the nodeDeallocationOption property: Determines what to do with a Compute Node and its running task(s) after + * it has been selected for deallocation. The default value is requeue. + * + * @return the nodeDeallocationOption value. + */ + @Generated + public BatchNodeDeallocationOption getNodeDeallocationOption() { + return this.nodeDeallocationOption; + } + + /** + * Set the nodeDeallocationOption property: Determines what to do with a Compute Node and its running task(s) after + * it has been selected for deallocation. The default value is requeue. + * + * @param nodeDeallocationOption the nodeDeallocationOption value to set. + * @return the BatchNodeRemoveParameters object itself. + */ + @Generated + public BatchNodeRemoveParameters setNodeDeallocationOption(BatchNodeDeallocationOption nodeDeallocationOption) { + this.nodeDeallocationOption = nodeDeallocationOption; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("nodeList", this.nodeIds, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("resizeTimeout", CoreUtils.durationToStringWithDays(this.resizeTimeout)); + jsonWriter.writeStringField("nodeDeallocationOption", + this.nodeDeallocationOption == null ? null : this.nodeDeallocationOption.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BatchNodeRemoveParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BatchNodeRemoveParameters if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BatchNodeRemoveParameters. + */ + @Generated + public static BatchNodeRemoveParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List nodeIds = null; + Duration resizeTimeout = null; + BatchNodeDeallocationOption nodeDeallocationOption = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nodeList".equals(fieldName)) { + nodeIds = reader.readArray(reader1 -> reader1.getString()); + } else if ("resizeTimeout".equals(fieldName)) { + resizeTimeout = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); + } else if ("nodeDeallocationOption".equals(fieldName)) { + nodeDeallocationOption = BatchNodeDeallocationOption.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + BatchNodeRemoveParameters deserializedBatchNodeRemoveParameters = new BatchNodeRemoveParameters(nodeIds); + deserializedBatchNodeRemoveParameters.resizeTimeout = resizeTimeout; + deserializedBatchNodeRemoveParameters.nodeDeallocationOption = nodeDeallocationOption; + + return deserializedBatchNodeRemoveParameters; + }); + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeSchedulingDisableOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeSchedulingDisableOptions.java new file mode 100644 index 000000000000..0689584ec2fd --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeSchedulingDisableOptions.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Disable Node Scheduling operation. + */ +@Fluent +public final class BatchNodeSchedulingDisableOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /* + * The options to use for disabling scheduling on the Compute Node. + */ + @Generated + private BatchNodeDisableSchedulingParameters parameters; + + /** + * Creates an instance of BatchNodeSchedulingDisableOptions class. + */ + @Generated + public BatchNodeSchedulingDisableOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchNodeSchedulingDisableOptions object itself. + */ + @Generated + public BatchNodeSchedulingDisableOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } + + /** + * Get the parameters property: The options to use for disabling scheduling on the Compute Node. + * + * @return the parameters value. + */ + @Generated + public BatchNodeDisableSchedulingParameters getParameters() { + return this.parameters; + } + + /** + * Set the parameters property: The options to use for disabling scheduling on the Compute Node. + * + * @param parameters the parameters value to set. + * @return the BatchNodeSchedulingDisableOptions object itself. + */ + @Generated + public BatchNodeSchedulingDisableOptions setParameters(BatchNodeDisableSchedulingParameters parameters) { + this.parameters = parameters; + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeSchedulingEnableOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeSchedulingEnableOptions.java new file mode 100644 index 000000000000..dd96f9053396 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeSchedulingEnableOptions.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Enable Node Scheduling operation. + */ +@Fluent +public final class BatchNodeSchedulingEnableOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /** + * Creates an instance of BatchNodeSchedulingEnableOptions class. + */ + @Generated + public BatchNodeSchedulingEnableOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchNodeSchedulingEnableOptions object itself. + */ + @Generated + public BatchNodeSchedulingEnableOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeStartOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeStartOptions.java new file mode 100644 index 000000000000..41eff2869d65 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeStartOptions.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Start Node operation. + */ +@Fluent +public final class BatchNodeStartOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /** + * Creates an instance of BatchNodeStartOptions class. + */ + @Generated + public BatchNodeStartOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchNodeStartOptions object itself. + */ + @Generated + public BatchNodeStartOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeUserCreateOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeUserCreateOptions.java new file mode 100644 index 000000000000..d1f0a53dfa8e --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeUserCreateOptions.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Create Node User operation. + */ +@Fluent +public final class BatchNodeUserCreateOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /** + * Creates an instance of BatchNodeUserCreateOptions class. + */ + @Generated + public BatchNodeUserCreateOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchNodeUserCreateOptions object itself. + */ + @Generated + public BatchNodeUserCreateOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeUserCreateParameters.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeUserCreateParameters.java new file mode 100644 index 000000000000..2cfe4ddd9678 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeUserCreateParameters.java @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Parameters for creating a user account for RDP or SSH access on an Azure Batch Compute Node. + */ +@Fluent +public final class BatchNodeUserCreateParameters implements JsonSerializable { + /* + * The user name of the Account. + */ + @Generated + private final String name; + + /* + * Whether the Account should be an administrator on the Compute Node. The default value is false. + */ + @Generated + private Boolean isAdmin; + + /* + * The time at which the Account should expire. If omitted, the default is 1 day from the current time. For Linux + * Compute Nodes, the expiryTime has a precision up to a day. + */ + @Generated + private OffsetDateTime expiryTime; + + /* + * The password of the Account. The password is required for Windows Compute Nodes. For Linux Compute Nodes, the + * password can optionally be specified along with the sshPublicKey property. + */ + @Generated + private String password; + + /* + * The SSH public key that can be used for remote login to the Compute Node. The public key should be compatible + * with OpenSSH encoding and should be base 64 encoded. This property can be specified only for Linux Compute Nodes. + * If this is specified for a Windows Compute Node, then the Batch service rejects the request; if you are calling + * the REST API directly, the HTTP status code is 400 (Bad Request). + */ + @Generated + private String sshPublicKey; + + /** + * Creates an instance of BatchNodeUserCreateParameters class. + * + * @param name the name value to set. + */ + @Generated + public BatchNodeUserCreateParameters(String name) { + this.name = name; + } + + /** + * Get the name property: The user name of the Account. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the isAdmin property: Whether the Account should be an administrator on the Compute Node. The default value + * is false. + * + * @return the isAdmin value. + */ + @Generated + public Boolean isAdmin() { + return this.isAdmin; + } + + /** + * Set the isAdmin property: Whether the Account should be an administrator on the Compute Node. The default value + * is false. + * + * @param isAdmin the isAdmin value to set. + * @return the BatchNodeUserCreateParameters object itself. + */ + @Generated + public BatchNodeUserCreateParameters setIsAdmin(Boolean isAdmin) { + this.isAdmin = isAdmin; + return this; + } + + /** + * Get the expiryTime property: The time at which the Account should expire. If omitted, the default is 1 day from + * the current time. For Linux Compute Nodes, the expiryTime has a precision up to a day. + * + * @return the expiryTime value. + */ + @Generated + public OffsetDateTime getExpiryTime() { + return this.expiryTime; + } + + /** + * Set the expiryTime property: The time at which the Account should expire. If omitted, the default is 1 day from + * the current time. For Linux Compute Nodes, the expiryTime has a precision up to a day. + * + * @param expiryTime the expiryTime value to set. + * @return the BatchNodeUserCreateParameters object itself. + */ + @Generated + public BatchNodeUserCreateParameters setExpiryTime(OffsetDateTime expiryTime) { + this.expiryTime = expiryTime; + return this; + } + + /** + * Get the password property: The password of the Account. The password is required for Windows Compute Nodes. For + * Linux Compute Nodes, the password can optionally be specified along with the sshPublicKey property. + * + * @return the password value. + */ + @Generated + public String getPassword() { + return this.password; + } + + /** + * Set the password property: The password of the Account. The password is required for Windows Compute Nodes. For + * Linux Compute Nodes, the password can optionally be specified along with the sshPublicKey property. + * + * @param password the password value to set. + * @return the BatchNodeUserCreateParameters object itself. + */ + @Generated + public BatchNodeUserCreateParameters setPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the sshPublicKey property: The SSH public key that can be used for remote login to the Compute Node. The + * public key should be compatible with OpenSSH encoding and should be base 64 encoded. This property can be + * specified only for Linux Compute Nodes. If this is specified for a Windows Compute Node, then the Batch service + * rejects the request; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). + * + * @return the sshPublicKey value. + */ + @Generated + public String getSshPublicKey() { + return this.sshPublicKey; + } + + /** + * Set the sshPublicKey property: The SSH public key that can be used for remote login to the Compute Node. The + * public key should be compatible with OpenSSH encoding and should be base 64 encoded. This property can be + * specified only for Linux Compute Nodes. If this is specified for a Windows Compute Node, then the Batch service + * rejects the request; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). + * + * @param sshPublicKey the sshPublicKey value to set. + * @return the BatchNodeUserCreateParameters object itself. + */ + @Generated + public BatchNodeUserCreateParameters setSshPublicKey(String sshPublicKey) { + this.sshPublicKey = sshPublicKey; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeBooleanField("isAdmin", this.isAdmin); + jsonWriter.writeStringField("expiryTime", + this.expiryTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expiryTime)); + jsonWriter.writeStringField("password", this.password); + jsonWriter.writeStringField("sshPublicKey", this.sshPublicKey); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BatchNodeUserCreateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BatchNodeUserCreateParameters if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BatchNodeUserCreateParameters. + */ + @Generated + public static BatchNodeUserCreateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String name = null; + Boolean isAdmin = null; + OffsetDateTime expiryTime = null; + String password = null; + String sshPublicKey = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("isAdmin".equals(fieldName)) { + isAdmin = reader.getNullable(JsonReader::getBoolean); + } else if ("expiryTime".equals(fieldName)) { + expiryTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("password".equals(fieldName)) { + password = reader.getString(); + } else if ("sshPublicKey".equals(fieldName)) { + sshPublicKey = reader.getString(); + } else { + reader.skipChildren(); + } + } + BatchNodeUserCreateParameters deserializedBatchNodeUserCreateParameters + = new BatchNodeUserCreateParameters(name); + deserializedBatchNodeUserCreateParameters.isAdmin = isAdmin; + deserializedBatchNodeUserCreateParameters.expiryTime = expiryTime; + deserializedBatchNodeUserCreateParameters.password = password; + deserializedBatchNodeUserCreateParameters.sshPublicKey = sshPublicKey; + + return deserializedBatchNodeUserCreateParameters; + }); + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeUserDeleteOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeUserDeleteOptions.java new file mode 100644 index 000000000000..9b8524cc4ee5 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeUserDeleteOptions.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Delete Node User operation. + */ +@Fluent +public final class BatchNodeUserDeleteOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /** + * Creates an instance of BatchNodeUserDeleteOptions class. + */ + @Generated + public BatchNodeUserDeleteOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchNodeUserDeleteOptions object itself. + */ + @Generated + public BatchNodeUserDeleteOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeUserReplaceOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeUserReplaceOptions.java new file mode 100644 index 000000000000..c19477935bb1 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeUserReplaceOptions.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Replace Node User operation. + */ +@Fluent +public final class BatchNodeUserReplaceOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /** + * Creates an instance of BatchNodeUserReplaceOptions class. + */ + @Generated + public BatchNodeUserReplaceOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchNodeUserReplaceOptions object itself. + */ + @Generated + public BatchNodeUserReplaceOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeUserUpdateParameters.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeUserUpdateParameters.java new file mode 100644 index 000000000000..9da638827814 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodeUserUpdateParameters.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Parameters for updating a user account for RDP or SSH access on an Azure Batch Compute Node. + */ +@Fluent +public final class BatchNodeUserUpdateParameters implements JsonSerializable { + /* + * The password of the Account. The password is required for Windows Compute Nodes. For Linux Compute Nodes, the + * password can optionally be specified along with the sshPublicKey property. If omitted, any existing password is + * removed. + */ + @Generated + private String password; + + /* + * The time at which the Account should expire. If omitted, the default is 1 day from the current time. For Linux + * Compute Nodes, the expiryTime has a precision up to a day. + */ + @Generated + private OffsetDateTime expiryTime; + + /* + * The SSH public key that can be used for remote login to the Compute Node. The public key should be compatible + * with OpenSSH encoding and should be base 64 encoded. This property can be specified only for Linux Compute Nodes. + * If this is specified for a Windows Compute Node, then the Batch service rejects the request; if you are calling + * the REST API directly, the HTTP status code is 400 (Bad Request). If omitted, any existing SSH public key is + * removed. + */ + @Generated + private String sshPublicKey; + + /** + * Creates an instance of BatchNodeUserUpdateParameters class. + */ + @Generated + public BatchNodeUserUpdateParameters() { + } + + /** + * Get the password property: The password of the Account. The password is required for Windows Compute Nodes. For + * Linux Compute Nodes, the password can optionally be specified along with the sshPublicKey property. If omitted, + * any existing password is removed. + * + * @return the password value. + */ + @Generated + public String getPassword() { + return this.password; + } + + /** + * Set the password property: The password of the Account. The password is required for Windows Compute Nodes. For + * Linux Compute Nodes, the password can optionally be specified along with the sshPublicKey property. If omitted, + * any existing password is removed. + * + * @param password the password value to set. + * @return the BatchNodeUserUpdateParameters object itself. + */ + @Generated + public BatchNodeUserUpdateParameters setPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the expiryTime property: The time at which the Account should expire. If omitted, the default is 1 day from + * the current time. For Linux Compute Nodes, the expiryTime has a precision up to a day. + * + * @return the expiryTime value. + */ + @Generated + public OffsetDateTime getExpiryTime() { + return this.expiryTime; + } + + /** + * Set the expiryTime property: The time at which the Account should expire. If omitted, the default is 1 day from + * the current time. For Linux Compute Nodes, the expiryTime has a precision up to a day. + * + * @param expiryTime the expiryTime value to set. + * @return the BatchNodeUserUpdateParameters object itself. + */ + @Generated + public BatchNodeUserUpdateParameters setExpiryTime(OffsetDateTime expiryTime) { + this.expiryTime = expiryTime; + return this; + } + + /** + * Get the sshPublicKey property: The SSH public key that can be used for remote login to the Compute Node. The + * public key should be compatible with OpenSSH encoding and should be base 64 encoded. This property can be + * specified only for Linux Compute Nodes. If this is specified for a Windows Compute Node, then the Batch service + * rejects the request; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). If + * omitted, any existing SSH public key is removed. + * + * @return the sshPublicKey value. + */ + @Generated + public String getSshPublicKey() { + return this.sshPublicKey; + } + + /** + * Set the sshPublicKey property: The SSH public key that can be used for remote login to the Compute Node. The + * public key should be compatible with OpenSSH encoding and should be base 64 encoded. This property can be + * specified only for Linux Compute Nodes. If this is specified for a Windows Compute Node, then the Batch service + * rejects the request; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). If + * omitted, any existing SSH public key is removed. + * + * @param sshPublicKey the sshPublicKey value to set. + * @return the BatchNodeUserUpdateParameters object itself. + */ + @Generated + public BatchNodeUserUpdateParameters setSshPublicKey(String sshPublicKey) { + this.sshPublicKey = sshPublicKey; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("password", this.password); + jsonWriter.writeStringField("expiryTime", + this.expiryTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expiryTime)); + jsonWriter.writeStringField("sshPublicKey", this.sshPublicKey); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BatchNodeUserUpdateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BatchNodeUserUpdateParameters if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BatchNodeUserUpdateParameters. + */ + @Generated + public static BatchNodeUserUpdateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BatchNodeUserUpdateParameters deserializedBatchNodeUserUpdateParameters + = new BatchNodeUserUpdateParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("password".equals(fieldName)) { + deserializedBatchNodeUserUpdateParameters.password = reader.getString(); + } else if ("expiryTime".equals(fieldName)) { + deserializedBatchNodeUserUpdateParameters.expiryTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("sshPublicKey".equals(fieldName)) { + deserializedBatchNodeUserUpdateParameters.sshPublicKey = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBatchNodeUserUpdateParameters; + }); + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodesListOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodesListOptions.java new file mode 100644 index 000000000000..f5e0fcef0a0c --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodesListOptions.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; +import java.util.List; + +/** + * Optional parameters for List Nodes operation. + */ +@Fluent +public final class BatchNodesListOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /* + * The maximum number of items to return in the response. A maximum of 1000 + * applications can be returned. + */ + @Generated + private Integer maxPageSize; + + /* + * An OData $filter clause. For more information on constructing this filter, see + * https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-nodes-in-a-pool. + */ + @Generated + private String filter; + + /* + * An OData $select clause. + */ + @Generated + private List select; + + /** + * Creates an instance of BatchNodesListOptions class. + */ + @Generated + public BatchNodesListOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchNodesListOptions object itself. + */ + @Generated + public BatchNodesListOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } + + /** + * Get the maxPageSize property: The maximum number of items to return in the response. A maximum of 1000 + * applications can be returned. + * + * @return the maxPageSize value. + */ + @Generated + public Integer getMaxPageSize() { + return this.maxPageSize; + } + + /** + * Set the maxPageSize property: The maximum number of items to return in the response. A maximum of 1000 + * applications can be returned. + * + * @param maxPageSize the maxPageSize value to set. + * @return the BatchNodesListOptions object itself. + */ + @Generated + public BatchNodesListOptions setMaxPageSize(Integer maxPageSize) { + this.maxPageSize = maxPageSize; + return this; + } + + /** + * Get the filter property: An OData $filter clause. For more information on constructing this filter, see + * https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-nodes-in-a-pool. + * + * @return the filter value. + */ + @Generated + public String getFilter() { + return this.filter; + } + + /** + * Set the filter property: An OData $filter clause. For more information on constructing this filter, see + * https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-nodes-in-a-pool. + * + * @param filter the filter value to set. + * @return the BatchNodesListOptions object itself. + */ + @Generated + public BatchNodesListOptions setFilter(String filter) { + this.filter = filter; + return this; + } + + /** + * Get the select property: An OData $select clause. + * + * @return the select value. + */ + @Generated + public List getSelect() { + return this.select; + } + + /** + * Set the select property: An OData $select clause. + * + * @param select the select value to set. + * @return the BatchNodesListOptions object itself. + */ + @Generated + public BatchNodesListOptions setSelect(List select) { + this.select = select; + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodesRemoveOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodesRemoveOptions.java new file mode 100644 index 000000000000..8f35d8ed23a2 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchNodesRemoveOptions.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Remove Nodes operation. + */ +@Fluent +public final class BatchNodesRemoveOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /** + * Creates an instance of BatchNodesRemoveOptions class. + */ + @Generated + public BatchNodesRemoveOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchNodesRemoveOptions object itself. + */ + @Generated + public BatchNodesRemoveOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchOsDisk.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchOsDisk.java new file mode 100644 index 000000000000..b8e21e9048e5 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchOsDisk.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Settings for the operating system disk of the compute node (VM). + */ +@Fluent +public final class BatchOsDisk implements JsonSerializable { + /* + * Specifies the ephemeral Disk Settings for the operating system disk used by the compute node (VM). + */ + @Generated + private BatchDiffDiskSettings ephemeralOSDiskSettings; + + /* + * Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The default values are: None + * for Standard storage. ReadOnly for Premium storage. + */ + @Generated + private CachingType caching; + + /* + * The initial disk size in GB when creating new OS disk. + */ + @Generated + private Integer diskSizeGB; + + /* + * The managed disk parameters. + */ + @Generated + private ManagedDisk managedDisk; + + /* + * Specifies whether writeAccelerator should be enabled or disabled on the disk. + */ + @Generated + private Boolean writeAcceleratorEnabled; + + /** + * Creates an instance of BatchOsDisk class. + */ + @Generated + public BatchOsDisk() { + } + + /** + * Get the ephemeralOSDiskSettings property: Specifies the ephemeral Disk Settings for the operating system disk + * used by the compute node (VM). + * + * @return the ephemeralOSDiskSettings value. + */ + @Generated + public BatchDiffDiskSettings getEphemeralOSDiskSettings() { + return this.ephemeralOSDiskSettings; + } + + /** + * Set the ephemeralOSDiskSettings property: Specifies the ephemeral Disk Settings for the operating system disk + * used by the compute node (VM). + * + * @param ephemeralOSDiskSettings the ephemeralOSDiskSettings value to set. + * @return the BatchOsDisk object itself. + */ + @Generated + public BatchOsDisk setEphemeralOSDiskSettings(BatchDiffDiskSettings ephemeralOSDiskSettings) { + this.ephemeralOSDiskSettings = ephemeralOSDiskSettings; + return this; + } + + /** + * Get the caching property: Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The + * default values are: None for Standard storage. ReadOnly for Premium storage. + * + * @return the caching value. + */ + @Generated + public CachingType getCaching() { + return this.caching; + } + + /** + * Set the caching property: Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The + * default values are: None for Standard storage. ReadOnly for Premium storage. + * + * @param caching the caching value to set. + * @return the BatchOsDisk object itself. + */ + @Generated + public BatchOsDisk setCaching(CachingType caching) { + this.caching = caching; + return this; + } + + /** + * Get the diskSizeGB property: The initial disk size in GB when creating new OS disk. + * + * @return the diskSizeGB value. + */ + @Generated + public Integer getDiskSizeGB() { + return this.diskSizeGB; + } + + /** + * Set the diskSizeGB property: The initial disk size in GB when creating new OS disk. + * + * @param diskSizeGB the diskSizeGB value to set. + * @return the BatchOsDisk object itself. + */ + @Generated + public BatchOsDisk setDiskSizeGB(Integer diskSizeGB) { + this.diskSizeGB = diskSizeGB; + return this; + } + + /** + * Get the managedDisk property: The managed disk parameters. + * + * @return the managedDisk value. + */ + @Generated + public ManagedDisk getManagedDisk() { + return this.managedDisk; + } + + /** + * Set the managedDisk property: The managed disk parameters. + * + * @param managedDisk the managedDisk value to set. + * @return the BatchOsDisk object itself. + */ + @Generated + public BatchOsDisk setManagedDisk(ManagedDisk managedDisk) { + this.managedDisk = managedDisk; + return this; + } + + /** + * Get the writeAcceleratorEnabled property: Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @return the writeAcceleratorEnabled value. + */ + @Generated + public Boolean isWriteAcceleratorEnabled() { + return this.writeAcceleratorEnabled; + } + + /** + * Set the writeAcceleratorEnabled property: Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param writeAcceleratorEnabled the writeAcceleratorEnabled value to set. + * @return the BatchOsDisk object itself. + */ + @Generated + public BatchOsDisk setWriteAcceleratorEnabled(Boolean writeAcceleratorEnabled) { + this.writeAcceleratorEnabled = writeAcceleratorEnabled; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("ephemeralOSDiskSettings", this.ephemeralOSDiskSettings); + jsonWriter.writeStringField("caching", this.caching == null ? null : this.caching.toString()); + jsonWriter.writeNumberField("diskSizeGB", this.diskSizeGB); + jsonWriter.writeJsonField("managedDisk", this.managedDisk); + jsonWriter.writeBooleanField("writeAcceleratorEnabled", this.writeAcceleratorEnabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BatchOsDisk from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BatchOsDisk if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the BatchOsDisk. + */ + @Generated + public static BatchOsDisk fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BatchOsDisk deserializedBatchOsDisk = new BatchOsDisk(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ephemeralOSDiskSettings".equals(fieldName)) { + deserializedBatchOsDisk.ephemeralOSDiskSettings = BatchDiffDiskSettings.fromJson(reader); + } else if ("caching".equals(fieldName)) { + deserializedBatchOsDisk.caching = CachingType.fromString(reader.getString()); + } else if ("diskSizeGB".equals(fieldName)) { + deserializedBatchOsDisk.diskSizeGB = reader.getNullable(JsonReader::getInt); + } else if ("managedDisk".equals(fieldName)) { + deserializedBatchOsDisk.managedDisk = ManagedDisk.fromJson(reader); + } else if ("writeAcceleratorEnabled".equals(fieldName)) { + deserializedBatchOsDisk.writeAcceleratorEnabled = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedBatchOsDisk; + }); + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPool.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPool.java index 61c7e3921606..3eb910ac1209 100644 --- a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPool.java +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPool.java @@ -246,16 +246,7 @@ public final class BatchPool implements JsonSerializable { * A list of name-value pairs associated with the Pool as metadata. */ @Generated - private List metadata; - - /* - * Utilization and resource usage statistics for the entire lifetime of the Pool. This property is populated only if - * the BatchPool was retrieved with an expand clause including the 'stats' attribute; otherwise it is null. The - * statistics may not be immediately available. The Batch service performs periodic roll-up of statistics. The - * typical delay is about 30 minutes. - */ - @Generated - private BatchPoolStatistics stats; + private List metadata; /* * A list of file systems to mount on each node in the pool. This supports Azure Files, NFS, CIFS/SMB, and Blobfuse. @@ -654,23 +645,10 @@ public List getUserAccounts() { * @return the metadata value. */ @Generated - public List getMetadata() { + public List getMetadata() { return this.metadata; } - /** - * Get the stats property: Utilization and resource usage statistics for the entire lifetime of the Pool. This - * property is populated only if the BatchPool was retrieved with an expand clause including the 'stats' attribute; - * otherwise it is null. The statistics may not be immediately available. The Batch service performs periodic - * roll-up of statistics. The typical delay is about 30 minutes. - * - * @return the stats value. - */ - @Generated - public BatchPoolStatistics getStats() { - return this.stats; - } - /** * Get the mountConfiguration property: A list of file systems to mount on each node in the pool. This supports * Azure Files, NFS, CIFS/SMB, and Blobfuse. @@ -831,10 +809,10 @@ public static BatchPool fromJson(JsonReader jsonReader) throws IOException { List userAccounts = reader.readArray(reader1 -> UserAccount.fromJson(reader1)); deserializedBatchPool.userAccounts = userAccounts; } else if ("metadata".equals(fieldName)) { - List metadata = reader.readArray(reader1 -> MetadataItem.fromJson(reader1)); + List metadata = reader.readArray(reader1 -> BatchMetadataItem.fromJson(reader1)); deserializedBatchPool.metadata = metadata; } else if ("stats".equals(fieldName)) { - deserializedBatchPool.stats = BatchPoolStatistics.fromJson(reader); + deserializedBatchPool.poolStatistics = BatchPoolStatistics.fromJson(reader); } else if ("mountConfiguration".equals(fieldName)) { List mountConfiguration = reader.readArray(reader1 -> MountConfiguration.fromJson(reader1)); @@ -856,4 +834,26 @@ public static BatchPool fromJson(JsonReader jsonReader) throws IOException { return deserializedBatchPool; }); } + + /* + * Utilization and resource usage statistics for the entire lifetime of the Pool. This property is populated only if + * the BatchPool was retrieved with an expand clause including the 'stats' attribute; otherwise it is null. The + * statistics may not be immediately available. The Batch service performs periodic roll-up of statistics. The + * typical delay is about 30 minutes. + */ + @Generated + private BatchPoolStatistics poolStatistics; + + /** + * Get the poolStatistics property: Utilization and resource usage statistics for the entire lifetime of the Pool. + * This property is populated only if the BatchPool was retrieved with an expand clause including the 'stats' + * attribute; otherwise it is null. The statistics may not be immediately available. The Batch service performs + * periodic roll-up of statistics. The typical delay is about 30 minutes. + * + * @return the poolStatistics value. + */ + @Generated + public BatchPoolStatistics getPoolStatistics() { + return this.poolStatistics; + } } diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolAutoScaleDisableOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolAutoScaleDisableOptions.java new file mode 100644 index 000000000000..0ac0b3a0385f --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolAutoScaleDisableOptions.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Disable Pool AutoScale operation. + */ +@Fluent +public final class BatchPoolAutoScaleDisableOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /** + * Creates an instance of BatchPoolAutoScaleDisableOptions class. + */ + @Generated + public BatchPoolAutoScaleDisableOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchPoolAutoScaleDisableOptions object itself. + */ + @Generated + public BatchPoolAutoScaleDisableOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolAutoScaleEnableOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolAutoScaleEnableOptions.java new file mode 100644 index 000000000000..f77cbf7ce901 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolAutoScaleEnableOptions.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Enable Pool AutoScale operation. + */ +@Fluent +public final class BatchPoolAutoScaleEnableOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /** + * Creates an instance of BatchPoolAutoScaleEnableOptions class. + */ + @Generated + public BatchPoolAutoScaleEnableOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchPoolAutoScaleEnableOptions object itself. + */ + @Generated + public BatchPoolAutoScaleEnableOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolAutoScaleEnableParameters.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolAutoScaleEnableParameters.java new file mode 100644 index 000000000000..af690b0a9561 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolAutoScaleEnableParameters.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Duration; + +/** + * Parameters for enabling automatic scaling on an Azure Batch Pool. + */ +@Fluent +public final class BatchPoolAutoScaleEnableParameters implements JsonSerializable { + /* + * The formula for the desired number of Compute Nodes in the Pool. The default value is 15 minutes. The minimum and + * maximum value are 5 minutes and 168 hours respectively. If you specify a value less than 5 minutes or greater + * than 168 hours, the Batch service rejects the request with an invalid property value error; if you are calling + * the REST API directly, the HTTP status code is 400 (Bad Request). If you specify a new interval, then the + * existing autoscale evaluation schedule will be stopped and a new autoscale evaluation schedule will be started, + * with its starting time being the time when this request was issued. + */ + @Generated + private String autoScaleFormula; + + /* + * The time interval at which to automatically adjust the Pool size according to the autoscale formula. The default + * value is 15 minutes. The minimum and maximum value are 5 minutes and 168 hours respectively. If you specify a + * value less than 5 minutes or greater than 168 hours, the Batch service rejects the request with an invalid + * property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). If you + * specify a new interval, then the existing autoscale evaluation schedule will be stopped and a new autoscale + * evaluation schedule will be started, with its starting time being the time when this request was issued. + */ + @Generated + private Duration autoScaleEvaluationInterval; + + /** + * Creates an instance of BatchPoolAutoScaleEnableParameters class. + */ + @Generated + public BatchPoolAutoScaleEnableParameters() { + } + + /** + * Get the autoScaleFormula property: The formula for the desired number of Compute Nodes in the Pool. The default + * value is 15 minutes. The minimum and maximum value are 5 minutes and 168 hours respectively. If you specify a + * value less than 5 minutes or greater than 168 hours, the Batch service rejects the request with an invalid + * property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). If you + * specify a new interval, then the existing autoscale evaluation schedule will be stopped and a new autoscale + * evaluation schedule will be started, with its starting time being the time when this request was issued. + * + * @return the autoScaleFormula value. + */ + @Generated + public String getAutoScaleFormula() { + return this.autoScaleFormula; + } + + /** + * Set the autoScaleFormula property: The formula for the desired number of Compute Nodes in the Pool. The default + * value is 15 minutes. The minimum and maximum value are 5 minutes and 168 hours respectively. If you specify a + * value less than 5 minutes or greater than 168 hours, the Batch service rejects the request with an invalid + * property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). If you + * specify a new interval, then the existing autoscale evaluation schedule will be stopped and a new autoscale + * evaluation schedule will be started, with its starting time being the time when this request was issued. + * + * @param autoScaleFormula the autoScaleFormula value to set. + * @return the BatchPoolAutoScaleEnableParameters object itself. + */ + @Generated + public BatchPoolAutoScaleEnableParameters setAutoScaleFormula(String autoScaleFormula) { + this.autoScaleFormula = autoScaleFormula; + return this; + } + + /** + * Get the autoScaleEvaluationInterval property: The time interval at which to automatically adjust the Pool size + * according to the autoscale formula. The default value is 15 minutes. The minimum and maximum value are 5 minutes + * and 168 hours respectively. If you specify a value less than 5 minutes or greater than 168 hours, the Batch + * service rejects the request with an invalid property value error; if you are calling the REST API directly, the + * HTTP status code is 400 (Bad Request). If you specify a new interval, then the existing autoscale evaluation + * schedule will be stopped and a new autoscale evaluation schedule will be started, with its starting time being + * the time when this request was issued. + * + * @return the autoScaleEvaluationInterval value. + */ + @Generated + public Duration getAutoScaleEvaluationInterval() { + return this.autoScaleEvaluationInterval; + } + + /** + * Set the autoScaleEvaluationInterval property: The time interval at which to automatically adjust the Pool size + * according to the autoscale formula. The default value is 15 minutes. The minimum and maximum value are 5 minutes + * and 168 hours respectively. If you specify a value less than 5 minutes or greater than 168 hours, the Batch + * service rejects the request with an invalid property value error; if you are calling the REST API directly, the + * HTTP status code is 400 (Bad Request). If you specify a new interval, then the existing autoscale evaluation + * schedule will be stopped and a new autoscale evaluation schedule will be started, with its starting time being + * the time when this request was issued. + * + * @param autoScaleEvaluationInterval the autoScaleEvaluationInterval value to set. + * @return the BatchPoolAutoScaleEnableParameters object itself. + */ + @Generated + public BatchPoolAutoScaleEnableParameters setAutoScaleEvaluationInterval(Duration autoScaleEvaluationInterval) { + this.autoScaleEvaluationInterval = autoScaleEvaluationInterval; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("autoScaleFormula", this.autoScaleFormula); + jsonWriter.writeStringField("autoScaleEvaluationInterval", + CoreUtils.durationToStringWithDays(this.autoScaleEvaluationInterval)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BatchPoolAutoScaleEnableParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BatchPoolAutoScaleEnableParameters if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BatchPoolAutoScaleEnableParameters. + */ + @Generated + public static BatchPoolAutoScaleEnableParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BatchPoolAutoScaleEnableParameters deserializedBatchPoolAutoScaleEnableParameters + = new BatchPoolAutoScaleEnableParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("autoScaleFormula".equals(fieldName)) { + deserializedBatchPoolAutoScaleEnableParameters.autoScaleFormula = reader.getString(); + } else if ("autoScaleEvaluationInterval".equals(fieldName)) { + deserializedBatchPoolAutoScaleEnableParameters.autoScaleEvaluationInterval + = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedBatchPoolAutoScaleEnableParameters; + }); + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolAutoScaleEvaluateOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolAutoScaleEvaluateOptions.java new file mode 100644 index 000000000000..53e7225a5b2b --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolAutoScaleEvaluateOptions.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Evaluate Pool AutoScale operation. + */ +@Fluent +public final class BatchPoolAutoScaleEvaluateOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /** + * Creates an instance of BatchPoolAutoScaleEvaluateOptions class. + */ + @Generated + public BatchPoolAutoScaleEvaluateOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchPoolAutoScaleEvaluateOptions object itself. + */ + @Generated + public BatchPoolAutoScaleEvaluateOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolAutoScaleEvaluateParameters.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolAutoScaleEvaluateParameters.java new file mode 100644 index 000000000000..df51cc64c1e2 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolAutoScaleEvaluateParameters.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters for evaluating an automatic scaling formula on an Azure Batch Pool. + */ +@Immutable +public final class BatchPoolAutoScaleEvaluateParameters + implements JsonSerializable { + /* + * The formula for the desired number of Compute Nodes in the Pool. The formula is validated and its results + * calculated, but it is not applied to the Pool. To apply the formula to the Pool, 'Enable automatic scaling on a + * Pool'. For more information about specifying this formula, see Automatically scale Compute Nodes in an Azure + * Batch Pool (https://learn.microsoft.com/azure/batch/batch-automatic-scaling). + */ + @Generated + private final String autoScaleFormula; + + /** + * Creates an instance of BatchPoolAutoScaleEvaluateParameters class. + * + * @param autoScaleFormula the autoScaleFormula value to set. + */ + @Generated + public BatchPoolAutoScaleEvaluateParameters(String autoScaleFormula) { + this.autoScaleFormula = autoScaleFormula; + } + + /** + * Get the autoScaleFormula property: The formula for the desired number of Compute Nodes in the Pool. The formula + * is validated and its results calculated, but it is not applied to the Pool. To apply the formula to the Pool, + * 'Enable automatic scaling on a Pool'. For more information about specifying this formula, see Automatically scale + * Compute Nodes in an Azure Batch Pool (https://learn.microsoft.com/azure/batch/batch-automatic-scaling). + * + * @return the autoScaleFormula value. + */ + @Generated + public String getAutoScaleFormula() { + return this.autoScaleFormula; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("autoScaleFormula", this.autoScaleFormula); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BatchPoolAutoScaleEvaluateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BatchPoolAutoScaleEvaluateParameters if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BatchPoolAutoScaleEvaluateParameters. + */ + @Generated + public static BatchPoolAutoScaleEvaluateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String autoScaleFormula = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("autoScaleFormula".equals(fieldName)) { + autoScaleFormula = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new BatchPoolAutoScaleEvaluateParameters(autoScaleFormula); + }); + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolCreateOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolCreateOptions.java new file mode 100644 index 000000000000..10220b7d7125 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolCreateOptions.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Create Pool operation. + */ +@Fluent +public final class BatchPoolCreateOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /** + * Creates an instance of BatchPoolCreateOptions class. + */ + @Generated + public BatchPoolCreateOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchPoolCreateOptions object itself. + */ + @Generated + public BatchPoolCreateOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolCreateParameters.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolCreateParameters.java new file mode 100644 index 000000000000..e371e64da00e --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolCreateParameters.java @@ -0,0 +1,956 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +/** + * Parameters for creating an Azure Batch Pool. + */ +@Fluent +public final class BatchPoolCreateParameters implements JsonSerializable { + /* + * A string that uniquely identifies the Pool within the Account. The ID can contain any combination of alphanumeric + * characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is + * case-preserving and case-insensitive (that is, you may not have two Pool IDs within an Account that differ only + * by case). + */ + @Generated + private final String id; + + /* + * The display name for the Pool. The display name need not be unique and can contain any Unicode characters up to a + * maximum length of 1024. + */ + @Generated + private String displayName; + + /* + * The size of virtual machines in the Pool. All virtual machines in a Pool are the same size. For information about + * available VM sizes for Pools using Images from the Virtual Machines Marketplace (pools created with + * virtualMachineConfiguration), see Sizes for Virtual Machines in Azure + * (https://learn.microsoft.com/azure/virtual-machines/sizes/overview). Batch supports all Azure VM sizes except + * STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). + */ + @Generated + private final String vmSize; + + /* + * The virtual machine configuration for the Pool. This property must be specified. + */ + @Generated + private VirtualMachineConfiguration virtualMachineConfiguration; + + /* + * The timeout for allocation of Compute Nodes to the Pool. This timeout applies only to manual scaling; it has no + * effect when enableAutoScale is set to true. The default value is 15 minutes. The minimum value is 5 minutes. If + * you specify a value less than 5 minutes, the Batch service returns an error; if you are calling the REST API + * directly, the HTTP status code is 400 (Bad Request). + */ + @Generated + private Duration resizeTimeout; + + /* + * The user-specified tags associated with the pool. The user-defined tags to be associated with the Azure Batch + * Pool. When specified, these tags are propagated to the backing Azure resources associated with the pool. This + * property can only be specified when the Batch account was created with the poolAllocationMode property set to + * 'UserSubscription'. + */ + @Generated + private Map resourceTags; + + /* + * The desired number of dedicated Compute Nodes in the Pool. This property must not be specified if enableAutoScale + * is set to true. If enableAutoScale is set to false, then you must set either targetDedicatedNodes, + * targetLowPriorityNodes, or both. + */ + @Generated + private Integer targetDedicatedNodes; + + /* + * The desired number of Spot/Low-priority Compute Nodes in the Pool. This property must not be specified if + * enableAutoScale is set to true. If enableAutoScale is set to false, then you must set either + * targetDedicatedNodes, targetLowPriorityNodes, or both. + */ + @Generated + private Integer targetLowPriorityNodes; + + /* + * Whether the Pool size should automatically adjust over time. If false, at least one of targetDedicatedNodes and + * targetLowPriorityNodes must be specified. If true, the autoScaleFormula property is required and the Pool + * automatically resizes according to the formula. The default value is false. + */ + @Generated + private Boolean enableAutoScale; + + /* + * A formula for the desired number of Compute Nodes in the Pool. This property must not be specified if + * enableAutoScale is set to false. It is required if enableAutoScale is set to true. The formula is checked for + * validity before the Pool is created. If the formula is not valid, the Batch service rejects the request with + * detailed error information. For more information about specifying this formula, see 'Automatically scale Compute + * Nodes in an Azure Batch Pool' (https://learn.microsoft.com/azure/batch/batch-automatic-scaling). + */ + @Generated + private String autoScaleFormula; + + /* + * The time interval at which to automatically adjust the Pool size according to the autoscale formula. The default + * value is 15 minutes. The minimum and maximum value are 5 minutes and 168 hours respectively. If you specify a + * value less than 5 minutes or greater than 168 hours, the Batch service returns an error; if you are calling the + * REST API directly, the HTTP status code is 400 (Bad Request). + */ + @Generated + private Duration autoScaleEvaluationInterval; + + /* + * Whether the Pool permits direct communication between Compute Nodes. Enabling inter-node communication limits the + * maximum size of the Pool due to deployment restrictions on the Compute Nodes of the Pool. This may result in the + * Pool not reaching its desired size. The default value is false. + */ + @Generated + private Boolean enableInterNodeCommunication; + + /* + * The network configuration for the Pool. + */ + @Generated + private NetworkConfiguration networkConfiguration; + + /* + * A Task specified to run on each Compute Node as it joins the Pool. The Task runs when the Compute Node is added + * to the Pool or when the Compute Node is restarted. + */ + @Generated + private BatchStartTask startTask; + + /* + * For Windows Nodes, the Batch service installs the Certificates to the specified Certificate store and location. + * For Linux Compute Nodes, the Certificates are stored in a directory inside the Task working directory and an + * environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the Task to query for this location. + * For Certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory + * (e.g., /home/{user-name}/certs) and Certificates are placed in that directory. + * Warning: This property is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault + * Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. + */ + @Generated + private List certificateReferences; + + /* + * The list of Packages to be installed on each Compute Node in the Pool. When creating a pool, the package's + * application ID must be fully qualified + * (/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{ + * accountName}/applications/{applicationName}). Changes to Package references affect all new Nodes joining the + * Pool, but do not affect Compute Nodes that are already in the Pool until they are rebooted or reimaged. There is + * a maximum of 10 Package references on any given Pool. + */ + @Generated + private List applicationPackageReferences; + + /* + * The number of task slots that can be used to run concurrent tasks on a single compute node in the pool. The + * default value is 1. The maximum value is the smaller of 4 times the number of cores of the vmSize of the pool or + * 256. + */ + @Generated + private Integer taskSlotsPerNode; + + /* + * How Tasks are distributed across Compute Nodes in a Pool. If not specified, the default is spread. + */ + @Generated + private BatchTaskSchedulingPolicy taskSchedulingPolicy; + + /* + * The list of user Accounts to be created on each Compute Node in the Pool. + */ + @Generated + private List userAccounts; + + /* + * A list of name-value pairs associated with the Pool as metadata. The Batch service does not assign any meaning to + * metadata; it is solely for the use of user code. + */ + @Generated + private List metadata; + + /* + * Mount storage using specified file system for the entire lifetime of the pool. Mount the storage using Azure + * fileshare, NFS, CIFS or Blobfuse based file system. + */ + @Generated + private List mountConfiguration; + + /* + * The desired node communication mode for the pool. If omitted, the default value is Default. + */ + @Generated + private BatchNodeCommunicationMode targetNodeCommunicationMode; + + /* + * The upgrade policy for the Pool. Describes an upgrade policy - automatic, manual, or rolling. + */ + @Generated + private UpgradePolicy upgradePolicy; + + /** + * Creates an instance of BatchPoolCreateParameters class. + * + * @param id the id value to set. + * @param vmSize the vmSize value to set. + */ + @Generated + public BatchPoolCreateParameters(String id, String vmSize) { + this.id = id; + this.vmSize = vmSize; + } + + /** + * Get the id property: A string that uniquely identifies the Pool within the Account. The ID can contain any + * combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 + * characters. The ID is case-preserving and case-insensitive (that is, you may not have two Pool IDs within an + * Account that differ only by case). + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the displayName property: The display name for the Pool. The display name need not be unique and can contain + * any Unicode characters up to a maximum length of 1024. + * + * @return the displayName value. + */ + @Generated + public String getDisplayName() { + return this.displayName; + } + + /** + * Set the displayName property: The display name for the Pool. The display name need not be unique and can contain + * any Unicode characters up to a maximum length of 1024. + * + * @param displayName the displayName value to set. + * @return the BatchPoolCreateParameters object itself. + */ + @Generated + public BatchPoolCreateParameters setDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the vmSize property: The size of virtual machines in the Pool. All virtual machines in a Pool are the same + * size. For information about available VM sizes for Pools using Images from the Virtual Machines Marketplace + * (pools created with virtualMachineConfiguration), see Sizes for Virtual Machines in Azure + * (https://learn.microsoft.com/azure/virtual-machines/sizes/overview). Batch supports all Azure VM sizes except + * STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). + * + * @return the vmSize value. + */ + @Generated + public String getVmSize() { + return this.vmSize; + } + + /** + * Get the virtualMachineConfiguration property: The virtual machine configuration for the Pool. This property must + * be specified. + * + * @return the virtualMachineConfiguration value. + */ + @Generated + public VirtualMachineConfiguration getVirtualMachineConfiguration() { + return this.virtualMachineConfiguration; + } + + /** + * Set the virtualMachineConfiguration property: The virtual machine configuration for the Pool. This property must + * be specified. + * + * @param virtualMachineConfiguration the virtualMachineConfiguration value to set. + * @return the BatchPoolCreateParameters object itself. + */ + @Generated + public BatchPoolCreateParameters + setVirtualMachineConfiguration(VirtualMachineConfiguration virtualMachineConfiguration) { + this.virtualMachineConfiguration = virtualMachineConfiguration; + return this; + } + + /** + * Get the resizeTimeout property: The timeout for allocation of Compute Nodes to the Pool. This timeout applies + * only to manual scaling; it has no effect when enableAutoScale is set to true. The default value is 15 minutes. + * The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service returns an error; + * if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). + * + * @return the resizeTimeout value. + */ + @Generated + public Duration getResizeTimeout() { + return this.resizeTimeout; + } + + /** + * Set the resizeTimeout property: The timeout for allocation of Compute Nodes to the Pool. This timeout applies + * only to manual scaling; it has no effect when enableAutoScale is set to true. The default value is 15 minutes. + * The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service returns an error; + * if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). + * + * @param resizeTimeout the resizeTimeout value to set. + * @return the BatchPoolCreateParameters object itself. + */ + @Generated + public BatchPoolCreateParameters setResizeTimeout(Duration resizeTimeout) { + this.resizeTimeout = resizeTimeout; + return this; + } + + /** + * Get the resourceTags property: The user-specified tags associated with the pool. The user-defined tags to be + * associated with the Azure Batch Pool. When specified, these tags are propagated to the backing Azure resources + * associated with the pool. This property can only be specified when the Batch account was created with the + * poolAllocationMode property set to 'UserSubscription'. + * + * @return the resourceTags value. + */ + @Generated + public Map getResourceTags() { + return this.resourceTags; + } + + /** + * Set the resourceTags property: The user-specified tags associated with the pool. The user-defined tags to be + * associated with the Azure Batch Pool. When specified, these tags are propagated to the backing Azure resources + * associated with the pool. This property can only be specified when the Batch account was created with the + * poolAllocationMode property set to 'UserSubscription'. + * + * @param resourceTags the resourceTags value to set. + * @return the BatchPoolCreateParameters object itself. + */ + @Generated + public BatchPoolCreateParameters setResourceTags(Map resourceTags) { + this.resourceTags = resourceTags; + return this; + } + + /** + * Get the targetDedicatedNodes property: The desired number of dedicated Compute Nodes in the Pool. This property + * must not be specified if enableAutoScale is set to true. If enableAutoScale is set to false, then you must set + * either targetDedicatedNodes, targetLowPriorityNodes, or both. + * + * @return the targetDedicatedNodes value. + */ + @Generated + public Integer getTargetDedicatedNodes() { + return this.targetDedicatedNodes; + } + + /** + * Set the targetDedicatedNodes property: The desired number of dedicated Compute Nodes in the Pool. This property + * must not be specified if enableAutoScale is set to true. If enableAutoScale is set to false, then you must set + * either targetDedicatedNodes, targetLowPriorityNodes, or both. + * + * @param targetDedicatedNodes the targetDedicatedNodes value to set. + * @return the BatchPoolCreateParameters object itself. + */ + @Generated + public BatchPoolCreateParameters setTargetDedicatedNodes(Integer targetDedicatedNodes) { + this.targetDedicatedNodes = targetDedicatedNodes; + return this; + } + + /** + * Get the targetLowPriorityNodes property: The desired number of Spot/Low-priority Compute Nodes in the Pool. This + * property must not be specified if enableAutoScale is set to true. If enableAutoScale is set to false, then you + * must set either targetDedicatedNodes, targetLowPriorityNodes, or both. + * + * @return the targetLowPriorityNodes value. + */ + @Generated + public Integer getTargetLowPriorityNodes() { + return this.targetLowPriorityNodes; + } + + /** + * Set the targetLowPriorityNodes property: The desired number of Spot/Low-priority Compute Nodes in the Pool. This + * property must not be specified if enableAutoScale is set to true. If enableAutoScale is set to false, then you + * must set either targetDedicatedNodes, targetLowPriorityNodes, or both. + * + * @param targetLowPriorityNodes the targetLowPriorityNodes value to set. + * @return the BatchPoolCreateParameters object itself. + */ + @Generated + public BatchPoolCreateParameters setTargetLowPriorityNodes(Integer targetLowPriorityNodes) { + this.targetLowPriorityNodes = targetLowPriorityNodes; + return this; + } + + /** + * Get the enableAutoScale property: Whether the Pool size should automatically adjust over time. If false, at least + * one of targetDedicatedNodes and targetLowPriorityNodes must be specified. If true, the autoScaleFormula property + * is required and the Pool automatically resizes according to the formula. The default value is false. + * + * @return the enableAutoScale value. + */ + @Generated + public Boolean isEnableAutoScale() { + return this.enableAutoScale; + } + + /** + * Set the enableAutoScale property: Whether the Pool size should automatically adjust over time. If false, at least + * one of targetDedicatedNodes and targetLowPriorityNodes must be specified. If true, the autoScaleFormula property + * is required and the Pool automatically resizes according to the formula. The default value is false. + * + * @param enableAutoScale the enableAutoScale value to set. + * @return the BatchPoolCreateParameters object itself. + */ + @Generated + public BatchPoolCreateParameters setEnableAutoScale(Boolean enableAutoScale) { + this.enableAutoScale = enableAutoScale; + return this; + } + + /** + * Get the autoScaleFormula property: A formula for the desired number of Compute Nodes in the Pool. This property + * must not be specified if enableAutoScale is set to false. It is required if enableAutoScale is set to true. The + * formula is checked for validity before the Pool is created. If the formula is not valid, the Batch service + * rejects the request with detailed error information. For more information about specifying this formula, see + * 'Automatically scale Compute Nodes in an Azure Batch Pool' + * (https://learn.microsoft.com/azure/batch/batch-automatic-scaling). + * + * @return the autoScaleFormula value. + */ + @Generated + public String getAutoScaleFormula() { + return this.autoScaleFormula; + } + + /** + * Set the autoScaleFormula property: A formula for the desired number of Compute Nodes in the Pool. This property + * must not be specified if enableAutoScale is set to false. It is required if enableAutoScale is set to true. The + * formula is checked for validity before the Pool is created. If the formula is not valid, the Batch service + * rejects the request with detailed error information. For more information about specifying this formula, see + * 'Automatically scale Compute Nodes in an Azure Batch Pool' + * (https://learn.microsoft.com/azure/batch/batch-automatic-scaling). + * + * @param autoScaleFormula the autoScaleFormula value to set. + * @return the BatchPoolCreateParameters object itself. + */ + @Generated + public BatchPoolCreateParameters setAutoScaleFormula(String autoScaleFormula) { + this.autoScaleFormula = autoScaleFormula; + return this; + } + + /** + * Get the autoScaleEvaluationInterval property: The time interval at which to automatically adjust the Pool size + * according to the autoscale formula. The default value is 15 minutes. The minimum and maximum value are 5 minutes + * and 168 hours respectively. If you specify a value less than 5 minutes or greater than 168 hours, the Batch + * service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). + * + * @return the autoScaleEvaluationInterval value. + */ + @Generated + public Duration getAutoScaleEvaluationInterval() { + return this.autoScaleEvaluationInterval; + } + + /** + * Set the autoScaleEvaluationInterval property: The time interval at which to automatically adjust the Pool size + * according to the autoscale formula. The default value is 15 minutes. The minimum and maximum value are 5 minutes + * and 168 hours respectively. If you specify a value less than 5 minutes or greater than 168 hours, the Batch + * service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). + * + * @param autoScaleEvaluationInterval the autoScaleEvaluationInterval value to set. + * @return the BatchPoolCreateParameters object itself. + */ + @Generated + public BatchPoolCreateParameters setAutoScaleEvaluationInterval(Duration autoScaleEvaluationInterval) { + this.autoScaleEvaluationInterval = autoScaleEvaluationInterval; + return this; + } + + /** + * Get the enableInterNodeCommunication property: Whether the Pool permits direct communication between Compute + * Nodes. Enabling inter-node communication limits the maximum size of the Pool due to deployment restrictions on + * the Compute Nodes of the Pool. This may result in the Pool not reaching its desired size. The default value is + * false. + * + * @return the enableInterNodeCommunication value. + */ + @Generated + public Boolean isEnableInterNodeCommunication() { + return this.enableInterNodeCommunication; + } + + /** + * Set the enableInterNodeCommunication property: Whether the Pool permits direct communication between Compute + * Nodes. Enabling inter-node communication limits the maximum size of the Pool due to deployment restrictions on + * the Compute Nodes of the Pool. This may result in the Pool not reaching its desired size. The default value is + * false. + * + * @param enableInterNodeCommunication the enableInterNodeCommunication value to set. + * @return the BatchPoolCreateParameters object itself. + */ + @Generated + public BatchPoolCreateParameters setEnableInterNodeCommunication(Boolean enableInterNodeCommunication) { + this.enableInterNodeCommunication = enableInterNodeCommunication; + return this; + } + + /** + * Get the networkConfiguration property: The network configuration for the Pool. + * + * @return the networkConfiguration value. + */ + @Generated + public NetworkConfiguration getNetworkConfiguration() { + return this.networkConfiguration; + } + + /** + * Set the networkConfiguration property: The network configuration for the Pool. + * + * @param networkConfiguration the networkConfiguration value to set. + * @return the BatchPoolCreateParameters object itself. + */ + @Generated + public BatchPoolCreateParameters setNetworkConfiguration(NetworkConfiguration networkConfiguration) { + this.networkConfiguration = networkConfiguration; + return this; + } + + /** + * Get the startTask property: A Task specified to run on each Compute Node as it joins the Pool. The Task runs when + * the Compute Node is added to the Pool or when the Compute Node is restarted. + * + * @return the startTask value. + */ + @Generated + public BatchStartTask getStartTask() { + return this.startTask; + } + + /** + * Set the startTask property: A Task specified to run on each Compute Node as it joins the Pool. The Task runs when + * the Compute Node is added to the Pool or when the Compute Node is restarted. + * + * @param startTask the startTask value to set. + * @return the BatchPoolCreateParameters object itself. + */ + @Generated + public BatchPoolCreateParameters setStartTask(BatchStartTask startTask) { + this.startTask = startTask; + return this; + } + + /** + * Get the certificateReferences property: For Windows Nodes, the Batch service installs the Certificates to the + * specified Certificate store and location. + * For Linux Compute Nodes, the Certificates are stored in a directory inside the Task working directory and an + * environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the Task to query for this location. + * For Certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory + * (e.g., /home/{user-name}/certs) and Certificates are placed in that directory. + * Warning: This property is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault + * Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. + * + * @return the certificateReferences value. + */ + @Generated + public List getCertificateReferences() { + return this.certificateReferences; + } + + /** + * Set the certificateReferences property: For Windows Nodes, the Batch service installs the Certificates to the + * specified Certificate store and location. + * For Linux Compute Nodes, the Certificates are stored in a directory inside the Task working directory and an + * environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the Task to query for this location. + * For Certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory + * (e.g., /home/{user-name}/certs) and Certificates are placed in that directory. + * Warning: This property is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault + * Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. + * + * @param certificateReferences the certificateReferences value to set. + * @return the BatchPoolCreateParameters object itself. + */ + @Generated + public BatchPoolCreateParameters setCertificateReferences(List certificateReferences) { + this.certificateReferences = certificateReferences; + return this; + } + + /** + * Get the applicationPackageReferences property: The list of Packages to be installed on each Compute Node in the + * Pool. When creating a pool, the package's application ID must be fully qualified + * (/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}). + * Changes to Package references affect all new Nodes joining the Pool, but do not affect Compute Nodes that are + * already in the Pool until they are rebooted or reimaged. There is a maximum of 10 Package references on any given + * Pool. + * + * @return the applicationPackageReferences value. + */ + @Generated + public List getApplicationPackageReferences() { + return this.applicationPackageReferences; + } + + /** + * Set the applicationPackageReferences property: The list of Packages to be installed on each Compute Node in the + * Pool. When creating a pool, the package's application ID must be fully qualified + * (/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}). + * Changes to Package references affect all new Nodes joining the Pool, but do not affect Compute Nodes that are + * already in the Pool until they are rebooted or reimaged. There is a maximum of 10 Package references on any given + * Pool. + * + * @param applicationPackageReferences the applicationPackageReferences value to set. + * @return the BatchPoolCreateParameters object itself. + */ + @Generated + public BatchPoolCreateParameters + setApplicationPackageReferences(List applicationPackageReferences) { + this.applicationPackageReferences = applicationPackageReferences; + return this; + } + + /** + * Get the taskSlotsPerNode property: The number of task slots that can be used to run concurrent tasks on a single + * compute node in the pool. The default value is 1. The maximum value is the smaller of 4 times the number of cores + * of the vmSize of the pool or 256. + * + * @return the taskSlotsPerNode value. + */ + @Generated + public Integer getTaskSlotsPerNode() { + return this.taskSlotsPerNode; + } + + /** + * Set the taskSlotsPerNode property: The number of task slots that can be used to run concurrent tasks on a single + * compute node in the pool. The default value is 1. The maximum value is the smaller of 4 times the number of cores + * of the vmSize of the pool or 256. + * + * @param taskSlotsPerNode the taskSlotsPerNode value to set. + * @return the BatchPoolCreateParameters object itself. + */ + @Generated + public BatchPoolCreateParameters setTaskSlotsPerNode(Integer taskSlotsPerNode) { + this.taskSlotsPerNode = taskSlotsPerNode; + return this; + } + + /** + * Get the taskSchedulingPolicy property: How Tasks are distributed across Compute Nodes in a Pool. If not + * specified, the default is spread. + * + * @return the taskSchedulingPolicy value. + */ + @Generated + public BatchTaskSchedulingPolicy getTaskSchedulingPolicy() { + return this.taskSchedulingPolicy; + } + + /** + * Set the taskSchedulingPolicy property: How Tasks are distributed across Compute Nodes in a Pool. If not + * specified, the default is spread. + * + * @param taskSchedulingPolicy the taskSchedulingPolicy value to set. + * @return the BatchPoolCreateParameters object itself. + */ + @Generated + public BatchPoolCreateParameters setTaskSchedulingPolicy(BatchTaskSchedulingPolicy taskSchedulingPolicy) { + this.taskSchedulingPolicy = taskSchedulingPolicy; + return this; + } + + /** + * Get the userAccounts property: The list of user Accounts to be created on each Compute Node in the Pool. + * + * @return the userAccounts value. + */ + @Generated + public List getUserAccounts() { + return this.userAccounts; + } + + /** + * Set the userAccounts property: The list of user Accounts to be created on each Compute Node in the Pool. + * + * @param userAccounts the userAccounts value to set. + * @return the BatchPoolCreateParameters object itself. + */ + @Generated + public BatchPoolCreateParameters setUserAccounts(List userAccounts) { + this.userAccounts = userAccounts; + return this; + } + + /** + * Get the metadata property: A list of name-value pairs associated with the Pool as metadata. The Batch service + * does not assign any meaning to metadata; it is solely for the use of user code. + * + * @return the metadata value. + */ + @Generated + public List getMetadata() { + return this.metadata; + } + + /** + * Set the metadata property: A list of name-value pairs associated with the Pool as metadata. The Batch service + * does not assign any meaning to metadata; it is solely for the use of user code. + * + * @param metadata the metadata value to set. + * @return the BatchPoolCreateParameters object itself. + */ + @Generated + public BatchPoolCreateParameters setMetadata(List metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the mountConfiguration property: Mount storage using specified file system for the entire lifetime of the + * pool. Mount the storage using Azure fileshare, NFS, CIFS or Blobfuse based file system. + * + * @return the mountConfiguration value. + */ + @Generated + public List getMountConfiguration() { + return this.mountConfiguration; + } + + /** + * Set the mountConfiguration property: Mount storage using specified file system for the entire lifetime of the + * pool. Mount the storage using Azure fileshare, NFS, CIFS or Blobfuse based file system. + * + * @param mountConfiguration the mountConfiguration value to set. + * @return the BatchPoolCreateParameters object itself. + */ + @Generated + public BatchPoolCreateParameters setMountConfiguration(List mountConfiguration) { + this.mountConfiguration = mountConfiguration; + return this; + } + + /** + * Get the targetNodeCommunicationMode property: The desired node communication mode for the pool. If omitted, the + * default value is Default. + * + * @return the targetNodeCommunicationMode value. + */ + @Generated + public BatchNodeCommunicationMode getTargetNodeCommunicationMode() { + return this.targetNodeCommunicationMode; + } + + /** + * Set the targetNodeCommunicationMode property: The desired node communication mode for the pool. If omitted, the + * default value is Default. + * + * @param targetNodeCommunicationMode the targetNodeCommunicationMode value to set. + * @return the BatchPoolCreateParameters object itself. + */ + @Generated + public BatchPoolCreateParameters + setTargetNodeCommunicationMode(BatchNodeCommunicationMode targetNodeCommunicationMode) { + this.targetNodeCommunicationMode = targetNodeCommunicationMode; + return this; + } + + /** + * Get the upgradePolicy property: The upgrade policy for the Pool. Describes an upgrade policy - automatic, manual, + * or rolling. + * + * @return the upgradePolicy value. + */ + @Generated + public UpgradePolicy getUpgradePolicy() { + return this.upgradePolicy; + } + + /** + * Set the upgradePolicy property: The upgrade policy for the Pool. Describes an upgrade policy - automatic, manual, + * or rolling. + * + * @param upgradePolicy the upgradePolicy value to set. + * @return the BatchPoolCreateParameters object itself. + */ + @Generated + public BatchPoolCreateParameters setUpgradePolicy(UpgradePolicy upgradePolicy) { + this.upgradePolicy = upgradePolicy; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("vmSize", this.vmSize); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeJsonField("virtualMachineConfiguration", this.virtualMachineConfiguration); + jsonWriter.writeStringField("resizeTimeout", CoreUtils.durationToStringWithDays(this.resizeTimeout)); + jsonWriter.writeMapField("resourceTags", this.resourceTags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeNumberField("targetDedicatedNodes", this.targetDedicatedNodes); + jsonWriter.writeNumberField("targetLowPriorityNodes", this.targetLowPriorityNodes); + jsonWriter.writeBooleanField("enableAutoScale", this.enableAutoScale); + jsonWriter.writeStringField("autoScaleFormula", this.autoScaleFormula); + jsonWriter.writeStringField("autoScaleEvaluationInterval", + CoreUtils.durationToStringWithDays(this.autoScaleEvaluationInterval)); + jsonWriter.writeBooleanField("enableInterNodeCommunication", this.enableInterNodeCommunication); + jsonWriter.writeJsonField("networkConfiguration", this.networkConfiguration); + jsonWriter.writeJsonField("startTask", this.startTask); + jsonWriter.writeArrayField("certificateReferences", this.certificateReferences, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("applicationPackageReferences", this.applicationPackageReferences, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeNumberField("taskSlotsPerNode", this.taskSlotsPerNode); + jsonWriter.writeJsonField("taskSchedulingPolicy", this.taskSchedulingPolicy); + jsonWriter.writeArrayField("userAccounts", this.userAccounts, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("metadata", this.metadata, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("mountConfiguration", this.mountConfiguration, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("targetNodeCommunicationMode", + this.targetNodeCommunicationMode == null ? null : this.targetNodeCommunicationMode.toString()); + jsonWriter.writeJsonField("upgradePolicy", this.upgradePolicy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BatchPoolCreateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BatchPoolCreateParameters if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BatchPoolCreateParameters. + */ + @Generated + public static BatchPoolCreateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + String vmSize = null; + String displayName = null; + VirtualMachineConfiguration virtualMachineConfiguration = null; + Duration resizeTimeout = null; + Map resourceTags = null; + Integer targetDedicatedNodes = null; + Integer targetLowPriorityNodes = null; + Boolean enableAutoScale = null; + String autoScaleFormula = null; + Duration autoScaleEvaluationInterval = null; + Boolean enableInterNodeCommunication = null; + NetworkConfiguration networkConfiguration = null; + BatchStartTask startTask = null; + List certificateReferences = null; + List applicationPackageReferences = null; + Integer taskSlotsPerNode = null; + BatchTaskSchedulingPolicy taskSchedulingPolicy = null; + List userAccounts = null; + List metadata = null; + List mountConfiguration = null; + BatchNodeCommunicationMode targetNodeCommunicationMode = null; + UpgradePolicy upgradePolicy = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("vmSize".equals(fieldName)) { + vmSize = reader.getString(); + } else if ("displayName".equals(fieldName)) { + displayName = reader.getString(); + } else if ("virtualMachineConfiguration".equals(fieldName)) { + virtualMachineConfiguration = VirtualMachineConfiguration.fromJson(reader); + } else if ("resizeTimeout".equals(fieldName)) { + resizeTimeout = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); + } else if ("resourceTags".equals(fieldName)) { + resourceTags = reader.readMap(reader1 -> reader1.getString()); + } else if ("targetDedicatedNodes".equals(fieldName)) { + targetDedicatedNodes = reader.getNullable(JsonReader::getInt); + } else if ("targetLowPriorityNodes".equals(fieldName)) { + targetLowPriorityNodes = reader.getNullable(JsonReader::getInt); + } else if ("enableAutoScale".equals(fieldName)) { + enableAutoScale = reader.getNullable(JsonReader::getBoolean); + } else if ("autoScaleFormula".equals(fieldName)) { + autoScaleFormula = reader.getString(); + } else if ("autoScaleEvaluationInterval".equals(fieldName)) { + autoScaleEvaluationInterval + = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); + } else if ("enableInterNodeCommunication".equals(fieldName)) { + enableInterNodeCommunication = reader.getNullable(JsonReader::getBoolean); + } else if ("networkConfiguration".equals(fieldName)) { + networkConfiguration = NetworkConfiguration.fromJson(reader); + } else if ("startTask".equals(fieldName)) { + startTask = BatchStartTask.fromJson(reader); + } else if ("certificateReferences".equals(fieldName)) { + certificateReferences = reader.readArray(reader1 -> BatchCertificateReference.fromJson(reader1)); + } else if ("applicationPackageReferences".equals(fieldName)) { + applicationPackageReferences + = reader.readArray(reader1 -> BatchApplicationPackageReference.fromJson(reader1)); + } else if ("taskSlotsPerNode".equals(fieldName)) { + taskSlotsPerNode = reader.getNullable(JsonReader::getInt); + } else if ("taskSchedulingPolicy".equals(fieldName)) { + taskSchedulingPolicy = BatchTaskSchedulingPolicy.fromJson(reader); + } else if ("userAccounts".equals(fieldName)) { + userAccounts = reader.readArray(reader1 -> UserAccount.fromJson(reader1)); + } else if ("metadata".equals(fieldName)) { + metadata = reader.readArray(reader1 -> BatchMetadataItem.fromJson(reader1)); + } else if ("mountConfiguration".equals(fieldName)) { + mountConfiguration = reader.readArray(reader1 -> MountConfiguration.fromJson(reader1)); + } else if ("targetNodeCommunicationMode".equals(fieldName)) { + targetNodeCommunicationMode = BatchNodeCommunicationMode.fromString(reader.getString()); + } else if ("upgradePolicy".equals(fieldName)) { + upgradePolicy = UpgradePolicy.fromJson(reader); + } else { + reader.skipChildren(); + } + } + BatchPoolCreateParameters deserializedBatchPoolCreateParameters = new BatchPoolCreateParameters(id, vmSize); + deserializedBatchPoolCreateParameters.displayName = displayName; + deserializedBatchPoolCreateParameters.virtualMachineConfiguration = virtualMachineConfiguration; + deserializedBatchPoolCreateParameters.resizeTimeout = resizeTimeout; + deserializedBatchPoolCreateParameters.resourceTags = resourceTags; + deserializedBatchPoolCreateParameters.targetDedicatedNodes = targetDedicatedNodes; + deserializedBatchPoolCreateParameters.targetLowPriorityNodes = targetLowPriorityNodes; + deserializedBatchPoolCreateParameters.enableAutoScale = enableAutoScale; + deserializedBatchPoolCreateParameters.autoScaleFormula = autoScaleFormula; + deserializedBatchPoolCreateParameters.autoScaleEvaluationInterval = autoScaleEvaluationInterval; + deserializedBatchPoolCreateParameters.enableInterNodeCommunication = enableInterNodeCommunication; + deserializedBatchPoolCreateParameters.networkConfiguration = networkConfiguration; + deserializedBatchPoolCreateParameters.startTask = startTask; + deserializedBatchPoolCreateParameters.certificateReferences = certificateReferences; + deserializedBatchPoolCreateParameters.applicationPackageReferences = applicationPackageReferences; + deserializedBatchPoolCreateParameters.taskSlotsPerNode = taskSlotsPerNode; + deserializedBatchPoolCreateParameters.taskSchedulingPolicy = taskSchedulingPolicy; + deserializedBatchPoolCreateParameters.userAccounts = userAccounts; + deserializedBatchPoolCreateParameters.metadata = metadata; + deserializedBatchPoolCreateParameters.mountConfiguration = mountConfiguration; + deserializedBatchPoolCreateParameters.targetNodeCommunicationMode = targetNodeCommunicationMode; + deserializedBatchPoolCreateParameters.upgradePolicy = upgradePolicy; + + return deserializedBatchPoolCreateParameters; + }); + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolDeleteOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolDeleteOptions.java new file mode 100644 index 000000000000..fd72100c1d33 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolDeleteOptions.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Delete Pool operation. + */ +@Fluent +public final class BatchPoolDeleteOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /** + * Creates an instance of BatchPoolDeleteOptions class. + */ + @Generated + public BatchPoolDeleteOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchPoolDeleteOptions object itself. + */ + @Generated + public BatchPoolDeleteOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolEndpointConfiguration.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolEndpointConfiguration.java index b7551b42275d..6a1db43d9b63 100644 --- a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolEndpointConfiguration.java +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolEndpointConfiguration.java @@ -25,7 +25,7 @@ public final class BatchPoolEndpointConfiguration implements JsonSerializable inboundNatPools; + private final List inboundNatPools; /** * Creates an instance of BatchPoolEndpointConfiguration class. @@ -33,7 +33,7 @@ public final class BatchPoolEndpointConfiguration implements JsonSerializable inboundNatPools) { + public BatchPoolEndpointConfiguration(List inboundNatPools) { this.inboundNatPools = inboundNatPools; } @@ -46,7 +46,7 @@ public BatchPoolEndpointConfiguration(List inboundNatPools) { * @return the inboundNatPools value. */ @Generated - public List getInboundNatPools() { + public List getInboundNatPools() { return this.inboundNatPools; } @@ -74,12 +74,12 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { @Generated public static BatchPoolEndpointConfiguration fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - List inboundNatPools = null; + List inboundNatPools = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("inboundNATPools".equals(fieldName)) { - inboundNatPools = reader.readArray(reader1 -> InboundNatPool.fromJson(reader1)); + inboundNatPools = reader.readArray(reader1 -> BatchInboundNatPool.fromJson(reader1)); } else { reader.skipChildren(); } diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolExistsOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolExistsOptions.java index 6aba1ee7042e..007759d28586 100644 --- a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolExistsOptions.java +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolExistsOptions.java @@ -5,6 +5,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; +import java.time.Duration; /** * Optional parameters for Pool Exists operation. @@ -17,7 +18,7 @@ public final class BatchPoolExistsOptions { * value is larger than 30, the default will be used instead.". */ @Generated - private Integer timeOutInSeconds; + private Long timeOutInSeconds; /** * Creates an instance of BatchPoolExistsOptions class. @@ -33,8 +34,11 @@ public BatchPoolExistsOptions() { * @return the timeOutInSeconds value. */ @Generated - public Integer getTimeOutInSeconds() { - return this.timeOutInSeconds; + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); } /** @@ -45,8 +49,12 @@ public Integer getTimeOutInSeconds() { * @return the BatchPoolExistsOptions object itself. */ @Generated - public BatchPoolExistsOptions setTimeOutInSeconds(Integer timeOutInSeconds) { - this.timeOutInSeconds = timeOutInSeconds; + public BatchPoolExistsOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } return this; } } diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolGetOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolGetOptions.java new file mode 100644 index 000000000000..68a3a7816100 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolGetOptions.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; +import java.util.List; + +/** + * Optional parameters for Get Pool operation. + */ +@Fluent +public final class BatchPoolGetOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /* + * An OData $select clause. + */ + @Generated + private List select; + + /* + * An OData $expand clause. + */ + @Generated + private List expand; + + /** + * Creates an instance of BatchPoolGetOptions class. + */ + @Generated + public BatchPoolGetOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchPoolGetOptions object itself. + */ + @Generated + public BatchPoolGetOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } + + /** + * Get the select property: An OData $select clause. + * + * @return the select value. + */ + @Generated + public List getSelect() { + return this.select; + } + + /** + * Set the select property: An OData $select clause. + * + * @param select the select value to set. + * @return the BatchPoolGetOptions object itself. + */ + @Generated + public BatchPoolGetOptions setSelect(List select) { + this.select = select; + return this; + } + + /** + * Get the expand property: An OData $expand clause. + * + * @return the expand value. + */ + @Generated + public List getExpand() { + return this.expand; + } + + /** + * Set the expand property: An OData $expand clause. + * + * @param expand the expand value to set. + * @return the BatchPoolGetOptions object itself. + */ + @Generated + public BatchPoolGetOptions setExpand(List expand) { + this.expand = expand; + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolIdentity.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolIdentity.java index b25d2015d9a8..8471301fd985 100644 --- a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolIdentity.java +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolIdentity.java @@ -34,7 +34,7 @@ public final class BatchPoolIdentity implements JsonSerializable userAssignedIdentities; + private List userAssignedIdentities; /** * Creates an instance of BatchPoolIdentity class. @@ -66,7 +66,7 @@ public BatchPoolIdentityType getType() { * @return the userAssignedIdentities value. */ @Generated - public List getUserAssignedIdentities() { + public List getUserAssignedIdentities() { return this.userAssignedIdentities; } @@ -96,14 +96,14 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { public static BatchPoolIdentity fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { BatchPoolIdentityType type = null; - List userAssignedIdentities = null; + List userAssignedIdentities = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("type".equals(fieldName)) { type = BatchPoolIdentityType.fromString(reader.getString()); } else if ("userAssignedIdentities".equals(fieldName)) { - userAssignedIdentities = reader.readArray(reader1 -> UserAssignedIdentity.fromJson(reader1)); + userAssignedIdentities = reader.readArray(reader1 -> BatchUserAssignedIdentity.fromJson(reader1)); } else { reader.skipChildren(); } diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolNodeCountsListOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolNodeCountsListOptions.java new file mode 100644 index 000000000000..dce93551bda5 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolNodeCountsListOptions.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for List Pool Node Counts operation. + */ +@Fluent +public final class BatchPoolNodeCountsListOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /* + * The maximum number of items to return in the response. A maximum of 1000 + * applications can be returned. + */ + @Generated + private Integer maxPageSize; + + /* + * An OData $filter clause. For more information on constructing this filter, see + * https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-support-images. + */ + @Generated + private String filter; + + /** + * Creates an instance of BatchPoolNodeCountsListOptions class. + */ + @Generated + public BatchPoolNodeCountsListOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchPoolNodeCountsListOptions object itself. + */ + @Generated + public BatchPoolNodeCountsListOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } + + /** + * Get the maxPageSize property: The maximum number of items to return in the response. A maximum of 1000 + * applications can be returned. + * + * @return the maxPageSize value. + */ + @Generated + public Integer getMaxPageSize() { + return this.maxPageSize; + } + + /** + * Set the maxPageSize property: The maximum number of items to return in the response. A maximum of 1000 + * applications can be returned. + * + * @param maxPageSize the maxPageSize value to set. + * @return the BatchPoolNodeCountsListOptions object itself. + */ + @Generated + public BatchPoolNodeCountsListOptions setMaxPageSize(Integer maxPageSize) { + this.maxPageSize = maxPageSize; + return this; + } + + /** + * Get the filter property: An OData $filter clause. For more information on constructing this filter, see + * https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-support-images. + * + * @return the filter value. + */ + @Generated + public String getFilter() { + return this.filter; + } + + /** + * Set the filter property: An OData $filter clause. For more information on constructing this filter, see + * https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-support-images. + * + * @param filter the filter value to set. + * @return the BatchPoolNodeCountsListOptions object itself. + */ + @Generated + public BatchPoolNodeCountsListOptions setFilter(String filter) { + this.filter = filter; + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolPropertiesReplaceOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolPropertiesReplaceOptions.java new file mode 100644 index 000000000000..ce7e37862104 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolPropertiesReplaceOptions.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Replace Pool Properties operation. + */ +@Fluent +public final class BatchPoolPropertiesReplaceOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /** + * Creates an instance of BatchPoolPropertiesReplaceOptions class. + */ + @Generated + public BatchPoolPropertiesReplaceOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchPoolPropertiesReplaceOptions object itself. + */ + @Generated + public BatchPoolPropertiesReplaceOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolReplaceParameters.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolReplaceParameters.java new file mode 100644 index 000000000000..9d33e0c2db7d --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolReplaceParameters.java @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Parameters for replacing properties on an Azure Batch Pool. + */ +@Fluent +public final class BatchPoolReplaceParameters implements JsonSerializable { + /* + * A Task to run on each Compute Node as it joins the Pool. The Task runs when the Compute Node is added to the Pool + * or when the Compute Node is restarted. If this element is present, it overwrites any existing StartTask. If + * omitted, any existing StartTask is removed from the Pool. + */ + @Generated + private BatchStartTask startTask; + + /* + * This list replaces any existing Certificate references configured on the Pool. + * If you specify an empty collection, any existing Certificate references are removed from the Pool. + * For Windows Nodes, the Batch service installs the Certificates to the specified Certificate store and location. + * For Linux Compute Nodes, the Certificates are stored in a directory inside the Task working directory and an + * environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the Task to query for this location. + * For Certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory + * (e.g., /home/{user-name}/certs) and Certificates are placed in that directory. + * Warning: This property is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault + * Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. + */ + @Generated + private final List certificateReferences; + + /* + * The list of Application Packages to be installed on each Compute Node in the Pool. The list replaces any existing + * Application Package references on the Pool. Changes to Application Package references affect all new Compute + * Nodes joining the Pool, but do not affect Compute Nodes that are already in the Pool until they are rebooted or + * reimaged. There is a maximum of 10 Application Package references on any given Pool. If omitted, or if you + * specify an empty collection, any existing Application Packages references are removed from the Pool. A maximum of + * 10 references may be specified on a given Pool. + */ + @Generated + private final List applicationPackageReferences; + + /* + * A list of name-value pairs associated with the Pool as metadata. This list replaces any existing metadata + * configured on the Pool. If omitted, or if you specify an empty collection, any existing metadata is removed from + * the Pool. + */ + @Generated + private final List metadata; + + /* + * The desired node communication mode for the pool. This setting replaces any existing targetNodeCommunication + * setting on the Pool. If omitted, the existing setting is default. + */ + @Generated + private BatchNodeCommunicationMode targetNodeCommunicationMode; + + /** + * Creates an instance of BatchPoolReplaceParameters class. + * + * @param certificateReferences the certificateReferences value to set. + * @param applicationPackageReferences the applicationPackageReferences value to set. + * @param metadata the metadata value to set. + */ + @Generated + public BatchPoolReplaceParameters(List certificateReferences, + List applicationPackageReferences, List metadata) { + this.certificateReferences = certificateReferences; + this.applicationPackageReferences = applicationPackageReferences; + this.metadata = metadata; + } + + /** + * Get the startTask property: A Task to run on each Compute Node as it joins the Pool. The Task runs when the + * Compute Node is added to the Pool or when the Compute Node is restarted. If this element is present, it + * overwrites any existing StartTask. If omitted, any existing StartTask is removed from the Pool. + * + * @return the startTask value. + */ + @Generated + public BatchStartTask getStartTask() { + return this.startTask; + } + + /** + * Set the startTask property: A Task to run on each Compute Node as it joins the Pool. The Task runs when the + * Compute Node is added to the Pool or when the Compute Node is restarted. If this element is present, it + * overwrites any existing StartTask. If omitted, any existing StartTask is removed from the Pool. + * + * @param startTask the startTask value to set. + * @return the BatchPoolReplaceParameters object itself. + */ + @Generated + public BatchPoolReplaceParameters setStartTask(BatchStartTask startTask) { + this.startTask = startTask; + return this; + } + + /** + * Get the certificateReferences property: This list replaces any existing Certificate references configured on the + * Pool. + * If you specify an empty collection, any existing Certificate references are removed from the Pool. + * For Windows Nodes, the Batch service installs the Certificates to the specified Certificate store and location. + * For Linux Compute Nodes, the Certificates are stored in a directory inside the Task working directory and an + * environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the Task to query for this location. + * For Certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory + * (e.g., /home/{user-name}/certs) and Certificates are placed in that directory. + * Warning: This property is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault + * Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. + * + * @return the certificateReferences value. + */ + @Generated + public List getCertificateReferences() { + return this.certificateReferences; + } + + /** + * Get the applicationPackageReferences property: The list of Application Packages to be installed on each Compute + * Node in the Pool. The list replaces any existing Application Package references on the Pool. Changes to + * Application Package references affect all new Compute Nodes joining the Pool, but do not affect Compute Nodes + * that are already in the Pool until they are rebooted or reimaged. There is a maximum of 10 Application Package + * references on any given Pool. If omitted, or if you specify an empty collection, any existing Application + * Packages references are removed from the Pool. A maximum of 10 references may be specified on a given Pool. + * + * @return the applicationPackageReferences value. + */ + @Generated + public List getApplicationPackageReferences() { + return this.applicationPackageReferences; + } + + /** + * Get the metadata property: A list of name-value pairs associated with the Pool as metadata. This list replaces + * any existing metadata configured on the Pool. If omitted, or if you specify an empty collection, any existing + * metadata is removed from the Pool. + * + * @return the metadata value. + */ + @Generated + public List getMetadata() { + return this.metadata; + } + + /** + * Get the targetNodeCommunicationMode property: The desired node communication mode for the pool. This setting + * replaces any existing targetNodeCommunication setting on the Pool. If omitted, the existing setting is default. + * + * @return the targetNodeCommunicationMode value. + */ + @Generated + public BatchNodeCommunicationMode getTargetNodeCommunicationMode() { + return this.targetNodeCommunicationMode; + } + + /** + * Set the targetNodeCommunicationMode property: The desired node communication mode for the pool. This setting + * replaces any existing targetNodeCommunication setting on the Pool. If omitted, the existing setting is default. + * + * @param targetNodeCommunicationMode the targetNodeCommunicationMode value to set. + * @return the BatchPoolReplaceParameters object itself. + */ + @Generated + public BatchPoolReplaceParameters + setTargetNodeCommunicationMode(BatchNodeCommunicationMode targetNodeCommunicationMode) { + this.targetNodeCommunicationMode = targetNodeCommunicationMode; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("certificateReferences", this.certificateReferences, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("applicationPackageReferences", this.applicationPackageReferences, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("metadata", this.metadata, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("startTask", this.startTask); + jsonWriter.writeStringField("targetNodeCommunicationMode", + this.targetNodeCommunicationMode == null ? null : this.targetNodeCommunicationMode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BatchPoolReplaceParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BatchPoolReplaceParameters if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BatchPoolReplaceParameters. + */ + @Generated + public static BatchPoolReplaceParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List certificateReferences = null; + List applicationPackageReferences = null; + List metadata = null; + BatchStartTask startTask = null; + BatchNodeCommunicationMode targetNodeCommunicationMode = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("certificateReferences".equals(fieldName)) { + certificateReferences = reader.readArray(reader1 -> BatchCertificateReference.fromJson(reader1)); + } else if ("applicationPackageReferences".equals(fieldName)) { + applicationPackageReferences + = reader.readArray(reader1 -> BatchApplicationPackageReference.fromJson(reader1)); + } else if ("metadata".equals(fieldName)) { + metadata = reader.readArray(reader1 -> BatchMetadataItem.fromJson(reader1)); + } else if ("startTask".equals(fieldName)) { + startTask = BatchStartTask.fromJson(reader); + } else if ("targetNodeCommunicationMode".equals(fieldName)) { + targetNodeCommunicationMode = BatchNodeCommunicationMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + BatchPoolReplaceParameters deserializedBatchPoolReplaceParameters + = new BatchPoolReplaceParameters(certificateReferences, applicationPackageReferences, metadata); + deserializedBatchPoolReplaceParameters.startTask = startTask; + deserializedBatchPoolReplaceParameters.targetNodeCommunicationMode = targetNodeCommunicationMode; + + return deserializedBatchPoolReplaceParameters; + }); + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolResizeOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolResizeOptions.java new file mode 100644 index 000000000000..6334dd1e0241 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolResizeOptions.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Resize Pool operation. + */ +@Fluent +public final class BatchPoolResizeOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /** + * Creates an instance of BatchPoolResizeOptions class. + */ + @Generated + public BatchPoolResizeOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchPoolResizeOptions object itself. + */ + @Generated + public BatchPoolResizeOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolResizeParameters.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolResizeParameters.java new file mode 100644 index 000000000000..a47fad93677c --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolResizeParameters.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Duration; + +/** + * Parameters for changing the size of an Azure Batch Pool. + */ +@Fluent +public final class BatchPoolResizeParameters implements JsonSerializable { + /* + * The desired number of dedicated Compute Nodes in the Pool. + */ + @Generated + private Integer targetDedicatedNodes; + + /* + * The desired number of Spot/Low-priority Compute Nodes in the Pool. + */ + @Generated + private Integer targetLowPriorityNodes; + + /* + * The timeout for allocation of Nodes to the Pool or removal of Compute Nodes from the Pool. The default value is + * 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service returns + * an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). + */ + @Generated + private Duration resizeTimeout; + + /* + * Determines what to do with a Compute Node and its running task(s) if the Pool size is decreasing. The default + * value is requeue. + */ + @Generated + private BatchNodeDeallocationOption nodeDeallocationOption; + + /** + * Creates an instance of BatchPoolResizeParameters class. + */ + @Generated + public BatchPoolResizeParameters() { + } + + /** + * Get the targetDedicatedNodes property: The desired number of dedicated Compute Nodes in the Pool. + * + * @return the targetDedicatedNodes value. + */ + @Generated + public Integer getTargetDedicatedNodes() { + return this.targetDedicatedNodes; + } + + /** + * Set the targetDedicatedNodes property: The desired number of dedicated Compute Nodes in the Pool. + * + * @param targetDedicatedNodes the targetDedicatedNodes value to set. + * @return the BatchPoolResizeParameters object itself. + */ + @Generated + public BatchPoolResizeParameters setTargetDedicatedNodes(Integer targetDedicatedNodes) { + this.targetDedicatedNodes = targetDedicatedNodes; + return this; + } + + /** + * Get the targetLowPriorityNodes property: The desired number of Spot/Low-priority Compute Nodes in the Pool. + * + * @return the targetLowPriorityNodes value. + */ + @Generated + public Integer getTargetLowPriorityNodes() { + return this.targetLowPriorityNodes; + } + + /** + * Set the targetLowPriorityNodes property: The desired number of Spot/Low-priority Compute Nodes in the Pool. + * + * @param targetLowPriorityNodes the targetLowPriorityNodes value to set. + * @return the BatchPoolResizeParameters object itself. + */ + @Generated + public BatchPoolResizeParameters setTargetLowPriorityNodes(Integer targetLowPriorityNodes) { + this.targetLowPriorityNodes = targetLowPriorityNodes; + return this; + } + + /** + * Get the resizeTimeout property: The timeout for allocation of Nodes to the Pool or removal of Compute Nodes from + * the Pool. The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 + * minutes, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is + * 400 (Bad Request). + * + * @return the resizeTimeout value. + */ + @Generated + public Duration getResizeTimeout() { + return this.resizeTimeout; + } + + /** + * Set the resizeTimeout property: The timeout for allocation of Nodes to the Pool or removal of Compute Nodes from + * the Pool. The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 + * minutes, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is + * 400 (Bad Request). + * + * @param resizeTimeout the resizeTimeout value to set. + * @return the BatchPoolResizeParameters object itself. + */ + @Generated + public BatchPoolResizeParameters setResizeTimeout(Duration resizeTimeout) { + this.resizeTimeout = resizeTimeout; + return this; + } + + /** + * Get the nodeDeallocationOption property: Determines what to do with a Compute Node and its running task(s) if the + * Pool size is decreasing. The default value is requeue. + * + * @return the nodeDeallocationOption value. + */ + @Generated + public BatchNodeDeallocationOption getNodeDeallocationOption() { + return this.nodeDeallocationOption; + } + + /** + * Set the nodeDeallocationOption property: Determines what to do with a Compute Node and its running task(s) if the + * Pool size is decreasing. The default value is requeue. + * + * @param nodeDeallocationOption the nodeDeallocationOption value to set. + * @return the BatchPoolResizeParameters object itself. + */ + @Generated + public BatchPoolResizeParameters setNodeDeallocationOption(BatchNodeDeallocationOption nodeDeallocationOption) { + this.nodeDeallocationOption = nodeDeallocationOption; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("targetDedicatedNodes", this.targetDedicatedNodes); + jsonWriter.writeNumberField("targetLowPriorityNodes", this.targetLowPriorityNodes); + jsonWriter.writeStringField("resizeTimeout", CoreUtils.durationToStringWithDays(this.resizeTimeout)); + jsonWriter.writeStringField("nodeDeallocationOption", + this.nodeDeallocationOption == null ? null : this.nodeDeallocationOption.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BatchPoolResizeParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BatchPoolResizeParameters if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BatchPoolResizeParameters. + */ + @Generated + public static BatchPoolResizeParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BatchPoolResizeParameters deserializedBatchPoolResizeParameters = new BatchPoolResizeParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("targetDedicatedNodes".equals(fieldName)) { + deserializedBatchPoolResizeParameters.targetDedicatedNodes = reader.getNullable(JsonReader::getInt); + } else if ("targetLowPriorityNodes".equals(fieldName)) { + deserializedBatchPoolResizeParameters.targetLowPriorityNodes + = reader.getNullable(JsonReader::getInt); + } else if ("resizeTimeout".equals(fieldName)) { + deserializedBatchPoolResizeParameters.resizeTimeout + = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); + } else if ("nodeDeallocationOption".equals(fieldName)) { + deserializedBatchPoolResizeParameters.nodeDeallocationOption + = BatchNodeDeallocationOption.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedBatchPoolResizeParameters; + }); + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolResizeStopOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolResizeStopOptions.java new file mode 100644 index 000000000000..dd6c2a5c0c9a --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolResizeStopOptions.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Stop Pool Resize operation. + */ +@Fluent +public final class BatchPoolResizeStopOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /** + * Creates an instance of BatchPoolResizeStopOptions class. + */ + @Generated + public BatchPoolResizeStopOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchPoolResizeStopOptions object itself. + */ + @Generated + public BatchPoolResizeStopOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolResourceStatistics.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolResourceStatistics.java index f543b65b612a..c7f5cb9b261b 100644 --- a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolResourceStatistics.java +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolResourceStatistics.java @@ -64,18 +64,6 @@ public final class BatchPoolResourceStatistics implements JsonSerializable Long.parseLong(nonNullReader.getString())); + diskReadIops = reader.getNullable(nonNullReader -> Long.parseLong(nonNullReader.getString())); } else if ("diskWriteIOps".equals(fieldName)) { - diskWriteIOps = reader.getNullable(nonNullReader -> Long.parseLong(nonNullReader.getString())); + diskWriteIops = reader.getNullable(nonNullReader -> Long.parseLong(nonNullReader.getString())); } else if ("diskReadGiB".equals(fieldName)) { diskReadGiB = reader.getDouble(); } else if ("diskWriteGiB".equals(fieldName)) { @@ -358,8 +326,40 @@ public static BatchPoolResourceStatistics fromJson(JsonReader jsonReader) throws } } return new BatchPoolResourceStatistics(startTime, lastUpdateTime, avgCpuPercentage, avgMemoryGiB, - peakMemoryGiB, avgDiskGiB, peakDiskGiB, diskReadIOps, diskWriteIOps, diskReadGiB, diskWriteGiB, + peakMemoryGiB, avgDiskGiB, peakDiskGiB, diskReadIops, diskWriteIops, diskReadGiB, diskWriteGiB, networkReadGiB, networkWriteGiB); }); } + + /* + * The total number of disk read operations across all Compute Nodes in the Pool. + */ + @Generated + private final long diskReadIops; + + /* + * The total number of disk write operations across all Compute Nodes in the Pool. + */ + @Generated + private final long diskWriteIops; + + /** + * Get the diskReadIops property: The total number of disk read operations across all Compute Nodes in the Pool. + * + * @return the diskReadIops value. + */ + @Generated + public long getDiskReadIops() { + return this.diskReadIops; + } + + /** + * Get the diskWriteIops property: The total number of disk write operations across all Compute Nodes in the Pool. + * + * @return the diskWriteIops value. + */ + @Generated + public long getDiskWriteIops() { + return this.diskWriteIops; + } } diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolSpecification.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolSpecification.java index 50006cce0752..8f95c8775760 100644 --- a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolSpecification.java +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolSpecification.java @@ -171,7 +171,7 @@ public final class BatchPoolSpecification implements JsonSerializable metadata; + private List metadata; /* * A list of file systems to mount on each node in the pool. This supports Azure Files, NFS, CIFS/SMB, and Blobfuse. @@ -676,7 +676,7 @@ public BatchPoolSpecification setUserAccounts(List userAccounts) { * @return the metadata value. */ @Generated - public List getMetadata() { + public List getMetadata() { return this.metadata; } @@ -688,7 +688,7 @@ public List getMetadata() { * @return the BatchPoolSpecification object itself. */ @Generated - public BatchPoolSpecification setMetadata(List metadata) { + public BatchPoolSpecification setMetadata(List metadata) { this.metadata = metadata; return this; } @@ -833,7 +833,7 @@ public static BatchPoolSpecification fromJson(JsonReader jsonReader) throws IOEx List certificateReferences = null; List applicationPackageReferences = null; List userAccounts = null; - List metadata = null; + List metadata = null; List mountConfiguration = null; BatchNodeCommunicationMode targetNodeCommunicationMode = null; UpgradePolicy upgradePolicy = null; @@ -879,7 +879,7 @@ public static BatchPoolSpecification fromJson(JsonReader jsonReader) throws IOEx } else if ("userAccounts".equals(fieldName)) { userAccounts = reader.readArray(reader1 -> UserAccount.fromJson(reader1)); } else if ("metadata".equals(fieldName)) { - metadata = reader.readArray(reader1 -> MetadataItem.fromJson(reader1)); + metadata = reader.readArray(reader1 -> BatchMetadataItem.fromJson(reader1)); } else if ("mountConfiguration".equals(fieldName)) { mountConfiguration = reader.readArray(reader1 -> MountConfiguration.fromJson(reader1)); } else if ("targetNodeCommunicationMode".equals(fieldName)) { diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolStatistics.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolStatistics.java index ec821e77eb29..2f0493f93128 100644 --- a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolStatistics.java +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolStatistics.java @@ -39,18 +39,6 @@ public final class BatchPoolStatistics implements JsonSerializable CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("usageStats".equals(fieldName)) { - usageStats = BatchPoolUsageStatistics.fromJson(reader); + usageStatistics = BatchPoolUsageStatistics.fromJson(reader); } else if ("resourceStats".equals(fieldName)) { - resourceStats = BatchPoolResourceStatistics.fromJson(reader); + resourceStatistics = BatchPoolResourceStatistics.fromJson(reader); } else { reader.skipChildren(); } } BatchPoolStatistics deserializedBatchPoolStatistics = new BatchPoolStatistics(url, startTime, lastUpdateTime); - deserializedBatchPoolStatistics.usageStats = usageStats; - deserializedBatchPoolStatistics.resourceStats = resourceStats; + deserializedBatchPoolStatistics.usageStatistics = usageStatistics; + deserializedBatchPoolStatistics.resourceStatistics = resourceStatistics; return deserializedBatchPoolStatistics; }); } + + /* + * Statistics related to Pool usage, such as the amount of core-time used. + */ + @Generated + private BatchPoolUsageStatistics usageStatistics; + + /* + * Statistics related to resource consumption by Compute Nodes in the Pool. + */ + @Generated + private BatchPoolResourceStatistics resourceStatistics; + + /** + * Get the usageStatistics property: Statistics related to Pool usage, such as the amount of core-time used. + * + * @return the usageStatistics value. + */ + @Generated + public BatchPoolUsageStatistics getUsageStatistics() { + return this.usageStatistics; + } + + /** + * Get the resourceStatistics property: Statistics related to resource consumption by Compute Nodes in the Pool. + * + * @return the resourceStatistics value. + */ + @Generated + public BatchPoolResourceStatistics getResourceStatistics() { + return this.resourceStatistics; + } } diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolUpdateOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolUpdateOptions.java new file mode 100644 index 000000000000..bd745604f107 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolUpdateOptions.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Update Pool operation. + */ +@Fluent +public final class BatchPoolUpdateOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /** + * Creates an instance of BatchPoolUpdateOptions class. + */ + @Generated + public BatchPoolUpdateOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchPoolUpdateOptions object itself. + */ + @Generated + public BatchPoolUpdateOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolUpdateParameters.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolUpdateParameters.java new file mode 100644 index 000000000000..687819f4c470 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolUpdateParameters.java @@ -0,0 +1,692 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Parameters for updating an Azure Batch Pool. + */ +@Fluent +public final class BatchPoolUpdateParameters implements JsonSerializable { + /* + * The display name for the Pool. The display name need not be unique and can contain any Unicode characters up to a + * maximum length of 1024. This field can be updated only when the pool is empty. + */ + @Generated + private String displayName; + + /* + * The size of virtual machines in the Pool. For information about available sizes of virtual machines in Pools, see + * Choose a VM size for Compute Nodes in an Azure Batch Pool + * (https://learn.microsoft.com/azure/batch/batch-pool-vm-sizes).

This field can be updated only when the + * pool is empty. + */ + @Generated + private String vmSize; + + /* + * Whether the Pool permits direct communication between Compute Nodes. Enabling inter-node communication limits the + * maximum size of the Pool due to deployment restrictions on the Compute Nodes of the Pool. This may result in the + * Pool not reaching its desired size. The default value is false.

This field can be updated only when + * the pool is empty. + */ + @Generated + private Boolean enableInterNodeCommunication; + + /* + * A Task to run on each Compute Node as it joins the Pool. The Task runs when the Compute Node is added to the Pool + * or when the Compute Node is restarted. If this element is present, it overwrites any existing StartTask. If + * omitted, any existing StartTask is left unchanged. + */ + @Generated + private BatchStartTask startTask; + + /* + * If this element is present, it replaces any existing Certificate references configured on the Pool. + * If omitted, any existing Certificate references are left unchanged. + * For Windows Nodes, the Batch service installs the Certificates to the specified Certificate store and location. + * For Linux Compute Nodes, the Certificates are stored in a directory inside the Task working directory and an + * environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the Task to query for this location. + * For Certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory + * (e.g., /home/{user-name}/certs) and Certificates are placed in that directory. + * Warning: This property is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault + * Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. + */ + @Generated + private List certificateReferences; + + /* + * A list of Packages to be installed on each Compute Node in the Pool. Changes to Package references affect all new + * Nodes joining the Pool, but do not affect Compute Nodes that are already in the Pool until they are rebooted or + * reimaged. If this element is present, it replaces any existing Package references. If you specify an empty + * collection, then all Package references are removed from the Pool. If omitted, any existing Package references + * are left unchanged. + */ + @Generated + private List applicationPackageReferences; + + /* + * A list of name-value pairs associated with the Pool as metadata. If this element is present, it replaces any + * existing metadata configured on the Pool. If you specify an empty collection, any metadata is removed from the + * Pool. If omitted, any existing metadata is left unchanged. + */ + @Generated + private List metadata; + + /* + * The virtual machine configuration for the Pool. This property must be specified.

This field can be + * updated only when the pool is empty. + */ + @Generated + private VirtualMachineConfiguration virtualMachineConfiguration; + + /* + * The desired node communication mode for the pool. If this element is present, it replaces the existing + * targetNodeCommunicationMode configured on the Pool. If omitted, any existing metadata is left unchanged. + */ + @Generated + private BatchNodeCommunicationMode targetNodeCommunicationMode; + + /* + * The number of task slots that can be used to run concurrent tasks on a single compute node in the pool. The + * default value is 1. The maximum value is the smaller of 4 times the number of cores of the vmSize of the pool or + * 256.

This field can be updated only when the pool is empty. + */ + @Generated + private Integer taskSlotsPerNode; + + /* + * How Tasks are distributed across Compute Nodes in a Pool. If not specified, the default is spread.

This field can be updated only when the pool is empty. + */ + @Generated + private BatchTaskSchedulingPolicy taskSchedulingPolicy; + + /* + * The network configuration for the Pool. This field can be updated only when the pool is empty. + */ + @Generated + private NetworkConfiguration networkConfiguration; + + /* + * The user-specified tags associated with the pool. The user-defined tags to be associated with the Azure Batch + * Pool. When specified, these tags are propagated to the backing Azure resources associated with the pool. This + * property can only be specified when the Batch account was created with the poolAllocationMode property set to + * 'UserSubscription'.

This field can be updated only when the pool is empty. + */ + @Generated + private Map resourceTags; + + /* + * The list of user Accounts to be created on each Compute Node in the Pool. This field can be updated only when the + * pool is empty. + */ + @Generated + private List userAccounts; + + /* + * Mount storage using specified file system for the entire lifetime of the pool. Mount the storage using Azure + * fileshare, NFS, CIFS or Blobfuse based file system.

This field can be updated only when the pool is + * empty. + */ + @Generated + private List mountConfiguration; + + /* + * The upgrade policy for the Pool. Describes an upgrade policy - automatic, manual, or rolling.

This + * field can be updated only when the pool is empty. + */ + @Generated + private UpgradePolicy upgradePolicy; + + /** + * Creates an instance of BatchPoolUpdateParameters class. + */ + @Generated + public BatchPoolUpdateParameters() { + } + + /** + * Get the displayName property: The display name for the Pool. The display name need not be unique and can contain + * any Unicode characters up to a maximum length of 1024. This field can be updated only when the pool is empty. + * + * @return the displayName value. + */ + @Generated + public String getDisplayName() { + return this.displayName; + } + + /** + * Set the displayName property: The display name for the Pool. The display name need not be unique and can contain + * any Unicode characters up to a maximum length of 1024. This field can be updated only when the pool is empty. + * + * @param displayName the displayName value to set. + * @return the BatchPoolUpdateParameters object itself. + */ + @Generated + public BatchPoolUpdateParameters setDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the vmSize property: The size of virtual machines in the Pool. For information about available sizes of + * virtual machines in Pools, see Choose a VM size for Compute Nodes in an Azure Batch Pool + * (https://learn.microsoft.com/azure/batch/batch-pool-vm-sizes).<br /><br />This field can be updated + * only when the pool is empty. + * + * @return the vmSize value. + */ + @Generated + public String getVmSize() { + return this.vmSize; + } + + /** + * Set the vmSize property: The size of virtual machines in the Pool. For information about available sizes of + * virtual machines in Pools, see Choose a VM size for Compute Nodes in an Azure Batch Pool + * (https://learn.microsoft.com/azure/batch/batch-pool-vm-sizes).<br /><br />This field can be updated + * only when the pool is empty. + * + * @param vmSize the vmSize value to set. + * @return the BatchPoolUpdateParameters object itself. + */ + @Generated + public BatchPoolUpdateParameters setVmSize(String vmSize) { + this.vmSize = vmSize; + return this; + } + + /** + * Get the enableInterNodeCommunication property: Whether the Pool permits direct communication between Compute + * Nodes. Enabling inter-node communication limits the maximum size of the Pool due to deployment restrictions on + * the Compute Nodes of the Pool. This may result in the Pool not reaching its desired size. The default value is + * false.<br /><br />This field can be updated only when the pool is empty. + * + * @return the enableInterNodeCommunication value. + */ + @Generated + public Boolean isEnableInterNodeCommunication() { + return this.enableInterNodeCommunication; + } + + /** + * Set the enableInterNodeCommunication property: Whether the Pool permits direct communication between Compute + * Nodes. Enabling inter-node communication limits the maximum size of the Pool due to deployment restrictions on + * the Compute Nodes of the Pool. This may result in the Pool not reaching its desired size. The default value is + * false.<br /><br />This field can be updated only when the pool is empty. + * + * @param enableInterNodeCommunication the enableInterNodeCommunication value to set. + * @return the BatchPoolUpdateParameters object itself. + */ + @Generated + public BatchPoolUpdateParameters setEnableInterNodeCommunication(Boolean enableInterNodeCommunication) { + this.enableInterNodeCommunication = enableInterNodeCommunication; + return this; + } + + /** + * Get the startTask property: A Task to run on each Compute Node as it joins the Pool. The Task runs when the + * Compute Node is added to the Pool or when the Compute Node is restarted. If this element is present, it + * overwrites any existing StartTask. If omitted, any existing StartTask is left unchanged. + * + * @return the startTask value. + */ + @Generated + public BatchStartTask getStartTask() { + return this.startTask; + } + + /** + * Set the startTask property: A Task to run on each Compute Node as it joins the Pool. The Task runs when the + * Compute Node is added to the Pool or when the Compute Node is restarted. If this element is present, it + * overwrites any existing StartTask. If omitted, any existing StartTask is left unchanged. + * + * @param startTask the startTask value to set. + * @return the BatchPoolUpdateParameters object itself. + */ + @Generated + public BatchPoolUpdateParameters setStartTask(BatchStartTask startTask) { + this.startTask = startTask; + return this; + } + + /** + * Get the certificateReferences property: If this element is present, it replaces any existing Certificate + * references configured on the Pool. + * If omitted, any existing Certificate references are left unchanged. + * For Windows Nodes, the Batch service installs the Certificates to the specified Certificate store and location. + * For Linux Compute Nodes, the Certificates are stored in a directory inside the Task working directory and an + * environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the Task to query for this location. + * For Certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory + * (e.g., /home/{user-name}/certs) and Certificates are placed in that directory. + * Warning: This property is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault + * Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. + * + * @return the certificateReferences value. + */ + @Generated + public List getCertificateReferences() { + return this.certificateReferences; + } + + /** + * Set the certificateReferences property: If this element is present, it replaces any existing Certificate + * references configured on the Pool. + * If omitted, any existing Certificate references are left unchanged. + * For Windows Nodes, the Batch service installs the Certificates to the specified Certificate store and location. + * For Linux Compute Nodes, the Certificates are stored in a directory inside the Task working directory and an + * environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the Task to query for this location. + * For Certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory + * (e.g., /home/{user-name}/certs) and Certificates are placed in that directory. + * Warning: This property is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault + * Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. + * + * @param certificateReferences the certificateReferences value to set. + * @return the BatchPoolUpdateParameters object itself. + */ + @Generated + public BatchPoolUpdateParameters setCertificateReferences(List certificateReferences) { + this.certificateReferences = certificateReferences; + return this; + } + + /** + * Get the applicationPackageReferences property: A list of Packages to be installed on each Compute Node in the + * Pool. Changes to Package references affect all new Nodes joining the Pool, but do not affect Compute Nodes that + * are already in the Pool until they are rebooted or reimaged. If this element is present, it replaces any existing + * Package references. If you specify an empty collection, then all Package references are removed from the Pool. If + * omitted, any existing Package references are left unchanged. + * + * @return the applicationPackageReferences value. + */ + @Generated + public List getApplicationPackageReferences() { + return this.applicationPackageReferences; + } + + /** + * Set the applicationPackageReferences property: A list of Packages to be installed on each Compute Node in the + * Pool. Changes to Package references affect all new Nodes joining the Pool, but do not affect Compute Nodes that + * are already in the Pool until they are rebooted or reimaged. If this element is present, it replaces any existing + * Package references. If you specify an empty collection, then all Package references are removed from the Pool. If + * omitted, any existing Package references are left unchanged. + * + * @param applicationPackageReferences the applicationPackageReferences value to set. + * @return the BatchPoolUpdateParameters object itself. + */ + @Generated + public BatchPoolUpdateParameters + setApplicationPackageReferences(List applicationPackageReferences) { + this.applicationPackageReferences = applicationPackageReferences; + return this; + } + + /** + * Get the metadata property: A list of name-value pairs associated with the Pool as metadata. If this element is + * present, it replaces any existing metadata configured on the Pool. If you specify an empty collection, any + * metadata is removed from the Pool. If omitted, any existing metadata is left unchanged. + * + * @return the metadata value. + */ + @Generated + public List getMetadata() { + return this.metadata; + } + + /** + * Set the metadata property: A list of name-value pairs associated with the Pool as metadata. If this element is + * present, it replaces any existing metadata configured on the Pool. If you specify an empty collection, any + * metadata is removed from the Pool. If omitted, any existing metadata is left unchanged. + * + * @param metadata the metadata value to set. + * @return the BatchPoolUpdateParameters object itself. + */ + @Generated + public BatchPoolUpdateParameters setMetadata(List metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the virtualMachineConfiguration property: The virtual machine configuration for the Pool. This property must + * be specified.<br /><br />This field can be updated only when the pool is empty. + * + * @return the virtualMachineConfiguration value. + */ + @Generated + public VirtualMachineConfiguration getVirtualMachineConfiguration() { + return this.virtualMachineConfiguration; + } + + /** + * Set the virtualMachineConfiguration property: The virtual machine configuration for the Pool. This property must + * be specified.<br /><br />This field can be updated only when the pool is empty. + * + * @param virtualMachineConfiguration the virtualMachineConfiguration value to set. + * @return the BatchPoolUpdateParameters object itself. + */ + @Generated + public BatchPoolUpdateParameters + setVirtualMachineConfiguration(VirtualMachineConfiguration virtualMachineConfiguration) { + this.virtualMachineConfiguration = virtualMachineConfiguration; + return this; + } + + /** + * Get the targetNodeCommunicationMode property: The desired node communication mode for the pool. If this element + * is present, it replaces the existing targetNodeCommunicationMode configured on the Pool. If omitted, any existing + * metadata is left unchanged. + * + * @return the targetNodeCommunicationMode value. + */ + @Generated + public BatchNodeCommunicationMode getTargetNodeCommunicationMode() { + return this.targetNodeCommunicationMode; + } + + /** + * Set the targetNodeCommunicationMode property: The desired node communication mode for the pool. If this element + * is present, it replaces the existing targetNodeCommunicationMode configured on the Pool. If omitted, any existing + * metadata is left unchanged. + * + * @param targetNodeCommunicationMode the targetNodeCommunicationMode value to set. + * @return the BatchPoolUpdateParameters object itself. + */ + @Generated + public BatchPoolUpdateParameters + setTargetNodeCommunicationMode(BatchNodeCommunicationMode targetNodeCommunicationMode) { + this.targetNodeCommunicationMode = targetNodeCommunicationMode; + return this; + } + + /** + * Get the taskSlotsPerNode property: The number of task slots that can be used to run concurrent tasks on a single + * compute node in the pool. The default value is 1. The maximum value is the smaller of 4 times the number of cores + * of the vmSize of the pool or 256.<br /><br />This field can be updated only when the pool is empty. + * + * @return the taskSlotsPerNode value. + */ + @Generated + public Integer getTaskSlotsPerNode() { + return this.taskSlotsPerNode; + } + + /** + * Set the taskSlotsPerNode property: The number of task slots that can be used to run concurrent tasks on a single + * compute node in the pool. The default value is 1. The maximum value is the smaller of 4 times the number of cores + * of the vmSize of the pool or 256.<br /><br />This field can be updated only when the pool is empty. + * + * @param taskSlotsPerNode the taskSlotsPerNode value to set. + * @return the BatchPoolUpdateParameters object itself. + */ + @Generated + public BatchPoolUpdateParameters setTaskSlotsPerNode(Integer taskSlotsPerNode) { + this.taskSlotsPerNode = taskSlotsPerNode; + return this; + } + + /** + * Get the taskSchedulingPolicy property: How Tasks are distributed across Compute Nodes in a Pool. If not + * specified, the default is spread.<br /><br />This field can be updated only when the pool is empty. + * + * @return the taskSchedulingPolicy value. + */ + @Generated + public BatchTaskSchedulingPolicy getTaskSchedulingPolicy() { + return this.taskSchedulingPolicy; + } + + /** + * Set the taskSchedulingPolicy property: How Tasks are distributed across Compute Nodes in a Pool. If not + * specified, the default is spread.<br /><br />This field can be updated only when the pool is empty. + * + * @param taskSchedulingPolicy the taskSchedulingPolicy value to set. + * @return the BatchPoolUpdateParameters object itself. + */ + @Generated + public BatchPoolUpdateParameters setTaskSchedulingPolicy(BatchTaskSchedulingPolicy taskSchedulingPolicy) { + this.taskSchedulingPolicy = taskSchedulingPolicy; + return this; + } + + /** + * Get the networkConfiguration property: The network configuration for the Pool. This field can be updated only + * when the pool is empty. + * + * @return the networkConfiguration value. + */ + @Generated + public NetworkConfiguration getNetworkConfiguration() { + return this.networkConfiguration; + } + + /** + * Set the networkConfiguration property: The network configuration for the Pool. This field can be updated only + * when the pool is empty. + * + * @param networkConfiguration the networkConfiguration value to set. + * @return the BatchPoolUpdateParameters object itself. + */ + @Generated + public BatchPoolUpdateParameters setNetworkConfiguration(NetworkConfiguration networkConfiguration) { + this.networkConfiguration = networkConfiguration; + return this; + } + + /** + * Get the resourceTags property: The user-specified tags associated with the pool. The user-defined tags to be + * associated with the Azure Batch Pool. When specified, these tags are propagated to the backing Azure resources + * associated with the pool. This property can only be specified when the Batch account was created with the + * poolAllocationMode property set to 'UserSubscription'.<br /><br />This field can be updated only when + * the pool is empty. + * + * @return the resourceTags value. + */ + @Generated + public Map getResourceTags() { + return this.resourceTags; + } + + /** + * Set the resourceTags property: The user-specified tags associated with the pool. The user-defined tags to be + * associated with the Azure Batch Pool. When specified, these tags are propagated to the backing Azure resources + * associated with the pool. This property can only be specified when the Batch account was created with the + * poolAllocationMode property set to 'UserSubscription'.<br /><br />This field can be updated only when + * the pool is empty. + * + * @param resourceTags the resourceTags value to set. + * @return the BatchPoolUpdateParameters object itself. + */ + @Generated + public BatchPoolUpdateParameters setResourceTags(Map resourceTags) { + this.resourceTags = resourceTags; + return this; + } + + /** + * Get the userAccounts property: The list of user Accounts to be created on each Compute Node in the Pool. This + * field can be updated only when the pool is empty. + * + * @return the userAccounts value. + */ + @Generated + public List getUserAccounts() { + return this.userAccounts; + } + + /** + * Set the userAccounts property: The list of user Accounts to be created on each Compute Node in the Pool. This + * field can be updated only when the pool is empty. + * + * @param userAccounts the userAccounts value to set. + * @return the BatchPoolUpdateParameters object itself. + */ + @Generated + public BatchPoolUpdateParameters setUserAccounts(List userAccounts) { + this.userAccounts = userAccounts; + return this; + } + + /** + * Get the mountConfiguration property: Mount storage using specified file system for the entire lifetime of the + * pool. Mount the storage using Azure fileshare, NFS, CIFS or Blobfuse based file system.<br /><br + * />This field can be updated only when the pool is empty. + * + * @return the mountConfiguration value. + */ + @Generated + public List getMountConfiguration() { + return this.mountConfiguration; + } + + /** + * Set the mountConfiguration property: Mount storage using specified file system for the entire lifetime of the + * pool. Mount the storage using Azure fileshare, NFS, CIFS or Blobfuse based file system.<br /><br + * />This field can be updated only when the pool is empty. + * + * @param mountConfiguration the mountConfiguration value to set. + * @return the BatchPoolUpdateParameters object itself. + */ + @Generated + public BatchPoolUpdateParameters setMountConfiguration(List mountConfiguration) { + this.mountConfiguration = mountConfiguration; + return this; + } + + /** + * Get the upgradePolicy property: The upgrade policy for the Pool. Describes an upgrade policy - automatic, manual, + * or rolling.<br /><br />This field can be updated only when the pool is empty. + * + * @return the upgradePolicy value. + */ + @Generated + public UpgradePolicy getUpgradePolicy() { + return this.upgradePolicy; + } + + /** + * Set the upgradePolicy property: The upgrade policy for the Pool. Describes an upgrade policy - automatic, manual, + * or rolling.<br /><br />This field can be updated only when the pool is empty. + * + * @param upgradePolicy the upgradePolicy value to set. + * @return the BatchPoolUpdateParameters object itself. + */ + @Generated + public BatchPoolUpdateParameters setUpgradePolicy(UpgradePolicy upgradePolicy) { + this.upgradePolicy = upgradePolicy; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("vmSize", this.vmSize); + jsonWriter.writeBooleanField("enableInterNodeCommunication", this.enableInterNodeCommunication); + jsonWriter.writeJsonField("startTask", this.startTask); + jsonWriter.writeArrayField("certificateReferences", this.certificateReferences, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("applicationPackageReferences", this.applicationPackageReferences, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("metadata", this.metadata, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("virtualMachineConfiguration", this.virtualMachineConfiguration); + jsonWriter.writeStringField("targetNodeCommunicationMode", + this.targetNodeCommunicationMode == null ? null : this.targetNodeCommunicationMode.toString()); + jsonWriter.writeNumberField("taskSlotsPerNode", this.taskSlotsPerNode); + jsonWriter.writeJsonField("taskSchedulingPolicy", this.taskSchedulingPolicy); + jsonWriter.writeJsonField("networkConfiguration", this.networkConfiguration); + jsonWriter.writeMapField("resourceTags", this.resourceTags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("userAccounts", this.userAccounts, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("mountConfiguration", this.mountConfiguration, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("upgradePolicy", this.upgradePolicy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BatchPoolUpdateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BatchPoolUpdateParameters if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BatchPoolUpdateParameters. + */ + @Generated + public static BatchPoolUpdateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BatchPoolUpdateParameters deserializedBatchPoolUpdateParameters = new BatchPoolUpdateParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("displayName".equals(fieldName)) { + deserializedBatchPoolUpdateParameters.displayName = reader.getString(); + } else if ("vmSize".equals(fieldName)) { + deserializedBatchPoolUpdateParameters.vmSize = reader.getString(); + } else if ("enableInterNodeCommunication".equals(fieldName)) { + deserializedBatchPoolUpdateParameters.enableInterNodeCommunication + = reader.getNullable(JsonReader::getBoolean); + } else if ("startTask".equals(fieldName)) { + deserializedBatchPoolUpdateParameters.startTask = BatchStartTask.fromJson(reader); + } else if ("certificateReferences".equals(fieldName)) { + List certificateReferences + = reader.readArray(reader1 -> BatchCertificateReference.fromJson(reader1)); + deserializedBatchPoolUpdateParameters.certificateReferences = certificateReferences; + } else if ("applicationPackageReferences".equals(fieldName)) { + List applicationPackageReferences + = reader.readArray(reader1 -> BatchApplicationPackageReference.fromJson(reader1)); + deserializedBatchPoolUpdateParameters.applicationPackageReferences = applicationPackageReferences; + } else if ("metadata".equals(fieldName)) { + List metadata = reader.readArray(reader1 -> BatchMetadataItem.fromJson(reader1)); + deserializedBatchPoolUpdateParameters.metadata = metadata; + } else if ("virtualMachineConfiguration".equals(fieldName)) { + deserializedBatchPoolUpdateParameters.virtualMachineConfiguration + = VirtualMachineConfiguration.fromJson(reader); + } else if ("targetNodeCommunicationMode".equals(fieldName)) { + deserializedBatchPoolUpdateParameters.targetNodeCommunicationMode + = BatchNodeCommunicationMode.fromString(reader.getString()); + } else if ("taskSlotsPerNode".equals(fieldName)) { + deserializedBatchPoolUpdateParameters.taskSlotsPerNode = reader.getNullable(JsonReader::getInt); + } else if ("taskSchedulingPolicy".equals(fieldName)) { + deserializedBatchPoolUpdateParameters.taskSchedulingPolicy + = BatchTaskSchedulingPolicy.fromJson(reader); + } else if ("networkConfiguration".equals(fieldName)) { + deserializedBatchPoolUpdateParameters.networkConfiguration = NetworkConfiguration.fromJson(reader); + } else if ("resourceTags".equals(fieldName)) { + Map resourceTags = reader.readMap(reader1 -> reader1.getString()); + deserializedBatchPoolUpdateParameters.resourceTags = resourceTags; + } else if ("userAccounts".equals(fieldName)) { + List userAccounts = reader.readArray(reader1 -> UserAccount.fromJson(reader1)); + deserializedBatchPoolUpdateParameters.userAccounts = userAccounts; + } else if ("mountConfiguration".equals(fieldName)) { + List mountConfiguration + = reader.readArray(reader1 -> MountConfiguration.fromJson(reader1)); + deserializedBatchPoolUpdateParameters.mountConfiguration = mountConfiguration; + } else if ("upgradePolicy".equals(fieldName)) { + deserializedBatchPoolUpdateParameters.upgradePolicy = UpgradePolicy.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBatchPoolUpdateParameters; + }); + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolUsageMetricsListOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolUsageMetricsListOptions.java new file mode 100644 index 000000000000..7f27dc5dcb0b --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolUsageMetricsListOptions.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; +import java.time.OffsetDateTime; + +/** + * Optional parameters for List Pool Usage Metrics operation. + */ +@Fluent +public final class BatchPoolUsageMetricsListOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /* + * The maximum number of items to return in the response. A maximum of 1000 + * applications can be returned. + */ + @Generated + private Integer maxPageSize; + + /* + * The earliest time from which to include metrics. This must be at least two and + * a half hours before the current time. If not specified this defaults to the + * start time of the last aggregation interval currently available. + */ + @Generated + private OffsetDateTime startTime; + + /* + * The latest time from which to include metrics. This must be at least two hours + * before the current time. If not specified this defaults to the end time of the + * last aggregation interval currently available. + */ + @Generated + private OffsetDateTime endtime; + + /* + * An OData $filter clause. For more information on constructing this filter, see + * https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-account-usage-metrics. + */ + @Generated + private String filter; + + /** + * Creates an instance of BatchPoolUsageMetricsListOptions class. + */ + @Generated + public BatchPoolUsageMetricsListOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchPoolUsageMetricsListOptions object itself. + */ + @Generated + public BatchPoolUsageMetricsListOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } + + /** + * Get the maxPageSize property: The maximum number of items to return in the response. A maximum of 1000 + * applications can be returned. + * + * @return the maxPageSize value. + */ + @Generated + public Integer getMaxPageSize() { + return this.maxPageSize; + } + + /** + * Set the maxPageSize property: The maximum number of items to return in the response. A maximum of 1000 + * applications can be returned. + * + * @param maxPageSize the maxPageSize value to set. + * @return the BatchPoolUsageMetricsListOptions object itself. + */ + @Generated + public BatchPoolUsageMetricsListOptions setMaxPageSize(Integer maxPageSize) { + this.maxPageSize = maxPageSize; + return this; + } + + /** + * Get the startTime property: The earliest time from which to include metrics. This must be at least two and + * a half hours before the current time. If not specified this defaults to the + * start time of the last aggregation interval currently available. + * + * @return the startTime value. + */ + @Generated + public OffsetDateTime getStartTime() { + return this.startTime; + } + + /** + * Set the startTime property: The earliest time from which to include metrics. This must be at least two and + * a half hours before the current time. If not specified this defaults to the + * start time of the last aggregation interval currently available. + * + * @param startTime the startTime value to set. + * @return the BatchPoolUsageMetricsListOptions object itself. + */ + @Generated + public BatchPoolUsageMetricsListOptions setStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endtime property: The latest time from which to include metrics. This must be at least two hours + * before the current time. If not specified this defaults to the end time of the + * last aggregation interval currently available. + * + * @return the endtime value. + */ + @Generated + public OffsetDateTime getEndtime() { + return this.endtime; + } + + /** + * Set the endtime property: The latest time from which to include metrics. This must be at least two hours + * before the current time. If not specified this defaults to the end time of the + * last aggregation interval currently available. + * + * @param endtime the endtime value to set. + * @return the BatchPoolUsageMetricsListOptions object itself. + */ + @Generated + public BatchPoolUsageMetricsListOptions setEndtime(OffsetDateTime endtime) { + this.endtime = endtime; + return this; + } + + /** + * Get the filter property: An OData $filter clause. For more information on constructing this filter, see + * https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-account-usage-metrics. + * + * @return the filter value. + */ + @Generated + public String getFilter() { + return this.filter; + } + + /** + * Set the filter property: An OData $filter clause. For more information on constructing this filter, see + * https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-account-usage-metrics. + * + * @param filter the filter value to set. + * @return the BatchPoolUsageMetricsListOptions object itself. + */ + @Generated + public BatchPoolUsageMetricsListOptions setFilter(String filter) { + this.filter = filter; + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolsListOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolsListOptions.java new file mode 100644 index 000000000000..0e2553e0ad56 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPoolsListOptions.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; +import java.util.List; + +/** + * Optional parameters for List Pools operation. + */ +@Fluent +public final class BatchPoolsListOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /* + * The maximum number of items to return in the response. A maximum of 1000 + * applications can be returned. + */ + @Generated + private Integer maxPageSize; + + /* + * An OData $filter clause. For more information on constructing this filter, see + * https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-pools. + */ + @Generated + private String filter; + + /* + * An OData $select clause. + */ + @Generated + private List select; + + /* + * An OData $expand clause. + */ + @Generated + private List expand; + + /** + * Creates an instance of BatchPoolsListOptions class. + */ + @Generated + public BatchPoolsListOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchPoolsListOptions object itself. + */ + @Generated + public BatchPoolsListOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } + + /** + * Get the maxPageSize property: The maximum number of items to return in the response. A maximum of 1000 + * applications can be returned. + * + * @return the maxPageSize value. + */ + @Generated + public Integer getMaxPageSize() { + return this.maxPageSize; + } + + /** + * Set the maxPageSize property: The maximum number of items to return in the response. A maximum of 1000 + * applications can be returned. + * + * @param maxPageSize the maxPageSize value to set. + * @return the BatchPoolsListOptions object itself. + */ + @Generated + public BatchPoolsListOptions setMaxPageSize(Integer maxPageSize) { + this.maxPageSize = maxPageSize; + return this; + } + + /** + * Get the filter property: An OData $filter clause. For more information on constructing this filter, see + * https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-pools. + * + * @return the filter value. + */ + @Generated + public String getFilter() { + return this.filter; + } + + /** + * Set the filter property: An OData $filter clause. For more information on constructing this filter, see + * https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-pools. + * + * @param filter the filter value to set. + * @return the BatchPoolsListOptions object itself. + */ + @Generated + public BatchPoolsListOptions setFilter(String filter) { + this.filter = filter; + return this; + } + + /** + * Get the select property: An OData $select clause. + * + * @return the select value. + */ + @Generated + public List getSelect() { + return this.select; + } + + /** + * Set the select property: An OData $select clause. + * + * @param select the select value to set. + * @return the BatchPoolsListOptions object itself. + */ + @Generated + public BatchPoolsListOptions setSelect(List select) { + this.select = select; + return this; + } + + /** + * Get the expand property: An OData $expand clause. + * + * @return the expand value. + */ + @Generated + public List getExpand() { + return this.expand; + } + + /** + * Set the expand property: An OData $expand clause. + * + * @param expand the expand value to set. + * @return the BatchPoolsListOptions object itself. + */ + @Generated + public BatchPoolsListOptions setExpand(List expand) { + this.expand = expand; + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPublicIpAddressConfiguration.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPublicIpAddressConfiguration.java new file mode 100644 index 000000000000..78d5c110e762 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchPublicIpAddressConfiguration.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The public IP Address configuration of the networking configuration of a Pool. + */ +@Fluent +public final class BatchPublicIpAddressConfiguration implements JsonSerializable { + /* + * The provisioning type for Public IP Addresses for the Pool. The default value is BatchManaged. + */ + @Generated + private IpAddressProvisioningType ipAddressProvisioningType; + + /* + * The list of public IPs which the Batch service will use when provisioning Compute Nodes. The number of IPs + * specified here limits the maximum size of the Pool - 100 dedicated nodes or 100 Spot/Low-priority nodes can be + * allocated for each public IP. For example, a pool needing 250 dedicated VMs would need at least 3 public IPs + * specified. Each element of this collection is of the form: + * /subscriptions/{subscription}/resourceGroups/{group}/providers/Microsoft.Network/publicIPAddresses/{ip}. + */ + @Generated + private List ipAddressIds; + + /** + * Creates an instance of BatchPublicIpAddressConfiguration class. + */ + @Generated + public BatchPublicIpAddressConfiguration() { + } + + /** + * Get the ipAddressProvisioningType property: The provisioning type for Public IP Addresses for the Pool. The + * default value is BatchManaged. + * + * @return the ipAddressProvisioningType value. + */ + @Generated + public IpAddressProvisioningType getIpAddressProvisioningType() { + return this.ipAddressProvisioningType; + } + + /** + * Set the ipAddressProvisioningType property: The provisioning type for Public IP Addresses for the Pool. The + * default value is BatchManaged. + * + * @param ipAddressProvisioningType the ipAddressProvisioningType value to set. + * @return the BatchPublicIpAddressConfiguration object itself. + */ + @Generated + public BatchPublicIpAddressConfiguration + setIpAddressProvisioningType(IpAddressProvisioningType ipAddressProvisioningType) { + this.ipAddressProvisioningType = ipAddressProvisioningType; + return this; + } + + /** + * Get the ipAddressIds property: The list of public IPs which the Batch service will use when provisioning Compute + * Nodes. The number of IPs specified here limits the maximum size of the Pool - 100 dedicated nodes or 100 + * Spot/Low-priority nodes can be allocated for each public IP. For example, a pool needing 250 dedicated VMs would + * need at least 3 public IPs specified. Each element of this collection is of the form: + * /subscriptions/{subscription}/resourceGroups/{group}/providers/Microsoft.Network/publicIPAddresses/{ip}. + * + * @return the ipAddressIds value. + */ + @Generated + public List getIpAddressIds() { + return this.ipAddressIds; + } + + /** + * Set the ipAddressIds property: The list of public IPs which the Batch service will use when provisioning Compute + * Nodes. The number of IPs specified here limits the maximum size of the Pool - 100 dedicated nodes or 100 + * Spot/Low-priority nodes can be allocated for each public IP. For example, a pool needing 250 dedicated VMs would + * need at least 3 public IPs specified. Each element of this collection is of the form: + * /subscriptions/{subscription}/resourceGroups/{group}/providers/Microsoft.Network/publicIPAddresses/{ip}. + * + * @param ipAddressIds the ipAddressIds value to set. + * @return the BatchPublicIpAddressConfiguration object itself. + */ + @Generated + public BatchPublicIpAddressConfiguration setIpAddressIds(List ipAddressIds) { + this.ipAddressIds = ipAddressIds; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("provision", + this.ipAddressProvisioningType == null ? null : this.ipAddressProvisioningType.toString()); + jsonWriter.writeArrayField("ipAddressIds", this.ipAddressIds, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BatchPublicIpAddressConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BatchPublicIpAddressConfiguration if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BatchPublicIpAddressConfiguration. + */ + @Generated + public static BatchPublicIpAddressConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BatchPublicIpAddressConfiguration deserializedBatchPublicIpAddressConfiguration + = new BatchPublicIpAddressConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provision".equals(fieldName)) { + deserializedBatchPublicIpAddressConfiguration.ipAddressProvisioningType + = IpAddressProvisioningType.fromString(reader.getString()); + } else if ("ipAddressIds".equals(fieldName)) { + List ipAddressIds = reader.readArray(reader1 -> reader1.getString()); + deserializedBatchPublicIpAddressConfiguration.ipAddressIds = ipAddressIds; + } else { + reader.skipChildren(); + } + } + + return deserializedBatchPublicIpAddressConfiguration; + }); + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchSubTasksListOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchSubTasksListOptions.java new file mode 100644 index 000000000000..cf258e15256d --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchSubTasksListOptions.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; +import java.util.List; + +/** + * Optional parameters for List SubTasks operation. + */ +@Fluent +public final class BatchSubTasksListOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /* + * An OData $select clause. + */ + @Generated + private List select; + + /** + * Creates an instance of BatchSubTasksListOptions class. + */ + @Generated + public BatchSubTasksListOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchSubTasksListOptions object itself. + */ + @Generated + public BatchSubTasksListOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } + + /** + * Get the select property: An OData $select clause. + * + * @return the select value. + */ + @Generated + public List getSelect() { + return this.select; + } + + /** + * Set the select property: An OData $select clause. + * + * @param select the select value to set. + * @return the BatchSubTasksListOptions object itself. + */ + @Generated + public BatchSubTasksListOptions setSelect(List select) { + this.select = select; + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchSupportedImage.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchSupportedImage.java index ac16d7384aee..3a1407922857 100644 --- a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchSupportedImage.java +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchSupportedImage.java @@ -32,7 +32,7 @@ public final class BatchSupportedImage implements JsonSerializable { String nodeAgentSkuId = null; - ImageReference imageReference = null; + BatchVmImageReference imageReference = null; OSType osType = null; ImageVerificationType verificationType = null; List capabilities = null; @@ -186,7 +169,7 @@ public static BatchSupportedImage fromJson(JsonReader jsonReader) throws IOExcep if ("nodeAgentSKUId".equals(fieldName)) { nodeAgentSkuId = reader.getString(); } else if ("imageReference".equals(fieldName)) { - imageReference = ImageReference.fromJson(reader); + imageReference = BatchVmImageReference.fromJson(reader); } else if ("osType".equals(fieldName)) { osType = OSType.fromString(reader.getString()); } else if ("verificationType".equals(fieldName)) { @@ -207,4 +190,21 @@ public static BatchSupportedImage fromJson(JsonReader jsonReader) throws IOExcep return deserializedBatchSupportedImage; }); } + + /** + * Creates an instance of BatchSupportedImage class. + * + * @param nodeAgentSkuId the nodeAgentSkuId value to set. + * @param imageReference the imageReference value to set. + * @param osType the osType value to set. + * @param verificationType the verificationType value to set. + */ + @Generated + private BatchSupportedImage(String nodeAgentSkuId, BatchVmImageReference imageReference, OSType osType, + ImageVerificationType verificationType) { + this.nodeAgentSkuId = nodeAgentSkuId; + this.imageReference = imageReference; + this.osType = osType; + this.verificationType = verificationType; + } } diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTask.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTask.java index 2ee7fe240325..8e5f91dd349d 100644 --- a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTask.java +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTask.java @@ -151,7 +151,7 @@ public final class BatchTask implements JsonSerializable { * A locality hint that can be used by the Batch service to select a Compute Node on which to start the new Task. */ @Generated - private AffinityInfo affinityInfo; + private BatchAffinityInfo affinityInfo; /* * The execution constraints that apply to this Task. @@ -193,12 +193,6 @@ public final class BatchTask implements JsonSerializable { @Generated private MultiInstanceSettings multiInstanceSettings; - /* - * Resource usage statistics for the Task. - */ - @Generated - private BatchTaskStatistics stats; - /* * The Tasks that this Task depends on. This Task will not be scheduled until all Tasks that it depends on have * completed successfully. If any of those Tasks fail and exhaust their retry counts, this Task will never be @@ -429,7 +423,7 @@ public List getEnvironmentSettings() { * @return the affinityInfo value. */ @Generated - public AffinityInfo getAffinityInfo() { + public BatchAffinityInfo getAffinityInfo() { return this.affinityInfo; } @@ -509,16 +503,6 @@ public MultiInstanceSettings getMultiInstanceSettings() { return this.multiInstanceSettings; } - /** - * Get the stats property: Resource usage statistics for the Task. - * - * @return the stats value. - */ - @Generated - public BatchTaskStatistics getStats() { - return this.stats; - } - /** * Get the dependsOn property: The Tasks that this Task depends on. This Task will not be scheduled until all Tasks * that it depends on have completed successfully. If any of those Tasks fail and exhaust their retry counts, this @@ -627,7 +611,7 @@ public static BatchTask fromJson(JsonReader jsonReader) throws IOException { = reader.readArray(reader1 -> EnvironmentSetting.fromJson(reader1)); deserializedBatchTask.environmentSettings = environmentSettings; } else if ("affinityInfo".equals(fieldName)) { - deserializedBatchTask.affinityInfo = AffinityInfo.fromJson(reader); + deserializedBatchTask.affinityInfo = BatchAffinityInfo.fromJson(reader); } else if ("constraints".equals(fieldName)) { deserializedBatchTask.constraints = BatchTaskConstraints.fromJson(reader); } else if ("requiredSlots".equals(fieldName)) { @@ -641,7 +625,7 @@ public static BatchTask fromJson(JsonReader jsonReader) throws IOException { } else if ("multiInstanceSettings".equals(fieldName)) { deserializedBatchTask.multiInstanceSettings = MultiInstanceSettings.fromJson(reader); } else if ("stats".equals(fieldName)) { - deserializedBatchTask.stats = BatchTaskStatistics.fromJson(reader); + deserializedBatchTask.taskStatistics = BatchTaskStatistics.fromJson(reader); } else if ("dependsOn".equals(fieldName)) { deserializedBatchTask.dependsOn = BatchTaskDependencies.fromJson(reader); } else if ("applicationPackageReferences".equals(fieldName)) { @@ -657,4 +641,20 @@ public static BatchTask fromJson(JsonReader jsonReader) throws IOException { return deserializedBatchTask; }); } + + /* + * Resource usage statistics for the Task. + */ + @Generated + private BatchTaskStatistics taskStatistics; + + /** + * Get the taskStatistics property: Resource usage statistics for the Task. + * + * @return the taskStatistics value. + */ + @Generated + public BatchTaskStatistics getTaskStatistics() { + return this.taskStatistics; + } } diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskCollectionCreateOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskCollectionCreateOptions.java new file mode 100644 index 000000000000..b7394d8cfeb5 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskCollectionCreateOptions.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Create Task Collection operation. + */ +@Fluent +public final class BatchTaskCollectionCreateOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /** + * Creates an instance of BatchTaskCollectionCreateOptions class. + */ + @Generated + public BatchTaskCollectionCreateOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchTaskCollectionCreateOptions object itself. + */ + @Generated + public BatchTaskCollectionCreateOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskCreateOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskCreateOptions.java new file mode 100644 index 000000000000..77f6d323cf4e --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskCreateOptions.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Create Task operation. + */ +@Fluent +public final class BatchTaskCreateOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /** + * Creates an instance of BatchTaskCreateOptions class. + */ + @Generated + public BatchTaskCreateOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchTaskCreateOptions object itself. + */ + @Generated + public BatchTaskCreateOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskCreateParameters.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskCreateParameters.java new file mode 100644 index 000000000000..96ffc40ece71 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskCreateParameters.java @@ -0,0 +1,690 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Parameters for creating an Azure Batch Task. + */ +@Fluent +public final class BatchTaskCreateParameters implements JsonSerializable { + /* + * A string that uniquely identifies the Task within the Job. The ID can contain any combination of alphanumeric + * characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is + * case-preserving and case-insensitive (that is, you may not have two IDs within a Job that differ only by case). + */ + @Generated + private final String id; + + /* + * A display name for the Task. The display name need not be unique and can contain any Unicode characters up to a + * maximum length of 1024. + */ + @Generated + private String displayName; + + /* + * How the Batch service should respond when the Task completes. + */ + @Generated + private ExitConditions exitConditions; + + /* + * The command line of the Task. For multi-instance Tasks, the command line is executed as the primary Task, after + * the primary Task and all subtasks have finished executing the coordination command line. The command line does + * not run under a shell, and therefore cannot take advantage of shell features such as environment variable + * expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for + * example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to + * file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided + * environment variable (https://learn.microsoft.com/azure/batch/batch-compute-node-environment-variables). + */ + @Generated + private final String commandLine; + + /* + * The settings for the container under which the Task runs. If the Pool that will run this Task has + * containerConfiguration set, this must be set as well. If the Pool that will run this Task doesn't have + * containerConfiguration set, this must not be set. When this is specified, all directories recursively below the + * AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all Task + * environment variables are mapped into the container, and the Task command line is executed in the container. + * Files produced in the container outside of AZ_BATCH_NODE_ROOT_DIR might not be reflected to the host disk, + * meaning that Batch file APIs will not be able to access those files. + */ + @Generated + private BatchTaskContainerSettings containerSettings; + + /* + * A list of files that the Batch service will download to the Compute Node before running the command line. For + * multi-instance Tasks, the resource files will only be downloaded to the Compute Node on which the primary Task is + * executed. There is a maximum size for the list of resource files. When the max size is exceeded, the request will + * fail and the response error code will be RequestEntityTooLarge. If this occurs, the collection of ResourceFiles + * must be reduced in size. This can be achieved using .zip files, Application Packages, or Docker Containers. + */ + @Generated + private List resourceFiles; + + /* + * A list of files that the Batch service will upload from the Compute Node after running the command line. For + * multi-instance Tasks, the files will only be uploaded from the Compute Node on which the primary Task is + * executed. + */ + @Generated + private List outputFiles; + + /* + * A list of environment variable settings for the Task. + */ + @Generated + private List environmentSettings; + + /* + * A locality hint that can be used by the Batch service to select a Compute Node on which to start the new Task. + */ + @Generated + private BatchAffinityInfo affinityInfo; + + /* + * The execution constraints that apply to this Task. If you do not specify constraints, the maxTaskRetryCount is + * the maxTaskRetryCount specified for the Job, the maxWallClockTime is infinite, and the retentionTime is 7 days. + */ + @Generated + private BatchTaskConstraints constraints; + + /* + * The number of scheduling slots that the Task required to run. The default is 1. A Task can only be scheduled to + * run on a compute node if the node has enough free scheduling slots available. For multi-instance Tasks, this must + * be 1. + */ + @Generated + private Integer requiredSlots; + + /* + * The user identity under which the Task runs. If omitted, the Task runs as a non-administrative user unique to the + * Task. + */ + @Generated + private UserIdentity userIdentity; + + /* + * An object that indicates that the Task is a multi-instance Task, and contains information about how to run the + * multi-instance Task. + */ + @Generated + private MultiInstanceSettings multiInstanceSettings; + + /* + * The Tasks that this Task depends on. This Task will not be scheduled until all Tasks that it depends on have + * completed successfully. If any of those Tasks fail and exhaust their retry counts, this Task will never be + * scheduled. If the Job does not have usesTaskDependencies set to true, and this element is present, the request + * fails with error code TaskDependenciesNotSpecifiedOnJob. + */ + @Generated + private BatchTaskDependencies dependsOn; + + /* + * A list of Packages that the Batch service will deploy to the Compute Node before running the command line. + * Application packages are downloaded and deployed to a shared directory, not the Task working directory. + * Therefore, if a referenced package is already on the Node, and is up to date, then it is not re-downloaded; the + * existing copy on the Compute Node is used. If a referenced Package cannot be installed, for example because the + * package has been deleted or because download failed, the Task fails. + */ + @Generated + private List applicationPackageReferences; + + /* + * The settings for an authentication token that the Task can use to perform Batch service operations. If this + * property is set, the Batch service provides the Task with an authentication token which can be used to + * authenticate Batch service operations without requiring an Account access key. The token is provided via the + * AZ_BATCH_AUTHENTICATION_TOKEN environment variable. The operations that the Task can carry out using the token + * depend on the settings. For example, a Task can request Job permissions in order to add other Tasks to the Job, + * or check the status of the Job or of other Tasks under the Job. + */ + @Generated + private AuthenticationTokenSettings authenticationTokenSettings; + + /** + * Creates an instance of BatchTaskCreateParameters class. + * + * @param id the id value to set. + * @param commandLine the commandLine value to set. + */ + @Generated + public BatchTaskCreateParameters(String id, String commandLine) { + this.id = id; + this.commandLine = commandLine; + } + + /** + * Get the id property: A string that uniquely identifies the Task within the Job. The ID can contain any + * combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 + * characters. The ID is case-preserving and case-insensitive (that is, you may not have two IDs within a Job that + * differ only by case). + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the displayName property: A display name for the Task. The display name need not be unique and can contain + * any Unicode characters up to a maximum length of 1024. + * + * @return the displayName value. + */ + @Generated + public String getDisplayName() { + return this.displayName; + } + + /** + * Set the displayName property: A display name for the Task. The display name need not be unique and can contain + * any Unicode characters up to a maximum length of 1024. + * + * @param displayName the displayName value to set. + * @return the BatchTaskCreateParameters object itself. + */ + @Generated + public BatchTaskCreateParameters setDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the exitConditions property: How the Batch service should respond when the Task completes. + * + * @return the exitConditions value. + */ + @Generated + public ExitConditions getExitConditions() { + return this.exitConditions; + } + + /** + * Set the exitConditions property: How the Batch service should respond when the Task completes. + * + * @param exitConditions the exitConditions value to set. + * @return the BatchTaskCreateParameters object itself. + */ + @Generated + public BatchTaskCreateParameters setExitConditions(ExitConditions exitConditions) { + this.exitConditions = exitConditions; + return this; + } + + /** + * Get the commandLine property: The command line of the Task. For multi-instance Tasks, the command line is + * executed as the primary Task, after the primary Task and all subtasks have finished executing the coordination + * command line. The command line does not run under a shell, and therefore cannot take advantage of shell features + * such as environment variable expansion. If you want to take advantage of such features, you should invoke the + * shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If + * the command line refers to file paths, it should use a relative path (relative to the Task working directory), or + * use the Batch provided environment variable + * (https://learn.microsoft.com/azure/batch/batch-compute-node-environment-variables). + * + * @return the commandLine value. + */ + @Generated + public String getCommandLine() { + return this.commandLine; + } + + /** + * Get the containerSettings property: The settings for the container under which the Task runs. If the Pool that + * will run this Task has containerConfiguration set, this must be set as well. If the Pool that will run this Task + * doesn't have containerConfiguration set, this must not be set. When this is specified, all directories + * recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into + * the container, all Task environment variables are mapped into the container, and the Task command line is + * executed in the container. Files produced in the container outside of AZ_BATCH_NODE_ROOT_DIR might not be + * reflected to the host disk, meaning that Batch file APIs will not be able to access those files. + * + * @return the containerSettings value. + */ + @Generated + public BatchTaskContainerSettings getContainerSettings() { + return this.containerSettings; + } + + /** + * Set the containerSettings property: The settings for the container under which the Task runs. If the Pool that + * will run this Task has containerConfiguration set, this must be set as well. If the Pool that will run this Task + * doesn't have containerConfiguration set, this must not be set. When this is specified, all directories + * recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into + * the container, all Task environment variables are mapped into the container, and the Task command line is + * executed in the container. Files produced in the container outside of AZ_BATCH_NODE_ROOT_DIR might not be + * reflected to the host disk, meaning that Batch file APIs will not be able to access those files. + * + * @param containerSettings the containerSettings value to set. + * @return the BatchTaskCreateParameters object itself. + */ + @Generated + public BatchTaskCreateParameters setContainerSettings(BatchTaskContainerSettings containerSettings) { + this.containerSettings = containerSettings; + return this; + } + + /** + * Get the resourceFiles property: A list of files that the Batch service will download to the Compute Node before + * running the command line. For multi-instance Tasks, the resource files will only be downloaded to the Compute + * Node on which the primary Task is executed. There is a maximum size for the list of resource files. When the max + * size is exceeded, the request will fail and the response error code will be RequestEntityTooLarge. If this + * occurs, the collection of ResourceFiles must be reduced in size. This can be achieved using .zip files, + * Application Packages, or Docker Containers. + * + * @return the resourceFiles value. + */ + @Generated + public List getResourceFiles() { + return this.resourceFiles; + } + + /** + * Set the resourceFiles property: A list of files that the Batch service will download to the Compute Node before + * running the command line. For multi-instance Tasks, the resource files will only be downloaded to the Compute + * Node on which the primary Task is executed. There is a maximum size for the list of resource files. When the max + * size is exceeded, the request will fail and the response error code will be RequestEntityTooLarge. If this + * occurs, the collection of ResourceFiles must be reduced in size. This can be achieved using .zip files, + * Application Packages, or Docker Containers. + * + * @param resourceFiles the resourceFiles value to set. + * @return the BatchTaskCreateParameters object itself. + */ + @Generated + public BatchTaskCreateParameters setResourceFiles(List resourceFiles) { + this.resourceFiles = resourceFiles; + return this; + } + + /** + * Get the outputFiles property: A list of files that the Batch service will upload from the Compute Node after + * running the command line. For multi-instance Tasks, the files will only be uploaded from the Compute Node on + * which the primary Task is executed. + * + * @return the outputFiles value. + */ + @Generated + public List getOutputFiles() { + return this.outputFiles; + } + + /** + * Set the outputFiles property: A list of files that the Batch service will upload from the Compute Node after + * running the command line. For multi-instance Tasks, the files will only be uploaded from the Compute Node on + * which the primary Task is executed. + * + * @param outputFiles the outputFiles value to set. + * @return the BatchTaskCreateParameters object itself. + */ + @Generated + public BatchTaskCreateParameters setOutputFiles(List outputFiles) { + this.outputFiles = outputFiles; + return this; + } + + /** + * Get the environmentSettings property: A list of environment variable settings for the Task. + * + * @return the environmentSettings value. + */ + @Generated + public List getEnvironmentSettings() { + return this.environmentSettings; + } + + /** + * Set the environmentSettings property: A list of environment variable settings for the Task. + * + * @param environmentSettings the environmentSettings value to set. + * @return the BatchTaskCreateParameters object itself. + */ + @Generated + public BatchTaskCreateParameters setEnvironmentSettings(List environmentSettings) { + this.environmentSettings = environmentSettings; + return this; + } + + /** + * Get the affinityInfo property: A locality hint that can be used by the Batch service to select a Compute Node on + * which to start the new Task. + * + * @return the affinityInfo value. + */ + @Generated + public BatchAffinityInfo getAffinityInfo() { + return this.affinityInfo; + } + + /** + * Set the affinityInfo property: A locality hint that can be used by the Batch service to select a Compute Node on + * which to start the new Task. + * + * @param affinityInfo the affinityInfo value to set. + * @return the BatchTaskCreateParameters object itself. + */ + @Generated + public BatchTaskCreateParameters setAffinityInfo(BatchAffinityInfo affinityInfo) { + this.affinityInfo = affinityInfo; + return this; + } + + /** + * Get the constraints property: The execution constraints that apply to this Task. If you do not specify + * constraints, the maxTaskRetryCount is the maxTaskRetryCount specified for the Job, the maxWallClockTime is + * infinite, and the retentionTime is 7 days. + * + * @return the constraints value. + */ + @Generated + public BatchTaskConstraints getConstraints() { + return this.constraints; + } + + /** + * Set the constraints property: The execution constraints that apply to this Task. If you do not specify + * constraints, the maxTaskRetryCount is the maxTaskRetryCount specified for the Job, the maxWallClockTime is + * infinite, and the retentionTime is 7 days. + * + * @param constraints the constraints value to set. + * @return the BatchTaskCreateParameters object itself. + */ + @Generated + public BatchTaskCreateParameters setConstraints(BatchTaskConstraints constraints) { + this.constraints = constraints; + return this; + } + + /** + * Get the requiredSlots property: The number of scheduling slots that the Task required to run. The default is 1. A + * Task can only be scheduled to run on a compute node if the node has enough free scheduling slots available. For + * multi-instance Tasks, this must be 1. + * + * @return the requiredSlots value. + */ + @Generated + public Integer getRequiredSlots() { + return this.requiredSlots; + } + + /** + * Set the requiredSlots property: The number of scheduling slots that the Task required to run. The default is 1. A + * Task can only be scheduled to run on a compute node if the node has enough free scheduling slots available. For + * multi-instance Tasks, this must be 1. + * + * @param requiredSlots the requiredSlots value to set. + * @return the BatchTaskCreateParameters object itself. + */ + @Generated + public BatchTaskCreateParameters setRequiredSlots(Integer requiredSlots) { + this.requiredSlots = requiredSlots; + return this; + } + + /** + * Get the userIdentity property: The user identity under which the Task runs. If omitted, the Task runs as a + * non-administrative user unique to the Task. + * + * @return the userIdentity value. + */ + @Generated + public UserIdentity getUserIdentity() { + return this.userIdentity; + } + + /** + * Set the userIdentity property: The user identity under which the Task runs. If omitted, the Task runs as a + * non-administrative user unique to the Task. + * + * @param userIdentity the userIdentity value to set. + * @return the BatchTaskCreateParameters object itself. + */ + @Generated + public BatchTaskCreateParameters setUserIdentity(UserIdentity userIdentity) { + this.userIdentity = userIdentity; + return this; + } + + /** + * Get the multiInstanceSettings property: An object that indicates that the Task is a multi-instance Task, and + * contains information about how to run the multi-instance Task. + * + * @return the multiInstanceSettings value. + */ + @Generated + public MultiInstanceSettings getMultiInstanceSettings() { + return this.multiInstanceSettings; + } + + /** + * Set the multiInstanceSettings property: An object that indicates that the Task is a multi-instance Task, and + * contains information about how to run the multi-instance Task. + * + * @param multiInstanceSettings the multiInstanceSettings value to set. + * @return the BatchTaskCreateParameters object itself. + */ + @Generated + public BatchTaskCreateParameters setMultiInstanceSettings(MultiInstanceSettings multiInstanceSettings) { + this.multiInstanceSettings = multiInstanceSettings; + return this; + } + + /** + * Get the dependsOn property: The Tasks that this Task depends on. This Task will not be scheduled until all Tasks + * that it depends on have completed successfully. If any of those Tasks fail and exhaust their retry counts, this + * Task will never be scheduled. If the Job does not have usesTaskDependencies set to true, and this element is + * present, the request fails with error code TaskDependenciesNotSpecifiedOnJob. + * + * @return the dependsOn value. + */ + @Generated + public BatchTaskDependencies getDependsOn() { + return this.dependsOn; + } + + /** + * Set the dependsOn property: The Tasks that this Task depends on. This Task will not be scheduled until all Tasks + * that it depends on have completed successfully. If any of those Tasks fail and exhaust their retry counts, this + * Task will never be scheduled. If the Job does not have usesTaskDependencies set to true, and this element is + * present, the request fails with error code TaskDependenciesNotSpecifiedOnJob. + * + * @param dependsOn the dependsOn value to set. + * @return the BatchTaskCreateParameters object itself. + */ + @Generated + public BatchTaskCreateParameters setDependsOn(BatchTaskDependencies dependsOn) { + this.dependsOn = dependsOn; + return this; + } + + /** + * Get the applicationPackageReferences property: A list of Packages that the Batch service will deploy to the + * Compute Node before running the command line. Application packages are downloaded and deployed to a shared + * directory, not the Task working directory. Therefore, if a referenced package is already on the Node, and is up + * to date, then it is not re-downloaded; the existing copy on the Compute Node is used. If a referenced Package + * cannot be installed, for example because the package has been deleted or because download failed, the Task fails. + * + * @return the applicationPackageReferences value. + */ + @Generated + public List getApplicationPackageReferences() { + return this.applicationPackageReferences; + } + + /** + * Set the applicationPackageReferences property: A list of Packages that the Batch service will deploy to the + * Compute Node before running the command line. Application packages are downloaded and deployed to a shared + * directory, not the Task working directory. Therefore, if a referenced package is already on the Node, and is up + * to date, then it is not re-downloaded; the existing copy on the Compute Node is used. If a referenced Package + * cannot be installed, for example because the package has been deleted or because download failed, the Task fails. + * + * @param applicationPackageReferences the applicationPackageReferences value to set. + * @return the BatchTaskCreateParameters object itself. + */ + @Generated + public BatchTaskCreateParameters + setApplicationPackageReferences(List applicationPackageReferences) { + this.applicationPackageReferences = applicationPackageReferences; + return this; + } + + /** + * Get the authenticationTokenSettings property: The settings for an authentication token that the Task can use to + * perform Batch service operations. If this property is set, the Batch service provides the Task with an + * authentication token which can be used to authenticate Batch service operations without requiring an Account + * access key. The token is provided via the AZ_BATCH_AUTHENTICATION_TOKEN environment variable. The operations that + * the Task can carry out using the token depend on the settings. For example, a Task can request Job permissions in + * order to add other Tasks to the Job, or check the status of the Job or of other Tasks under the Job. + * + * @return the authenticationTokenSettings value. + */ + @Generated + public AuthenticationTokenSettings getAuthenticationTokenSettings() { + return this.authenticationTokenSettings; + } + + /** + * Set the authenticationTokenSettings property: The settings for an authentication token that the Task can use to + * perform Batch service operations. If this property is set, the Batch service provides the Task with an + * authentication token which can be used to authenticate Batch service operations without requiring an Account + * access key. The token is provided via the AZ_BATCH_AUTHENTICATION_TOKEN environment variable. The operations that + * the Task can carry out using the token depend on the settings. For example, a Task can request Job permissions in + * order to add other Tasks to the Job, or check the status of the Job or of other Tasks under the Job. + * + * @param authenticationTokenSettings the authenticationTokenSettings value to set. + * @return the BatchTaskCreateParameters object itself. + */ + @Generated + public BatchTaskCreateParameters + setAuthenticationTokenSettings(AuthenticationTokenSettings authenticationTokenSettings) { + this.authenticationTokenSettings = authenticationTokenSettings; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("commandLine", this.commandLine); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeJsonField("exitConditions", this.exitConditions); + jsonWriter.writeJsonField("containerSettings", this.containerSettings); + jsonWriter.writeArrayField("resourceFiles", this.resourceFiles, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("outputFiles", this.outputFiles, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("environmentSettings", this.environmentSettings, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("affinityInfo", this.affinityInfo); + jsonWriter.writeJsonField("constraints", this.constraints); + jsonWriter.writeNumberField("requiredSlots", this.requiredSlots); + jsonWriter.writeJsonField("userIdentity", this.userIdentity); + jsonWriter.writeJsonField("multiInstanceSettings", this.multiInstanceSettings); + jsonWriter.writeJsonField("dependsOn", this.dependsOn); + jsonWriter.writeArrayField("applicationPackageReferences", this.applicationPackageReferences, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("authenticationTokenSettings", this.authenticationTokenSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BatchTaskCreateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BatchTaskCreateParameters if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BatchTaskCreateParameters. + */ + @Generated + public static BatchTaskCreateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + String commandLine = null; + String displayName = null; + ExitConditions exitConditions = null; + BatchTaskContainerSettings containerSettings = null; + List resourceFiles = null; + List outputFiles = null; + List environmentSettings = null; + BatchAffinityInfo affinityInfo = null; + BatchTaskConstraints constraints = null; + Integer requiredSlots = null; + UserIdentity userIdentity = null; + MultiInstanceSettings multiInstanceSettings = null; + BatchTaskDependencies dependsOn = null; + List applicationPackageReferences = null; + AuthenticationTokenSettings authenticationTokenSettings = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("commandLine".equals(fieldName)) { + commandLine = reader.getString(); + } else if ("displayName".equals(fieldName)) { + displayName = reader.getString(); + } else if ("exitConditions".equals(fieldName)) { + exitConditions = ExitConditions.fromJson(reader); + } else if ("containerSettings".equals(fieldName)) { + containerSettings = BatchTaskContainerSettings.fromJson(reader); + } else if ("resourceFiles".equals(fieldName)) { + resourceFiles = reader.readArray(reader1 -> ResourceFile.fromJson(reader1)); + } else if ("outputFiles".equals(fieldName)) { + outputFiles = reader.readArray(reader1 -> OutputFile.fromJson(reader1)); + } else if ("environmentSettings".equals(fieldName)) { + environmentSettings = reader.readArray(reader1 -> EnvironmentSetting.fromJson(reader1)); + } else if ("affinityInfo".equals(fieldName)) { + affinityInfo = BatchAffinityInfo.fromJson(reader); + } else if ("constraints".equals(fieldName)) { + constraints = BatchTaskConstraints.fromJson(reader); + } else if ("requiredSlots".equals(fieldName)) { + requiredSlots = reader.getNullable(JsonReader::getInt); + } else if ("userIdentity".equals(fieldName)) { + userIdentity = UserIdentity.fromJson(reader); + } else if ("multiInstanceSettings".equals(fieldName)) { + multiInstanceSettings = MultiInstanceSettings.fromJson(reader); + } else if ("dependsOn".equals(fieldName)) { + dependsOn = BatchTaskDependencies.fromJson(reader); + } else if ("applicationPackageReferences".equals(fieldName)) { + applicationPackageReferences + = reader.readArray(reader1 -> BatchApplicationPackageReference.fromJson(reader1)); + } else if ("authenticationTokenSettings".equals(fieldName)) { + authenticationTokenSettings = AuthenticationTokenSettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + BatchTaskCreateParameters deserializedBatchTaskCreateParameters + = new BatchTaskCreateParameters(id, commandLine); + deserializedBatchTaskCreateParameters.displayName = displayName; + deserializedBatchTaskCreateParameters.exitConditions = exitConditions; + deserializedBatchTaskCreateParameters.containerSettings = containerSettings; + deserializedBatchTaskCreateParameters.resourceFiles = resourceFiles; + deserializedBatchTaskCreateParameters.outputFiles = outputFiles; + deserializedBatchTaskCreateParameters.environmentSettings = environmentSettings; + deserializedBatchTaskCreateParameters.affinityInfo = affinityInfo; + deserializedBatchTaskCreateParameters.constraints = constraints; + deserializedBatchTaskCreateParameters.requiredSlots = requiredSlots; + deserializedBatchTaskCreateParameters.userIdentity = userIdentity; + deserializedBatchTaskCreateParameters.multiInstanceSettings = multiInstanceSettings; + deserializedBatchTaskCreateParameters.dependsOn = dependsOn; + deserializedBatchTaskCreateParameters.applicationPackageReferences = applicationPackageReferences; + deserializedBatchTaskCreateParameters.authenticationTokenSettings = authenticationTokenSettings; + + return deserializedBatchTaskCreateParameters; + }); + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskCreateResult.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskCreateResult.java new file mode 100644 index 000000000000..cec10afc5586 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskCreateResult.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Result for a single Task created as part of an add Task collection operation. + */ +@Immutable +public final class BatchTaskCreateResult implements JsonSerializable { + /* + * The status of the add Task request. + */ + @Generated + private final BatchTaskAddStatus status; + + /* + * The ID of the Task for which this is the result. + */ + @Generated + private final String taskId; + + /* + * The ETag of the Task, if the Task was successfully added. You can use this to detect whether the Task has changed + * between requests. In particular, you can be pass the ETag with an Update Task request to specify that your + * changes should take effect only if nobody else has modified the Job in the meantime. + */ + @Generated + private String eTag; + + /* + * The last modified time of the Task. + */ + @Generated + private OffsetDateTime lastModified; + + /* + * The URL of the Task, if the Task was successfully added. + */ + @Generated + private String location; + + /* + * The error encountered while attempting to add the Task. + */ + @Generated + private BatchError error; + + /** + * Creates an instance of BatchTaskCreateResult class. + * + * @param status the status value to set. + * @param taskId the taskId value to set. + */ + @Generated + private BatchTaskCreateResult(BatchTaskAddStatus status, String taskId) { + this.status = status; + this.taskId = taskId; + } + + /** + * Get the status property: The status of the add Task request. + * + * @return the status value. + */ + @Generated + public BatchTaskAddStatus getStatus() { + return this.status; + } + + /** + * Get the taskId property: The ID of the Task for which this is the result. + * + * @return the taskId value. + */ + @Generated + public String getTaskId() { + return this.taskId; + } + + /** + * Get the eTag property: The ETag of the Task, if the Task was successfully added. You can use this to detect + * whether the Task has changed between requests. In particular, you can be pass the ETag with an Update Task + * request to specify that your changes should take effect only if nobody else has modified the Job in the meantime. + * + * @return the eTag value. + */ + @Generated + public String getETag() { + return this.eTag; + } + + /** + * Get the lastModified property: The last modified time of the Task. + * + * @return the lastModified value. + */ + @Generated + public OffsetDateTime getLastModified() { + return this.lastModified; + } + + /** + * Get the location property: The URL of the Task, if the Task was successfully added. + * + * @return the location value. + */ + @Generated + public String getLocation() { + return this.location; + } + + /** + * Get the error property: The error encountered while attempting to add the Task. + * + * @return the error value. + */ + @Generated + public BatchError getError() { + return this.error; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("taskId", this.taskId); + jsonWriter.writeStringField("eTag", this.eTag); + jsonWriter.writeStringField("lastModified", + this.lastModified == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastModified)); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeJsonField("error", this.error); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BatchTaskCreateResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BatchTaskCreateResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BatchTaskCreateResult. + */ + @Generated + public static BatchTaskCreateResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BatchTaskAddStatus status = null; + String taskId = null; + String eTag = null; + OffsetDateTime lastModified = null; + String location = null; + BatchError error = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + status = BatchTaskAddStatus.fromString(reader.getString()); + } else if ("taskId".equals(fieldName)) { + taskId = reader.getString(); + } else if ("eTag".equals(fieldName)) { + eTag = reader.getString(); + } else if ("lastModified".equals(fieldName)) { + lastModified = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("location".equals(fieldName)) { + location = reader.getString(); + } else if ("error".equals(fieldName)) { + error = BatchError.fromJson(reader); + } else { + reader.skipChildren(); + } + } + BatchTaskCreateResult deserializedBatchTaskCreateResult = new BatchTaskCreateResult(status, taskId); + deserializedBatchTaskCreateResult.eTag = eTag; + deserializedBatchTaskCreateResult.lastModified = lastModified; + deserializedBatchTaskCreateResult.location = location; + deserializedBatchTaskCreateResult.error = error; + + return deserializedBatchTaskCreateResult; + }); + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskDeleteOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskDeleteOptions.java new file mode 100644 index 000000000000..2d3f71a105fa --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskDeleteOptions.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Delete Task operation. + */ +@Fluent +public final class BatchTaskDeleteOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /** + * Creates an instance of BatchTaskDeleteOptions class. + */ + @Generated + public BatchTaskDeleteOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchTaskDeleteOptions object itself. + */ + @Generated + public BatchTaskDeleteOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskFailureInfo.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskFailureInfo.java index d39d7bfc3047..e1fc255c4bc8 100644 --- a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskFailureInfo.java +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskFailureInfo.java @@ -22,7 +22,7 @@ public final class BatchTaskFailureInfo implements JsonSerializable details; - /** - * Creates an instance of BatchTaskFailureInfo class. - * - * @param category the category value to set. - */ - @Generated - private BatchTaskFailureInfo(ErrorCategory category) { - this.category = category; - } - /** * Get the category property: The category of the Task error. * * @return the category value. */ @Generated - public ErrorCategory getCategory() { + public BatchErrorSourceCategory getCategory() { return this.category; } @@ -120,7 +110,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { @Generated public static BatchTaskFailureInfo fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - ErrorCategory category = null; + BatchErrorSourceCategory category = null; String code = null; String message = null; List details = null; @@ -128,7 +118,7 @@ public static BatchTaskFailureInfo fromJson(JsonReader jsonReader) throws IOExce String fieldName = reader.getFieldName(); reader.nextToken(); if ("category".equals(fieldName)) { - category = ErrorCategory.fromString(reader.getString()); + category = BatchErrorSourceCategory.fromString(reader.getString()); } else if ("code".equals(fieldName)) { code = reader.getString(); } else if ("message".equals(fieldName)) { @@ -146,4 +136,14 @@ public static BatchTaskFailureInfo fromJson(JsonReader jsonReader) throws IOExce return deserializedBatchTaskFailureInfo; }); } + + /** + * Creates an instance of BatchTaskFailureInfo class. + * + * @param category the category value to set. + */ + @Generated + private BatchTaskFailureInfo(BatchErrorSourceCategory category) { + this.category = category; + } } diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskFailureMode.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskFailureMode.java new file mode 100644 index 000000000000..db5796ae638b --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskFailureMode.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * TaskFailure enums. + */ +public final class BatchTaskFailureMode extends ExpandableStringEnum { + /** + * Do nothing. The Job remains active unless terminated or disabled by some other means. + */ + @Generated + public static final BatchTaskFailureMode NO_ACTION = fromString("noaction"); + + /** + * Terminate the Job. The Job's terminationReason is set to 'AllTasksComplete'. + */ + @Generated + public static final BatchTaskFailureMode PERFORM_EXIT_OPTIONS_JOB_ACTION + = fromString("performexitoptionsjobaction"); + + /** + * Creates a new instance of BatchTaskFailureMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public BatchTaskFailureMode() { + } + + /** + * Creates or finds a BatchTaskFailureMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding BatchTaskFailureMode. + */ + @Generated + public static BatchTaskFailureMode fromString(String name) { + return fromString(name, BatchTaskFailureMode.class); + } + + /** + * Gets known BatchTaskFailureMode values. + * + * @return known BatchTaskFailureMode values. + */ + @Generated + public static Collection values() { + return values(BatchTaskFailureMode.class); + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskFileDeleteOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskFileDeleteOptions.java new file mode 100644 index 000000000000..f4a6bf5d4340 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskFileDeleteOptions.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Delete Task File operation. + */ +@Fluent +public final class BatchTaskFileDeleteOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /* + * Whether to delete children of a directory. If the filePath parameter represents + * a directory instead of a file, you can set recursive to true to delete the + * directory and all of the files and subdirectories in it. If recursive is false + * then the directory must be empty or deletion will fail. + */ + @Generated + private Boolean recursive; + + /** + * Creates an instance of BatchTaskFileDeleteOptions class. + */ + @Generated + public BatchTaskFileDeleteOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchTaskFileDeleteOptions object itself. + */ + @Generated + public BatchTaskFileDeleteOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } + + /** + * Get the recursive property: Whether to delete children of a directory. If the filePath parameter represents + * a directory instead of a file, you can set recursive to true to delete the + * directory and all of the files and subdirectories in it. If recursive is false + * then the directory must be empty or deletion will fail. + * + * @return the recursive value. + */ + @Generated + public Boolean isRecursive() { + return this.recursive; + } + + /** + * Set the recursive property: Whether to delete children of a directory. If the filePath parameter represents + * a directory instead of a file, you can set recursive to true to delete the + * directory and all of the files and subdirectories in it. If recursive is false + * then the directory must be empty or deletion will fail. + * + * @param recursive the recursive value to set. + * @return the BatchTaskFileDeleteOptions object itself. + */ + @Generated + public BatchTaskFileDeleteOptions setRecursive(Boolean recursive) { + this.recursive = recursive; + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskFileGetOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskFileGetOptions.java new file mode 100644 index 000000000000..b6cd8e605252 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskFileGetOptions.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.core.util.DateTimeRfc1123; +import java.time.Duration; +import java.time.OffsetDateTime; + +/** + * Optional parameters for Get Task File operation. + */ +@Fluent +public final class BatchTaskFileGetOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /* + * A timestamp indicating the last modified time of the resource known to the + * client. The operation will be performed only if the resource on the service has + * been modified since the specified time. + */ + @Generated + private DateTimeRfc1123 ifModifiedSince; + + /* + * A timestamp indicating the last modified time of the resource known to the + * client. The operation will be performed only if the resource on the service has + * not been modified since the specified time. + */ + @Generated + private DateTimeRfc1123 ifUnmodifiedSince; + + /* + * The byte range to be retrieved. The default is to retrieve the entire file. The + * format is bytes=startRange-endRange. + */ + @Generated + private String ocpRange; + + /** + * Creates an instance of BatchTaskFileGetOptions class. + */ + @Generated + public BatchTaskFileGetOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchTaskFileGetOptions object itself. + */ + @Generated + public BatchTaskFileGetOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } + + /** + * Get the ifModifiedSince property: A timestamp indicating the last modified time of the resource known to the + * client. The operation will be performed only if the resource on the service has + * been modified since the specified time. + * + * @return the ifModifiedSince value. + */ + @Generated + public OffsetDateTime getIfModifiedSince() { + if (this.ifModifiedSince == null) { + return null; + } + return this.ifModifiedSince.getDateTime(); + } + + /** + * Set the ifModifiedSince property: A timestamp indicating the last modified time of the resource known to the + * client. The operation will be performed only if the resource on the service has + * been modified since the specified time. + * + * @param ifModifiedSince the ifModifiedSince value to set. + * @return the BatchTaskFileGetOptions object itself. + */ + @Generated + public BatchTaskFileGetOptions setIfModifiedSince(OffsetDateTime ifModifiedSince) { + if (ifModifiedSince == null) { + this.ifModifiedSince = null; + } else { + this.ifModifiedSince = new DateTimeRfc1123(ifModifiedSince); + } + return this; + } + + /** + * Get the ifUnmodifiedSince property: A timestamp indicating the last modified time of the resource known to the + * client. The operation will be performed only if the resource on the service has + * not been modified since the specified time. + * + * @return the ifUnmodifiedSince value. + */ + @Generated + public OffsetDateTime getIfUnmodifiedSince() { + if (this.ifUnmodifiedSince == null) { + return null; + } + return this.ifUnmodifiedSince.getDateTime(); + } + + /** + * Set the ifUnmodifiedSince property: A timestamp indicating the last modified time of the resource known to the + * client. The operation will be performed only if the resource on the service has + * not been modified since the specified time. + * + * @param ifUnmodifiedSince the ifUnmodifiedSince value to set. + * @return the BatchTaskFileGetOptions object itself. + */ + @Generated + public BatchTaskFileGetOptions setIfUnmodifiedSince(OffsetDateTime ifUnmodifiedSince) { + if (ifUnmodifiedSince == null) { + this.ifUnmodifiedSince = null; + } else { + this.ifUnmodifiedSince = new DateTimeRfc1123(ifUnmodifiedSince); + } + return this; + } + + /** + * Get the ocpRange property: The byte range to be retrieved. The default is to retrieve the entire file. The + * format is bytes=startRange-endRange. + * + * @return the ocpRange value. + */ + @Generated + public String getOcpRange() { + return this.ocpRange; + } + + /** + * Set the ocpRange property: The byte range to be retrieved. The default is to retrieve the entire file. The + * format is bytes=startRange-endRange. + * + * @param ocpRange the ocpRange value to set. + * @return the BatchTaskFileGetOptions object itself. + */ + @Generated + public BatchTaskFileGetOptions setOcpRange(String ocpRange) { + this.ocpRange = ocpRange; + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskFilePropertiesGetOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskFilePropertiesGetOptions.java new file mode 100644 index 000000000000..0a890f0259f6 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskFilePropertiesGetOptions.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.core.util.DateTimeRfc1123; +import java.time.Duration; +import java.time.OffsetDateTime; + +/** + * Optional parameters for Get Task File Properties operation. + */ +@Fluent +public final class BatchTaskFilePropertiesGetOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /* + * A timestamp indicating the last modified time of the resource known to the + * client. The operation will be performed only if the resource on the service has + * been modified since the specified time. + */ + @Generated + private DateTimeRfc1123 ifModifiedSince; + + /* + * A timestamp indicating the last modified time of the resource known to the + * client. The operation will be performed only if the resource on the service has + * not been modified since the specified time. + */ + @Generated + private DateTimeRfc1123 ifUnmodifiedSince; + + /** + * Creates an instance of BatchTaskFilePropertiesGetOptions class. + */ + @Generated + public BatchTaskFilePropertiesGetOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchTaskFilePropertiesGetOptions object itself. + */ + @Generated + public BatchTaskFilePropertiesGetOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } + + /** + * Get the ifModifiedSince property: A timestamp indicating the last modified time of the resource known to the + * client. The operation will be performed only if the resource on the service has + * been modified since the specified time. + * + * @return the ifModifiedSince value. + */ + @Generated + public OffsetDateTime getIfModifiedSince() { + if (this.ifModifiedSince == null) { + return null; + } + return this.ifModifiedSince.getDateTime(); + } + + /** + * Set the ifModifiedSince property: A timestamp indicating the last modified time of the resource known to the + * client. The operation will be performed only if the resource on the service has + * been modified since the specified time. + * + * @param ifModifiedSince the ifModifiedSince value to set. + * @return the BatchTaskFilePropertiesGetOptions object itself. + */ + @Generated + public BatchTaskFilePropertiesGetOptions setIfModifiedSince(OffsetDateTime ifModifiedSince) { + if (ifModifiedSince == null) { + this.ifModifiedSince = null; + } else { + this.ifModifiedSince = new DateTimeRfc1123(ifModifiedSince); + } + return this; + } + + /** + * Get the ifUnmodifiedSince property: A timestamp indicating the last modified time of the resource known to the + * client. The operation will be performed only if the resource on the service has + * not been modified since the specified time. + * + * @return the ifUnmodifiedSince value. + */ + @Generated + public OffsetDateTime getIfUnmodifiedSince() { + if (this.ifUnmodifiedSince == null) { + return null; + } + return this.ifUnmodifiedSince.getDateTime(); + } + + /** + * Set the ifUnmodifiedSince property: A timestamp indicating the last modified time of the resource known to the + * client. The operation will be performed only if the resource on the service has + * not been modified since the specified time. + * + * @param ifUnmodifiedSince the ifUnmodifiedSince value to set. + * @return the BatchTaskFilePropertiesGetOptions object itself. + */ + @Generated + public BatchTaskFilePropertiesGetOptions setIfUnmodifiedSince(OffsetDateTime ifUnmodifiedSince) { + if (ifUnmodifiedSince == null) { + this.ifUnmodifiedSince = null; + } else { + this.ifUnmodifiedSince = new DateTimeRfc1123(ifUnmodifiedSince); + } + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskFilesListOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskFilesListOptions.java new file mode 100644 index 000000000000..131c74b3c9f8 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskFilesListOptions.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for List Task Files operation. + */ +@Fluent +public final class BatchTaskFilesListOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /* + * The maximum number of items to return in the response. A maximum of 1000 + * applications can be returned. + */ + @Generated + private Integer maxPageSize; + + /* + * An OData $filter clause. For more information on constructing this filter, see + * https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-task-files. + */ + @Generated + private String filter; + + /* + * Whether to list children of the Task directory. This parameter can be used in + * combination with the filter parameter to list specific type of files. + */ + @Generated + private Boolean recursive; + + /** + * Creates an instance of BatchTaskFilesListOptions class. + */ + @Generated + public BatchTaskFilesListOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchTaskFilesListOptions object itself. + */ + @Generated + public BatchTaskFilesListOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } + + /** + * Get the maxPageSize property: The maximum number of items to return in the response. A maximum of 1000 + * applications can be returned. + * + * @return the maxPageSize value. + */ + @Generated + public Integer getMaxPageSize() { + return this.maxPageSize; + } + + /** + * Set the maxPageSize property: The maximum number of items to return in the response. A maximum of 1000 + * applications can be returned. + * + * @param maxPageSize the maxPageSize value to set. + * @return the BatchTaskFilesListOptions object itself. + */ + @Generated + public BatchTaskFilesListOptions setMaxPageSize(Integer maxPageSize) { + this.maxPageSize = maxPageSize; + return this; + } + + /** + * Get the filter property: An OData $filter clause. For more information on constructing this filter, see + * https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-task-files. + * + * @return the filter value. + */ + @Generated + public String getFilter() { + return this.filter; + } + + /** + * Set the filter property: An OData $filter clause. For more information on constructing this filter, see + * https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-task-files. + * + * @param filter the filter value to set. + * @return the BatchTaskFilesListOptions object itself. + */ + @Generated + public BatchTaskFilesListOptions setFilter(String filter) { + this.filter = filter; + return this; + } + + /** + * Get the recursive property: Whether to list children of the Task directory. This parameter can be used in + * combination with the filter parameter to list specific type of files. + * + * @return the recursive value. + */ + @Generated + public Boolean isRecursive() { + return this.recursive; + } + + /** + * Set the recursive property: Whether to list children of the Task directory. This parameter can be used in + * combination with the filter parameter to list specific type of files. + * + * @param recursive the recursive value to set. + * @return the BatchTaskFilesListOptions object itself. + */ + @Generated + public BatchTaskFilesListOptions setRecursive(Boolean recursive) { + this.recursive = recursive; + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskGetOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskGetOptions.java new file mode 100644 index 000000000000..19468bdea839 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskGetOptions.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; +import java.util.List; + +/** + * Optional parameters for Get Task operation. + */ +@Fluent +public final class BatchTaskGetOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /* + * An OData $select clause. + */ + @Generated + private List select; + + /* + * An OData $expand clause. + */ + @Generated + private List expand; + + /** + * Creates an instance of BatchTaskGetOptions class. + */ + @Generated + public BatchTaskGetOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchTaskGetOptions object itself. + */ + @Generated + public BatchTaskGetOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } + + /** + * Get the select property: An OData $select clause. + * + * @return the select value. + */ + @Generated + public List getSelect() { + return this.select; + } + + /** + * Set the select property: An OData $select clause. + * + * @param select the select value to set. + * @return the BatchTaskGetOptions object itself. + */ + @Generated + public BatchTaskGetOptions setSelect(List select) { + this.select = select; + return this; + } + + /** + * Get the expand property: An OData $expand clause. + * + * @return the expand value. + */ + @Generated + public List getExpand() { + return this.expand; + } + + /** + * Set the expand property: An OData $expand clause. + * + * @param expand the expand value to set. + * @return the BatchTaskGetOptions object itself. + */ + @Generated + public BatchTaskGetOptions setExpand(List expand) { + this.expand = expand; + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskGroup.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskGroup.java index cd46fc705343..cea0854b2c5f 100644 --- a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskGroup.java +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskGroup.java @@ -18,36 +18,14 @@ @Immutable public final class BatchTaskGroup implements JsonSerializable { - /* - * The collection of Tasks to add. The maximum count of Tasks is 100. The total serialized size of this collection - * must be less than 1MB. If it is greater than 1MB (for example if each Task has 100's of resource files or - * environment variables), the request will fail with code 'RequestBodyTooLarge' and should be retried again with - * fewer Tasks. - */ - @Generated - private final List value; - /** * Creates an instance of BatchTaskGroup class. * - * @param value the value value to set. - */ - @Generated - public BatchTaskGroup(List value) { - this.value = value; - } - - /** - * Get the value property: The collection of Tasks to add. The maximum count of Tasks is 100. The total serialized - * size of this collection must be less than 1MB. If it is greater than 1MB (for example if each Task has 100's of - * resource files or environment variables), the request will fail with code 'RequestBodyTooLarge' and should be - * retried again with fewer Tasks. - * - * @return the value value. + * @param values the values value to set. */ @Generated - public List getValue() { - return this.value; + public BatchTaskGroup(List values) { + this.values = values; } /** @@ -57,7 +35,7 @@ public List getValue() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("value", this.values, (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -73,17 +51,39 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { @Generated public static BatchTaskGroup fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - List value = null; + List values = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("value".equals(fieldName)) { - value = reader.readArray(reader1 -> BatchTaskCreateContent.fromJson(reader1)); + values = reader.readArray(reader1 -> BatchTaskCreateParameters.fromJson(reader1)); } else { reader.skipChildren(); } } - return new BatchTaskGroup(value); + return new BatchTaskGroup(values); }); } + + /* + * The collection of Tasks to add. The maximum count of Tasks is 100. The total serialized size of this collection + * must be less than 1MB. If it is greater than 1MB (for example if each Task has 100's of resource files or + * environment variables), the request will fail with code 'RequestBodyTooLarge' and should be retried again with + * fewer Tasks. + */ + @Generated + private final List values; + + /** + * Get the values property: The collection of Tasks to add. The maximum count of Tasks is 100. The total serialized + * size of this collection must be less than 1MB. If it is greater than 1MB (for example if each Task has 100's of + * resource files or environment variables), the request will fail with code 'RequestBodyTooLarge' and should be + * retried again with fewer Tasks. + * + * @return the values value. + */ + @Generated + public List getValues() { + return this.values; + } } diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskReactivateOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskReactivateOptions.java new file mode 100644 index 000000000000..41bb9f01b170 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskReactivateOptions.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Reactivate Task operation. + */ +@Fluent +public final class BatchTaskReactivateOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /** + * Creates an instance of BatchTaskReactivateOptions class. + */ + @Generated + public BatchTaskReactivateOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchTaskReactivateOptions object itself. + */ + @Generated + public BatchTaskReactivateOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskReplaceOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskReplaceOptions.java new file mode 100644 index 000000000000..293ca9a4e62b --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskReplaceOptions.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Replace Task operation. + */ +@Fluent +public final class BatchTaskReplaceOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /** + * Creates an instance of BatchTaskReplaceOptions class. + */ + @Generated + public BatchTaskReplaceOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchTaskReplaceOptions object itself. + */ + @Generated + public BatchTaskReplaceOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskStatistics.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskStatistics.java index d02951142968..4e7e7e69f8d7 100644 --- a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskStatistics.java +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskStatistics.java @@ -61,30 +61,6 @@ public final class BatchTaskStatistics implements JsonSerializable Duration.parse(nonNullReader.getString())); } else if ("readIOps".equals(fieldName)) { - readIOps = reader.getNullable(nonNullReader -> Long.parseLong(nonNullReader.getString())); + readIops = reader.getNullable(nonNullReader -> Long.parseLong(nonNullReader.getString())); } else if ("writeIOps".equals(fieldName)) { - writeIOps = reader.getNullable(nonNullReader -> Long.parseLong(nonNullReader.getString())); + writeIops = reader.getNullable(nonNullReader -> Long.parseLong(nonNullReader.getString())); } else if ("readIOGiB".equals(fieldName)) { - readIOGiB = reader.getDouble(); + readIoGiB = reader.getDouble(); } else if ("writeIOGiB".equals(fieldName)) { - writeIOGiB = reader.getDouble(); + writeIoGiB = reader.getDouble(); } else if ("waitTime".equals(fieldName)) { waitTime = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); } else { @@ -321,7 +257,71 @@ public static BatchTaskStatistics fromJson(JsonReader jsonReader) throws IOExcep } } return new BatchTaskStatistics(url, startTime, lastUpdateTime, userCpuTime, kernelCpuTime, wallClockTime, - readIOps, writeIOps, readIOGiB, writeIOGiB, waitTime); + readIops, writeIops, readIoGiB, writeIoGiB, waitTime); }); } + + /* + * The total number of disk read operations made by the Task. + */ + @Generated + private final long readIops; + + /* + * The total number of disk write operations made by the Task. + */ + @Generated + private final long writeIops; + + /* + * The total gibibytes read from disk by the Task. + */ + @Generated + private final double readIoGiB; + + /* + * The total gibibytes written to disk by the Task. + */ + @Generated + private final double writeIoGiB; + + /** + * Get the readIops property: The total number of disk read operations made by the Task. + * + * @return the readIops value. + */ + @Generated + public long getReadIops() { + return this.readIops; + } + + /** + * Get the writeIops property: The total number of disk write operations made by the Task. + * + * @return the writeIops value. + */ + @Generated + public long getWriteIops() { + return this.writeIops; + } + + /** + * Get the readIoGiB property: The total gibibytes read from disk by the Task. + * + * @return the readIoGiB value. + */ + @Generated + public double getReadIoGiB() { + return this.readIoGiB; + } + + /** + * Get the writeIoGiB property: The total gibibytes written to disk by the Task. + * + * @return the writeIoGiB value. + */ + @Generated + public double getWriteIoGiB() { + return this.writeIoGiB; + } } diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskTerminateOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskTerminateOptions.java new file mode 100644 index 000000000000..c218748b3bc8 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTaskTerminateOptions.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for Terminate Task operation. + */ +@Fluent +public final class BatchTaskTerminateOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /** + * Creates an instance of BatchTaskTerminateOptions class. + */ + @Generated + public BatchTaskTerminateOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchTaskTerminateOptions object itself. + */ + @Generated + public BatchTaskTerminateOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTasksListOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTasksListOptions.java new file mode 100644 index 000000000000..ae41fd4890b0 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchTasksListOptions.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; +import java.util.List; + +/** + * Optional parameters for List Tasks operation. + */ +@Fluent +public final class BatchTasksListOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /* + * The maximum number of items to return in the response. A maximum of 1000 + * applications can be returned. + */ + @Generated + private Integer maxPageSize; + + /* + * An OData $filter clause. For more information on constructing this filter, see + * https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-tasks. + */ + @Generated + private String filter; + + /* + * An OData $select clause. + */ + @Generated + private List select; + + /* + * An OData $expand clause. + */ + @Generated + private List expand; + + /** + * Creates an instance of BatchTasksListOptions class. + */ + @Generated + public BatchTasksListOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the BatchTasksListOptions object itself. + */ + @Generated + public BatchTasksListOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } + + /** + * Get the maxPageSize property: The maximum number of items to return in the response. A maximum of 1000 + * applications can be returned. + * + * @return the maxPageSize value. + */ + @Generated + public Integer getMaxPageSize() { + return this.maxPageSize; + } + + /** + * Set the maxPageSize property: The maximum number of items to return in the response. A maximum of 1000 + * applications can be returned. + * + * @param maxPageSize the maxPageSize value to set. + * @return the BatchTasksListOptions object itself. + */ + @Generated + public BatchTasksListOptions setMaxPageSize(Integer maxPageSize) { + this.maxPageSize = maxPageSize; + return this; + } + + /** + * Get the filter property: An OData $filter clause. For more information on constructing this filter, see + * https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-tasks. + * + * @return the filter value. + */ + @Generated + public String getFilter() { + return this.filter; + } + + /** + * Set the filter property: An OData $filter clause. For more information on constructing this filter, see + * https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-tasks. + * + * @param filter the filter value to set. + * @return the BatchTasksListOptions object itself. + */ + @Generated + public BatchTasksListOptions setFilter(String filter) { + this.filter = filter; + return this; + } + + /** + * Get the select property: An OData $select clause. + * + * @return the select value. + */ + @Generated + public List getSelect() { + return this.select; + } + + /** + * Set the select property: An OData $select clause. + * + * @param select the select value to set. + * @return the BatchTasksListOptions object itself. + */ + @Generated + public BatchTasksListOptions setSelect(List select) { + this.select = select; + return this; + } + + /** + * Get the expand property: An OData $expand clause. + * + * @return the expand value. + */ + @Generated + public List getExpand() { + return this.expand; + } + + /** + * Set the expand property: An OData $expand clause. + * + * @param expand the expand value to set. + * @return the BatchTasksListOptions object itself. + */ + @Generated + public BatchTasksListOptions setExpand(List expand) { + this.expand = expand; + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchUefiSettings.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchUefiSettings.java new file mode 100644 index 000000000000..7af91bc416a5 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchUefiSettings.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Specifies the security settings like secure boot and vTPM used while creating the virtual machine. + */ +@Fluent +public final class BatchUefiSettings implements JsonSerializable { + /* + * Specifies whether secure boot should be enabled on the virtual machine. + */ + @Generated + private Boolean secureBootEnabled; + + /* + * Specifies whether vTPM should be enabled on the virtual machine. + */ + @Generated + private Boolean vTpmEnabled; + + /** + * Creates an instance of BatchUefiSettings class. + */ + @Generated + public BatchUefiSettings() { + } + + /** + * Get the secureBootEnabled property: Specifies whether secure boot should be enabled on the virtual machine. + * + * @return the secureBootEnabled value. + */ + @Generated + public Boolean isSecureBootEnabled() { + return this.secureBootEnabled; + } + + /** + * Set the secureBootEnabled property: Specifies whether secure boot should be enabled on the virtual machine. + * + * @param secureBootEnabled the secureBootEnabled value to set. + * @return the BatchUefiSettings object itself. + */ + @Generated + public BatchUefiSettings setSecureBootEnabled(Boolean secureBootEnabled) { + this.secureBootEnabled = secureBootEnabled; + return this; + } + + /** + * Get the vTpmEnabled property: Specifies whether vTPM should be enabled on the virtual machine. + * + * @return the vTpmEnabled value. + */ + @Generated + public Boolean isVTpmEnabled() { + return this.vTpmEnabled; + } + + /** + * Set the vTpmEnabled property: Specifies whether vTPM should be enabled on the virtual machine. + * + * @param vTpmEnabled the vTpmEnabled value to set. + * @return the BatchUefiSettings object itself. + */ + @Generated + public BatchUefiSettings setVTpmEnabled(Boolean vTpmEnabled) { + this.vTpmEnabled = vTpmEnabled; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("secureBootEnabled", this.secureBootEnabled); + jsonWriter.writeBooleanField("vTpmEnabled", this.vTpmEnabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BatchUefiSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BatchUefiSettings if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the BatchUefiSettings. + */ + @Generated + public static BatchUefiSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BatchUefiSettings deserializedBatchUefiSettings = new BatchUefiSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("secureBootEnabled".equals(fieldName)) { + deserializedBatchUefiSettings.secureBootEnabled = reader.getNullable(JsonReader::getBoolean); + } else if ("vTpmEnabled".equals(fieldName)) { + deserializedBatchUefiSettings.vTpmEnabled = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedBatchUefiSettings; + }); + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchUserAssignedIdentity.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchUserAssignedIdentity.java new file mode 100644 index 000000000000..99dddf04b0b1 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchUserAssignedIdentity.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The user assigned Identity. + */ +@Immutable +public final class BatchUserAssignedIdentity implements JsonSerializable { + /* + * The ARM resource id of the user assigned identity. + */ + @Generated + private final String resourceId; + + /* + * The client id of the user assigned identity. + */ + @Generated + private String clientId; + + /* + * The principal id of the user assigned identity. + */ + @Generated + private String principalId; + + /** + * Creates an instance of BatchUserAssignedIdentity class. + * + * @param resourceId the resourceId value to set. + */ + @Generated + private BatchUserAssignedIdentity(String resourceId) { + this.resourceId = resourceId; + } + + /** + * Get the resourceId property: The ARM resource id of the user assigned identity. + * + * @return the resourceId value. + */ + @Generated + public String getResourceId() { + return this.resourceId; + } + + /** + * Get the clientId property: The client id of the user assigned identity. + * + * @return the clientId value. + */ + @Generated + public String getClientId() { + return this.clientId; + } + + /** + * Get the principalId property: The principal id of the user assigned identity. + * + * @return the principalId value. + */ + @Generated + public String getPrincipalId() { + return this.principalId; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceId", this.resourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BatchUserAssignedIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BatchUserAssignedIdentity if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BatchUserAssignedIdentity. + */ + @Generated + public static BatchUserAssignedIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String resourceId = null; + String clientId = null; + String principalId = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceId".equals(fieldName)) { + resourceId = reader.getString(); + } else if ("clientId".equals(fieldName)) { + clientId = reader.getString(); + } else if ("principalId".equals(fieldName)) { + principalId = reader.getString(); + } else { + reader.skipChildren(); + } + } + BatchUserAssignedIdentity deserializedBatchUserAssignedIdentity = new BatchUserAssignedIdentity(resourceId); + deserializedBatchUserAssignedIdentity.clientId = clientId; + deserializedBatchUserAssignedIdentity.principalId = principalId; + + return deserializedBatchUserAssignedIdentity; + }); + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchVmImageReference.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchVmImageReference.java new file mode 100644 index 000000000000..672b1dcde144 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchVmImageReference.java @@ -0,0 +1,346 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A reference to an Azure Virtual Machines Marketplace Image or a Azure Compute Gallery Image. + * To get the list of all Azure Marketplace Image references verified by Azure Batch, see the + * ' List Supported Images ' operation. + */ +@Fluent +public final class BatchVmImageReference implements JsonSerializable { + /* + * The publisher of the Azure Virtual Machines Marketplace Image. For example, Canonical or MicrosoftWindowsServer. + */ + @Generated + private String publisher; + + /* + * The offer type of the Azure Virtual Machines Marketplace Image. For example, UbuntuServer or WindowsServer. + */ + @Generated + private String offer; + + /* + * The SKU of the Azure Virtual Machines Marketplace Image. For example, 18.04-LTS or 2019-Datacenter. + */ + @Generated + private String sku; + + /* + * The version of the Azure Virtual Machines Marketplace Image. A value of 'latest' can be specified to select the + * latest version of an Image. If omitted, the default is 'latest'. + */ + @Generated + private String version; + + /* + * The ARM resource identifier of the Azure Compute Gallery Image. Compute Nodes in the Pool will be created using + * this Image Id. This is of the form + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName + * }/images/{imageDefinitionName}/versions/{VersionId} or + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName + * }/images/{imageDefinitionName} for always defaulting to the latest image version. This property is mutually + * exclusive with other ImageReference properties. The Azure Compute Gallery Image must have replicas in the same + * region and must be in the same subscription as the Azure Batch account. If the image version is not specified in + * the imageId, the latest version will be used. For information about the firewall settings for the Batch Compute + * Node agent to communicate with the Batch service see + * https://learn.microsoft.com/azure/batch/nodes-and-pools#virtual-network-vnet-and-firewall-configuration. + */ + @Generated + private String virtualMachineImageId; + + /* + * The specific version of the platform image or marketplace image used to create the node. This read-only field + * differs from 'version' only if the value specified for 'version' when the pool was created was 'latest'. + */ + @Generated + private String exactVersion; + + /* + * The shared gallery image unique identifier. This property is mutually exclusive with other properties and can be + * fetched from shared gallery image GET call. + */ + @Generated + private String sharedGalleryImageId; + + /* + * The community gallery image unique identifier. This property is mutually exclusive with other properties and can + * be fetched from community gallery image GET call. + */ + @Generated + private String communityGalleryImageId; + + /** + * Creates an instance of BatchVmImageReference class. + */ + @Generated + public BatchVmImageReference() { + } + + /** + * Get the publisher property: The publisher of the Azure Virtual Machines Marketplace Image. For example, Canonical + * or MicrosoftWindowsServer. + * + * @return the publisher value. + */ + @Generated + public String getPublisher() { + return this.publisher; + } + + /** + * Set the publisher property: The publisher of the Azure Virtual Machines Marketplace Image. For example, Canonical + * or MicrosoftWindowsServer. + * + * @param publisher the publisher value to set. + * @return the BatchVmImageReference object itself. + */ + @Generated + public BatchVmImageReference setPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the offer property: The offer type of the Azure Virtual Machines Marketplace Image. For example, UbuntuServer + * or WindowsServer. + * + * @return the offer value. + */ + @Generated + public String getOffer() { + return this.offer; + } + + /** + * Set the offer property: The offer type of the Azure Virtual Machines Marketplace Image. For example, UbuntuServer + * or WindowsServer. + * + * @param offer the offer value to set. + * @return the BatchVmImageReference object itself. + */ + @Generated + public BatchVmImageReference setOffer(String offer) { + this.offer = offer; + return this; + } + + /** + * Get the sku property: The SKU of the Azure Virtual Machines Marketplace Image. For example, 18.04-LTS or + * 2019-Datacenter. + * + * @return the sku value. + */ + @Generated + public String getSku() { + return this.sku; + } + + /** + * Set the sku property: The SKU of the Azure Virtual Machines Marketplace Image. For example, 18.04-LTS or + * 2019-Datacenter. + * + * @param sku the sku value to set. + * @return the BatchVmImageReference object itself. + */ + @Generated + public BatchVmImageReference setSku(String sku) { + this.sku = sku; + return this; + } + + /** + * Get the version property: The version of the Azure Virtual Machines Marketplace Image. A value of 'latest' can be + * specified to select the latest version of an Image. If omitted, the default is 'latest'. + * + * @return the version value. + */ + @Generated + public String getVersion() { + return this.version; + } + + /** + * Set the version property: The version of the Azure Virtual Machines Marketplace Image. A value of 'latest' can be + * specified to select the latest version of an Image. If omitted, the default is 'latest'. + * + * @param version the version value to set. + * @return the BatchVmImageReference object itself. + */ + @Generated + public BatchVmImageReference setVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the virtualMachineImageId property: The ARM resource identifier of the Azure Compute Gallery Image. Compute + * Nodes in the Pool will be created using this Image Id. This is of the form + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageDefinitionName}/versions/{VersionId} + * or + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageDefinitionName} + * for always defaulting to the latest image version. This property is mutually exclusive with other ImageReference + * properties. The Azure Compute Gallery Image must have replicas in the same region and must be in the same + * subscription as the Azure Batch account. If the image version is not specified in the imageId, the latest version + * will be used. For information about the firewall settings for the Batch Compute Node agent to communicate with + * the Batch service see + * https://learn.microsoft.com/azure/batch/nodes-and-pools#virtual-network-vnet-and-firewall-configuration. + * + * @return the virtualMachineImageId value. + */ + @Generated + public String getVirtualMachineImageId() { + return this.virtualMachineImageId; + } + + /** + * Set the virtualMachineImageId property: The ARM resource identifier of the Azure Compute Gallery Image. Compute + * Nodes in the Pool will be created using this Image Id. This is of the form + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageDefinitionName}/versions/{VersionId} + * or + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageDefinitionName} + * for always defaulting to the latest image version. This property is mutually exclusive with other ImageReference + * properties. The Azure Compute Gallery Image must have replicas in the same region and must be in the same + * subscription as the Azure Batch account. If the image version is not specified in the imageId, the latest version + * will be used. For information about the firewall settings for the Batch Compute Node agent to communicate with + * the Batch service see + * https://learn.microsoft.com/azure/batch/nodes-and-pools#virtual-network-vnet-and-firewall-configuration. + * + * @param virtualMachineImageId the virtualMachineImageId value to set. + * @return the BatchVmImageReference object itself. + */ + @Generated + public BatchVmImageReference setVirtualMachineImageId(String virtualMachineImageId) { + this.virtualMachineImageId = virtualMachineImageId; + return this; + } + + /** + * Get the exactVersion property: The specific version of the platform image or marketplace image used to create the + * node. This read-only field differs from 'version' only if the value specified for 'version' when the pool was + * created was 'latest'. + * + * @return the exactVersion value. + */ + @Generated + public String getExactVersion() { + return this.exactVersion; + } + + /** + * Get the sharedGalleryImageId property: The shared gallery image unique identifier. This property is mutually + * exclusive with other properties and can be fetched from shared gallery image GET call. + * + * @return the sharedGalleryImageId value. + */ + @Generated + public String getSharedGalleryImageId() { + return this.sharedGalleryImageId; + } + + /** + * Set the sharedGalleryImageId property: The shared gallery image unique identifier. This property is mutually + * exclusive with other properties and can be fetched from shared gallery image GET call. + * + * @param sharedGalleryImageId the sharedGalleryImageId value to set. + * @return the BatchVmImageReference object itself. + */ + @Generated + public BatchVmImageReference setSharedGalleryImageId(String sharedGalleryImageId) { + this.sharedGalleryImageId = sharedGalleryImageId; + return this; + } + + /** + * Get the communityGalleryImageId property: The community gallery image unique identifier. This property is + * mutually exclusive with other properties and can be fetched from community gallery image GET call. + * + * @return the communityGalleryImageId value. + */ + @Generated + public String getCommunityGalleryImageId() { + return this.communityGalleryImageId; + } + + /** + * Set the communityGalleryImageId property: The community gallery image unique identifier. This property is + * mutually exclusive with other properties and can be fetched from community gallery image GET call. + * + * @param communityGalleryImageId the communityGalleryImageId value to set. + * @return the BatchVmImageReference object itself. + */ + @Generated + public BatchVmImageReference setCommunityGalleryImageId(String communityGalleryImageId) { + this.communityGalleryImageId = communityGalleryImageId; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("publisher", this.publisher); + jsonWriter.writeStringField("offer", this.offer); + jsonWriter.writeStringField("sku", this.sku); + jsonWriter.writeStringField("version", this.version); + jsonWriter.writeStringField("virtualMachineImageId", this.virtualMachineImageId); + jsonWriter.writeStringField("sharedGalleryImageId", this.sharedGalleryImageId); + jsonWriter.writeStringField("communityGalleryImageId", this.communityGalleryImageId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BatchVmImageReference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BatchVmImageReference if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the BatchVmImageReference. + */ + @Generated + public static BatchVmImageReference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BatchVmImageReference deserializedBatchVmImageReference = new BatchVmImageReference(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("publisher".equals(fieldName)) { + deserializedBatchVmImageReference.publisher = reader.getString(); + } else if ("offer".equals(fieldName)) { + deserializedBatchVmImageReference.offer = reader.getString(); + } else if ("sku".equals(fieldName)) { + deserializedBatchVmImageReference.sku = reader.getString(); + } else if ("version".equals(fieldName)) { + deserializedBatchVmImageReference.version = reader.getString(); + } else if ("virtualMachineImageId".equals(fieldName)) { + deserializedBatchVmImageReference.virtualMachineImageId = reader.getString(); + } else if ("exactVersion".equals(fieldName)) { + deserializedBatchVmImageReference.exactVersion = reader.getString(); + } else if ("sharedGalleryImageId".equals(fieldName)) { + deserializedBatchVmImageReference.sharedGalleryImageId = reader.getString(); + } else if ("communityGalleryImageId".equals(fieldName)) { + deserializedBatchVmImageReference.communityGalleryImageId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBatchVmImageReference; + }); + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/ExitOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/ExitOptions.java index 0f71101fb0c4..0020a711df16 100644 --- a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/ExitOptions.java +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/ExitOptions.java @@ -25,7 +25,7 @@ public final class ExitOptions implements JsonSerializable { * API directly, the HTTP status code is 400 (Bad Request). */ @Generated - private BatchJobAction jobAction; + private BatchJobActionKind jobAction; /* * An action that the Batch service performs on Tasks that depend on this Task. Possible values are 'satisfy' @@ -52,26 +52,10 @@ public ExitOptions() { * @return the jobAction value. */ @Generated - public BatchJobAction getJobAction() { + public BatchJobActionKind getJobAction() { return this.jobAction; } - /** - * Set the jobAction property: An action to take on the Job containing the Task, if the Task completes with the - * given exit condition and the Job's onTaskFailed property is 'performExitOptionsJobAction'. The default is none - * for exit code 0 and terminate for all other exit conditions. If the Job's onTaskFailed property is noaction, then - * specifying this property returns an error and the add Task request fails with an invalid property value error; if - * you are calling the REST API directly, the HTTP status code is 400 (Bad Request). - * - * @param jobAction the jobAction value to set. - * @return the ExitOptions object itself. - */ - @Generated - public ExitOptions setJobAction(BatchJobAction jobAction) { - this.jobAction = jobAction; - return this; - } - /** * Get the dependencyAction property: An action that the Batch service performs on Tasks that depend on this Task. * Possible values are 'satisfy' (allowing dependent tasks to progress) and 'block' (dependent tasks continue to @@ -127,7 +111,7 @@ public static ExitOptions fromJson(JsonReader jsonReader) throws IOException { String fieldName = reader.getFieldName(); reader.nextToken(); if ("jobAction".equals(fieldName)) { - deserializedExitOptions.jobAction = BatchJobAction.fromString(reader.getString()); + deserializedExitOptions.jobAction = BatchJobActionKind.fromString(reader.getString()); } else if ("dependencyAction".equals(fieldName)) { deserializedExitOptions.dependencyAction = DependencyAction.fromString(reader.getString()); } else { @@ -137,4 +121,20 @@ public static ExitOptions fromJson(JsonReader jsonReader) throws IOException { return deserializedExitOptions; }); } + + /** + * Set the jobAction property: An action to take on the Job containing the Task, if the Task completes with the + * given exit condition and the Job's onTaskFailed property is 'performExitOptionsJobAction'. The default is none + * for exit code 0 and terminate for all other exit conditions. If the Job's onTaskFailed property is noaction, then + * specifying this property returns an error and the add Task request fails with an invalid property value error; if + * you are calling the REST API directly, the HTTP status code is 400 (Bad Request). + * + * @param jobAction the jobAction value to set. + * @return the ExitOptions object itself. + */ + @Generated + public ExitOptions setJobAction(BatchJobActionKind jobAction) { + this.jobAction = jobAction; + return this; + } } diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/ManagedDisk.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/ManagedDisk.java index 661085600554..bf3e2a1a931d 100644 --- a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/ManagedDisk.java +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/ManagedDisk.java @@ -27,7 +27,7 @@ public final class ManagedDisk implements JsonSerializable { * Specifies the security profile settings for the managed disk. */ @Generated - private VMDiskSecurityProfile securityProfile; + private VmDiskSecurityProfile securityProfile; /** * Creates an instance of ManagedDisk class. @@ -64,22 +64,10 @@ public ManagedDisk setStorageAccountType(StorageAccountType storageAccountType) * @return the securityProfile value. */ @Generated - public VMDiskSecurityProfile getSecurityProfile() { + public VmDiskSecurityProfile getSecurityProfile() { return this.securityProfile; } - /** - * Set the securityProfile property: Specifies the security profile settings for the managed disk. - * - * @param securityProfile the securityProfile value to set. - * @return the ManagedDisk object itself. - */ - @Generated - public ManagedDisk setSecurityProfile(VMDiskSecurityProfile securityProfile) { - this.securityProfile = securityProfile; - return this; - } - /** * {@inheritDoc} */ @@ -111,7 +99,7 @@ public static ManagedDisk fromJson(JsonReader jsonReader) throws IOException { if ("storageAccountType".equals(fieldName)) { deserializedManagedDisk.storageAccountType = StorageAccountType.fromString(reader.getString()); } else if ("securityProfile".equals(fieldName)) { - deserializedManagedDisk.securityProfile = VMDiskSecurityProfile.fromJson(reader); + deserializedManagedDisk.securityProfile = VmDiskSecurityProfile.fromJson(reader); } else { reader.skipChildren(); } @@ -119,4 +107,16 @@ public static ManagedDisk fromJson(JsonReader jsonReader) throws IOException { return deserializedManagedDisk; }); } + + /** + * Set the securityProfile property: Specifies the security profile settings for the managed disk. + * + * @param securityProfile the securityProfile value to set. + * @return the ManagedDisk object itself. + */ + @Generated + public ManagedDisk setSecurityProfile(VmDiskSecurityProfile securityProfile) { + this.securityProfile = securityProfile; + return this; + } } diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/NetworkConfiguration.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/NetworkConfiguration.java index cf4b4765a8e7..dd6ada7df6be 100644 --- a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/NetworkConfiguration.java +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/NetworkConfiguration.java @@ -37,12 +37,6 @@ public final class NetworkConfiguration implements JsonSerializable uploadHeaders; + private List uploadHeaders; /** * Creates an instance of OutputFileBlobContainerDestination class. @@ -134,7 +134,7 @@ public OutputFileBlobContainerDestination setIdentityReference(BatchNodeIdentity * @return the uploadHeaders value. */ @Generated - public List getUploadHeaders() { + public List getUploadHeaders() { return this.uploadHeaders; } @@ -147,7 +147,7 @@ public List getUploadHeaders() { * @return the OutputFileBlobContainerDestination object itself. */ @Generated - public OutputFileBlobContainerDestination setUploadHeaders(List uploadHeaders) { + public OutputFileBlobContainerDestination setUploadHeaders(List uploadHeaders) { this.uploadHeaders = uploadHeaders; return this; } @@ -181,7 +181,7 @@ public static OutputFileBlobContainerDestination fromJson(JsonReader jsonReader) String containerUrl = null; String path = null; BatchNodeIdentityReference identityReference = null; - List uploadHeaders = null; + List uploadHeaders = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -192,7 +192,7 @@ public static OutputFileBlobContainerDestination fromJson(JsonReader jsonReader) } else if ("identityReference".equals(fieldName)) { identityReference = BatchNodeIdentityReference.fromJson(reader); } else if ("uploadHeaders".equals(fieldName)) { - uploadHeaders = reader.readArray(reader1 -> HttpHeader.fromJson(reader1)); + uploadHeaders = reader.readArray(reader1 -> OutputFileUploadHeader.fromJson(reader1)); } else { reader.skipChildren(); } diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/OutputFileUploadHeader.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/OutputFileUploadHeader.java new file mode 100644 index 000000000000..1724c3660950 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/OutputFileUploadHeader.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * An HTTP header name-value pair. + */ +@Fluent +public final class OutputFileUploadHeader implements JsonSerializable { + /* + * The case-insensitive name of the header to be used while uploading output files. + */ + @Generated + private final String name; + + /* + * The value of the header to be used while uploading output files. + */ + @Generated + private String value; + + /** + * Creates an instance of OutputFileUploadHeader class. + * + * @param name the name value to set. + */ + @Generated + public OutputFileUploadHeader(String name) { + this.name = name; + } + + /** + * Get the name property: The case-insensitive name of the header to be used while uploading output files. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the value property: The value of the header to be used while uploading output files. + * + * @return the value value. + */ + @Generated + public String getValue() { + return this.value; + } + + /** + * Set the value property: The value of the header to be used while uploading output files. + * + * @param value the value value to set. + * @return the OutputFileUploadHeader object itself. + */ + @Generated + public OutputFileUploadHeader setValue(String value) { + this.value = value; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OutputFileUploadHeader from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OutputFileUploadHeader if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OutputFileUploadHeader. + */ + @Generated + public static OutputFileUploadHeader fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String name = null; + String value = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("value".equals(fieldName)) { + value = reader.getString(); + } else { + reader.skipChildren(); + } + } + OutputFileUploadHeader deserializedOutputFileUploadHeader = new OutputFileUploadHeader(name); + deserializedOutputFileUploadHeader.value = value; + + return deserializedOutputFileUploadHeader; + }); + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/SecurityProfile.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/SecurityProfile.java index 2a01f50ef608..33f3da72fafb 100644 --- a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/SecurityProfile.java +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/SecurityProfile.java @@ -38,21 +38,7 @@ public final class SecurityProfile implements JsonSerializable * security settings like secure boot and vTPM used while creating the virtual machine. */ @Generated - private final UefiSettings uefiSettings; - - /** - * Creates an instance of SecurityProfile class. - * - * @param encryptionAtHost the encryptionAtHost value to set. - * @param securityType the securityType value to set. - * @param uefiSettings the uefiSettings value to set. - */ - @Generated - public SecurityProfile(boolean encryptionAtHost, SecurityTypes securityType, UefiSettings uefiSettings) { - this.encryptionAtHost = encryptionAtHost; - this.securityType = securityType; - this.uefiSettings = uefiSettings; - } + private final BatchUefiSettings uefiSettings; /** * Get the encryptionAtHost property: This property can be used by user in the request to enable or disable the Host @@ -86,7 +72,7 @@ public SecurityTypes getSecurityType() { * @return the uefiSettings value. */ @Generated - public UefiSettings getUefiSettings() { + public BatchUefiSettings getUefiSettings() { return this.uefiSettings; } @@ -117,7 +103,7 @@ public static SecurityProfile fromJson(JsonReader jsonReader) throws IOException return jsonReader.readObject(reader -> { boolean encryptionAtHost = false; SecurityTypes securityType = null; - UefiSettings uefiSettings = null; + BatchUefiSettings uefiSettings = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -126,7 +112,7 @@ public static SecurityProfile fromJson(JsonReader jsonReader) throws IOException } else if ("securityType".equals(fieldName)) { securityType = SecurityTypes.fromString(reader.getString()); } else if ("uefiSettings".equals(fieldName)) { - uefiSettings = UefiSettings.fromJson(reader); + uefiSettings = BatchUefiSettings.fromJson(reader); } else { reader.skipChildren(); } @@ -134,4 +120,18 @@ public static SecurityProfile fromJson(JsonReader jsonReader) throws IOException return new SecurityProfile(encryptionAtHost, securityType, uefiSettings); }); } + + /** + * Creates an instance of SecurityProfile class. + * + * @param encryptionAtHost the encryptionAtHost value to set. + * @param securityType the securityType value to set. + * @param uefiSettings the uefiSettings value to set. + */ + @Generated + public SecurityProfile(boolean encryptionAtHost, SecurityTypes securityType, BatchUefiSettings uefiSettings) { + this.encryptionAtHost = encryptionAtHost; + this.securityType = securityType; + this.uefiSettings = uefiSettings; + } } diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/SupportedBatchImagesListOptions.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/SupportedBatchImagesListOptions.java new file mode 100644 index 000000000000..a1fac499bb7d --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/SupportedBatchImagesListOptions.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.time.Duration; + +/** + * Optional parameters for List Supported Images operation. + */ +@Fluent +public final class SupportedBatchImagesListOptions { + /* + * The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the + * value is larger than 30, the default will be used instead.". + */ + @Generated + private Long timeOutInSeconds; + + /* + * The maximum number of items to return in the response. A maximum of 1000 + * applications can be returned. + */ + @Generated + private Integer maxPageSize; + + /* + * An OData $filter clause. For more information on constructing this filter, see + * https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-support-images. + */ + @Generated + private String filter; + + /** + * Creates an instance of SupportedBatchImagesListOptions class. + */ + @Generated + public SupportedBatchImagesListOptions() { + } + + /** + * Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @return the timeOutInSeconds value. + */ + @Generated + public Duration getTimeOutInSeconds() { + if (this.timeOutInSeconds == null) { + return null; + } + return Duration.ofSeconds(this.timeOutInSeconds); + } + + /** + * Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds. + * The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + * + * @param timeOutInSeconds the timeOutInSeconds value to set. + * @return the SupportedBatchImagesListOptions object itself. + */ + @Generated + public SupportedBatchImagesListOptions setTimeOutInSeconds(Duration timeOutInSeconds) { + if (timeOutInSeconds == null) { + this.timeOutInSeconds = null; + } else { + this.timeOutInSeconds = timeOutInSeconds.getSeconds(); + } + return this; + } + + /** + * Get the maxPageSize property: The maximum number of items to return in the response. A maximum of 1000 + * applications can be returned. + * + * @return the maxPageSize value. + */ + @Generated + public Integer getMaxPageSize() { + return this.maxPageSize; + } + + /** + * Set the maxPageSize property: The maximum number of items to return in the response. A maximum of 1000 + * applications can be returned. + * + * @param maxPageSize the maxPageSize value to set. + * @return the SupportedBatchImagesListOptions object itself. + */ + @Generated + public SupportedBatchImagesListOptions setMaxPageSize(Integer maxPageSize) { + this.maxPageSize = maxPageSize; + return this; + } + + /** + * Get the filter property: An OData $filter clause. For more information on constructing this filter, see + * https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-support-images. + * + * @return the filter value. + */ + @Generated + public String getFilter() { + return this.filter; + } + + /** + * Set the filter property: An OData $filter clause. For more information on constructing this filter, see + * https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-support-images. + * + * @param filter the filter value to set. + * @return the SupportedBatchImagesListOptions object itself. + */ + @Generated + public SupportedBatchImagesListOptions setFilter(String filter) { + this.filter = filter; + return this; + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/UploadBatchServiceLogsParameters.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/UploadBatchServiceLogsParameters.java new file mode 100644 index 000000000000..ebe9e0d5dd39 --- /dev/null +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/UploadBatchServiceLogsParameters.java @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.compute.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * The Azure Batch service log files upload parameters for a Compute Node. + */ +@Fluent +public final class UploadBatchServiceLogsParameters implements JsonSerializable { + /* + * The URL of the container within Azure Blob Storage to which to upload the Batch Service log file(s). If a user + * assigned managed identity is not being used, the URL must include a Shared Access Signature (SAS) granting write + * permissions to the container. The SAS duration must allow enough time for the upload to finish. The start time + * for SAS is optional and recommended to not be specified. + */ + @Generated + private final String containerUrl; + + /* + * The start of the time range from which to upload Batch Service log file(s). Any log file containing a log message + * in the time range will be uploaded. This means that the operation might retrieve more logs than have been + * requested since the entire log file is always uploaded, but the operation should not retrieve fewer logs than + * have been requested. + */ + @Generated + private final OffsetDateTime startTime; + + /* + * The end of the time range from which to upload Batch Service log file(s). Any log file containing a log message + * in the time range will be uploaded. This means that the operation might retrieve more logs than have been + * requested since the entire log file is always uploaded, but the operation should not retrieve fewer logs than + * have been requested. If omitted, the default is to upload all logs available after the startTime. + */ + @Generated + private OffsetDateTime endTime; + + /* + * The reference to the user assigned identity to use to access Azure Blob Storage specified by containerUrl. The + * identity must have write access to the Azure Blob Storage container. + */ + @Generated + private BatchNodeIdentityReference identityReference; + + /** + * Creates an instance of UploadBatchServiceLogsParameters class. + * + * @param containerUrl the containerUrl value to set. + * @param startTime the startTime value to set. + */ + @Generated + public UploadBatchServiceLogsParameters(String containerUrl, OffsetDateTime startTime) { + this.containerUrl = containerUrl; + this.startTime = startTime; + } + + /** + * Get the containerUrl property: The URL of the container within Azure Blob Storage to which to upload the Batch + * Service log file(s). If a user assigned managed identity is not being used, the URL must include a Shared Access + * Signature (SAS) granting write permissions to the container. The SAS duration must allow enough time for the + * upload to finish. The start time for SAS is optional and recommended to not be specified. + * + * @return the containerUrl value. + */ + @Generated + public String getContainerUrl() { + return this.containerUrl; + } + + /** + * Get the startTime property: The start of the time range from which to upload Batch Service log file(s). Any log + * file containing a log message in the time range will be uploaded. This means that the operation might retrieve + * more logs than have been requested since the entire log file is always uploaded, but the operation should not + * retrieve fewer logs than have been requested. + * + * @return the startTime value. + */ + @Generated + public OffsetDateTime getStartTime() { + return this.startTime; + } + + /** + * Get the endTime property: The end of the time range from which to upload Batch Service log file(s). Any log file + * containing a log message in the time range will be uploaded. This means that the operation might retrieve more + * logs than have been requested since the entire log file is always uploaded, but the operation should not retrieve + * fewer logs than have been requested. If omitted, the default is to upload all logs available after the startTime. + * + * @return the endTime value. + */ + @Generated + public OffsetDateTime getEndTime() { + return this.endTime; + } + + /** + * Set the endTime property: The end of the time range from which to upload Batch Service log file(s). Any log file + * containing a log message in the time range will be uploaded. This means that the operation might retrieve more + * logs than have been requested since the entire log file is always uploaded, but the operation should not retrieve + * fewer logs than have been requested. If omitted, the default is to upload all logs available after the startTime. + * + * @param endTime the endTime value to set. + * @return the UploadBatchServiceLogsParameters object itself. + */ + @Generated + public UploadBatchServiceLogsParameters setEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the identityReference property: The reference to the user assigned identity to use to access Azure Blob + * Storage specified by containerUrl. The identity must have write access to the Azure Blob Storage container. + * + * @return the identityReference value. + */ + @Generated + public BatchNodeIdentityReference getIdentityReference() { + return this.identityReference; + } + + /** + * Set the identityReference property: The reference to the user assigned identity to use to access Azure Blob + * Storage specified by containerUrl. The identity must have write access to the Azure Blob Storage container. + * + * @param identityReference the identityReference value to set. + * @return the UploadBatchServiceLogsParameters object itself. + */ + @Generated + public UploadBatchServiceLogsParameters setIdentityReference(BatchNodeIdentityReference identityReference) { + this.identityReference = identityReference; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("containerUrl", this.containerUrl); + jsonWriter.writeStringField("startTime", + this.startTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTime)); + jsonWriter.writeStringField("endTime", + this.endTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endTime)); + jsonWriter.writeJsonField("identityReference", this.identityReference); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UploadBatchServiceLogsParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UploadBatchServiceLogsParameters if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UploadBatchServiceLogsParameters. + */ + @Generated + public static UploadBatchServiceLogsParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String containerUrl = null; + OffsetDateTime startTime = null; + OffsetDateTime endTime = null; + BatchNodeIdentityReference identityReference = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("containerUrl".equals(fieldName)) { + containerUrl = reader.getString(); + } else if ("startTime".equals(fieldName)) { + startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endTime".equals(fieldName)) { + endTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("identityReference".equals(fieldName)) { + identityReference = BatchNodeIdentityReference.fromJson(reader); + } else { + reader.skipChildren(); + } + } + UploadBatchServiceLogsParameters deserializedUploadBatchServiceLogsParameters + = new UploadBatchServiceLogsParameters(containerUrl, startTime); + deserializedUploadBatchServiceLogsParameters.endTime = endTime; + deserializedUploadBatchServiceLogsParameters.identityReference = identityReference; + + return deserializedUploadBatchServiceLogsParameters; + }); + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/VirtualMachineConfiguration.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/VirtualMachineConfiguration.java index 0a86fee31929..6efb8f885d5d 100644 --- a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/VirtualMachineConfiguration.java +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/VirtualMachineConfiguration.java @@ -23,7 +23,7 @@ public final class VirtualMachineConfiguration implements JsonSerializable extensions) { * @return the osDisk value. */ @Generated - public OSDisk getOsDisk() { + public BatchOsDisk getOsDisk() { return this.osDisk; } - /** - * Set the osDisk property: Settings for the operating system disk of the Virtual Machine. - * - * @param osDisk the osDisk value to set. - * @return the VirtualMachineConfiguration object itself. - */ - @Generated - public VirtualMachineConfiguration setOsDisk(OSDisk osDisk) { - this.osDisk = osDisk; - return this; - } - /** * Get the securityProfile property: Specifies the security profile settings for the virtual machine or virtual * machine scale set. @@ -465,23 +427,23 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { @Generated public static VirtualMachineConfiguration fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - ImageReference imageReference = null; + BatchVmImageReference imageReference = null; String nodeAgentSkuId = null; WindowsConfiguration windowsConfiguration = null; List dataDisks = null; String licenseType = null; - ContainerConfiguration containerConfiguration = null; + BatchContainerConfiguration containerConfiguration = null; DiskEncryptionConfiguration diskEncryptionConfiguration = null; BatchNodePlacementConfiguration nodePlacementConfiguration = null; List extensions = null; - OSDisk osDisk = null; + BatchOsDisk osDisk = null; SecurityProfile securityProfile = null; ServiceArtifactReference serviceArtifactReference = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("imageReference".equals(fieldName)) { - imageReference = ImageReference.fromJson(reader); + imageReference = BatchVmImageReference.fromJson(reader); } else if ("nodeAgentSKUId".equals(fieldName)) { nodeAgentSkuId = reader.getString(); } else if ("windowsConfiguration".equals(fieldName)) { @@ -491,7 +453,7 @@ public static VirtualMachineConfiguration fromJson(JsonReader jsonReader) throws } else if ("licenseType".equals(fieldName)) { licenseType = reader.getString(); } else if ("containerConfiguration".equals(fieldName)) { - containerConfiguration = ContainerConfiguration.fromJson(reader); + containerConfiguration = BatchContainerConfiguration.fromJson(reader); } else if ("diskEncryptionConfiguration".equals(fieldName)) { diskEncryptionConfiguration = DiskEncryptionConfiguration.fromJson(reader); } else if ("nodePlacementConfiguration".equals(fieldName)) { @@ -499,7 +461,7 @@ public static VirtualMachineConfiguration fromJson(JsonReader jsonReader) throws } else if ("extensions".equals(fieldName)) { extensions = reader.readArray(reader1 -> VMExtension.fromJson(reader1)); } else if ("osDisk".equals(fieldName)) { - osDisk = OSDisk.fromJson(reader); + osDisk = BatchOsDisk.fromJson(reader); } else if ("securityProfile".equals(fieldName)) { securityProfile = SecurityProfile.fromJson(reader); } else if ("serviceArtifactReference".equals(fieldName)) { @@ -523,4 +485,42 @@ public static VirtualMachineConfiguration fromJson(JsonReader jsonReader) throws return deserializedVirtualMachineConfiguration; }); } + + /** + * Creates an instance of VirtualMachineConfiguration class. + * + * @param imageReference the imageReference value to set. + * @param nodeAgentSkuId the nodeAgentSkuId value to set. + */ + @Generated + public VirtualMachineConfiguration(BatchVmImageReference imageReference, String nodeAgentSkuId) { + this.imageReference = imageReference; + this.nodeAgentSkuId = nodeAgentSkuId; + } + + /** + * Set the containerConfiguration property: The container configuration for the Pool. If specified, setup is + * performed on each Compute Node in the Pool to allow Tasks to run in containers. All regular Tasks and Job manager + * Tasks run on this Pool must specify the containerSettings property, and all other Tasks may specify it. + * + * @param containerConfiguration the containerConfiguration value to set. + * @return the VirtualMachineConfiguration object itself. + */ + @Generated + public VirtualMachineConfiguration setContainerConfiguration(BatchContainerConfiguration containerConfiguration) { + this.containerConfiguration = containerConfiguration; + return this; + } + + /** + * Set the osDisk property: Settings for the operating system disk of the Virtual Machine. + * + * @param osDisk the osDisk value to set. + * @return the VirtualMachineConfiguration object itself. + */ + @Generated + public VirtualMachineConfiguration setOsDisk(BatchOsDisk osDisk) { + this.osDisk = osDisk; + return this; + } } diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/VirtualMachineInfo.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/VirtualMachineInfo.java index 6487abdf0250..1765461af97f 100644 --- a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/VirtualMachineInfo.java +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/VirtualMachineInfo.java @@ -21,7 +21,7 @@ public final class VirtualMachineInfo implements JsonSerializable { + /* + * Specifies the EncryptionType of the managed disk. It is set to VMGuestStateOnly for encryption of just the + * VMGuestState blob, and NonPersistedTPM for not persisting firmware state in the VMGuestState blob. **Note**: It + * can be set for only Confidential VMs and is required when using Confidential VMs. + */ + @Generated + private SecurityEncryptionTypes securityEncryptionType; + + /** + * Creates an instance of VmDiskSecurityProfile class. + */ + @Generated + public VmDiskSecurityProfile() { + } + + /** + * Get the securityEncryptionType property: Specifies the EncryptionType of the managed disk. It is set to + * VMGuestStateOnly for encryption of just the VMGuestState blob, and NonPersistedTPM for not persisting firmware + * state in the VMGuestState blob. **Note**: It can be set for only Confidential VMs and is required when using + * Confidential VMs. + * + * @return the securityEncryptionType value. + */ + @Generated + public SecurityEncryptionTypes getSecurityEncryptionType() { + return this.securityEncryptionType; + } + + /** + * Set the securityEncryptionType property: Specifies the EncryptionType of the managed disk. It is set to + * VMGuestStateOnly for encryption of just the VMGuestState blob, and NonPersistedTPM for not persisting firmware + * state in the VMGuestState blob. **Note**: It can be set for only Confidential VMs and is required when using + * Confidential VMs. + * + * @param securityEncryptionType the securityEncryptionType value to set. + * @return the VmDiskSecurityProfile object itself. + */ + @Generated + public VmDiskSecurityProfile setSecurityEncryptionType(SecurityEncryptionTypes securityEncryptionType) { + this.securityEncryptionType = securityEncryptionType; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("securityEncryptionType", + this.securityEncryptionType == null ? null : this.securityEncryptionType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VmDiskSecurityProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VmDiskSecurityProfile if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the VmDiskSecurityProfile. + */ + @Generated + public static VmDiskSecurityProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VmDiskSecurityProfile deserializedVmDiskSecurityProfile = new VmDiskSecurityProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("securityEncryptionType".equals(fieldName)) { + deserializedVmDiskSecurityProfile.securityEncryptionType + = SecurityEncryptionTypes.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedVmDiskSecurityProfile; + }); + } +} diff --git a/sdk/batch/azure-compute-batch/src/main/resources/META-INF/azure-compute-batch_apiview_properties.json b/sdk/batch/azure-compute-batch/src/main/resources/META-INF/azure-compute-batch_apiview_properties.json index 2de447260bdd..d98b95214d6c 100644 --- a/sdk/batch/azure-compute-batch/src/main/resources/META-INF/azure-compute-batch_apiview_properties.json +++ b/sdk/batch/azure-compute-batch/src/main/resources/META-INF/azure-compute-batch_apiview_properties.json @@ -280,8 +280,6 @@ "com.azure.compute.batch.BatchClient.uploadNodeLogs": "Client.BatchClient.uploadNodeLogs", "com.azure.compute.batch.BatchClient.uploadNodeLogsWithResponse": "Client.BatchClient.uploadNodeLogs", "com.azure.compute.batch.BatchClientBuilder": "Client.BatchClient", - "com.azure.compute.batch.models.AccessScope": "Azure.Batch.AccessScope", - "com.azure.compute.batch.models.AffinityInfo": "Azure.Batch.AffinityInfo", "com.azure.compute.batch.models.AllocationState": "Azure.Batch.AllocationState", "com.azure.compute.batch.models.AuthenticationTokenSettings": "Azure.Batch.AuthenticationTokenSettings", "com.azure.compute.batch.models.AutoScaleRun": "Azure.Batch.AutoScaleRun", @@ -291,215 +289,239 @@ "com.azure.compute.batch.models.AutomaticOsUpgradePolicy": "Azure.Batch.AutomaticOsUpgradePolicy", "com.azure.compute.batch.models.AzureBlobFileSystemConfiguration": "Azure.Batch.AzureBlobFileSystemConfiguration", "com.azure.compute.batch.models.AzureFileShareConfiguration": "Azure.Batch.AzureFileShareConfiguration", + "com.azure.compute.batch.models.BatchAccessScope": "Azure.Batch.BatchAccessScope", + "com.azure.compute.batch.models.BatchAffinityInfo": "Azure.Batch.BatchAffinityInfo", + "com.azure.compute.batch.models.BatchAllTasksCompleteMode": "Azure.Batch.BatchAllTasksCompleteMode", "com.azure.compute.batch.models.BatchApplication": "Azure.Batch.BatchApplication", + "com.azure.compute.batch.models.BatchApplicationGetOptions": null, "com.azure.compute.batch.models.BatchApplicationPackageReference": "Azure.Batch.BatchApplicationPackageReference", + "com.azure.compute.batch.models.BatchApplicationsListOptions": null, "com.azure.compute.batch.models.BatchAutoPoolSpecification": "Azure.Batch.BatchAutoPoolSpecification", "com.azure.compute.batch.models.BatchCertificate": "Azure.Batch.BatchCertificate", + "com.azure.compute.batch.models.BatchCertificateCancelDeletionOptions": null, + "com.azure.compute.batch.models.BatchCertificateCreateOptions": null, + "com.azure.compute.batch.models.BatchCertificateDeleteError": "Azure.Batch.BatchCertificateDeleteError", + "com.azure.compute.batch.models.BatchCertificateDeleteOptions": null, "com.azure.compute.batch.models.BatchCertificateFormat": "Azure.Batch.BatchCertificateFormat", + "com.azure.compute.batch.models.BatchCertificateGetOptions": null, "com.azure.compute.batch.models.BatchCertificateReference": "Azure.Batch.BatchCertificateReference", "com.azure.compute.batch.models.BatchCertificateState": "Azure.Batch.BatchCertificateState", "com.azure.compute.batch.models.BatchCertificateStoreLocation": "Azure.Batch.BatchCertificateStoreLocation", "com.azure.compute.batch.models.BatchCertificateVisibility": "Azure.Batch.BatchCertificateVisibility", + "com.azure.compute.batch.models.BatchCertificatesListOptions": null, + "com.azure.compute.batch.models.BatchContainerConfiguration": "Azure.Batch.BatchContainerConfiguration", + "com.azure.compute.batch.models.BatchCreateTaskCollectionResult": "Azure.Batch.BatchCreateTaskCollectionResult", + "com.azure.compute.batch.models.BatchDiffDiskSettings": "Azure.Batch.BatchDiffDiskSettings", "com.azure.compute.batch.models.BatchError": "Azure.Batch.BatchError", "com.azure.compute.batch.models.BatchErrorDetail": "Azure.Batch.BatchErrorDetail", "com.azure.compute.batch.models.BatchErrorMessage": "Azure.Batch.BatchErrorMessage", + "com.azure.compute.batch.models.BatchErrorSourceCategory": "Azure.Batch.BatchErrorSourceCategory", + "com.azure.compute.batch.models.BatchInboundNatPool": "Azure.Batch.BatchInboundNatPool", "com.azure.compute.batch.models.BatchJob": "Azure.Batch.BatchJob", - "com.azure.compute.batch.models.BatchJobAction": "Azure.Batch.BatchJobAction", + "com.azure.compute.batch.models.BatchJobActionKind": "Azure.Batch.BatchJobActionKind", "com.azure.compute.batch.models.BatchJobConstraints": "Azure.Batch.BatchJobConstraints", - "com.azure.compute.batch.models.BatchJobCreateContent": "Azure.Batch.BatchJobCreateContent", - "com.azure.compute.batch.models.BatchJobDisableContent": "Azure.Batch.BatchJobDisableContent", + "com.azure.compute.batch.models.BatchJobCreateOptions": null, + "com.azure.compute.batch.models.BatchJobCreateParameters": "Azure.Batch.BatchJobCreateOptions", + "com.azure.compute.batch.models.BatchJobDeleteOptions": null, + "com.azure.compute.batch.models.BatchJobDisableOptions": null, + "com.azure.compute.batch.models.BatchJobDisableParameters": "Azure.Batch.BatchJobDisableOptions", + "com.azure.compute.batch.models.BatchJobEnableOptions": null, "com.azure.compute.batch.models.BatchJobExecutionInfo": "Azure.Batch.BatchJobExecutionInfo", + "com.azure.compute.batch.models.BatchJobGetOptions": null, "com.azure.compute.batch.models.BatchJobManagerTask": "Azure.Batch.BatchJobManagerTask", "com.azure.compute.batch.models.BatchJobNetworkConfiguration": "Azure.Batch.BatchJobNetworkConfiguration", "com.azure.compute.batch.models.BatchJobPreparationAndReleaseTaskStatus": "Azure.Batch.BatchJobPreparationAndReleaseTaskStatus", + "com.azure.compute.batch.models.BatchJobPreparationAndReleaseTaskStatusListOptions": null, "com.azure.compute.batch.models.BatchJobPreparationTask": "Azure.Batch.BatchJobPreparationTask", "com.azure.compute.batch.models.BatchJobPreparationTaskExecutionInfo": "Azure.Batch.BatchJobPreparationTaskExecutionInfo", "com.azure.compute.batch.models.BatchJobPreparationTaskState": "Azure.Batch.BatchJobPreparationTaskState", "com.azure.compute.batch.models.BatchJobReleaseTask": "Azure.Batch.BatchJobReleaseTask", "com.azure.compute.batch.models.BatchJobReleaseTaskExecutionInfo": "Azure.Batch.BatchJobReleaseTaskExecutionInfo", "com.azure.compute.batch.models.BatchJobReleaseTaskState": "Azure.Batch.BatchJobReleaseTaskState", + "com.azure.compute.batch.models.BatchJobReplaceOptions": null, "com.azure.compute.batch.models.BatchJobSchedule": "Azure.Batch.BatchJobSchedule", "com.azure.compute.batch.models.BatchJobScheduleConfiguration": "Azure.Batch.BatchJobScheduleConfiguration", - "com.azure.compute.batch.models.BatchJobScheduleCreateContent": "Azure.Batch.BatchJobScheduleCreateContent", + "com.azure.compute.batch.models.BatchJobScheduleCreateOptions": null, + "com.azure.compute.batch.models.BatchJobScheduleCreateParameters": "Azure.Batch.BatchJobScheduleCreateOptions", + "com.azure.compute.batch.models.BatchJobScheduleDeleteOptions": null, + "com.azure.compute.batch.models.BatchJobScheduleDisableOptions": null, + "com.azure.compute.batch.models.BatchJobScheduleEnableOptions": null, "com.azure.compute.batch.models.BatchJobScheduleExecutionInfo": "Azure.Batch.BatchJobScheduleExecutionInfo", "com.azure.compute.batch.models.BatchJobScheduleExistsOptions": null, + "com.azure.compute.batch.models.BatchJobScheduleGetOptions": null, + "com.azure.compute.batch.models.BatchJobScheduleReplaceOptions": null, "com.azure.compute.batch.models.BatchJobScheduleState": "Azure.Batch.BatchJobScheduleState", "com.azure.compute.batch.models.BatchJobScheduleStatistics": "Azure.Batch.BatchJobScheduleStatistics", - "com.azure.compute.batch.models.BatchJobScheduleUpdateContent": "Azure.Batch.BatchJobScheduleUpdateContent", + "com.azure.compute.batch.models.BatchJobScheduleTerminateOptions": null, + "com.azure.compute.batch.models.BatchJobScheduleUpdateOptions": null, + "com.azure.compute.batch.models.BatchJobScheduleUpdateParameters": "Azure.Batch.BatchJobScheduleUpdateOptions", + "com.azure.compute.batch.models.BatchJobSchedulesListOptions": null, "com.azure.compute.batch.models.BatchJobSchedulingError": "Azure.Batch.BatchJobSchedulingError", "com.azure.compute.batch.models.BatchJobSpecification": "Azure.Batch.BatchJobSpecification", "com.azure.compute.batch.models.BatchJobState": "Azure.Batch.BatchJobState", "com.azure.compute.batch.models.BatchJobStatistics": "Azure.Batch.BatchJobStatistics", - "com.azure.compute.batch.models.BatchJobTerminateContent": "Azure.Batch.BatchJobTerminateContent", - "com.azure.compute.batch.models.BatchJobUpdateContent": "Azure.Batch.BatchJobUpdateContent", + "com.azure.compute.batch.models.BatchJobTaskCountsGetOptions": null, + "com.azure.compute.batch.models.BatchJobTerminateOptions": null, + "com.azure.compute.batch.models.BatchJobTerminateParameters": "Azure.Batch.BatchJobTerminateOptions", + "com.azure.compute.batch.models.BatchJobUpdateOptions": null, + "com.azure.compute.batch.models.BatchJobUpdateParameters": "Azure.Batch.BatchJobUpdateOptions", + "com.azure.compute.batch.models.BatchJobsFromScheduleListOptions": null, + "com.azure.compute.batch.models.BatchJobsListOptions": null, + "com.azure.compute.batch.models.BatchMetadataItem": "Azure.Batch.BatchMetadataItem", "com.azure.compute.batch.models.BatchNode": "Azure.Batch.BatchNode", "com.azure.compute.batch.models.BatchNodeAgentInfo": "Azure.Batch.BatchNodeAgentInfo", "com.azure.compute.batch.models.BatchNodeCommunicationMode": "Azure.Batch.BatchNodeCommunicationMode", "com.azure.compute.batch.models.BatchNodeCounts": "Azure.Batch.BatchNodeCounts", - "com.azure.compute.batch.models.BatchNodeDeallocateContent": "Azure.Batch.BatchNodeDeallocateContent", "com.azure.compute.batch.models.BatchNodeDeallocateOption": "Azure.Batch.BatchNodeDeallocateOption", + "com.azure.compute.batch.models.BatchNodeDeallocateOptions": null, + "com.azure.compute.batch.models.BatchNodeDeallocateParameters": "Azure.Batch.BatchNodeDeallocateOptions", "com.azure.compute.batch.models.BatchNodeDeallocationOption": "Azure.Batch.BatchNodeDeallocationOption", - "com.azure.compute.batch.models.BatchNodeDisableSchedulingContent": "Azure.Batch.BatchNodeDisableSchedulingContent", "com.azure.compute.batch.models.BatchNodeDisableSchedulingOption": "Azure.Batch.BatchNodeDisableSchedulingOption", + "com.azure.compute.batch.models.BatchNodeDisableSchedulingParameters": "Azure.Batch.BatchNodeDisableSchedulingOptions", "com.azure.compute.batch.models.BatchNodeEndpointConfiguration": "Azure.Batch.BatchNodeEndpointConfiguration", "com.azure.compute.batch.models.BatchNodeError": "Azure.Batch.BatchNodeError", + "com.azure.compute.batch.models.BatchNodeExtensionGetOptions": null, + "com.azure.compute.batch.models.BatchNodeExtensionsListOptions": null, "com.azure.compute.batch.models.BatchNodeFile": "Azure.Batch.BatchNodeFile", + "com.azure.compute.batch.models.BatchNodeFileDeleteOptions": null, + "com.azure.compute.batch.models.BatchNodeFileGetOptions": null, + "com.azure.compute.batch.models.BatchNodeFilePropertiesGetOptions": null, + "com.azure.compute.batch.models.BatchNodeFilesListOptions": null, "com.azure.compute.batch.models.BatchNodeFillType": "Azure.Batch.BatchNodeFillType", + "com.azure.compute.batch.models.BatchNodeGetOptions": null, "com.azure.compute.batch.models.BatchNodeIdentityReference": "Azure.Batch.BatchNodeIdentityReference", "com.azure.compute.batch.models.BatchNodeInfo": "Azure.Batch.BatchNodeInfo", + "com.azure.compute.batch.models.BatchNodeLogsUploadOptions": null, "com.azure.compute.batch.models.BatchNodePlacementConfiguration": "Azure.Batch.BatchNodePlacementConfiguration", "com.azure.compute.batch.models.BatchNodePlacementPolicyType": "Azure.Batch.BatchNodePlacementPolicyType", - "com.azure.compute.batch.models.BatchNodeRebootContent": "Azure.Batch.BatchNodeRebootContent", - "com.azure.compute.batch.models.BatchNodeRebootOption": "Azure.Batch.BatchNodeRebootOption", - "com.azure.compute.batch.models.BatchNodeReimageContent": "Azure.Batch.BatchNodeReimageContent", + "com.azure.compute.batch.models.BatchNodeRebootKind": "Azure.Batch.BatchNodeRebootKind", + "com.azure.compute.batch.models.BatchNodeRebootOptions": null, + "com.azure.compute.batch.models.BatchNodeRebootParameters": "Azure.Batch.BatchNodeRebootOptions", "com.azure.compute.batch.models.BatchNodeReimageOption": "Azure.Batch.BatchNodeReimageOption", + "com.azure.compute.batch.models.BatchNodeReimageOptions": null, + "com.azure.compute.batch.models.BatchNodeReimageParameters": "Azure.Batch.BatchNodeReimageOptions", "com.azure.compute.batch.models.BatchNodeRemoteLoginSettings": "Azure.Batch.BatchNodeRemoteLoginSettings", - "com.azure.compute.batch.models.BatchNodeRemoveContent": "Azure.Batch.BatchNodeRemoveContent", + "com.azure.compute.batch.models.BatchNodeRemoteLoginSettingsGetOptions": null, + "com.azure.compute.batch.models.BatchNodeRemoveParameters": "Azure.Batch.BatchNodeRemoveOptions", + "com.azure.compute.batch.models.BatchNodeSchedulingDisableOptions": null, + "com.azure.compute.batch.models.BatchNodeSchedulingEnableOptions": null, + "com.azure.compute.batch.models.BatchNodeStartOptions": null, "com.azure.compute.batch.models.BatchNodeState": "Azure.Batch.BatchNodeState", - "com.azure.compute.batch.models.BatchNodeUserCreateContent": "Azure.Batch.BatchNodeUserCreateContent", - "com.azure.compute.batch.models.BatchNodeUserUpdateContent": "Azure.Batch.BatchNodeUserUpdateContent", + "com.azure.compute.batch.models.BatchNodeUserCreateOptions": null, + "com.azure.compute.batch.models.BatchNodeUserCreateParameters": "Azure.Batch.BatchNodeUserCreateOptions", + "com.azure.compute.batch.models.BatchNodeUserDeleteOptions": null, + "com.azure.compute.batch.models.BatchNodeUserReplaceOptions": null, + "com.azure.compute.batch.models.BatchNodeUserUpdateParameters": "Azure.Batch.BatchNodeUserUpdateOptions", "com.azure.compute.batch.models.BatchNodeVMExtension": "Azure.Batch.BatchNodeVMExtension", + "com.azure.compute.batch.models.BatchNodesListOptions": null, + "com.azure.compute.batch.models.BatchNodesRemoveOptions": null, + "com.azure.compute.batch.models.BatchOsDisk": "Azure.Batch.BatchOsDisk", "com.azure.compute.batch.models.BatchPool": "Azure.Batch.BatchPool", - "com.azure.compute.batch.models.BatchPoolCreateContent": "Azure.Batch.BatchPoolCreateContent", - "com.azure.compute.batch.models.BatchPoolEnableAutoScaleContent": "Azure.Batch.BatchPoolEnableAutoScaleContent", + "com.azure.compute.batch.models.BatchPoolAutoScaleDisableOptions": null, + "com.azure.compute.batch.models.BatchPoolAutoScaleEnableOptions": null, + "com.azure.compute.batch.models.BatchPoolAutoScaleEnableParameters": "Azure.Batch.BatchPoolAutoScaleEnableOptions", + "com.azure.compute.batch.models.BatchPoolAutoScaleEvaluateOptions": null, + "com.azure.compute.batch.models.BatchPoolAutoScaleEvaluateParameters": "Azure.Batch.BatchPoolAutoScaleEvaluateOptions", + "com.azure.compute.batch.models.BatchPoolCreateOptions": null, + "com.azure.compute.batch.models.BatchPoolCreateParameters": "Azure.Batch.BatchPoolCreateOptions", + "com.azure.compute.batch.models.BatchPoolDeleteOptions": null, "com.azure.compute.batch.models.BatchPoolEndpointConfiguration": "Azure.Batch.BatchPoolEndpointConfiguration", - "com.azure.compute.batch.models.BatchPoolEvaluateAutoScaleContent": "Azure.Batch.BatchPoolEvaluateAutoScaleContent", "com.azure.compute.batch.models.BatchPoolExistsOptions": null, + "com.azure.compute.batch.models.BatchPoolGetOptions": null, "com.azure.compute.batch.models.BatchPoolIdentity": "Azure.Batch.BatchPoolIdentity", "com.azure.compute.batch.models.BatchPoolIdentityType": "Azure.Batch.BatchPoolIdentityType", "com.azure.compute.batch.models.BatchPoolInfo": "Azure.Batch.BatchPoolInfo", "com.azure.compute.batch.models.BatchPoolLifetimeOption": "Azure.Batch.BatchPoolLifetimeOption", "com.azure.compute.batch.models.BatchPoolNodeCounts": "Azure.Batch.BatchPoolNodeCounts", - "com.azure.compute.batch.models.BatchPoolReplaceContent": "Azure.Batch.BatchPoolReplaceContent", - "com.azure.compute.batch.models.BatchPoolResizeContent": "Azure.Batch.BatchPoolResizeContent", + "com.azure.compute.batch.models.BatchPoolNodeCountsListOptions": null, + "com.azure.compute.batch.models.BatchPoolPropertiesReplaceOptions": null, + "com.azure.compute.batch.models.BatchPoolReplaceParameters": "Azure.Batch.BatchPoolReplaceOptions", + "com.azure.compute.batch.models.BatchPoolResizeOptions": null, + "com.azure.compute.batch.models.BatchPoolResizeParameters": "Azure.Batch.BatchPoolResizeOptions", + "com.azure.compute.batch.models.BatchPoolResizeStopOptions": null, "com.azure.compute.batch.models.BatchPoolResourceStatistics": "Azure.Batch.BatchPoolResourceStatistics", "com.azure.compute.batch.models.BatchPoolSpecification": "Azure.Batch.BatchPoolSpecification", "com.azure.compute.batch.models.BatchPoolState": "Azure.Batch.BatchPoolState", "com.azure.compute.batch.models.BatchPoolStatistics": "Azure.Batch.BatchPoolStatistics", - "com.azure.compute.batch.models.BatchPoolUpdateContent": "Azure.Batch.BatchPoolUpdateContent", + "com.azure.compute.batch.models.BatchPoolUpdateOptions": null, + "com.azure.compute.batch.models.BatchPoolUpdateParameters": "Azure.Batch.BatchPoolUpdateOptions", "com.azure.compute.batch.models.BatchPoolUsageMetrics": "Azure.Batch.BatchPoolUsageMetrics", + "com.azure.compute.batch.models.BatchPoolUsageMetricsListOptions": null, "com.azure.compute.batch.models.BatchPoolUsageStatistics": "Azure.Batch.BatchPoolUsageStatistics", + "com.azure.compute.batch.models.BatchPoolsListOptions": null, + "com.azure.compute.batch.models.BatchPublicIpAddressConfiguration": "Azure.Batch.BatchPublicIpAddressConfiguration", "com.azure.compute.batch.models.BatchStartTask": "Azure.Batch.BatchStartTask", "com.azure.compute.batch.models.BatchStartTaskInfo": "Azure.Batch.BatchStartTaskInfo", "com.azure.compute.batch.models.BatchStartTaskState": "Azure.Batch.BatchStartTaskState", + "com.azure.compute.batch.models.BatchSubTasksListOptions": null, "com.azure.compute.batch.models.BatchSubtask": "Azure.Batch.BatchSubtask", "com.azure.compute.batch.models.BatchSubtaskState": "Azure.Batch.BatchSubtaskState", "com.azure.compute.batch.models.BatchSupportedImage": "Azure.Batch.BatchSupportedImage", "com.azure.compute.batch.models.BatchTask": "Azure.Batch.BatchTask", - "com.azure.compute.batch.models.BatchTaskAddCollectionResult": "Azure.Batch.BatchTaskAddCollectionResult", - "com.azure.compute.batch.models.BatchTaskAddResult": "Azure.Batch.BatchTaskAddResult", "com.azure.compute.batch.models.BatchTaskAddStatus": "Azure.Batch.BatchTaskAddStatus", + "com.azure.compute.batch.models.BatchTaskCollectionCreateOptions": null, "com.azure.compute.batch.models.BatchTaskConstraints": "Azure.Batch.BatchTaskConstraints", "com.azure.compute.batch.models.BatchTaskContainerExecutionInfo": "Azure.Batch.BatchTaskContainerExecutionInfo", "com.azure.compute.batch.models.BatchTaskContainerSettings": "Azure.Batch.BatchTaskContainerSettings", "com.azure.compute.batch.models.BatchTaskCounts": "Azure.Batch.BatchTaskCounts", "com.azure.compute.batch.models.BatchTaskCountsResult": "Azure.Batch.BatchTaskCountsResult", - "com.azure.compute.batch.models.BatchTaskCreateContent": "Azure.Batch.BatchTaskCreateContent", + "com.azure.compute.batch.models.BatchTaskCreateOptions": null, + "com.azure.compute.batch.models.BatchTaskCreateParameters": "Azure.Batch.BatchTaskCreateOptions", + "com.azure.compute.batch.models.BatchTaskCreateResult": "Azure.Batch.BatchTaskCreateResult", + "com.azure.compute.batch.models.BatchTaskDeleteOptions": null, "com.azure.compute.batch.models.BatchTaskDependencies": "Azure.Batch.BatchTaskDependencies", "com.azure.compute.batch.models.BatchTaskExecutionInfo": "Azure.Batch.BatchTaskExecutionInfo", "com.azure.compute.batch.models.BatchTaskExecutionResult": "Azure.Batch.BatchTaskExecutionResult", "com.azure.compute.batch.models.BatchTaskFailureInfo": "Azure.Batch.BatchTaskFailureInfo", + "com.azure.compute.batch.models.BatchTaskFailureMode": "Azure.Batch.BatchTaskFailureMode", + "com.azure.compute.batch.models.BatchTaskFileDeleteOptions": null, + "com.azure.compute.batch.models.BatchTaskFileGetOptions": null, + "com.azure.compute.batch.models.BatchTaskFilePropertiesGetOptions": null, + "com.azure.compute.batch.models.BatchTaskFilesListOptions": null, + "com.azure.compute.batch.models.BatchTaskGetOptions": null, "com.azure.compute.batch.models.BatchTaskGroup": "Azure.Batch.BatchTaskGroup", "com.azure.compute.batch.models.BatchTaskIdRange": "Azure.Batch.BatchTaskIdRange", "com.azure.compute.batch.models.BatchTaskInfo": "Azure.Batch.BatchTaskInfo", + "com.azure.compute.batch.models.BatchTaskReactivateOptions": null, + "com.azure.compute.batch.models.BatchTaskReplaceOptions": null, "com.azure.compute.batch.models.BatchTaskSchedulingPolicy": "Azure.Batch.BatchTaskSchedulingPolicy", "com.azure.compute.batch.models.BatchTaskSlotCounts": "Azure.Batch.BatchTaskSlotCounts", "com.azure.compute.batch.models.BatchTaskState": "Azure.Batch.BatchTaskState", "com.azure.compute.batch.models.BatchTaskStatistics": "Azure.Batch.BatchTaskStatistics", + "com.azure.compute.batch.models.BatchTaskTerminateOptions": null, + "com.azure.compute.batch.models.BatchTasksListOptions": null, + "com.azure.compute.batch.models.BatchUefiSettings": "Azure.Batch.BatchUefiSettings", + "com.azure.compute.batch.models.BatchUserAssignedIdentity": "Azure.Batch.BatchUserAssignedIdentity", + "com.azure.compute.batch.models.BatchVmImageReference": "Azure.Batch.BatchVmImageReference", "com.azure.compute.batch.models.CachingType": "Azure.Batch.CachingType", - "com.azure.compute.batch.models.CancelBatchCertificateDeletionOptions": null, "com.azure.compute.batch.models.CifsMountConfiguration": "Azure.Batch.CifsMountConfiguration", - "com.azure.compute.batch.models.ContainerConfiguration": "Azure.Batch.ContainerConfiguration", "com.azure.compute.batch.models.ContainerHostBatchBindMountEntry": "Azure.Batch.ContainerHostBatchBindMountEntry", "com.azure.compute.batch.models.ContainerHostDataPath": "Azure.Batch.ContainerHostDataPath", "com.azure.compute.batch.models.ContainerRegistryReference": "Azure.Batch.ContainerRegistryReference", "com.azure.compute.batch.models.ContainerType": "Azure.Batch.ContainerType", "com.azure.compute.batch.models.ContainerWorkingDirectory": "Azure.Batch.ContainerWorkingDirectory", - "com.azure.compute.batch.models.CreateBatchCertificateOptions": null, - "com.azure.compute.batch.models.CreateBatchJobOptions": null, - "com.azure.compute.batch.models.CreateBatchJobScheduleOptions": null, - "com.azure.compute.batch.models.CreateBatchNodeUserOptions": null, - "com.azure.compute.batch.models.CreateBatchPoolOptions": null, - "com.azure.compute.batch.models.CreateBatchTaskCollectionOptions": null, - "com.azure.compute.batch.models.CreateBatchTaskOptions": null, "com.azure.compute.batch.models.DataDisk": "Azure.Batch.DataDisk", - "com.azure.compute.batch.models.DeallocateBatchNodeOptions": null, - "com.azure.compute.batch.models.DeleteBatchCertificateError": "Azure.Batch.DeleteBatchCertificateError", - "com.azure.compute.batch.models.DeleteBatchCertificateOptions": null, - "com.azure.compute.batch.models.DeleteBatchJobOptions": null, - "com.azure.compute.batch.models.DeleteBatchJobScheduleOptions": null, - "com.azure.compute.batch.models.DeleteBatchNodeFileOptions": null, - "com.azure.compute.batch.models.DeleteBatchNodeUserOptions": null, - "com.azure.compute.batch.models.DeleteBatchPoolOptions": null, - "com.azure.compute.batch.models.DeleteBatchTaskFileOptions": null, - "com.azure.compute.batch.models.DeleteBatchTaskOptions": null, "com.azure.compute.batch.models.DependencyAction": "Azure.Batch.DependencyAction", "com.azure.compute.batch.models.DiffDiskPlacement": "Azure.Batch.DiffDiskPlacement", - "com.azure.compute.batch.models.DiffDiskSettings": "Azure.Batch.DiffDiskSettings", "com.azure.compute.batch.models.DisableBatchJobOption": "Azure.Batch.DisableBatchJobOption", - "com.azure.compute.batch.models.DisableBatchJobOptions": null, - "com.azure.compute.batch.models.DisableBatchJobScheduleOptions": null, - "com.azure.compute.batch.models.DisableBatchNodeSchedulingOptions": null, - "com.azure.compute.batch.models.DisableBatchPoolAutoScaleOptions": null, "com.azure.compute.batch.models.DiskEncryptionConfiguration": "Azure.Batch.DiskEncryptionConfiguration", "com.azure.compute.batch.models.DiskEncryptionTarget": "Azure.Batch.DiskEncryptionTarget", "com.azure.compute.batch.models.DynamicVNetAssignmentScope": "Azure.Batch.DynamicVNetAssignmentScope", "com.azure.compute.batch.models.ElevationLevel": "Azure.Batch.ElevationLevel", - "com.azure.compute.batch.models.EnableBatchJobOptions": null, - "com.azure.compute.batch.models.EnableBatchJobScheduleOptions": null, - "com.azure.compute.batch.models.EnableBatchNodeSchedulingOptions": null, - "com.azure.compute.batch.models.EnableBatchPoolAutoScaleOptions": null, "com.azure.compute.batch.models.EnvironmentSetting": "Azure.Batch.EnvironmentSetting", - "com.azure.compute.batch.models.ErrorCategory": "Azure.Batch.ErrorCategory", - "com.azure.compute.batch.models.EvaluateBatchPoolAutoScaleOptions": null, "com.azure.compute.batch.models.ExitCodeMapping": "Azure.Batch.ExitCodeMapping", "com.azure.compute.batch.models.ExitCodeRangeMapping": "Azure.Batch.ExitCodeRangeMapping", "com.azure.compute.batch.models.ExitConditions": "Azure.Batch.ExitConditions", "com.azure.compute.batch.models.ExitOptions": "Azure.Batch.ExitOptions", "com.azure.compute.batch.models.FileProperties": "Azure.Batch.FileProperties", - "com.azure.compute.batch.models.GetBatchApplicationOptions": null, - "com.azure.compute.batch.models.GetBatchCertificateOptions": null, - "com.azure.compute.batch.models.GetBatchJobOptions": null, - "com.azure.compute.batch.models.GetBatchJobScheduleOptions": null, - "com.azure.compute.batch.models.GetBatchJobTaskCountsOptions": null, - "com.azure.compute.batch.models.GetBatchNodeExtensionOptions": null, - "com.azure.compute.batch.models.GetBatchNodeFileOptions": null, - "com.azure.compute.batch.models.GetBatchNodeFilePropertiesOptions": null, - "com.azure.compute.batch.models.GetBatchNodeOptions": null, - "com.azure.compute.batch.models.GetBatchNodeRemoteLoginSettingsOptions": null, - "com.azure.compute.batch.models.GetBatchPoolOptions": null, - "com.azure.compute.batch.models.GetBatchTaskFileOptions": null, - "com.azure.compute.batch.models.GetBatchTaskFilePropertiesOptions": null, - "com.azure.compute.batch.models.GetBatchTaskOptions": null, - "com.azure.compute.batch.models.GetCertificateResponse": "Client.getCertificate.Response.anonymous", - "com.azure.compute.batch.models.HttpHeader": "Azure.Batch.HttpHeader", - "com.azure.compute.batch.models.ImageReference": "Azure.Batch.ImageReference", "com.azure.compute.batch.models.ImageVerificationType": "Azure.Batch.ImageVerificationType", "com.azure.compute.batch.models.InboundEndpoint": "Azure.Batch.InboundEndpoint", "com.azure.compute.batch.models.InboundEndpointProtocol": "Azure.Batch.InboundEndpointProtocol", - "com.azure.compute.batch.models.InboundNatPool": "Azure.Batch.InboundNatPool", "com.azure.compute.batch.models.InstanceViewStatus": "Azure.Batch.InstanceViewStatus", "com.azure.compute.batch.models.IpAddressProvisioningType": "Azure.Batch.IpAddressProvisioningType", "com.azure.compute.batch.models.LinuxUserConfiguration": "Azure.Batch.LinuxUserConfiguration", - "com.azure.compute.batch.models.ListBatchApplicationsOptions": null, - "com.azure.compute.batch.models.ListBatchCertificatesOptions": null, - "com.azure.compute.batch.models.ListBatchJobPreparationAndReleaseTaskStatusOptions": null, - "com.azure.compute.batch.models.ListBatchJobSchedulesOptions": null, - "com.azure.compute.batch.models.ListBatchJobsFromScheduleOptions": null, - "com.azure.compute.batch.models.ListBatchJobsOptions": null, - "com.azure.compute.batch.models.ListBatchNodeExtensionsOptions": null, - "com.azure.compute.batch.models.ListBatchNodeFilesOptions": null, - "com.azure.compute.batch.models.ListBatchNodesOptions": null, - "com.azure.compute.batch.models.ListBatchPoolNodeCountsOptions": null, - "com.azure.compute.batch.models.ListBatchPoolUsageMetricsOptions": null, - "com.azure.compute.batch.models.ListBatchPoolsOptions": null, - "com.azure.compute.batch.models.ListBatchSubTasksOptions": null, - "com.azure.compute.batch.models.ListBatchTaskFilesOptions": null, - "com.azure.compute.batch.models.ListBatchTasksOptions": null, - "com.azure.compute.batch.models.ListSupportedBatchImagesOptions": null, "com.azure.compute.batch.models.LoginMode": "Azure.Batch.LoginMode", "com.azure.compute.batch.models.ManagedDisk": "Azure.Batch.ManagedDisk", - "com.azure.compute.batch.models.MetadataItem": "Azure.Batch.MetadataItem", "com.azure.compute.batch.models.MountConfiguration": "Azure.Batch.MountConfiguration", "com.azure.compute.batch.models.MultiInstanceSettings": "Azure.Batch.MultiInstanceSettings", "com.azure.compute.batch.models.NameValuePair": "Azure.Batch.NameValuePair", @@ -507,27 +529,14 @@ "com.azure.compute.batch.models.NetworkSecurityGroupRule": "Azure.Batch.NetworkSecurityGroupRule", "com.azure.compute.batch.models.NetworkSecurityGroupRuleAccess": "Azure.Batch.NetworkSecurityGroupRuleAccess", "com.azure.compute.batch.models.NfsMountConfiguration": "Azure.Batch.NfsMountConfiguration", - "com.azure.compute.batch.models.OSDisk": "Azure.Batch.OSDisk", "com.azure.compute.batch.models.OSType": "Azure.Batch.OSType", - "com.azure.compute.batch.models.OnAllBatchTasksComplete": "Azure.Batch.OnAllBatchTasksComplete", - "com.azure.compute.batch.models.OnBatchTaskFailure": "Azure.Batch.OnBatchTaskFailure", "com.azure.compute.batch.models.OutputFile": "Azure.Batch.OutputFile", "com.azure.compute.batch.models.OutputFileBlobContainerDestination": "Azure.Batch.OutputFileBlobContainerDestination", "com.azure.compute.batch.models.OutputFileDestination": "Azure.Batch.OutputFileDestination", "com.azure.compute.batch.models.OutputFileUploadCondition": "Azure.Batch.OutputFileUploadCondition", "com.azure.compute.batch.models.OutputFileUploadConfig": "Azure.Batch.OutputFileUploadConfig", - "com.azure.compute.batch.models.PublicIpAddressConfiguration": "Azure.Batch.PublicIpAddressConfiguration", - "com.azure.compute.batch.models.ReactivateBatchTaskOptions": null, - "com.azure.compute.batch.models.RebootBatchNodeOptions": null, + "com.azure.compute.batch.models.OutputFileUploadHeader": "Azure.Batch.OutputFileUploadHeader", "com.azure.compute.batch.models.RecentBatchJob": "Azure.Batch.RecentBatchJob", - "com.azure.compute.batch.models.ReimageBatchNodeOptions": null, - "com.azure.compute.batch.models.RemoveBatchNodesOptions": null, - "com.azure.compute.batch.models.ReplaceBatchJobOptions": null, - "com.azure.compute.batch.models.ReplaceBatchJobScheduleOptions": null, - "com.azure.compute.batch.models.ReplaceBatchNodeUserOptions": null, - "com.azure.compute.batch.models.ReplaceBatchPoolPropertiesOptions": null, - "com.azure.compute.batch.models.ReplaceBatchTaskOptions": null, - "com.azure.compute.batch.models.ResizeBatchPoolOptions": null, "com.azure.compute.batch.models.ResizeError": "Azure.Batch.ResizeError", "com.azure.compute.batch.models.ResourceFile": "Azure.Batch.ResourceFile", "com.azure.compute.batch.models.RollingUpgradePolicy": "Azure.Batch.RollingUpgradePolicy", @@ -536,30 +545,20 @@ "com.azure.compute.batch.models.SecurityProfile": "Azure.Batch.SecurityProfile", "com.azure.compute.batch.models.SecurityTypes": "Azure.Batch.SecurityTypes", "com.azure.compute.batch.models.ServiceArtifactReference": "Azure.Batch.ServiceArtifactReference", - "com.azure.compute.batch.models.StartBatchNodeOptions": null, "com.azure.compute.batch.models.StatusLevelTypes": "Azure.Batch.StatusLevelTypes", - "com.azure.compute.batch.models.StopBatchPoolResizeOptions": null, "com.azure.compute.batch.models.StorageAccountType": "Azure.Batch.StorageAccountType", - "com.azure.compute.batch.models.TerminateBatchJobOptions": null, - "com.azure.compute.batch.models.TerminateBatchJobScheduleOptions": null, - "com.azure.compute.batch.models.TerminateBatchTaskOptions": null, - "com.azure.compute.batch.models.UefiSettings": "Azure.Batch.UefiSettings", - "com.azure.compute.batch.models.UpdateBatchJobOptions": null, - "com.azure.compute.batch.models.UpdateBatchJobScheduleOptions": null, - "com.azure.compute.batch.models.UpdateBatchPoolOptions": null, + "com.azure.compute.batch.models.SupportedBatchImagesListOptions": null, "com.azure.compute.batch.models.UpgradeMode": "Azure.Batch.UpgradeMode", "com.azure.compute.batch.models.UpgradePolicy": "Azure.Batch.UpgradePolicy", - "com.azure.compute.batch.models.UploadBatchNodeLogsOptions": null, - "com.azure.compute.batch.models.UploadBatchServiceLogsContent": "Azure.Batch.UploadBatchServiceLogsContent", + "com.azure.compute.batch.models.UploadBatchServiceLogsParameters": "Azure.Batch.UploadBatchServiceLogsOptions", "com.azure.compute.batch.models.UploadBatchServiceLogsResult": "Azure.Batch.UploadBatchServiceLogsResult", "com.azure.compute.batch.models.UserAccount": "Azure.Batch.UserAccount", - "com.azure.compute.batch.models.UserAssignedIdentity": "Azure.Batch.UserAssignedIdentity", "com.azure.compute.batch.models.UserIdentity": "Azure.Batch.UserIdentity", - "com.azure.compute.batch.models.VMDiskSecurityProfile": "Azure.Batch.VMDiskSecurityProfile", "com.azure.compute.batch.models.VMExtension": "Azure.Batch.VMExtension", "com.azure.compute.batch.models.VMExtensionInstanceView": "Azure.Batch.VMExtensionInstanceView", "com.azure.compute.batch.models.VirtualMachineConfiguration": "Azure.Batch.VirtualMachineConfiguration", "com.azure.compute.batch.models.VirtualMachineInfo": "Azure.Batch.VirtualMachineInfo", + "com.azure.compute.batch.models.VmDiskSecurityProfile": "Azure.Batch.BatchVMDiskSecurityProfile", "com.azure.compute.batch.models.WindowsConfiguration": "Azure.Batch.WindowsConfiguration", "com.azure.compute.batch.models.WindowsUserConfiguration": "Azure.Batch.WindowsUserConfiguration" } diff --git a/sdk/batch/azure-compute-batch/tsp-location.yaml b/sdk/batch/azure-compute-batch/tsp-location.yaml index d56c8209b46c..dfa636e3fa57 100644 --- a/sdk/batch/azure-compute-batch/tsp-location.yaml +++ b/sdk/batch/azure-compute-batch/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/batch/Azure.Batch -commit: 80ea1faf49a5f7c655529d312fe886daed0069ad +commit: da5f436da0537251f7336b56f1e2df48c634d147 repo: Azure/azure-rest-api-specs -cleanup: false +additionalDirectories: