diff --git a/eng/Packages.Data.props b/eng/Packages.Data.props index b9fb801b6fa0..2496d74e0e74 100644 --- a/eng/Packages.Data.props +++ b/eng/Packages.Data.props @@ -12,7 +12,7 @@ --> - + diff --git a/sdk/batch/Microsoft.Azure.Batch/.markdownlint.jsonc b/sdk/batch/Microsoft.Azure.Batch/.markdownlint.jsonc new file mode 100644 index 000000000000..a1390b4ff96b --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/.markdownlint.jsonc @@ -0,0 +1,4 @@ +{ + "MD013": false, + "MD024": { "siblings_only": true } + } \ No newline at end of file diff --git a/sdk/batch/Microsoft.Azure.Batch/CHANGELOG.md b/sdk/batch/Microsoft.Azure.Batch/CHANGELOG.md index 71c82c2de52b..c643bcb1db9c 100644 --- a/sdk/batch/Microsoft.Azure.Batch/CHANGELOG.md +++ b/sdk/batch/Microsoft.Azure.Batch/CHANGELOG.md @@ -1,21 +1,39 @@ # Release History -## 14.1.0-beta.1 (Unreleased) - -### Bug fixes -- Updated dependency versions. +## 15.0.0 (2021-06-01) + +### Features Added + +- Add ability to assign user-assigned managed identities to `CloudPool`. These identities will be made available on each node in the pool, and can be used to access various resources. +- Added `IdentityReference` property to the following models to support accessing resources via managed identity: + - `AzureBlobFileSystemConfiguration` + - `OutputFileBlobContainerDestination` + - `ContainerRegistry` + - `ResourceFile` + - `UploadBatchServiceLogsConfiguration` +- Added new `ComputeNodeExtension` operations to `BatchServiceClient` for getting/listing VM extensions on a node +- Added new `extensions` property to `VirtualMachineConfiguration` on `CloudPool` to specify virtual machine extensions for nodes +- Added the ability to specify availability zones using a new property `NodePlacementConfiguration` on `VirtualMachineConfiguration` +- Added new `OSDisk` property to `VirtualMachineConfiguration`, which contains settings for the operating system disk of the Virtual Machine. + - The `placement` property on `DiffDiskSettings` specifies the ephemeral disk placement for operating system disks for all VMs in the pool. Setting it to "CacheDisk" will store the ephemeral OS disk on the VM cache. +- Added `MaxParallelTasks` property on `CloudJob` to control the maximum allowed tasks per job (defaults to -1, meaning unlimited). +- Added `VirtualMachineInfo` property on `ComputeNode` which contains information about the current state of the virtual machine, including the exact version of the marketplace image the VM is using. +- Added `RecurrenceInterval` property to `Schedule` to control the interval between the start times of two successive job under a job schedule. ## 14.0.0 (2020-09-10) + ### Features + - **[Breaking]** Removed proprty `MaxTasksPerNode` on CloudPool and added property `TaskSlotsPerNode`. Using this property `CloudTasks` in a `CloudJob` can consume a dynamic amount of slots allowing for more fine-grained control over resource consumption. - **[Breaking]** Changed the return type of `GetJobTaskCounts` operations to return a `TaskCountsResult` object, which is a complex object containing the previous `TaskCounts` object and a new `TaskSlotCounts` object providing similar information in the context of slots being used. - Added property `RequiredSlots` to CloudTask allowing user to specify how many slots on a node they should take up. - ## 13.0.0 (2020-03-01) + ### Features + - Added ability to encrypt `ComputeNode` disk drives using the new `DiskEncryptionConfiguration` property of `VirtualMachineConfiguration`. - **[Breaking]** The `VirtualMachineImageId` property of `ImageReference` can now only refer to a Shared Image Gallery image. - **[Breaking]** The `CreateCertificate` functions on `CertificateOperations` have been renamed to `CreateCertificateFromCer` and `CreateCertificateFromPfx` and had their parameters updated to more clearly reflect that `password` is optional for PFX formatted certificates. @@ -23,15 +41,19 @@ in a `CloudJob` can consume a dynamic amount of slots allowing for more fine-gra - The `PublicIPs` property of `NetworkConfiguration` has moved in to `PublicIPAddressConfiguration` as well. This property can only be specified if `IPAddressProvisioningType` is `UserManaged`. ### Bug fixes - - Add missing error codes to `TaskFailureInformationCodes`. + +- Add missing error codes to `TaskFailureInformationCodes`. ### REST API version + This version of the Batch .NET client library targets version 2020-03-01.11.0 of the Azure Batch REST API. **Note**: This REST API version may not be available in all regions prior to 2020-03-13. Attempts to use the SDK will fail if the region has not had support for the REST API version enabled yet. ## 12.0.0 + ### Features -- Added ability to specify a collection of public IPs on `NetworkConfiguration` via the new `PublicIPs` property. This guarantees nodes in the Pool will have an + +- Added ability to specify a collection of public IPs on `NetworkConfiguration` via the new `PublicIPs` property. This guarantees nodes in the Pool will have an IP from the list user provided IPs. - Added ability to mount remote file-systems on each node of a pool via the `MountConfiguration` property on `CloudPool`. - Shared Image Gallery images can now be specified on the `VirtualMachineImageId` property of `ImageReference` by referencing the image via its ARM ID. @@ -39,38 +61,48 @@ This version of the Batch .NET client library targets version 2020-03-01.11.0 of - **[Breaking]** When not specified, the default value for `Scope` on `AutoUserSpecification` is now always `Pool` (was `Task` on Windows nodes, `Pool` on Linux nodes). ### Bug fixes - - Improved various confusing or incomplete documentation. + +- Improved various confusing or incomplete documentation. ### REST API version + This version of the Batch .NET client library targets version 2019-08-01.10.0 of the Azure Batch REST API. ## 11.0.0 + ### Features - - Added `maxBackoff` parameter to `RetryPolicyProvider.ExponentialRetryProvider`. This option was already available on the `ExponentialRetry` constructor, + +- Added `maxBackoff` parameter to `RetryPolicyProvider.ExponentialRetryProvider`. This option was already available on the `ExponentialRetry` constructor, but adding it on `RetryPolicyProvider.ExponentialRetryProvider` makes it easier to use. - - **[Breaking]** Replaced `PoolOperations.ListNodeAgentSKUs` with `PoolOperations.ListSupportedImages`. `ListSupportedImages` contains all of the same information originally available in - `ListNodeAgentSKUs` but in a clearer format. New non-verified images are also now returned. Additional information about `Capabilities` and `BatchSupportEndOfLife` is accessible on the +- **[Breaking]** Replaced `PoolOperations.ListNodeAgentSKUs` with `PoolOperations.ListSupportedImages`. `ListSupportedImages` contains all of the same information originally available in + `ListNodeAgentSKUs` but in a clearer format. New non-verified images are also now returned. Additional information about `Capabilities` and `BatchSupportEndOfLife` is accessible on the `ImageInformation` object returned by `ListSupportedImages`. - - Now support network security rules blocking network access to a `CloudPool` based on the source port of the traffic. This is done via the `SourcePortRanges` property on `NetworkSecurityGroupRule`. - - When running a container, Batch now supports executing the task in the container working directory or in the Batch task working directory. This is controlled by the +- Now support network security rules blocking network access to a `CloudPool` based on the source port of the traffic. This is done via the `SourcePortRanges` property on `NetworkSecurityGroupRule`. +- When running a container, Batch now supports executing the task in the container working directory or in the Batch task working directory. This is controlled by the `WorkingDirectory` property on `TaskContainerSettings`. ### Bug fixes - - Improved various confusing or incomplete documentation. + +- Improved various confusing or incomplete documentation. ### REST API version + This version of the Batch .NET client library targets version 2019-06-01.9.0 of the Azure Batch REST API. ## 10.1.0 + - Added `net461` and `netstandard2.0` target frameworks. - Updated `Microsoft.AspNetCore.WebUtilities` to `1.1.2` for the `netstandard1.4` target framework. ### REST API version + This version of the Batch .NET client library targets version 2018-12-01.8.0 of the Azure Batch REST API. ## 10.0.0 + ### Features -- **[Breaking]** Removed support for the `ChangeOSVersion` API on `CloudServiceConfiguration` pools. + +- **[Breaking]** Removed support for the `ChangeOSVersion` API on `CloudServiceConfiguration` pools. - Removed `PoolOperations.ChangeOSVersion` and `PoolOperations.ChangeOSVersionAsync`. - Renamed `TargetOSVersion` to `OSVersion` and removed `CurrentOSVersion` on `CloudPool`. - Removed `PoolState.Upgrading` enum. @@ -84,9 +116,9 @@ This version of the Batch .NET client library targets version 2018-12-01.8.0 of - URLs provided to `ResourceFile` via the `ResourceFile.FromUrl` method can now be any HTTP URL. Previously, these had to be an Azure Blob Storage URL. - The `BlobPrefix` property can be used to filter downloads from a storage container to only those matching the prefix. - **[Breaking]** Removed `OSDisk` property from `VirtualMachineConfiguration`. This property is no longer supported. -- Pools which set the `DynamicVNetAssignmentScope` on `NetworkConfiguration` to be `DynamicVNetAssignmentScope.Job` can - now dynamically assign a Virtual Network to each node the job's tasks run on. The specific Virtual Network to join the nodes to is specified in - the new `JobNetworkConfiguration` property on `CloudJob` and `JobSpecification`. +- Pools which set the `DynamicVNetAssignmentScope` on `NetworkConfiguration` to be `DynamicVNetAssignmentScope.Job` can + now dynamically assign a Virtual Network to each node the job's tasks run on. The specific Virtual Network to join the nodes to is specified in + the new `JobNetworkConfiguration` property on `CloudJob` and `JobSpecification`. - **Note**: This feature is in public preview. It is disabled for all Batch accounts except for those which have contacted us and requested to be in the pilot. - The maximum lifetime of a task is now 180 days (previously it was 7). @@ -95,19 +127,25 @@ This version of the Batch .NET client library targets version 2018-12-01.8.0 of - `ExponentialRetry` supports a backoff cap, via the `MaxBackoff` property. ### Bug fixes + - The built in retry policies `ExponentialRetry` and `LinearRetry` now correctly retry on HTTP status code `429` and honor the `retry-after` header. ### REST API version + This version of the Batch .NET client library targets version 2018-12-01.8.0 of the Azure Batch REST API. ## 9.0.1 + - Updating Newtonsoft.Json to 10.0.3 ### REST API version + This version of the Batch .NET client library targets version 2018-08-01.7.0 of the Azure Batch REST API. ## 9.0.0 + ### Features + - Added the ability to see what version of the Azure Batch Node Agent is running on each of the VMs in a pool, via the new `NodeAgentInformation` property on `ComputeNode`. - Added the ability to specify a `Filter` on the `Result` of a task. See [here](https://docs.microsoft.com/rest/api/batchservice/odata-filters-in-batch) for more details. - This enables the often requested scenario of performing a server-side query to find all tasks which failed. @@ -117,48 +155,62 @@ This version of the Batch .NET client library targets version 2018-08-01.7.0 of - **[Breaking]** The default caching type for `DataDisk` and `OSDisk` is now `ReadWrite` instead of `None`. ### Bug fixes + - Fixed bug when using `BatchSharedKeyCredentials` where some operations would fail with an `Unauthenticated` error in `netcoreapp2.1` even though the right shared key was used. ### REST API version + This version of the Batch .NET client library targets version 2018-08-01.7.0 of the Azure Batch REST API. ## 8.1.2 + Rename Nuget package name from Azure.Batch to Microsoft.Azure.Batch -## Prior to version 8.1.2, this package was named "Azure.Batch" on Nuget. The release notes below are for that package. +## Prior to version 8.1.2, this package was named "Azure.Batch" on Nuget. The release notes below are for that package -## 8.1.2 Add deprecation announcement to nuget package. ## 8.1.1 + ### Bug fixes - - Fixed bug where LeavingPool state was not correctly returned via the `ListPoolNodeCounts` method on `PoolOperations`. - - Clarified various confusing documentation. + +- Fixed bug where LeavingPool state was not correctly returned via the `ListPoolNodeCounts` method on `PoolOperations`. +- Clarified various confusing documentation. ### REST API version + This version of the Batch .NET client library targets version 2018-02-01.6.1 of the Azure Batch REST API. ## 8.1.0 + ### Features - - Added the ability to query pool node counts by state, via the new `ListPoolNodeCounts` method on `PoolOperations`. - - Added the ability to upload Azure Batch node agent logs from a particular node, via the `UploadComputeNodeBatchServiceLogs` method on `PoolOperations` and `ComputeNode`. - - This is intended for use in debugging by Microsoft support when there are problems on a node. + +- Added the ability to query pool node counts by state, via the new `ListPoolNodeCounts` method on `PoolOperations`. +- Added the ability to upload Azure Batch node agent logs from a particular node, via the `UploadComputeNodeBatchServiceLogs` method on `PoolOperations` and `ComputeNode`. + - This is intended for use in debugging by Microsoft support when there are problems on a node. ### REST API version + This version of the Batch .NET client library targets version 2018-02-01.6.1 of the Azure Batch REST API. ### Import Note + The package will be renamed to Microsoft.Azure.Batch in a future release. ## 8.0.1 + ### Bug fixes + - Fixed a bug where deserializing some enum properties could fail if using Newtonsoft 10. ### REST API version + This version of the Batch .NET client library targets version 2017-09-01.6.0 of the Azure Batch REST API. ## 8.0.0 + ### Features + - Added the ability to get a discount on Windows VM pricing if you have on-premises licenses for the OS SKUs you are deploying, via `LicenseType` on `VirtualMachineConfiguration`. - Added support for attaching empty data drives to `VirtualMachineConfiguration` based pools, via the new `DataDisks` property on `VirtualMachineConfiguration`. - **[Breaking]** Custom images must now be deployed using a reference to an ARM Image, instead of pointing to .vhd files in blobs directly. @@ -168,32 +220,43 @@ This version of the Batch .NET client library targets version 2017-09-01.6.0 of - Added support for tasks run using Docker containers. To run a task using a Docker container you must specify a `ContainerConfiguration` on the `VirtualMachineConfiguration` for a pool, and then add `TaskContainerSettings` on the Task. ### REST API version + This version of the Batch .NET client library targets version 2017-09-01.6.0 of the Azure Batch REST API. ## 7.1.0 + ### Features + - Added support for detailed aggregate task counts via a new `JobOperations.GetJobTaskCounts` API. Also available on `CloudJob.GetTaskCounts`. - Added support for specifying inbound endpoints on pool compute nodes, via a new `CloudPool.PoolEndpointConfiguration` property. This allows specific ports on the node to be addressed externally. ### REST API version + This version of the Batch .NET client library targets version 2017-06-01.5.1 of the Azure Batch REST API. ## 7.0.1 + ### Bug fixes + - Fixed a bug where requests using HTTP DELETE (for example, `DeletePool` and `DeleteJob`) failed with an authentication error in the netstandard package. This was due to a change made to `HttpClient` in netcore. - This bug impacted the 6.1.0 release as well. ### REST API version + This version of the Batch .NET client library targets version 2017-05-01.5.0 of the Azure Batch REST API. ## 7.0.0 + ### License + Moved source code and NuGet package from Apache 2.0 license to MIT license. This is more consistent with the other Azure SDKs as well as other open source projects from Microsoft such as .NET. ### REST API version + This version of the Batch .NET client library targets version 2017-05-01.5.0 of the Azure Batch REST API. ### Features + - Added support for the new low-priority node type. - **[Breaking]** `TargetDedicated` and `CurrentDedicated` on `CloudPool` and `PoolSpecification` have been renamed to `TargetDedicatedComputeNodes` and `CurrentDedicatedComputeNodes`. - **[Breaking]** `ResizeError` on `CloudPool` is now a collection called `ResizeErrors`. @@ -215,31 +278,42 @@ This version of the Batch .NET client library targets version 2017-05-01.5.0 of - Please note that this feature is in gated public preview, and you must request access to it via a support ticket. ### Bug fixes + - **[Breaking]** Removed `Unmapped` enum state from `AddTaskStatus`, `CertificateFormat`, `CertificateVisibility`, `CertStoreLocation`, `ComputeNodeFillType`, `OSType`, and `PoolLifetimeOption` as they were not ever used. ### Documentation + - Improved and clarified documentation. ### Packaging + - The package now includes a `netstandard1.4` assembly instead of the previous `netstandard1.5`. ## 6.1.0 + ### REST API version + This version of the Batch .NET client library targets version 2017-01-01.4.0 of the Azure Batch REST API. ### Packaging + - The client library is now supported on .NET Core. The package now includes a `netstandard1.5` assembly in addition to the `net45` assembly. ## 6.0.0 + ### REST API version + This version of the Batch .NET client library targets version 2017-01-01.4.0 of the Azure Batch REST API. ### Features + #### Breaking changes + - Added support for running a task under a configurable user identity via the `UserIdentity` property on all task objects (`CloudTask`, `JobPreparationTask`, `StartTask`, etc). `UserIdentity` replaces `RunElevated`. `UserIdentity` supports running a task as a predefined named user (via `UserIdentity.UserName`) or an automatically created user. The `AutoUserSpecification` specifies an automatically created user account under which to run the task. To translate existing code, change `RunElevated = true` to `UserIdentity = new UserIdentity(new AutoUserSpecification(elevationLevel: ElevationLevel.Admin))` and `RunElevated = false` to `UserIdentity = new UserIdentity(new AutoUserSpecification(elevationLevel: ElevationLevel.NonAdmin))`. - Moved `FileToStage` implementation to the [Azure.Batch.FileStaging](https://www.nuget.org/packages/Azure.Batch.FileStaging) NuGet package and removed the dependency on `WindowsAzure.Storage` from the `Azure.Batch` package. This gives more flexibility on what version of `WindowsAzure.Storage` to use for users who do not use the `FileToStage` features. #### Non-breaking changes + - Added support for defining pool-wide users, via the `UserAccounts` property on `CloudPool` and `PoolSpecification`. You can run a task as such a user using the `UserIdentity` constructor that takes a user name. - Added support for requesting the Batch service provide an authentication token to the task when it runs. This is done using the `AuthenticationTokenSettings` on `CloudTask` and `JobManagerTask`. This avoids the need to pass Batch account keys to the task in order to issue requests to the Batch service. - Added support for specifying an action to take on a task's dependencies if the task fails using the `DependencyAction` property of `ExitOptions`. @@ -247,65 +321,86 @@ This version of the Batch .NET client library targets version 2017-01-01.4.0 of - Added support for Azure Active Directory based authentication. Use `BatchClient.Open/OpenAsync(BatchTokenCredentials)` to use this form of authentication. This is mandatory for accounts with `PoolAllocationMode = UserSubscription`. ### Package dependencies + - Removed the dependency on `WindowsAzure.Storage`. - Updated to use version 3.3.5 of `Microsoft.Rest.ClientRuntime.Azure`. ### Documentation + - Improved and clarified documentation. ## 5.1.2 + ### Bug fixes + - Fixed a bug where performing `JobOperations.GetNodeFile` and `PoolOperations.GetNodeFile` could throw an `OutOfMemoryException` if the file that was being examined was large. ### REST API version + This version of the Batch .NET client library targets version 2016-07-01.3.1 of the Azure Batch REST API. ## 5.1.1 + ### Bug fixes + - Fixed a bug where certificates with a signing algorithm other than SHA1 were incorrectly imported, causing the Batch service to reject them. ### REST API version + This version of the Batch .NET client library targets version 2016-07-01.3.1 of the Azure Batch REST API. ## 5.1.0 + ### Features + - Added support for a new operation `JobOperations.ReactivateTask` (or `CloudTask.Reactivate`) which allows users to reactivate a previously failed task. ### REST API version + This version of the Batch .NET client library targets version 2016-07-01.3.1 of the Azure Batch REST API. ## 5.0.2 + ### Bug fixes + - Fixed bug where `CommitChanges` would incorrectly include elements in the request which did not actually change. ### REST API version + This version of the Batch .NET client library targets version 2016-07-01.3.1 of the Azure Batch REST API. ## 5.0.1 + ### Bug fixes + - Fixed bug where `CloudJob.Commit` and `CloudJob.CommitChanges` would hit an exception when attempting to commit a job which had previously been gotten using an `ODataDetail` select clause. ### Documentation + - Improved comments for `ExitCode` on all task execution information objects (`TaskExecutionInformation`, `JobPreparationTaskExecutionInformation`, `JobReleaseTaskExecutionInformation`, `StartTaskInformation`, etc) - Improved documentation on `ocp-range` header format. ### REST API version + This version of the Batch .NET client library targets version 2016-07-01.3.1 of the Azure Batch REST API. ## 5.0.0 + ### Features + - Added `CommitChanges` method on `CloudJob`, `CloudJobSchedule` and `CloudPool`, which use the HTTP PATCH verb to perform partial updates, which can be safer if multiple clients are making concurrent changes). - Added support for joining a `CloudPool` to a virtual network on using the `NetworkConfiguration` property. - Added support for automatically terminating jobs when all tasks complete or when a task fails, via the `CloudJob.OnAllTasksComplete` and `CloudJob.OnAllTasksFailure` properties, and the `CloudTask.ExitConditions` property. - Added support for application package references on `CloudTask` and `JobManagerTask`. - ### Documentation + - Improved documentation across various classes in the `Microsoft.Azure.Batch` namespace as well as the `Microsoft.Azure.Batch.Protocol` namespaces. - Improved documentation for `AddTask` overload which takes a collection of `CloudTask` objects to include details about possible exceptions. - Improved documentation for the `WhenAll`/`WaitAll` methods of `TaskStateMonitor`. ### Other + - Updated constructors for the following types to more clearly convey their required properties: - `JobManagerTask` - `JobPreparationTask` @@ -320,73 +415,83 @@ This version of the Batch .NET client library targets version 2016-07-01.3.1 of - Refactored existing methods to provide an overload which takes a `CancellationToken`, and an overload which takes a timeout. Removed the overload which takes both. ### REST API version + This version of the Batch .NET client library targets version 2016-07-01.3.1 of the Azure Batch REST API. ## 4.0.1 + ### Bug fixes -- Fixed a bug where specifying a `DetailLevel` on a list operation would fail if the Batch service returned a list spanning multiple pages. -- Fixed a bug where `TaskDependencies` and `ApplicationPackageSummary` could throw a `NullReferenceException` if the Batch service returned a collection that was null. -- Fixed a bug where `PoolOperations.ListNodeAgentSkus` and `PoolOperations.ListPoolUsageMetrics` were missing support for `DetailLevel`. -- Updated `FileMode` comment to clarify that the default is `0770` instead of `0600`. + +- Fixed a bug where specifying a `DetailLevel` on a list operation would fail if the Batch service returned a list spanning multiple pages. +- Fixed a bug where `TaskDependencies` and `ApplicationPackageSummary` could throw a `NullReferenceException` if the Batch service returned a collection that was null. +- Fixed a bug where `PoolOperations.ListNodeAgentSkus` and `PoolOperations.ListPoolUsageMetrics` were missing support for `DetailLevel`. +- Updated `FileMode` comment to clarify that the default is `0770` instead of `0600`. ### REST API version + This version of the Batch .NET client library targets version 2016-02-01.3.0 of the Azure Batch REST API. ## 4.0.0 + ### Package dependencies -- Removed Hyak.Common dependency. -- Removed Microsoft.Azure.Common dependency. -- Added Microsoft.Rest.ClientRuntime.Azure dependency. -- Updated Azure.Storage 4.x to 6.x. + +- Removed Hyak.Common dependency. +- Removed Microsoft.Azure.Common dependency. +- Added Microsoft.Rest.ClientRuntime.Azure dependency. +- Updated Azure.Storage 4.x to 6.x. ### Features -- Azure Batch now supports Linux compute nodes (you can see which Linux distributions and versions are supported by using the new `ListNodeAgentSkus` API). -- New API `ListNodeAgentSkus`. -- New API `GetRemoteLoginSettings`. -- `ResourceFile` now has a property `FileMode` which is used for Linux VM file download. -- All node file deletion methods now take an optional recursive option (which can be used on directories). -- Properties can now be read on objects after they have been committed. An exception will be thrown if you attempt to write them though. -- `Refresh()` can now be called on objects after they have been added via `Commit()`. -- Added a new namespace `Microsoft.Azure.Batch.Protocol.BatchRequests` which contains types defined for each type of `BatchRequest`. This is useful for writing interceptors. -- Changed various properties which had a type of `IEnumerable` to `IReadOnlyList` because they are explicitly read-only. -- Changed `CloudJob.CommonEnvironmentSettings` type from `IEnumerable` to `IList`. + +- Azure Batch now supports Linux compute nodes (you can see which Linux distributions and versions are supported by using the new `ListNodeAgentSkus` API). +- New API `ListNodeAgentSkus`. +- New API `GetRemoteLoginSettings`. +- `ResourceFile` now has a property `FileMode` which is used for Linux VM file download. +- All node file deletion methods now take an optional recursive option (which can be used on directories). +- Properties can now be read on objects after they have been committed. An exception will be thrown if you attempt to write them though. +- `Refresh()` can now be called on objects after they have been added via `Commit()`. +- Added a new namespace `Microsoft.Azure.Batch.Protocol.BatchRequests` which contains types defined for each type of `BatchRequest`. This is useful for writing interceptors. +- Changed various properties which had a type of `IEnumerable` to `IReadOnlyList` because they are explicitly read-only. +- Changed `CloudJob.CommonEnvironmentSettings` type from `IEnumerable` to `IList`. ### Bug fixes -- Fixed bug where `Enable` and `Disable` scheduling APIs weren't correctly inheriting the behaviors of their parent objects. -- Fixed bug in signing which breaks some requests issued with custom conditional headers such as If-Match. -- Fixed a few possible memory leaks. + +- Fixed bug where `Enable` and `Disable` scheduling APIs weren't correctly inheriting the behaviors of their parent objects. +- Fixed bug in signing which breaks some requests issued with custom conditional headers such as If-Match. +- Fixed a few possible memory leaks. ### Breaking and default behavior changes -- Changed the default exception thrown from all synchronous methods. Previously, all synchronous methods threw an `AggregateException`, which usually contained a single inner exception. Now that inner exception will be thrown directly and it will not be wrapped in an outer `AggregateException`. -- Changed `AddTask(IEnumerable)` to always wrap exceptions from its many parallel REST requests in a `ParallelOperationsException`. Note that in some cases (such as when performing validation before issuing requests) this method can throw exceptions other than a `ParallelOperationsException`. -- The `CloudPool` class has changed to support the creation and management of Linux pools based on the virtual machine compute infrastructure as well as Windows pools based on the Azure cloud services platform. - - To configure pools based on Azure cloud services, use the `CloudPool.CloudServiceConfiguration` property. - - To configure pools based on the virtual machines infrastructure (specifically Linux pools), use the `CloudPool.VirtualMachineConfiguration` property. - - The `OSFamily` and `TargetOSVersion` properties are no longer directly on the CloudPool type. These properties apply only to cloud service pools and are now on the `CloudServiceConfiguration` type. -- Enumerations - - Renamed `CertificateVisibility.RemoteDesktop` to `CertificateVisibility.RemoteUser`. - - Renamed `CertificateVisibility.Invalid` to `CertificateVisibility.None`. - - Removed `Unmapped` state for enumerations which the Batch service guarantees backwards compatibility with. - - Removed `Invalid` state from all enums, as this is now represented by the nullability of the enum. -- Removed `ComputeNodeUser` constructor. Use the `CreateComputeNodeUser` method of the `ComputeNode` or `PoolOperations` classes instead. -- Renamed `AutoScaleEvaluation` class to `AutoScaleRun`, and removed property `DataServiceId`. -- Using a `DetailLevel` that is not supported by an operation now throws an exception (e.g. trying to use `FilterClause` on an API that doesn't support it, or trying to use `SelectClause` on an API that doesn't support it). -- Renamed `AzureError` type to `BatchError`. This should now be accessed on the `BatchException` via `BatchException.RequestInformation.BatchError`. -- Changed `AddTaskResult`: - - `StatusCode` is now Status and is an enum instead of an int. - - `ContentId` removed. - - `DataServiceId` removed. -- `BatchClient.Open` and `BatchClient.OpenAsync` now take a `BatchServiceClient` object, not a `BatchRestClient` object. -- Made `AffinityInformation` read-only after construction. -- Changed `TaskSchedulingPolicy.ComputeNodeFillType` to be non-nullable. -- Removed `ReadAsStringAsync` optional Stream parameter. -- Refactored the protocol namespace. It is now generated via the AutoRest tool (https://github.com/Azure/autorest). - - Removed the `BatchRequest` constructor which took a `BatchRestClient` (it had been marked obsolete since Azure.Batch 3.0.0). - - Significantly refactored `BatchRequest`. - - Changed request interceptor types to reflect changes to `BatchRequest`. - - Changed most types in this namespace to comply with the new underlying protocol layer generated by AutoRest. -- Removed `ResourceStatistics.DiskWriteIOps` setter. -- Removed `TaskInformation.JobScheduleId` property. + +- Changed the default exception thrown from all synchronous methods. Previously, all synchronous methods threw an `AggregateException`, which usually contained a single inner exception. Now that inner exception will be thrown directly and it will not be wrapped in an outer `AggregateException`. +- Changed `AddTask(IEnumerable)` to always wrap exceptions from its many parallel REST requests in a `ParallelOperationsException`. Note that in some cases (such as when performing validation before issuing requests) this method can throw exceptions other than a `ParallelOperationsException`. +- The `CloudPool` class has changed to support the creation and management of Linux pools based on the virtual machine compute infrastructure as well as Windows pools based on the Azure cloud services platform. + - To configure pools based on Azure cloud services, use the `CloudPool.CloudServiceConfiguration` property. + - To configure pools based on the virtual machines infrastructure (specifically Linux pools), use the `CloudPool.VirtualMachineConfiguration` property. + - The `OSFamily` and `TargetOSVersion` properties are no longer directly on the CloudPool type. These properties apply only to cloud service pools and are now on the `CloudServiceConfiguration` type. +- Enumerations + - Renamed `CertificateVisibility.RemoteDesktop` to `CertificateVisibility.RemoteUser`. + - Renamed `CertificateVisibility.Invalid` to `CertificateVisibility.None`. + - Removed `Unmapped` state for enumerations which the Batch service guarantees backwards compatibility with. + - Removed `Invalid` state from all enums, as this is now represented by the nullability of the enum. +- Removed `ComputeNodeUser` constructor. Use the `CreateComputeNodeUser` method of the `ComputeNode` or `PoolOperations` classes instead. +- Renamed `AutoScaleEvaluation` class to `AutoScaleRun`, and removed property `DataServiceId`. +- Using a `DetailLevel` that is not supported by an operation now throws an exception (e.g. trying to use `FilterClause` on an API that doesn't support it, or trying to use `SelectClause` on an API that doesn't support it). +- Renamed `AzureError` type to `BatchError`. This should now be accessed on the `BatchException` via `BatchException.RequestInformation.BatchError`. +- Changed `AddTaskResult`: + - `StatusCode` is now Status and is an enum instead of an int. + - `ContentId` removed. + - `DataServiceId` removed. +- `BatchClient.Open` and `BatchClient.OpenAsync` now take a `BatchServiceClient` object, not a `BatchRestClient` object. +- Made `AffinityInformation` read-only after construction. +- Changed `TaskSchedulingPolicy.ComputeNodeFillType` to be non-nullable. +- Removed `ReadAsStringAsync` optional Stream parameter. +- Refactored the protocol namespace. It is now generated via the AutoRest tool (). + - Removed the `BatchRequest` constructor which took a `BatchRestClient` (it had been marked obsolete since Azure.Batch 3.0.0). + - Significantly refactored `BatchRequest`. + - Changed request interceptor types to reflect changes to `BatchRequest`. + - Changed most types in this namespace to comply with the new underlying protocol layer generated by AutoRest. +- Removed `ResourceStatistics.DiskWriteIOps` setter. +- Removed `TaskInformation.JobScheduleId` property. ### REST API version + This version of the Batch .NET client library targets version 2016-02-01.3.0 of the Azure Batch REST API. diff --git a/sdk/batch/Microsoft.Azure.Batch/README.md b/sdk/batch/Microsoft.Azure.Batch/README.md index 36ff8a8f083e..f91ee8a08548 100644 --- a/sdk/batch/Microsoft.Azure.Batch/README.md +++ b/sdk/batch/Microsoft.Azure.Batch/README.md @@ -1,10 +1,13 @@ # License notes + The Azure Batch C# client is now under the MIT license. Prior to March 10 2017 it was under the Apache 2.0 license. -# Azure Batch SDK developer guide +## Azure Batch SDK developer guide + `Microsoft.Azure.Batch.sln` is your one stop shop for all things related to the Azure Batch C# client library. This solution file contains all of the projects affiliated with the Azure Batch client (including testing and tooling). ## Changing the Azure Batch client + Depending on the type of change you want to make, the work required varies. If you follow this process you shouldn't miss anything: 1. Update the Azure Batch Swagger specification, which resides in the [Azure/azure-rest-api-specs](https://github.com/Azure/azure-rest-api-specs) GitHub repository (specifically [here](https://github.com/Azure/azure-rest-api-specs/tree/master/specification/batch/data-plane)) @@ -23,19 +26,21 @@ Depending on the type of change you want to make, the work required varies. If y * The `src\IProtocolLayer.cs` interface. * The `src\ProtocolLayer.cs` class. * The corresponding operations class, for example `PoolOperations.cs`. - * The corresponding entity which the operation is performed on, for example `CloudPool.cs`. + * The corresponding entity which the operation is performed on, for example `CloudPool.cs`. 7. Add tests for your new models and APIs into the correct test projects. - * `Azure.Batch.Unit.Tests` for unit tests. These tests do not have any external dependencies (they run entirely in-memory) and are used in the continuous integration job to validate checkins. + * `Azure.Batch.Unit.Tests` for unit tests. These tests do not have any external dependencies (they run entirely in-memory) and are used in the continuous integration job to validate checkins. * `BatchClientIntegrationTests` for integration tests. These tests run against a live Azure Batch endpoint and do not run during CI. See [running the end to end tests](#running-the-end-to-end-tests) for more details about how to run these tests. * **Note:** You should prefer to add unit tests over integration tests where possible -- integration tests should be reserved for ensuring that the Batch Service accepts the Swagger requests. Testing service behavior should occur in a service test, not the client. 8. Update the `CHANGELOG.md` file and the `Version` tag in `src/Microsoft.Azure.Batch.csproj`. Ensure that if you are making a breaking change, you update the major version of the version number. 9. Run the tests and ensure that they pass. -10. Open a PR to https://github.com/Azure/azure-sdk-for-net +10. Open a PR to ### Generate the `src\GeneratedProtocol` folder using AutoRest + The GeneratedProtocol folder holds the code generated by the [AutoRest](https://github.com/Azure/autorest) tool from a Swagger specification. The AutoRest tool has a command line interface of its own which you can use directly, or you can run `powershell Start-AutoRestCodeGeneration -ResourceProvider "batch/data-plane" -SdkRepoRootPath "" -AutoRestVersion "latest" -SdkGenerationDirectory "\sdk\batch\Microsoft.Azure.Batch\src\GeneratedProtocol" -ConfigFileTag "package-2020-03.11.0"` ### Generate the `src\Generated` folder + This folder contains the convenience layer models for Azure Batch. It is generated from a custom tool. The custom tool reads all of the specification files located in `Tools\ObjectModelCodeGenerator\Spec`. The convenience layer models require more metadata than the Swagger specification provides, so this file is an extra mapping layer on top of Swagger which provides more detail. **Note:** These specification files are all about the models, they have nothing to do with the actual APIs. 1. New entities defined in the Swagger specification have to be added here as well. See an existing entity for an example. @@ -43,12 +48,13 @@ This folder contains the convenience layer models for Azure Batch. It is generat There are a number of special flags which have meaning in the specification files. The easiest way to see a list of what flags are supported and at what level is to look at the backing code generation code: -1. For properties: `Tools\ObjectModelCodeGeneration\CodeGenerationLibrary\PropertyData.cs` +1. For properties: `Tools\ObjectModelCodeGeneration\CodeGenerationLibrary\PropertyData.cs` 2. For types: `Tools\ObjectModelCodeGeneration\CodeGenerationLibrary\ObjectModelTypeData.cs` - + Once you have added and updated the required files in `Tools\ObjectModelCodeGenerator\Spec` mark the `ObjectModelCodeGenerator` as your startup project in Visual Studio and run it -- it will regenerate the contents of the `src\Generated` folder. ## Running the end to end tests + A full end to end test pass takes 20-40 minutes. The following environment variables must be set for the the end to end tests to work - it is recommended to set up a script which sets these all so that it can easily be reused later: diff --git a/sdk/batch/Microsoft.Azure.Batch/Tools/CodeGenerationLibrary/CodeGenerationUtilities.cs b/sdk/batch/Microsoft.Azure.Batch/Tools/CodeGenerationLibrary/CodeGenerationUtilities.cs index e678a43e78cb..be39e960d71b 100644 --- a/sdk/batch/Microsoft.Azure.Batch/Tools/CodeGenerationLibrary/CodeGenerationUtilities.cs +++ b/sdk/batch/Microsoft.Azure.Batch/Tools/CodeGenerationLibrary/CodeGenerationUtilities.cs @@ -138,7 +138,8 @@ public static bool IsTypeComplex(string typeString) typeString.Equals("TimeSpan") || typeString.Equals("TimeSpan?") || typeString.Equals("DateTime") || - typeString.Equals("DateTime?")); + typeString.Equals("DateTime?") || + typeString.Equals("object")); return result; } diff --git a/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/AzureBlobFileSystemConfiguration.json b/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/AzureBlobFileSystemConfiguration.json index 396bbcaffbfb..39304ba9350b 100644 --- a/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/AzureBlobFileSystemConfiguration.json +++ b/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/AzureBlobFileSystemConfiguration.json @@ -79,6 +79,17 @@ "HideSetter": true }, "Value": null + }, + { + "Key": { + "Type": "ComputeNodeIdentityReference", + "Name": "IdentityReference", + "SummaryComment": "The reference to the user assigned identity to use to access containerName", + "RemarksComment": "This property is mutually exclusive with both accountKey and sasKey; exactly one must be specified.", + "BoundAccess": "read", + "UnboundAccess": "read,write" + }, + "Value": null } ] } diff --git a/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/BatchPoolIdentity.json b/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/BatchPoolIdentity.json new file mode 100644 index 000000000000..08bc9c7f1526 --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/BatchPoolIdentity.json @@ -0,0 +1,34 @@ +{ + "Name": "BatchPoolIdentity", + "ProtocolName": "Models.BatchPoolIdentity", + "SummaryComment": "The identity of the Batch pool, if configured.", + "IsConstructorPublic": false, + "Properties": [ + { + "Key": { + "Type": "Common.PoolIdentityType", + "Name": "Type", + "SummaryComment": "The identity of the Batch pool, if configured.", + "RemarksComment": "The list of user identities associated with the Batch pool. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.", + "BoundAccess": "read", + "UnboundAccess": "read,write", + "ConstructorArgumentType": "Required" + }, + "Value": { + "Type": "Models.PoolIdentityType", + "Name": "Type" + } + }, + { + "Key": { + "Type": "IList", + "Name": "UserAssignedIdentities", + "SummaryComment": "The list of user identities associated with the Batch account.", + "RemarksComment": "The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.", + "BoundAccess": "read", + "UnboundAccess": "read,write" + }, + "Value": null + } + ] +} diff --git a/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/CloudJob.json b/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/CloudJob.json index 7d7c41a2859c..5f34f1983360 100644 --- a/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/CloudJob.json +++ b/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/CloudJob.json @@ -289,6 +289,17 @@ "UnboundAccess": "read,write" }, "Value": null + }, + { + "Key": { + "Type": "int?", + "Name": "MaxParallelTasks", + "SummaryComment": "The maximum number of tasks that can be executed in parallel for the job.", + "RemarksComment": "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.", + "BoundAccess": "read,write", + "UnboundAccess": "read,write" + }, + "Value": null } ] } diff --git a/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/CloudPool.json b/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/CloudPool.json index 286f24e86ce2..19e7a0f9e579 100644 --- a/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/CloudPool.json +++ b/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/CloudPool.json @@ -429,6 +429,17 @@ "Type": "IList", "Name": "MountConfiguration" } + }, + { + "Key": { + "Type": "BatchPoolIdentity", + "Name": "Identity", + "SummaryComment": "The identity of the Batch pool, if configured.", + "RemarksComment": "The list of user identities associated with the Batch pool. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.", + "BoundAccess": "read,write", + "UnboundAccess": "read,write" + }, + "Value": null } ] } diff --git a/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/ComputeNode.json b/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/ComputeNode.json index a488aeb4acfa..1fedebe9d60f 100644 --- a/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/ComputeNode.json +++ b/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/ComputeNode.json @@ -269,6 +269,17 @@ "Type": "int?", "Name": "RunningTaskSlotsCount" } + }, + { + "Key": { + "Type": "VirtualMachineInfo", + "Name": "VirtualMachineInfo", + "SummaryComment": "Info about the current state of the virtual machine.", + "RemarksComment": null, + "BoundAccess": "read", + "UnboundAccess": "none" + }, + "Value": null } ] } diff --git a/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/ComputeNodeIdentityReference.json b/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/ComputeNodeIdentityReference.json new file mode 100644 index 000000000000..e809de3a6e8a --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/ComputeNodeIdentityReference.json @@ -0,0 +1,18 @@ +{ + "Name": "ComputeNodeIdentityReference", + "ProtocolName": "Models.ComputeNodeIdentityReference", + "SummaryComment": "The reference to a user assigned identity associated with the Batch pool which a compute node will use.", + "Properties": [ + { + "Key": { + "Type": "string", + "Name": "ResourceId", + "SummaryComment": "The ARM resource id of the user assigned identity.", + "RemarksComment": null, + "BoundAccess": "read", + "UnboundAccess": "read,write" + }, + "Value": null + } + ] +} diff --git a/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/ContainerRegistry.json b/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/ContainerRegistry.json index 1d62e8c590df..9fbfd4661612 100644 --- a/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/ContainerRegistry.json +++ b/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/ContainerRegistry.json @@ -8,12 +8,12 @@ { "Key": { "Type": "string", - "Name": "RegistryServer", - "SummaryComment": "The registry URL.", - "RemarksComment": "If omitted, the default is \"docker.io\".", + "Name": "UserName", + "SummaryComment": "The user name to log into the registry server.", + "RemarksComment": null, "BoundAccess": "read", "UnboundAccess": "read,write", - "ConstructorArgumentType": "Optional", + "ConstructorArgumentType": "Required", "HideSetter": true }, "Value": null @@ -21,12 +21,12 @@ { "Key": { "Type": "string", - "Name": "UserName", - "SummaryComment": "The user name to log into the registry server.", + "Name": "Password", + "SummaryComment": "The password to log into the registry server.", "RemarksComment": null, "BoundAccess": "read", "UnboundAccess": "read,write", - "ConstructorArgumentType": "Required", + "ConstructorArgumentType": "Optional", "HideSetter": true }, "Value": null @@ -34,8 +34,21 @@ { "Key": { "Type": "string", - "Name": "Password", - "SummaryComment": "The password to log into the registry server.", + "Name": "RegistryServer", + "SummaryComment": "The registry URL.", + "RemarksComment": "If omitted, the default is \"docker.io\".", + "BoundAccess": "read", + "UnboundAccess": "read,write", + "ConstructorArgumentType": "Optional", + "HideSetter": true + }, + "Value": null + }, + { + "Key": { + "Type": "ComputeNodeIdentityReference", + "Name": "IdentityReference", + "SummaryComment": "The reference to the user assigned identity to use to access an Azure Container Registry instead of username and password.", "RemarksComment": null, "BoundAccess": "read", "UnboundAccess": "read,write", diff --git a/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/DiffDiskSettings.json b/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/DiffDiskSettings.json new file mode 100644 index 000000000000..d6b1ddafebc5 --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/DiffDiskSettings.json @@ -0,0 +1,21 @@ +{ + "Name": "DiffDiskSettings", + "ProtocolName": "Models.DiffDiskSettings", + "SummaryComment": "Specifies the ephemeral Disk Settings for the operating system disk used by the compute node (VM).", + "Properties": [ + { + "Key": { + "Type": "Common.DiffDiskPlacement?", + "Name": "Placement", + "SummaryComment": "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://docs.microsoft.com/en-us/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements and Linux VMs at https://docs.microsoft.com/en-us/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements.", + "RemarksComment": null, + "BoundAccess": "read,write", + "UnboundAccess": "read,write" + }, + "Value": { + "Type": "Models.DiffDiskPlacement?", + "Name": "Placement" + } + } + ] +} diff --git a/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/ImageReference.json b/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/ImageReference.json index 167f6e4b00c2..979525eb3993 100644 --- a/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/ImageReference.json +++ b/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/ImageReference.json @@ -3,7 +3,6 @@ "ProtocolName": "Models.ImageReference", "SummaryComment": "A reference to an Azure Virtual Machines Marketplace Image or a custom Azure Virtual Machine Image. To get the list of all Azure Marketplace Image references verified by Azure Batch, see .", "IsUsedInCollections": true, - "IsConstructorPublic": false, "Properties": [ { "Key": { @@ -64,6 +63,17 @@ "HideSetter": true }, "Value": null + }, + { + "Key": { + "Type": "string", + "Name": "ExactVersion", + "SummaryComment": "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'.", + "RemarksComment": null, + "BoundAccess": "read", + "UnboundAccess": "read" + }, + "Value": null } ] } diff --git a/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/InstanceViewStatus.json b/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/InstanceViewStatus.json new file mode 100644 index 000000000000..2afc813da847 --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/InstanceViewStatus.json @@ -0,0 +1,71 @@ +{ + "Name": "InstanceViewStatus", + "ProtocolName": "Models.InstanceViewStatus", + "SummaryComment": "The instance view status.", + "IsUsedInCollections": true, + "Properties": [ + { + "Key": { + "Type": "string", + "Name": "Code", + "SummaryComment": "The status code.", + "RemarksComment": null, + "BoundAccess": "read", + "UnboundAccess": "read,write", + "HideSetter": true + }, + "Value": null + }, + { + "Key": { + "Type": "string", + "Name": "DisplayStatus", + "SummaryComment": "The localized label for the status.", + "RemarksComment": null, + "BoundAccess": "read", + "UnboundAccess": "read,write", + "HideSetter": true + }, + "Value": null + }, + { + "Key": { + "Type": "Common.StatusLevelTypes?", + "Name": "Level", + "SummaryComment": "Level code.", + "RemarksComment": null, + "BoundAccess": "read", + "UnboundAccess": "read,write", + "HideSetter": true + }, + "Value": { + "Type": "Models.StatusLevelTypes?", + "Name": "Level" + } + }, + { + "Key": { + "Type": "string", + "Name": "Message", + "SummaryComment": "The detailed status message.", + "RemarksComment": null, + "BoundAccess": "read", + "UnboundAccess": "read,write", + "HideSetter": true + }, + "Value": null + }, + { + "Key": { + "Type": "string", + "Name": "Time", + "SummaryComment": "The time of the status.", + "RemarksComment": null, + "BoundAccess": "read", + "UnboundAccess": "read,write", + "HideSetter": true + }, + "Value": null + } + ] +} diff --git a/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/JobManagerTask.json b/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/JobManagerTask.json index a9d3db6bb988..3fcb3c60e913 100644 --- a/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/JobManagerTask.json +++ b/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/JobManagerTask.json @@ -180,7 +180,7 @@ "Type": "int?", "Name": "RequiredSlots", "SummaryComment": "The number of scheduling slots that the Task required to run.", - "RemarksComment": "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.", + "RemarksComment": "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 property is not supported and must not be specified.", "BoundAccess": "read", "UnboundAccess": "read,write" }, diff --git a/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/JobSpecification.json b/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/JobSpecification.json index e5ab91e045ae..ebc49196dfd7 100644 --- a/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/JobSpecification.json +++ b/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/JobSpecification.json @@ -160,6 +160,17 @@ "UnboundAccess": "read,write" }, "Value": null + }, + { + "Key": { + "Type": "int?", + "Name": "MaxParallelTasks", + "SummaryComment": "The maximum number of tasks that can be executed in parallel for the job.", + "RemarksComment": "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.", + "BoundAccess": "read,write", + "UnboundAccess": "read,write" + }, + "Value": null } ] } diff --git a/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/NodePlacementPolicyType.json b/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/NodePlacementPolicyType.json new file mode 100644 index 000000000000..b8ba7546df86 --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/NodePlacementPolicyType.json @@ -0,0 +1,24 @@ +{ + "Name": "NodePlacementConfiguration", + "ProtocolName": "Models.NodePlacementConfiguration", + "SummaryComment": "Node placement configuration for a pool.", + "RemarkComment": "For regional placement, nodes in the pool will be allocated in the same region. For zonal placement, nodes in the pool will be spread across different zones with best effort balancing.", + "Properties": [ + { + "Key": { + "Type": "Common.NodePlacementPolicyType?", + "Name": "Policy", + "SummaryComment": "Node placement Policy type on Batch Pools.", + "RemarksComment": "Allocation policy used by Batch Service to provision the nodes. If not specified, Batch will use the regional policy.", + "BoundAccess": "read", + "UnboundAccess": "read,write", + "HideSetter": true, + "ConstructorArgumentType": "Required" + }, + "Value": { + "Type": "Models.NodePlacementPolicyType?", + "Name": "Policy" + } + } + ] +} diff --git a/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/NodeVMExtension.json b/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/NodeVMExtension.json new file mode 100644 index 000000000000..a4f6b59732ea --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/NodeVMExtension.json @@ -0,0 +1,43 @@ +{ + "Name": "NodeVMExtension", + "ProtocolName": "Models.NodeVMExtension", + "SummaryComment": "The configuration for virtual machine extension instance view.", + "Properties": [ + { + "Key": { + "Type": "string", + "Name": "ProvisioningState", + "SummaryComment": "The provisioning state of the virtual machine extension.", + "RemarksComment": null, + "BoundAccess": "read", + "UnboundAccess": "read,write" + }, + "Value": null + }, + { + "Key": { + "Type": "VMExtension", + "Name": "VmExtension", + "SummaryComment": "The virtual machine extension", + "RemarksComment": null, + "BoundAccess": "read", + "UnboundAccess": "read,write" + }, + "Value": { + "Type": "VMExtension", + "Name": "VmExtension" + } + }, + { + "Key": { + "Type": "VMExtensionInstanceView", + "Name": "InstanceView", + "SummaryComment": "The vm extension instance view.", + "RemarksComment": null, + "BoundAccess": "read", + "UnboundAccess": "read,write" + }, + "Value": null + } + ] +} diff --git a/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/OSDisk.json b/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/OSDisk.json new file mode 100644 index 000000000000..04ed3dd02506 --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/OSDisk.json @@ -0,0 +1,18 @@ +{ + "Name": "OSDisk", + "ProtocolName": "Models.OSDisk", + "SummaryComment": "Settings for the operating system disk of the compute node (VM).", + "Properties": [ + { + "Key": { + "Type": "DiffDiskSettings", + "Name": "EphemeralOSDiskSettings", + "SummaryComment": "Specifies the ephemeral Disk Settings for the operating system disk used by the compute node (VM).", + "RemarksComment": null, + "BoundAccess": "read,write", + "UnboundAccess": "read,write" + }, + "Value": null + } + ] +} diff --git a/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/OutputFileBlobContainerDestination.json b/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/OutputFileBlobContainerDestination.json index b9cd212a8ca2..b05afda0f9ef 100644 --- a/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/OutputFileBlobContainerDestination.json +++ b/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/OutputFileBlobContainerDestination.json @@ -13,7 +13,7 @@ "BoundAccess": "read", "UnboundAccess": "read,write", "ConstructorArgumentType": "Optional", - "HideSetter": true + "HideSetter": true }, "Value": null }, @@ -29,6 +29,17 @@ "HideSetter": true }, "Value": null + }, + { + "Key": { + "Type": "ComputeNodeIdentityReference", + "Name": "IdentityReference", + "SummaryComment": "The reference to the user assigned identity to use to access Azure Blob Storage specified by containerUrl", + "RemarksComment": "The identity must have write access to the Azure Blob Storage container", + "BoundAccess": "read", + "UnboundAccess": "read,write" + }, + "Value": null } ] } diff --git a/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/ResourceFile.json b/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/ResourceFile.json index 3b160cccf73b..43de327c551a 100644 --- a/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/ResourceFile.json +++ b/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/ResourceFile.json @@ -82,6 +82,19 @@ "HideSetter": true }, "Value": null + }, + { + "Key": { + "Type": "ComputeNodeIdentityReference", + "Name": "IdentityReference", + "SummaryComment": "The reference to the user assigned identity to use to access Azure Blob Storage specified by storageContainerUrl or httpUrl", + "RemarksComment": null, + "BoundAccess": "read", + "UnboundAccess": "read,write", + "ConstructorArgumentType": "Optional", + "HideSetter": true + }, + "Value": null } ] } diff --git a/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/UserAssignedIdentity.json b/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/UserAssignedIdentity.json new file mode 100644 index 000000000000..76a03ead6d72 --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/UserAssignedIdentity.json @@ -0,0 +1,42 @@ +{ + "Name": "UserAssignedIdentity", + "ProtocolName": "Models.UserAssignedIdentity", + "SummaryComment": "The reference to a user assigned identity associated with the Batch pool which a compute node will use.", + "IsUsedInCollections": true, + "Properties": [ + { + "Key": { + "Type": "string", + "Name": "ResourceId", + "SummaryComment": "The ARM resource id of the user assigned identity", + "RemarksComment": null, + "BoundAccess": "read", + "UnboundAccess": "read,write", + "ConstructorArgumentType": "Required" + }, + "Value": null + }, + { + "Key": { + "Type": "string", + "Name": "ClientId", + "SummaryComment": "The client id of the user assigned identity.", + "RemarksComment": null, + "BoundAccess": "read", + "UnboundAccess": "read" + }, + "Value": null + }, + { + "Key": { + "Type": "string", + "Name": "PrincipalId", + "SummaryComment": "The principal id of the user assigned identity.", + "RemarksComment": null, + "BoundAccess": "read", + "UnboundAccess": "read" + }, + "Value": null + } + ] +} diff --git a/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/VMExtension.json b/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/VMExtension.json new file mode 100644 index 000000000000..542eaecee5fa --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/VMExtension.json @@ -0,0 +1,100 @@ +{ + "Name": "VMExtension", + "ProtocolName": "Models.VMExtension", + "SummaryComment": "The configuration for virtual machine extensions.", + "IsContructorPublic": true, + "IsUsedInCollections": true, + "Properties": [ + { + "Key": { + "Type": "string", + "Name": "Name", + "SummaryComment": "The name of the virtual machine extension.", + "RemarksComment": null, + "BoundAccess": "read,write", + "UnboundAccess": "read,write", + "ConstructorArgumentType": "Required" + }, + "Value": null + }, + { + "Key": { + "Type": "string", + "Name": "Publisher", + "SummaryComment": "The name of the extension handler publisher.", + "RemarksComment": null, + "BoundAccess": "read,write", + "UnboundAccess": "read,write", + "ConstructorArgumentType": "Required" + }, + "Value": null + }, + { + "Key": { + "Type": "string", + "Name": "Type", + "SummaryComment": "The type of the extension.", + "RemarksComment": null, + "BoundAccess": "read,write", + "UnboundAccess": "read,write", + "ConstructorArgumentType": "Required" + }, + "Value": null + }, + { + "Key": { + "Type": "string", + "Name": "TypeHandlerVersion", + "SummaryComment": "The version of script handler.", + "RemarksComment": null, + "BoundAccess": "read,write", + "UnboundAccess": "read,write" + }, + "Value": null + }, + { + "Key": { + "Type": "bool?", + "Name": "AutoUpgradeMinorVersion", + "SummaryComment": "Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true.", + "RemarksComment": null, + "BoundAccess": "read,write", + "UnboundAccess": "read,write" + }, + "Value": null + }, + { + "Key": { + "Type": "object", + "Name": "Settings", + "SummaryComment": "JSON formatted public settings for the extension.", + "RemarksComment": null, + "BoundAccess": "read,write", + "UnboundAccess": "read,write" + }, + "Value": null + }, + { + "Key": { + "Type": "object", + "Name": "ProtectedSettings", + "SummaryComment": "The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all.", + "RemarksComment": null, + "BoundAccess": "read,write", + "UnboundAccess": "read,write" + }, + "Value": null + }, + { + "Key": { + "Type": "IList", + "Name": "ProvisionAfterExtensions", + "SummaryComment": "The collection of extension names.", + "RemarksComment": "Collection of extension names after which this extension needs to be provisioned.", + "BoundAccess": "read,write", + "UnboundAccess": "read,write" + }, + "Value": null + } + ] +} diff --git a/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/VMExtensionInstanceView.json b/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/VMExtensionInstanceView.json new file mode 100644 index 000000000000..9f14cf3ba1e0 --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/VMExtensionInstanceView.json @@ -0,0 +1,40 @@ +{ + "Name": "VMExtensionInstanceView", + "ProtocolName": "Models.VMExtensionInstanceView", + "SummaryComment": "The vm extension instance view.", + "Properties": [ + { + "Key": { + "Type": "string", + "Name": "Name", + "SummaryComment": "The name of the vm extension instance view.", + "RemarksComment": null, + "BoundAccess": "read", + "UnboundAccess": "read,write" + }, + "Value": null + }, + { + "Key": { + "Type": "IList", + "Name": "Statuses", + "SummaryComment": "The resource status information.", + "RemarksComment": null, + "BoundAccess": "read", + "UnboundAccess": "read,write" + }, + "Value": null + }, + { + "Key": { + "Type": "IList", + "Name": "SubStatuses", + "SummaryComment": "The resource substatus information.", + "RemarksComment": null, + "BoundAccess": "read", + "UnboundAccess": "read,write" + }, + "Value": null + } + ] +} diff --git a/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/VirtualMachineConfiguration.json b/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/VirtualMachineConfiguration.json index d64e15a766cf..25885ae3555a 100644 --- a/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/VirtualMachineConfiguration.json +++ b/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/VirtualMachineConfiguration.json @@ -1,90 +1,126 @@ +{ + "Name": "VirtualMachineConfiguration", + "ProtocolName": "Models.VirtualMachineConfiguration", + "SummaryComment": "The configuration for compute nodes in a pool based on the Azure Virtual Machines infrastructure.", + "ForceConstructorOrder": true, + "Properties": [ { - "Name": "VirtualMachineConfiguration", - "ProtocolName": "Models.VirtualMachineConfiguration", - "SummaryComment": "The configuration for compute nodes in a pool based on the Azure Virtual Machines infrastructure.", - "ForceConstructorOrder": true, - "Properties": [ - { - "Key": { - "Type": "ImageReference", - "Name": "ImageReference", - "SummaryComment": "A reference to the Azure Virtual Machines Marketplace Image or the custom Virtual Machine Image to use.", - "RemarksComment": null, - "BoundAccess": "read,write", - "UnboundAccess": "read,write", - "ConstructorArgumentType": "Required" - }, - "Value": null - }, - { - "Key": { - "Type": "string", - "Name": "NodeAgentSkuId", - "SummaryComment": "The SKU of Batch Node Agent to be provisioned on the compute node.", - "RemarksComment": "The Batch node agent is a program that runs on each node in the pool, and provides the command-and-control interface between the node and the Batch service. There are different implementations of the node agent, known as SKUs, for different operating systems.", - "BoundAccess": "read,write", - "UnboundAccess": "read,write", - "ConstructorArgumentType": "Required" - }, - "Value": { - "Type": "string", - "Name": "NodeAgentSKUId" - } - }, - { - "Key": { - "Type": "IList", - "Name": "DataDisks", - "SummaryComment": "The configuration for data disks attached to the Comptue Nodes in the pool.", - "RemarksComment": "This property must be specified if the Compute Nodes in the pool need to have empty data disks attached to them. This cannot be updated.", - "BoundAccess": "read,write", - "UnboundAccess": "read,write" - }, - "Value": null - }, - { - "Key": { - "Type": "string", - "Name": "LicenseType", - "SummaryComment": "The type of on-premises license to be used when deploying the operating system.", - "RemarksComment": "This only applies to images that contain the Windows operating system, and should only be used when you hold valid on-premises licenses for the nodes which will be deployed. If omitted, no on-premises licensing discount is applied. Values are: 'Windows_Server' - The on-premises license is for Windows Server. 'Windows_Client' - The on-premises license is for Windows Client.", - "BoundAccess": "read,write", - "UnboundAccess": "read,write" - }, - "Value": null - }, - { - "Key": { - "Type": "WindowsConfiguration", - "Name": "WindowsConfiguration", - "SummaryComment": "Windows operating system settings on the Virtual Machine. This property must not be specified if the ImageReference property specifies a Linux OS image.", - "RemarksComment": null, - "BoundAccess": "read,write", - "UnboundAccess": "read,write" - }, - "Value": null - }, - { - "Key": { - "Type": "ContainerConfiguration", - "Name": "ContainerConfiguration", - "SummaryComment": "The container configuration for the pool.", - "RemarksComment": "If specified, setup is performed on each node in the pool to allow tasks to run in containers. All regular tasks and job manager tasks run on this pool must specify , and all other tasks may specify it.", - "BoundAccess": "read,write", - "UnboundAccess": "read,write" - }, - "Value": null - }, - { - "Key": { - "Type": "DiskEncryptionConfiguration", - "Name": "DiskEncryptionConfiguration", - "SummaryComment": "The disk encryption configuration for the pool.", - "RemarksComment": "If specified, encryption is performed on each node in the pool during node provisioning.", - "BoundAccess": "read,write", - "UnboundAccess": "read,write" - }, - "Value": null - } - ] + "Key": { + "Type": "ImageReference", + "Name": "ImageReference", + "SummaryComment": "A reference to the Azure Virtual Machines Marketplace Image or the custom Virtual Machine Image to use.", + "RemarksComment": null, + "BoundAccess": "read,write", + "UnboundAccess": "read,write", + "ConstructorArgumentType": "Required" + }, + "Value": null + }, + { + "Key": { + "Type": "string", + "Name": "NodeAgentSkuId", + "SummaryComment": "The SKU of Batch Node Agent to be provisioned on the compute node.", + "RemarksComment": "The Batch node agent is a program that runs on each node in the pool, and provides the command-and-control interface between the node and the Batch service. There are different implementations of the node agent, known as SKUs, for different operating systems.", + "BoundAccess": "read,write", + "UnboundAccess": "read,write", + "ConstructorArgumentType": "Required" + }, + "Value": { + "Type": "string", + "Name": "NodeAgentSKUId" + } + }, + { + "Key": { + "Type": "IList", + "Name": "DataDisks", + "SummaryComment": "The configuration for data disks attached to the Comptue Nodes in the pool.", + "RemarksComment": "This property must be specified if the Compute Nodes in the pool need to have empty data disks attached to them. This cannot be updated.", + "BoundAccess": "read,write", + "UnboundAccess": "read,write" + }, + "Value": null + }, + { + "Key": { + "Type": "string", + "Name": "LicenseType", + "SummaryComment": "The type of on-premises license to be used when deploying the operating system.", + "RemarksComment": "This only applies to images that contain the Windows operating system, and should only be used when you hold valid on-premises licenses for the nodes which will be deployed. If omitted, no on-premises licensing discount is applied. Values are: 'Windows_Server' - The on-premises license is for Windows Server. 'Windows_Client' - The on-premises license is for Windows Client.", + "BoundAccess": "read,write", + "UnboundAccess": "read,write" + }, + "Value": null + }, + { + "Key": { + "Type": "WindowsConfiguration", + "Name": "WindowsConfiguration", + "SummaryComment": "Windows operating system settings on the Virtual Machine. This property must not be specified if the ImageReference property specifies a Linux OS image.", + "RemarksComment": null, + "BoundAccess": "read,write", + "UnboundAccess": "read,write" + }, + "Value": null + }, + { + "Key": { + "Type": "ContainerConfiguration", + "Name": "ContainerConfiguration", + "SummaryComment": "The container configuration for the pool.", + "RemarksComment": "If specified, setup is performed on each node in the pool to allow tasks to run in containers. All regular tasks and job manager tasks run on this pool must specify , and all other tasks may specify it.", + "BoundAccess": "read,write", + "UnboundAccess": "read,write" + }, + "Value": null + }, + { + "Key": { + "Type": "DiskEncryptionConfiguration", + "Name": "DiskEncryptionConfiguration", + "SummaryComment": "The disk encryption configuration for the pool.", + "RemarksComment": "If specified, encryption is performed on each node in the pool during node provisioning.", + "BoundAccess": "read,write", + "UnboundAccess": "read,write" + }, + "Value": null + }, + { + "Key": { + "Type": "NodePlacementConfiguration", + "Name": "NodePlacementConfiguration", + "SummaryComment": "The node placement configuration for the pool.", + "RemarksComment": "This configuration will specify rules on how nodes in the pool will be physically allocated.", + "BoundAccess": "read,write", + "UnboundAccess": "read,write" + }, + "Value": null + }, + { + "Key": { + "Type": "IList", + "Name": "Extensions", + "SummaryComment": "The virtual machine extension for the pool.", + "RemarksComment": "If specified, the extensions mentioned in this configuration will be installed on each node.", + "BoundAccess": "read,write", + "UnboundAccess": "read,write" + }, + "Value": null + }, + { + "Key": { + "Type": "OSDisk", + "Name": "OSDisk", + "SummaryComment": "Settings for the operating system disk of the Virtual Machine.", + "RemarksComment": null, + "BoundAccess": "read,write", + "UnboundAccess": "read,write" + }, + "Value": { + "Type": "OSDisk", + "Name": "OsDisk" + } } + ] +} \ No newline at end of file diff --git a/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/VirtualMachineInfo.json b/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/VirtualMachineInfo.json new file mode 100644 index 000000000000..cc7112bd871a --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/VirtualMachineInfo.json @@ -0,0 +1,20 @@ +{ + "Name": "VirtualMachineInfo", + "ProtocolName": "Models.VirtualMachineInfo", + "SummaryComment": "Info about the current state of the virtual machine.", + "IsConstructorPublic": true, + "IsUsedInCollections": true, + "Properties": [ + { + "Key": { + "Type": "ImageReference", + "Name": "ImageReference", + "SummaryComment": "The reference to the Azure Virtual Machine's Marketplace Image.", + "RemarksComment": null, + "BoundAccess": "read", + "UnboundAccess": "read,write" + }, + "Value": null + } + ] +} diff --git a/sdk/batch/Microsoft.Azure.Batch/src/CloudJob.cs b/sdk/batch/Microsoft.Azure.Batch/src/CloudJob.cs index 3a7790d23ebe..786d826e11ff 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/CloudJob.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/CloudJob.cs @@ -121,10 +121,12 @@ public async Task CommitChangesAsync( Models.PoolInformation modelPoolInformation = this.propertyContainer.PoolInformationProperty. GetTransportObjectIfChanged(); int? priority = this.propertyContainer.PriorityProperty.GetIfChangedOrNull(); + int? maxParallelTasks = this.propertyContainer.MaxParallelTasksProperty.GetIfChangedOrNull(); Task asyncTask = this.parentBatchClient.ProtocolLayer.PatchJob( this.Id, priority, + maxParallelTasks, UtilitiesInternal.MapNullableEnum(this.OnAllTasksComplete), modelPoolInformation, modelJobConstraints, diff --git a/sdk/batch/Microsoft.Azure.Batch/src/Common/BatchErrorCodeStrings.cs b/sdk/batch/Microsoft.Azure.Batch/src/Common/BatchErrorCodeStrings.cs index 8b36e9494654..c41f53a350fb 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/Common/BatchErrorCodeStrings.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/Common/BatchErrorCodeStrings.cs @@ -612,7 +612,7 @@ public static class PoolResizeErrorCodes /// /// Desired number of nodes could not be allocated as the resize timeout was reached /// - public const string AllocationTimedOut = "AllocationTimedOut"; + public const string AllocationTimedOut = "AllocationTimedout"; /// /// Desired number of nodes could not be allocated diff --git a/sdk/batch/Microsoft.Azure.Batch/src/Common/Enumerations/DiffDiskPlacement.cs b/sdk/batch/Microsoft.Azure.Batch/src/Common/Enumerations/DiffDiskPlacement.cs new file mode 100644 index 000000000000..041766a74b2e --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/src/Common/Enumerations/DiffDiskPlacement.cs @@ -0,0 +1,25 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// + +namespace Microsoft.Azure.Batch.Common +{ + /// + /// Specifies the ephemeral disk placement for operating system disk for all compute nodes (VMs) in the pool. + /// + /// + /// This property can be used by user in the request to choose which location the operating system should be in. + /// 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 + /// and Linux VMs. + /// + public enum DiffDiskPlacement + { + /// + /// The Ephemeral OS Disk is stored on the VM cache. + /// + CacheDisk, + } +} diff --git a/sdk/batch/Microsoft.Azure.Batch/src/Common/Enumerations/NodePlacementConfiguration.cs b/sdk/batch/Microsoft.Azure.Batch/src/Common/Enumerations/NodePlacementConfiguration.cs new file mode 100644 index 000000000000..9821949751fb --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/src/Common/Enumerations/NodePlacementConfiguration.cs @@ -0,0 +1,24 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// + +namespace Microsoft.Azure.Batch.Common +{ + /// + /// The placement policy for allocating nodes in the pool. + /// The default value is regional. + /// + public enum NodePlacementPolicyType + { + /// + /// All nodes in the pool will be allocated in the same region. + /// + Regional, + + /// + /// Nodes in the pool will be spread across different availability zones with best effort balancing. + /// + Zonal, + } +} diff --git a/sdk/batch/Microsoft.Azure.Batch/src/Common/Enumerations/PoolIdentityType.cs b/sdk/batch/Microsoft.Azure.Batch/src/Common/Enumerations/PoolIdentityType.cs new file mode 100644 index 000000000000..2ef72e6cb81f --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/src/Common/Enumerations/PoolIdentityType.cs @@ -0,0 +1,24 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +// + +namespace Microsoft.Azure.Batch.Common +{ + /// + /// The type of identity associated with a Batch pool. + /// + public enum PoolIdentityType + { + /// + /// Batch pool has user assigned identities with it. + /// + UserAssigned, + + /// + /// Batch pool has no identity associated with it. Setting `None` in update pool will remove existing identities. + /// + None + } +} diff --git a/sdk/batch/Microsoft.Azure.Batch/src/Common/Enumerations/StatusLevelTypes.cs b/sdk/batch/Microsoft.Azure.Batch/src/Common/Enumerations/StatusLevelTypes.cs new file mode 100644 index 000000000000..9bbbb3842847 --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/src/Common/Enumerations/StatusLevelTypes.cs @@ -0,0 +1,29 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +// + +namespace Microsoft.Azure.Batch.Common +{ + /// + /// Status level types. + /// + public enum StatusLevelTypes + { + /// + /// Error level. + /// + Error, + + /// + /// Info level. + /// + Info, + + /// + /// Warning level. + /// + Warning, + } +} diff --git a/sdk/batch/Microsoft.Azure.Batch/src/Generated/AzureBlobFileSystemConfiguration.cs b/sdk/batch/Microsoft.Azure.Batch/src/Generated/AzureBlobFileSystemConfiguration.cs index f335af010e26..86fb4655e8cb 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/Generated/AzureBlobFileSystemConfiguration.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/Generated/AzureBlobFileSystemConfiguration.cs @@ -22,7 +22,64 @@ namespace Microsoft.Azure.Batch /// public partial class AzureBlobFileSystemConfiguration : ITransportObjectProvider, IPropertyMetadata { + private class PropertyContainer : PropertyCollection + { + public readonly PropertyAccessor AccountKeyProperty; + public readonly PropertyAccessor AccountNameProperty; + public readonly PropertyAccessor BlobfuseOptionsProperty; + public readonly PropertyAccessor ContainerNameProperty; + public readonly PropertyAccessor IdentityReferenceProperty; + public readonly PropertyAccessor RelativeMountPathProperty; + public readonly PropertyAccessor SasKeyProperty; + + public PropertyContainer() : base(BindingState.Unbound) + { + this.AccountKeyProperty = this.CreatePropertyAccessor(nameof(AccountKey), BindingAccess.Read | BindingAccess.Write); + this.AccountNameProperty = this.CreatePropertyAccessor(nameof(AccountName), BindingAccess.Read | BindingAccess.Write); + this.BlobfuseOptionsProperty = this.CreatePropertyAccessor(nameof(BlobfuseOptions), BindingAccess.Read | BindingAccess.Write); + this.ContainerNameProperty = this.CreatePropertyAccessor(nameof(ContainerName), BindingAccess.Read | BindingAccess.Write); + this.IdentityReferenceProperty = this.CreatePropertyAccessor(nameof(IdentityReference), BindingAccess.Read | BindingAccess.Write); + this.RelativeMountPathProperty = this.CreatePropertyAccessor(nameof(RelativeMountPath), BindingAccess.Read | BindingAccess.Write); + this.SasKeyProperty = this.CreatePropertyAccessor(nameof(SasKey), BindingAccess.Read | BindingAccess.Write); + } + + public PropertyContainer(Models.AzureBlobFileSystemConfiguration protocolObject) : base(BindingState.Bound) + { + this.AccountKeyProperty = this.CreatePropertyAccessor( + protocolObject.AccountKey, + nameof(AccountKey), + BindingAccess.Read); + this.AccountNameProperty = this.CreatePropertyAccessor( + protocolObject.AccountName, + nameof(AccountName), + BindingAccess.Read); + this.BlobfuseOptionsProperty = this.CreatePropertyAccessor( + protocolObject.BlobfuseOptions, + nameof(BlobfuseOptions), + BindingAccess.Read); + this.ContainerNameProperty = this.CreatePropertyAccessor( + protocolObject.ContainerName, + nameof(ContainerName), + BindingAccess.Read); + this.IdentityReferenceProperty = this.CreatePropertyAccessor( + UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.IdentityReference, o => new ComputeNodeIdentityReference(o).Freeze()), + nameof(IdentityReference), + BindingAccess.Read); + this.RelativeMountPathProperty = this.CreatePropertyAccessor( + protocolObject.RelativeMountPath, + nameof(RelativeMountPath), + BindingAccess.Read); + this.SasKeyProperty = this.CreatePropertyAccessor( + protocolObject.SasKey, + nameof(SasKey), + BindingAccess.Read); + } + } + + private readonly PropertyContainer propertyContainer; + #region Constructors + /// /// Initializes a new instance of the class. /// @@ -40,6 +97,7 @@ internal AzureBlobFileSystemConfiguration( string sasKey = default(string), string blobfuseOptions = default(string)) { + this.propertyContainer = new PropertyContainer(); this.AccountName = accountName; this.ContainerName = containerName; this.RelativeMountPath = relativeMountPath; @@ -50,12 +108,7 @@ internal AzureBlobFileSystemConfiguration( internal AzureBlobFileSystemConfiguration(Models.AzureBlobFileSystemConfiguration protocolObject) { - this.AccountKey = protocolObject.AccountKey; - this.AccountName = protocolObject.AccountName; - this.BlobfuseOptions = protocolObject.BlobfuseOptions; - this.ContainerName = protocolObject.ContainerName; - this.RelativeMountPath = protocolObject.RelativeMountPath; - this.SasKey = protocolObject.SasKey; + this.propertyContainer = new PropertyContainer(protocolObject); } #endregion Constructors @@ -65,12 +118,20 @@ internal AzureBlobFileSystemConfiguration(Models.AzureBlobFileSystemConfiguratio /// /// Gets the Azure Storage Account key. This property is mutually exclusive with . /// - public string AccountKey { get; } + public string AccountKey + { + get { return this.propertyContainer.AccountKeyProperty.Value; } + private set { this.propertyContainer.AccountKeyProperty.Value = value; } + } /// /// Gets the Azure Storage account name. /// - public string AccountName { get; } + public string AccountName + { + get { return this.propertyContainer.AccountNameProperty.Value; } + private set { this.propertyContainer.AccountNameProperty.Value = value; } + } /// /// Gets additional command line options to pass to the mount command. @@ -78,12 +139,32 @@ internal AzureBlobFileSystemConfiguration(Models.AzureBlobFileSystemConfiguratio /// /// These are 'net use' options in Windows and 'mount' options in Linux. /// - public string BlobfuseOptions { get; } + public string BlobfuseOptions + { + get { return this.propertyContainer.BlobfuseOptionsProperty.Value; } + private set { this.propertyContainer.BlobfuseOptionsProperty.Value = value; } + } /// /// Gets the Azure Blob Storage Container name. /// - public string ContainerName { get; } + public string ContainerName + { + get { return this.propertyContainer.ContainerNameProperty.Value; } + private set { this.propertyContainer.ContainerNameProperty.Value = value; } + } + + /// + /// Gets or sets the reference to the user assigned identity to use to access containerName + /// + /// + /// This property is mutually exclusive with both accountKey and sasKey; exactly one must be specified. + /// + public ComputeNodeIdentityReference IdentityReference + { + get { return this.propertyContainer.IdentityReferenceProperty.Value; } + set { this.propertyContainer.IdentityReferenceProperty.Value = value; } + } /// /// Gets the relative path on the compute node where the file system will be mounted. @@ -92,12 +173,20 @@ internal AzureBlobFileSystemConfiguration(Models.AzureBlobFileSystemConfiguratio /// All file systems are mounted relative to the Batch mounts directory, accessible via the AZ_BATCH_NODE_MOUNTS_DIR /// environment variable. /// - public string RelativeMountPath { get; } + public string RelativeMountPath + { + get { return this.propertyContainer.RelativeMountPathProperty.Value; } + private set { this.propertyContainer.RelativeMountPathProperty.Value = value; } + } /// /// Gets the Azure Storage SAS token. This property is mutually exclusive with . /// - public string SasKey { get; } + public string SasKey + { + get { return this.propertyContainer.SasKeyProperty.Value; } + private set { this.propertyContainer.SasKeyProperty.Value = value; } + } #endregion // AzureBlobFileSystemConfiguration @@ -105,23 +194,18 @@ internal AzureBlobFileSystemConfiguration(Models.AzureBlobFileSystemConfiguratio bool IModifiable.HasBeenModified { - //This class is compile time readonly so it cannot have been modified - get { return false; } + get { return this.propertyContainer.HasBeenModified; } } bool IReadOnly.IsReadOnly { - get { return true; } - set - { - // This class is compile time readonly already - } + get { return this.propertyContainer.IsReadOnly; } + set { this.propertyContainer.IsReadOnly = value; } } - #endregion // IPropertyMetadata + #endregion //IPropertyMetadata #region Internal/private methods - /// /// Return a protocol object of the requested type. /// @@ -134,6 +218,7 @@ bool IReadOnly.IsReadOnly AccountName = this.AccountName, BlobfuseOptions = this.BlobfuseOptions, ContainerName = this.ContainerName, + IdentityReference = UtilitiesInternal.CreateObjectWithNullCheck(this.IdentityReference, (o) => o.GetTransportObject()), RelativeMountPath = this.RelativeMountPath, SasKey = this.SasKey, }; diff --git a/sdk/batch/Microsoft.Azure.Batch/src/Generated/BatchPoolIdentity.cs b/sdk/batch/Microsoft.Azure.Batch/src/Generated/BatchPoolIdentity.cs new file mode 100644 index 000000000000..ea0a18ab65c5 --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/src/Generated/BatchPoolIdentity.cs @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +// +// This file was autogenerated by a tool. +// Do not modify it. +// + +namespace Microsoft.Azure.Batch +{ + using Models = Microsoft.Azure.Batch.Protocol.Models; + using System; + using System.Collections.Generic; + using System.Linq; + + /// + /// The identity of the Batch pool, if configured. + /// + public partial class BatchPoolIdentity : ITransportObjectProvider, IPropertyMetadata + { + private class PropertyContainer : PropertyCollection + { + public readonly PropertyAccessor TypeProperty; + public readonly PropertyAccessor> UserAssignedIdentitiesProperty; + + public PropertyContainer() : base(BindingState.Unbound) + { + this.TypeProperty = this.CreatePropertyAccessor(nameof(Type), BindingAccess.Read | BindingAccess.Write); + this.UserAssignedIdentitiesProperty = this.CreatePropertyAccessor>(nameof(UserAssignedIdentities), BindingAccess.Read | BindingAccess.Write); + } + + public PropertyContainer(Models.BatchPoolIdentity protocolObject) : base(BindingState.Bound) + { + this.TypeProperty = this.CreatePropertyAccessor( + UtilitiesInternal.MapEnum(protocolObject.Type), + nameof(Type), + BindingAccess.Read); + this.UserAssignedIdentitiesProperty = this.CreatePropertyAccessor( + UserAssignedIdentity.ConvertFromProtocolCollectionAndFreeze(protocolObject.UserAssignedIdentities), + nameof(UserAssignedIdentities), + BindingAccess.Read); + } + } + + private readonly PropertyContainer propertyContainer; + + #region Constructors + + /// + /// Initializes a new instance of the class. + /// + /// The identity of the Batch pool, if configured. + internal BatchPoolIdentity( + Common.PoolIdentityType type) + { + this.propertyContainer = new PropertyContainer(); + this.Type = type; + } + + internal BatchPoolIdentity(Models.BatchPoolIdentity protocolObject) + { + this.propertyContainer = new PropertyContainer(protocolObject); + } + + #endregion Constructors + + #region BatchPoolIdentity + + /// + /// Gets or sets the identity of the Batch pool, if configured. + /// + /// + /// The list of user identities associated with the Batch pool. The user identity dictionary key references will + /// be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// + public Common.PoolIdentityType Type + { + get { return this.propertyContainer.TypeProperty.Value; } + set { this.propertyContainer.TypeProperty.Value = value; } + } + + /// + /// Gets or sets the list of user identities associated with the Batch account. + /// + /// + /// The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// + public IList UserAssignedIdentities + { + get { return this.propertyContainer.UserAssignedIdentitiesProperty.Value; } + set + { + this.propertyContainer.UserAssignedIdentitiesProperty.Value = ConcurrentChangeTrackedModifiableList.TransformEnumerableToConcurrentModifiableList(value); + } + } + + #endregion // BatchPoolIdentity + + #region IPropertyMetadata + + bool IModifiable.HasBeenModified + { + get { return this.propertyContainer.HasBeenModified; } + } + + bool IReadOnly.IsReadOnly + { + get { return this.propertyContainer.IsReadOnly; } + set { this.propertyContainer.IsReadOnly = value; } + } + + #endregion //IPropertyMetadata + + #region Internal/private methods + /// + /// Return a protocol object of the requested type. + /// + /// The protocol object of the requested type. + Models.BatchPoolIdentity ITransportObjectProvider.GetTransportObject() + { + Models.BatchPoolIdentity result = new Models.BatchPoolIdentity() + { + Type = UtilitiesInternal.MapEnum(this.Type), + UserAssignedIdentities = UtilitiesInternal.ConvertToProtocolCollection(this.UserAssignedIdentities), + }; + + return result; + } + + + #endregion // Internal/private methods + } +} \ No newline at end of file diff --git a/sdk/batch/Microsoft.Azure.Batch/src/Generated/CloudJob.cs b/sdk/batch/Microsoft.Azure.Batch/src/Generated/CloudJob.cs index 181f7b4a7c6d..4a378e1822fc 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/Generated/CloudJob.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/Generated/CloudJob.cs @@ -35,6 +35,7 @@ private class PropertyContainer : PropertyCollection public readonly PropertyAccessor JobPreparationTaskProperty; public readonly PropertyAccessor JobReleaseTaskProperty; public readonly PropertyAccessor LastModifiedProperty; + public readonly PropertyAccessor MaxParallelTasksProperty; public readonly PropertyAccessor> MetadataProperty; public readonly PropertyAccessor NetworkConfigurationProperty; public readonly PropertyAccessor OnAllTasksCompleteProperty; @@ -62,6 +63,7 @@ public PropertyContainer() : base(BindingState.Unbound) this.JobPreparationTaskProperty = this.CreatePropertyAccessor(nameof(JobPreparationTask), BindingAccess.Read | BindingAccess.Write); this.JobReleaseTaskProperty = this.CreatePropertyAccessor(nameof(JobReleaseTask), BindingAccess.Read | BindingAccess.Write); this.LastModifiedProperty = this.CreatePropertyAccessor(nameof(LastModified), BindingAccess.None); + this.MaxParallelTasksProperty = this.CreatePropertyAccessor(nameof(MaxParallelTasks), BindingAccess.Read | BindingAccess.Write); this.MetadataProperty = this.CreatePropertyAccessor>(nameof(Metadata), BindingAccess.Read | BindingAccess.Write); this.NetworkConfigurationProperty = this.CreatePropertyAccessor(nameof(NetworkConfiguration), BindingAccess.Read | BindingAccess.Write); this.OnAllTasksCompleteProperty = this.CreatePropertyAccessor(nameof(OnAllTasksComplete), BindingAccess.Read | BindingAccess.Write); @@ -123,6 +125,10 @@ public PropertyContainer(Models.CloudJob protocolObject) : base(BindingState.Bou protocolObject.LastModified, nameof(LastModified), BindingAccess.Read); + this.MaxParallelTasksProperty = this.CreatePropertyAccessor( + protocolObject.MaxParallelTasks, + nameof(MaxParallelTasks), + BindingAccess.Read | BindingAccess.Write); this.MetadataProperty = this.CreatePropertyAccessor( MetadataItem.ConvertFromProtocolCollection(protocolObject.Metadata), nameof(Metadata), @@ -336,6 +342,20 @@ public DateTime? LastModified get { return this.propertyContainer.LastModifiedProperty.Value; } } + /// + /// Gets or sets 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. + /// + public int? MaxParallelTasks + { + get { return this.propertyContainer.MaxParallelTasksProperty.Value; } + set { this.propertyContainer.MaxParallelTasksProperty.Value = value; } + } + /// /// Gets or sets a list of name-value pairs associated with the job as metadata. /// @@ -507,6 +527,7 @@ bool IReadOnly.IsReadOnly JobManagerTask = UtilitiesInternal.CreateObjectWithNullCheck(this.JobManagerTask, (o) => o.GetTransportObject()), JobPreparationTask = UtilitiesInternal.CreateObjectWithNullCheck(this.JobPreparationTask, (o) => o.GetTransportObject()), JobReleaseTask = UtilitiesInternal.CreateObjectWithNullCheck(this.JobReleaseTask, (o) => o.GetTransportObject()), + MaxParallelTasks = this.MaxParallelTasks, Metadata = UtilitiesInternal.ConvertToProtocolCollection(this.Metadata), NetworkConfiguration = UtilitiesInternal.CreateObjectWithNullCheck(this.NetworkConfiguration, (o) => o.GetTransportObject()), OnAllTasksComplete = UtilitiesInternal.MapNullableEnum(this.OnAllTasksComplete), diff --git a/sdk/batch/Microsoft.Azure.Batch/src/Generated/CloudPool.cs b/sdk/batch/Microsoft.Azure.Batch/src/Generated/CloudPool.cs index a7f3bb2c0920..12be2163fe50 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/Generated/CloudPool.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/Generated/CloudPool.cs @@ -40,6 +40,7 @@ private class PropertyContainer : PropertyCollection public readonly PropertyAccessor DisplayNameProperty; public readonly PropertyAccessor ETagProperty; public readonly PropertyAccessor IdProperty; + public readonly PropertyAccessor IdentityProperty; public readonly PropertyAccessor InterComputeNodeCommunicationEnabledProperty; public readonly PropertyAccessor LastModifiedProperty; public readonly PropertyAccessor> MetadataProperty; @@ -78,6 +79,7 @@ public PropertyContainer() : base(BindingState.Unbound) this.DisplayNameProperty = this.CreatePropertyAccessor(nameof(DisplayName), BindingAccess.Read | BindingAccess.Write); this.ETagProperty = this.CreatePropertyAccessor(nameof(ETag), BindingAccess.None); this.IdProperty = this.CreatePropertyAccessor(nameof(Id), BindingAccess.Read | BindingAccess.Write); + this.IdentityProperty = this.CreatePropertyAccessor(nameof(Identity), BindingAccess.Read | BindingAccess.Write); this.InterComputeNodeCommunicationEnabledProperty = this.CreatePropertyAccessor(nameof(InterComputeNodeCommunicationEnabled), BindingAccess.Read | BindingAccess.Write); this.LastModifiedProperty = this.CreatePropertyAccessor(nameof(LastModified), BindingAccess.None); this.MetadataProperty = this.CreatePropertyAccessor>(nameof(Metadata), BindingAccess.Read | BindingAccess.Write); @@ -165,6 +167,10 @@ public PropertyContainer(Models.CloudPool protocolObject) : base(BindingState.Bo protocolObject.Id, nameof(Id), BindingAccess.Read); + this.IdentityProperty = this.CreatePropertyAccessor( + UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.Identity, o => new BatchPoolIdentity(o)), + nameof(Identity), + BindingAccess.Read | BindingAccess.Write); this.InterComputeNodeCommunicationEnabledProperty = this.CreatePropertyAccessor( protocolObject.EnableInterNodeCommunication, nameof(InterComputeNodeCommunicationEnabled), @@ -468,6 +474,19 @@ public string Id set { this.propertyContainer.IdProperty.Value = value; } } + /// + /// Gets or sets the identity of the Batch pool, if configured. + /// + /// + /// The list of user identities associated with the Batch pool. The user identity dictionary key references will + /// be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// + public BatchPoolIdentity Identity + { + get { return this.propertyContainer.IdentityProperty.Value; } + set { this.propertyContainer.IdentityProperty.Value = value; } + } + /// /// Gets or sets whether the pool permits direct communication between its compute nodes. /// diff --git a/sdk/batch/Microsoft.Azure.Batch/src/Generated/ComputeNode.cs b/sdk/batch/Microsoft.Azure.Batch/src/Generated/ComputeNode.cs index 74d6890d9ff1..2185d788aa83 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/Generated/ComputeNode.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/Generated/ComputeNode.cs @@ -45,6 +45,7 @@ private class PropertyContainer : PropertyCollection public readonly PropertyAccessor TotalTasksRunProperty; public readonly PropertyAccessor TotalTasksSucceededProperty; public readonly PropertyAccessor UrlProperty; + public readonly PropertyAccessor VirtualMachineInfoProperty; public readonly PropertyAccessor VirtualMachineSizeProperty; public PropertyContainer(Models.ComputeNode protocolObject) : base(BindingState.Bound) { @@ -132,6 +133,10 @@ public PropertyContainer(Models.ComputeNode protocolObject) : base(BindingState. protocolObject.Url, nameof(Url), BindingAccess.Read); + this.VirtualMachineInfoProperty = this.CreatePropertyAccessor( + UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.VirtualMachineInfo, o => new VirtualMachineInfo(o).Freeze()), + nameof(VirtualMachineInfo), + BindingAccess.Read); this.VirtualMachineSizeProperty = this.CreatePropertyAccessor( protocolObject.VmSize, nameof(VirtualMachineSize), @@ -359,6 +364,14 @@ public string Url get { return this.propertyContainer.UrlProperty.Value; } } + /// + /// Gets info about the current state of the virtual machine. + /// + public VirtualMachineInfo VirtualMachineInfo + { + get { return this.propertyContainer.VirtualMachineInfoProperty.Value; } + } + /// /// Gets the size of the virtual machine hosting the compute node. /// diff --git a/sdk/batch/Microsoft.Azure.Batch/src/Generated/ComputeNodeIdentityReference.cs b/sdk/batch/Microsoft.Azure.Batch/src/Generated/ComputeNodeIdentityReference.cs new file mode 100644 index 000000000000..de2ef7dc35da --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/src/Generated/ComputeNodeIdentityReference.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +// +// This file was autogenerated by a tool. +// Do not modify it. +// + +namespace Microsoft.Azure.Batch +{ + using Models = Microsoft.Azure.Batch.Protocol.Models; + using System; + using System.Collections.Generic; + using System.Linq; + + /// + /// The reference to a user assigned identity associated with the Batch pool which a compute node will use. + /// + public partial class ComputeNodeIdentityReference : ITransportObjectProvider, IPropertyMetadata + { + private class PropertyContainer : PropertyCollection + { + public readonly PropertyAccessor ResourceIdProperty; + + public PropertyContainer() : base(BindingState.Unbound) + { + this.ResourceIdProperty = this.CreatePropertyAccessor(nameof(ResourceId), BindingAccess.Read | BindingAccess.Write); + } + + public PropertyContainer(Models.ComputeNodeIdentityReference protocolObject) : base(BindingState.Bound) + { + this.ResourceIdProperty = this.CreatePropertyAccessor( + protocolObject.ResourceId, + nameof(ResourceId), + BindingAccess.Read); + } + } + + private readonly PropertyContainer propertyContainer; + + #region Constructors + + /// + /// Initializes a new instance of the class. + /// + public ComputeNodeIdentityReference() + { + this.propertyContainer = new PropertyContainer(); + } + + internal ComputeNodeIdentityReference(Models.ComputeNodeIdentityReference protocolObject) + { + this.propertyContainer = new PropertyContainer(protocolObject); + } + + #endregion Constructors + + #region ComputeNodeIdentityReference + + /// + /// Gets or sets the ARM resource id of the user assigned identity. + /// + public string ResourceId + { + get { return this.propertyContainer.ResourceIdProperty.Value; } + set { this.propertyContainer.ResourceIdProperty.Value = value; } + } + + #endregion // ComputeNodeIdentityReference + + #region IPropertyMetadata + + bool IModifiable.HasBeenModified + { + get { return this.propertyContainer.HasBeenModified; } + } + + bool IReadOnly.IsReadOnly + { + get { return this.propertyContainer.IsReadOnly; } + set { this.propertyContainer.IsReadOnly = value; } + } + + #endregion //IPropertyMetadata + + #region Internal/private methods + /// + /// Return a protocol object of the requested type. + /// + /// The protocol object of the requested type. + Models.ComputeNodeIdentityReference ITransportObjectProvider.GetTransportObject() + { + Models.ComputeNodeIdentityReference result = new Models.ComputeNodeIdentityReference() + { + ResourceId = this.ResourceId, + }; + + return result; + } + + + #endregion // Internal/private methods + } +} \ No newline at end of file diff --git a/sdk/batch/Microsoft.Azure.Batch/src/Generated/ContainerRegistry.cs b/sdk/batch/Microsoft.Azure.Batch/src/Generated/ContainerRegistry.cs index f098cf805f1e..547c882b0140 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/Generated/ContainerRegistry.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/Generated/ContainerRegistry.cs @@ -27,20 +27,25 @@ public partial class ContainerRegistry : ITransportObjectProvider class. /// /// The user name to log into the registry server. - /// The registry URL. /// The password to log into the registry server. + /// The registry URL. + /// The reference to the user assigned identity to use to access an Azure Container Registry instead of username + /// and password. public ContainerRegistry( string userName, + string password = default(string), string registryServer = default(string), - string password = default(string)) + ComputeNodeIdentityReference identityReference = default(ComputeNodeIdentityReference)) { this.UserName = userName; - this.RegistryServer = registryServer; this.Password = password; + this.RegistryServer = registryServer; + this.IdentityReference = identityReference; } internal ContainerRegistry(Models.ContainerRegistry protocolObject) { + this.IdentityReference = UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.IdentityReference, o => new ComputeNodeIdentityReference(o).Freeze()); this.Password = protocolObject.Password; this.RegistryServer = protocolObject.RegistryServer; this.UserName = protocolObject.UserName; @@ -50,6 +55,12 @@ internal ContainerRegistry(Models.ContainerRegistry protocolObject) #region ContainerRegistry + /// + /// Gets the reference to the user assigned identity to use to access an Azure Container Registry instead of username + /// and password. + /// + public ComputeNodeIdentityReference IdentityReference { get; } + /// /// Gets the password to log into the registry server. /// @@ -99,6 +110,7 @@ bool IReadOnly.IsReadOnly { Models.ContainerRegistry result = new Models.ContainerRegistry() { + IdentityReference = UtilitiesInternal.CreateObjectWithNullCheck(this.IdentityReference, (o) => o.GetTransportObject()), Password = this.Password, RegistryServer = this.RegistryServer, UserName = this.UserName, diff --git a/sdk/batch/Microsoft.Azure.Batch/src/Generated/DiffDiskSettings.cs b/sdk/batch/Microsoft.Azure.Batch/src/Generated/DiffDiskSettings.cs new file mode 100644 index 000000000000..c3cbca54c8c9 --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/src/Generated/DiffDiskSettings.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +// +// This file was autogenerated by a tool. +// Do not modify it. +// + +namespace Microsoft.Azure.Batch +{ + using Models = Microsoft.Azure.Batch.Protocol.Models; + using System; + using System.Collections.Generic; + using System.Linq; + + /// + /// Specifies the ephemeral Disk Settings for the operating system disk used by the compute node (VM). + /// + public partial class DiffDiskSettings : ITransportObjectProvider, IPropertyMetadata + { + private class PropertyContainer : PropertyCollection + { + public readonly PropertyAccessor PlacementProperty; + + public PropertyContainer() : base(BindingState.Unbound) + { + this.PlacementProperty = this.CreatePropertyAccessor(nameof(Placement), BindingAccess.Read | BindingAccess.Write); + } + + public PropertyContainer(Models.DiffDiskSettings protocolObject) : base(BindingState.Bound) + { + this.PlacementProperty = this.CreatePropertyAccessor( + UtilitiesInternal.MapNullableEnum(protocolObject.Placement), + nameof(Placement), + BindingAccess.Read | BindingAccess.Write); + } + } + + private readonly PropertyContainer propertyContainer; + + #region Constructors + + /// + /// Initializes a new instance of the class. + /// + public DiffDiskSettings() + { + this.propertyContainer = new PropertyContainer(); + } + + internal DiffDiskSettings(Models.DiffDiskSettings protocolObject) + { + this.propertyContainer = new PropertyContainer(protocolObject); + } + + #endregion Constructors + + #region DiffDiskSettings + + /// + /// Gets or sets 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://docs.microsoft.com/en-us/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements + /// and Linux VMs at https://docs.microsoft.com/en-us/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements. + /// + public Common.DiffDiskPlacement? Placement + { + get { return this.propertyContainer.PlacementProperty.Value; } + set { this.propertyContainer.PlacementProperty.Value = value; } + } + + #endregion // DiffDiskSettings + + #region IPropertyMetadata + + bool IModifiable.HasBeenModified + { + get { return this.propertyContainer.HasBeenModified; } + } + + bool IReadOnly.IsReadOnly + { + get { return this.propertyContainer.IsReadOnly; } + set { this.propertyContainer.IsReadOnly = value; } + } + + #endregion //IPropertyMetadata + + #region Internal/private methods + /// + /// Return a protocol object of the requested type. + /// + /// The protocol object of the requested type. + Models.DiffDiskSettings ITransportObjectProvider.GetTransportObject() + { + Models.DiffDiskSettings result = new Models.DiffDiskSettings() + { + Placement = UtilitiesInternal.MapNullableEnum(this.Placement), + }; + + return result; + } + + + #endregion // Internal/private methods + } +} \ No newline at end of file diff --git a/sdk/batch/Microsoft.Azure.Batch/src/Generated/ImageReference.cs b/sdk/batch/Microsoft.Azure.Batch/src/Generated/ImageReference.cs index 3b7880ea12a0..3844d56f3817 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/Generated/ImageReference.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/Generated/ImageReference.cs @@ -24,9 +24,16 @@ namespace Microsoft.Azure.Batch public partial class ImageReference : ITransportObjectProvider, IPropertyMetadata { #region Constructors + /// + /// Initializes a new instance of the class. + /// + public ImageReference() + { + } internal ImageReference(Models.ImageReference protocolObject) { + this.ExactVersion = protocolObject.ExactVersion; this.Offer = protocolObject.Offer; this.Publisher = protocolObject.Publisher; this.Sku = protocolObject.Sku; @@ -38,6 +45,12 @@ internal ImageReference(Models.ImageReference protocolObject) #region ImageReference + /// + /// Gets 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'. + /// + public string ExactVersion { get; } + /// /// Gets the offer type of the Azure Virtual Machines Marketplace Image. /// diff --git a/sdk/batch/Microsoft.Azure.Batch/src/Generated/InstanceViewStatus.cs b/sdk/batch/Microsoft.Azure.Batch/src/Generated/InstanceViewStatus.cs new file mode 100644 index 000000000000..a8f33189d607 --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/src/Generated/InstanceViewStatus.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +// +// This file was autogenerated by a tool. +// Do not modify it. +// + +namespace Microsoft.Azure.Batch +{ + using Models = Microsoft.Azure.Batch.Protocol.Models; + using System; + using System.Collections.Generic; + using System.Linq; + + /// + /// The instance view status. + /// + public partial class InstanceViewStatus : ITransportObjectProvider, IPropertyMetadata + { + #region Constructors + /// + /// Initializes a new instance of the class. + /// + public InstanceViewStatus() + { + } + + internal InstanceViewStatus(Models.InstanceViewStatus protocolObject) + { + this.Code = protocolObject.Code; + this.DisplayStatus = protocolObject.DisplayStatus; + this.Level = UtilitiesInternal.MapNullableEnum(protocolObject.Level); + this.Message = protocolObject.Message; + this.Time = protocolObject.Time; + } + + #endregion Constructors + + #region InstanceViewStatus + + /// + /// Gets the status code. + /// + public string Code { get; } + + /// + /// Gets the localized label for the status. + /// + public string DisplayStatus { get; } + + /// + /// Gets level code. + /// + public Common.StatusLevelTypes? Level { get; } + + /// + /// Gets the detailed status message. + /// + public string Message { get; } + + /// + /// Gets the time of the status. + /// + public string Time { get; } + + #endregion // InstanceViewStatus + + #region IPropertyMetadata + + bool IModifiable.HasBeenModified + { + //This class is compile time readonly so it cannot have been modified + get { return false; } + } + + bool IReadOnly.IsReadOnly + { + get { return true; } + set + { + // This class is compile time readonly already + } + } + + #endregion // IPropertyMetadata + + #region Internal/private methods + + /// + /// Return a protocol object of the requested type. + /// + /// The protocol object of the requested type. + Models.InstanceViewStatus ITransportObjectProvider.GetTransportObject() + { + Models.InstanceViewStatus result = new Models.InstanceViewStatus() + { + Code = this.Code, + DisplayStatus = this.DisplayStatus, + Level = UtilitiesInternal.MapNullableEnum(this.Level), + Message = this.Message, + Time = this.Time, + }; + + return result; + } + + /// + /// Converts a collection of protocol layer objects to object layer collection objects. + /// + internal static IList ConvertFromProtocolCollection(IEnumerable protoCollection) + { + ConcurrentChangeTrackedModifiableList converted = UtilitiesInternal.CollectionToThreadSafeCollectionIModifiable( + items: protoCollection, + objectCreationFunc: o => new InstanceViewStatus(o)); + + return converted; + } + + /// + /// Converts a collection of protocol layer objects to object layer collection objects, in a frozen state. + /// + internal static IList ConvertFromProtocolCollectionAndFreeze(IEnumerable protoCollection) + { + ConcurrentChangeTrackedModifiableList converted = UtilitiesInternal.CollectionToThreadSafeCollectionIModifiable( + items: protoCollection, + objectCreationFunc: o => new InstanceViewStatus(o).Freeze()); + + converted = UtilitiesInternal.CreateObjectWithNullCheck(converted, o => o.Freeze()); + + return converted; + } + + /// + /// Converts a collection of protocol layer objects to object layer collection objects, with each object marked readonly + /// and returned as a readonly collection. + /// + internal static IReadOnlyList ConvertFromProtocolCollectionReadOnly(IEnumerable protoCollection) + { + IReadOnlyList converted = + UtilitiesInternal.CreateObjectWithNullCheck( + UtilitiesInternal.CollectionToNonThreadSafeCollection( + items: protoCollection, + objectCreationFunc: o => new InstanceViewStatus(o).Freeze()), o => o.AsReadOnly()); + + return converted; + } + + #endregion // Internal/private methods + } +} \ No newline at end of file diff --git a/sdk/batch/Microsoft.Azure.Batch/src/Generated/JobManagerTask.cs b/sdk/batch/Microsoft.Azure.Batch/src/Generated/JobManagerTask.cs index e72d1dec47fb..1042e5298de0 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/Generated/JobManagerTask.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/Generated/JobManagerTask.cs @@ -300,7 +300,7 @@ public IList OutputFiles /// /// /// 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. + /// slots available. For multi-instance Tasks, this property is not supported and must not be specified. /// public int? RequiredSlots { diff --git a/sdk/batch/Microsoft.Azure.Batch/src/Generated/JobSpecification.cs b/sdk/batch/Microsoft.Azure.Batch/src/Generated/JobSpecification.cs index f044c1825fcd..2e454b646679 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/Generated/JobSpecification.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/Generated/JobSpecification.cs @@ -30,6 +30,7 @@ private class PropertyContainer : PropertyCollection public readonly PropertyAccessor JobManagerTaskProperty; public readonly PropertyAccessor JobPreparationTaskProperty; public readonly PropertyAccessor JobReleaseTaskProperty; + public readonly PropertyAccessor MaxParallelTasksProperty; public readonly PropertyAccessor> MetadataProperty; public readonly PropertyAccessor NetworkConfigurationProperty; public readonly PropertyAccessor OnAllTasksCompleteProperty; @@ -46,6 +47,7 @@ public PropertyContainer() : base(BindingState.Unbound) this.JobManagerTaskProperty = this.CreatePropertyAccessor(nameof(JobManagerTask), BindingAccess.Read | BindingAccess.Write); this.JobPreparationTaskProperty = this.CreatePropertyAccessor(nameof(JobPreparationTask), BindingAccess.Read | BindingAccess.Write); this.JobReleaseTaskProperty = this.CreatePropertyAccessor(nameof(JobReleaseTask), BindingAccess.Read | BindingAccess.Write); + this.MaxParallelTasksProperty = this.CreatePropertyAccessor(nameof(MaxParallelTasks), BindingAccess.Read | BindingAccess.Write); this.MetadataProperty = this.CreatePropertyAccessor>(nameof(Metadata), BindingAccess.Read | BindingAccess.Write); this.NetworkConfigurationProperty = this.CreatePropertyAccessor(nameof(NetworkConfiguration), BindingAccess.Read | BindingAccess.Write); this.OnAllTasksCompleteProperty = this.CreatePropertyAccessor(nameof(OnAllTasksComplete), BindingAccess.Read | BindingAccess.Write); @@ -81,6 +83,10 @@ public PropertyContainer(Models.JobSpecification protocolObject) : base(BindingS UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.JobReleaseTask, o => new JobReleaseTask(o)), nameof(JobReleaseTask), BindingAccess.Read | BindingAccess.Write); + this.MaxParallelTasksProperty = this.CreatePropertyAccessor( + protocolObject.MaxParallelTasks, + nameof(MaxParallelTasks), + BindingAccess.Read | BindingAccess.Write); this.MetadataProperty = this.CreatePropertyAccessor( MetadataItem.ConvertFromProtocolCollection(protocolObject.Metadata), nameof(Metadata), @@ -205,6 +211,20 @@ public JobReleaseTask JobReleaseTask set { this.propertyContainer.JobReleaseTaskProperty.Value = value; } } + /// + /// Gets or sets 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. + /// + public int? MaxParallelTasks + { + get { return this.propertyContainer.MaxParallelTasksProperty.Value; } + set { this.propertyContainer.MaxParallelTasksProperty.Value = value; } + } + /// /// Gets or sets a list of name-value pairs associated with jobs created via this /// as metadata. @@ -317,6 +337,7 @@ bool IReadOnly.IsReadOnly JobManagerTask = UtilitiesInternal.CreateObjectWithNullCheck(this.JobManagerTask, (o) => o.GetTransportObject()), JobPreparationTask = UtilitiesInternal.CreateObjectWithNullCheck(this.JobPreparationTask, (o) => o.GetTransportObject()), JobReleaseTask = UtilitiesInternal.CreateObjectWithNullCheck(this.JobReleaseTask, (o) => o.GetTransportObject()), + MaxParallelTasks = this.MaxParallelTasks, Metadata = UtilitiesInternal.ConvertToProtocolCollection(this.Metadata), NetworkConfiguration = UtilitiesInternal.CreateObjectWithNullCheck(this.NetworkConfiguration, (o) => o.GetTransportObject()), OnAllTasksComplete = UtilitiesInternal.MapNullableEnum(this.OnAllTasksComplete), diff --git a/sdk/batch/Microsoft.Azure.Batch/src/Generated/NodePlacementConfiguration.cs b/sdk/batch/Microsoft.Azure.Batch/src/Generated/NodePlacementConfiguration.cs new file mode 100644 index 000000000000..99bae609687b --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/src/Generated/NodePlacementConfiguration.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +// +// This file was autogenerated by a tool. +// Do not modify it. +// + +namespace Microsoft.Azure.Batch +{ + using Models = Microsoft.Azure.Batch.Protocol.Models; + using System; + using System.Collections.Generic; + using System.Linq; + + /// + /// Node placement configuration for a pool. + /// + public partial class NodePlacementConfiguration : ITransportObjectProvider, IPropertyMetadata + { + #region Constructors + /// + /// Initializes a new instance of the class. + /// + /// Node placement Policy type on Batch Pools. + public NodePlacementConfiguration( + Common.NodePlacementPolicyType? policy) + { + this.Policy = policy; + } + + internal NodePlacementConfiguration(Models.NodePlacementConfiguration protocolObject) + { + this.Policy = UtilitiesInternal.MapNullableEnum(protocolObject.Policy); + } + + #endregion Constructors + + #region NodePlacementConfiguration + + /// + /// Gets node placement Policy type on Batch Pools. + /// + /// + /// Allocation policy used by Batch Service to provision the nodes. If not specified, Batch will use the regional + /// policy. + /// + public Common.NodePlacementPolicyType? Policy { get; } + + #endregion // NodePlacementConfiguration + + #region IPropertyMetadata + + bool IModifiable.HasBeenModified + { + //This class is compile time readonly so it cannot have been modified + get { return false; } + } + + bool IReadOnly.IsReadOnly + { + get { return true; } + set + { + // This class is compile time readonly already + } + } + + #endregion // IPropertyMetadata + + #region Internal/private methods + + /// + /// Return a protocol object of the requested type. + /// + /// The protocol object of the requested type. + Models.NodePlacementConfiguration ITransportObjectProvider.GetTransportObject() + { + Models.NodePlacementConfiguration result = new Models.NodePlacementConfiguration() + { + Policy = UtilitiesInternal.MapNullableEnum(this.Policy), + }; + + return result; + } + + + #endregion // Internal/private methods + } +} \ No newline at end of file diff --git a/sdk/batch/Microsoft.Azure.Batch/src/Generated/NodeVMExtension.cs b/sdk/batch/Microsoft.Azure.Batch/src/Generated/NodeVMExtension.cs new file mode 100644 index 000000000000..a4be555c5547 --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/src/Generated/NodeVMExtension.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +// +// This file was autogenerated by a tool. +// Do not modify it. +// + +namespace Microsoft.Azure.Batch +{ + using Models = Microsoft.Azure.Batch.Protocol.Models; + using System; + using System.Collections.Generic; + using System.Linq; + + /// + /// The configuration for virtual machine extension instance view. + /// + public partial class NodeVMExtension : ITransportObjectProvider, IPropertyMetadata + { + private class PropertyContainer : PropertyCollection + { + public readonly PropertyAccessor InstanceViewProperty; + public readonly PropertyAccessor ProvisioningStateProperty; + public readonly PropertyAccessor VmExtensionProperty; + + public PropertyContainer() : base(BindingState.Unbound) + { + this.InstanceViewProperty = this.CreatePropertyAccessor(nameof(InstanceView), BindingAccess.Read | BindingAccess.Write); + this.ProvisioningStateProperty = this.CreatePropertyAccessor(nameof(ProvisioningState), BindingAccess.Read | BindingAccess.Write); + this.VmExtensionProperty = this.CreatePropertyAccessor(nameof(VmExtension), BindingAccess.Read | BindingAccess.Write); + } + + public PropertyContainer(Models.NodeVMExtension protocolObject) : base(BindingState.Bound) + { + this.InstanceViewProperty = this.CreatePropertyAccessor( + UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.InstanceView, o => new VMExtensionInstanceView(o).Freeze()), + nameof(InstanceView), + BindingAccess.Read); + this.ProvisioningStateProperty = this.CreatePropertyAccessor( + protocolObject.ProvisioningState, + nameof(ProvisioningState), + BindingAccess.Read); + this.VmExtensionProperty = this.CreatePropertyAccessor( + UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.VmExtension, o => new VMExtension(o).Freeze()), + nameof(VmExtension), + BindingAccess.Read); + } + } + + private readonly PropertyContainer propertyContainer; + + #region Constructors + + /// + /// Initializes a new instance of the class. + /// + public NodeVMExtension() + { + this.propertyContainer = new PropertyContainer(); + } + + internal NodeVMExtension(Models.NodeVMExtension protocolObject) + { + this.propertyContainer = new PropertyContainer(protocolObject); + } + + #endregion Constructors + + #region NodeVMExtension + + /// + /// Gets or sets the vm extension instance view. + /// + public VMExtensionInstanceView InstanceView + { + get { return this.propertyContainer.InstanceViewProperty.Value; } + set { this.propertyContainer.InstanceViewProperty.Value = value; } + } + + /// + /// Gets or sets the provisioning state of the virtual machine extension. + /// + public string ProvisioningState + { + get { return this.propertyContainer.ProvisioningStateProperty.Value; } + set { this.propertyContainer.ProvisioningStateProperty.Value = value; } + } + + /// + /// Gets or sets the virtual machine extension + /// + public VMExtension VmExtension + { + get { return this.propertyContainer.VmExtensionProperty.Value; } + set { this.propertyContainer.VmExtensionProperty.Value = value; } + } + + #endregion // NodeVMExtension + + #region IPropertyMetadata + + bool IModifiable.HasBeenModified + { + get { return this.propertyContainer.HasBeenModified; } + } + + bool IReadOnly.IsReadOnly + { + get { return this.propertyContainer.IsReadOnly; } + set { this.propertyContainer.IsReadOnly = value; } + } + + #endregion //IPropertyMetadata + + #region Internal/private methods + /// + /// Return a protocol object of the requested type. + /// + /// The protocol object of the requested type. + Models.NodeVMExtension ITransportObjectProvider.GetTransportObject() + { + Models.NodeVMExtension result = new Models.NodeVMExtension() + { + InstanceView = UtilitiesInternal.CreateObjectWithNullCheck(this.InstanceView, (o) => o.GetTransportObject()), + ProvisioningState = this.ProvisioningState, + VmExtension = UtilitiesInternal.CreateObjectWithNullCheck(this.VmExtension, (o) => o.GetTransportObject()), + }; + + return result; + } + + + #endregion // Internal/private methods + } +} \ No newline at end of file diff --git a/sdk/batch/Microsoft.Azure.Batch/src/Generated/OSDisk.cs b/sdk/batch/Microsoft.Azure.Batch/src/Generated/OSDisk.cs new file mode 100644 index 000000000000..9eb77e2ed015 --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/src/Generated/OSDisk.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +// +// This file was autogenerated by a tool. +// Do not modify it. +// + +namespace Microsoft.Azure.Batch +{ + using Models = Microsoft.Azure.Batch.Protocol.Models; + using System; + using System.Collections.Generic; + using System.Linq; + + /// + /// Settings for the operating system disk of the compute node (VM). + /// + public partial class OSDisk : ITransportObjectProvider, IPropertyMetadata + { + private class PropertyContainer : PropertyCollection + { + public readonly PropertyAccessor EphemeralOSDiskSettingsProperty; + + public PropertyContainer() : base(BindingState.Unbound) + { + this.EphemeralOSDiskSettingsProperty = this.CreatePropertyAccessor(nameof(EphemeralOSDiskSettings), BindingAccess.Read | BindingAccess.Write); + } + + public PropertyContainer(Models.OSDisk protocolObject) : base(BindingState.Bound) + { + this.EphemeralOSDiskSettingsProperty = this.CreatePropertyAccessor( + UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.EphemeralOSDiskSettings, o => new DiffDiskSettings(o)), + nameof(EphemeralOSDiskSettings), + BindingAccess.Read | BindingAccess.Write); + } + } + + private readonly PropertyContainer propertyContainer; + + #region Constructors + + /// + /// Initializes a new instance of the class. + /// + public OSDisk() + { + this.propertyContainer = new PropertyContainer(); + } + + internal OSDisk(Models.OSDisk protocolObject) + { + this.propertyContainer = new PropertyContainer(protocolObject); + } + + #endregion Constructors + + #region OSDisk + + /// + /// Gets or sets specifies the ephemeral Disk Settings for the operating system disk used by the compute node (VM). + /// + public DiffDiskSettings EphemeralOSDiskSettings + { + get { return this.propertyContainer.EphemeralOSDiskSettingsProperty.Value; } + set { this.propertyContainer.EphemeralOSDiskSettingsProperty.Value = value; } + } + + #endregion // OSDisk + + #region IPropertyMetadata + + bool IModifiable.HasBeenModified + { + get { return this.propertyContainer.HasBeenModified; } + } + + bool IReadOnly.IsReadOnly + { + get { return this.propertyContainer.IsReadOnly; } + set { this.propertyContainer.IsReadOnly = value; } + } + + #endregion //IPropertyMetadata + + #region Internal/private methods + /// + /// Return a protocol object of the requested type. + /// + /// The protocol object of the requested type. + Models.OSDisk ITransportObjectProvider.GetTransportObject() + { + Models.OSDisk result = new Models.OSDisk() + { + EphemeralOSDiskSettings = UtilitiesInternal.CreateObjectWithNullCheck(this.EphemeralOSDiskSettings, (o) => o.GetTransportObject()), + }; + + return result; + } + + + #endregion // Internal/private methods + } +} \ No newline at end of file diff --git a/sdk/batch/Microsoft.Azure.Batch/src/Generated/OutputFileBlobContainerDestination.cs b/sdk/batch/Microsoft.Azure.Batch/src/Generated/OutputFileBlobContainerDestination.cs index bf8fe0bf5263..4f75ed1764c3 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/Generated/OutputFileBlobContainerDestination.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/Generated/OutputFileBlobContainerDestination.cs @@ -22,7 +22,40 @@ namespace Microsoft.Azure.Batch /// public partial class OutputFileBlobContainerDestination : ITransportObjectProvider, IPropertyMetadata { + private class PropertyContainer : PropertyCollection + { + public readonly PropertyAccessor ContainerUrlProperty; + public readonly PropertyAccessor IdentityReferenceProperty; + public readonly PropertyAccessor PathProperty; + + public PropertyContainer() : base(BindingState.Unbound) + { + this.ContainerUrlProperty = this.CreatePropertyAccessor(nameof(ContainerUrl), BindingAccess.Read | BindingAccess.Write); + this.IdentityReferenceProperty = this.CreatePropertyAccessor(nameof(IdentityReference), BindingAccess.Read | BindingAccess.Write); + this.PathProperty = this.CreatePropertyAccessor(nameof(Path), BindingAccess.Read | BindingAccess.Write); + } + + public PropertyContainer(Models.OutputFileBlobContainerDestination protocolObject) : base(BindingState.Bound) + { + this.ContainerUrlProperty = this.CreatePropertyAccessor( + protocolObject.ContainerUrl, + nameof(ContainerUrl), + BindingAccess.Read); + this.IdentityReferenceProperty = this.CreatePropertyAccessor( + UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.IdentityReference, o => new ComputeNodeIdentityReference(o).Freeze()), + nameof(IdentityReference), + BindingAccess.Read); + this.PathProperty = this.CreatePropertyAccessor( + protocolObject.Path, + nameof(Path), + BindingAccess.Read); + } + } + + private readonly PropertyContainer propertyContainer; + #region Constructors + /// /// Initializes a new instance of the class. /// @@ -32,14 +65,14 @@ public OutputFileBlobContainerDestination( string containerUrl, string path = default(string)) { + this.propertyContainer = new PropertyContainer(); this.ContainerUrl = containerUrl; this.Path = path; } internal OutputFileBlobContainerDestination(Models.OutputFileBlobContainerDestination protocolObject) { - this.ContainerUrl = protocolObject.ContainerUrl; - this.Path = protocolObject.Path; + this.propertyContainer = new PropertyContainer(protocolObject); } #endregion Constructors @@ -52,7 +85,23 @@ internal OutputFileBlobContainerDestination(Models.OutputFileBlobContainerDestin /// /// The URL must include a Shared Access Signature (SAS) granting write permissions to the container. /// - public string ContainerUrl { get; } + public string ContainerUrl + { + get { return this.propertyContainer.ContainerUrlProperty.Value; } + private set { this.propertyContainer.ContainerUrlProperty.Value = value; } + } + + /// + /// Gets or sets 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 + /// + public ComputeNodeIdentityReference IdentityReference + { + get { return this.propertyContainer.IdentityReferenceProperty.Value; } + set { this.propertyContainer.IdentityReferenceProperty.Value = value; } + } /// /// Gets the destination blob or virtual directory within the Azure Storage container to which to upload the file(s). @@ -64,7 +113,11 @@ internal OutputFileBlobContainerDestination(Models.OutputFileBlobContainerDestin /// directory (which is prepended to each blob name) to which to upload the file(s).If omitted, file(s) /// are uploaded to the root of the container with a blob name matching their file name. /// - public string Path { get; } + public string Path + { + get { return this.propertyContainer.PathProperty.Value; } + private set { this.propertyContainer.PathProperty.Value = value; } + } #endregion // OutputFileBlobContainerDestination @@ -72,23 +125,18 @@ internal OutputFileBlobContainerDestination(Models.OutputFileBlobContainerDestin bool IModifiable.HasBeenModified { - //This class is compile time readonly so it cannot have been modified - get { return false; } + get { return this.propertyContainer.HasBeenModified; } } bool IReadOnly.IsReadOnly { - get { return true; } - set - { - // This class is compile time readonly already - } + get { return this.propertyContainer.IsReadOnly; } + set { this.propertyContainer.IsReadOnly = value; } } - #endregion // IPropertyMetadata + #endregion //IPropertyMetadata #region Internal/private methods - /// /// Return a protocol object of the requested type. /// @@ -98,6 +146,7 @@ bool IReadOnly.IsReadOnly Models.OutputFileBlobContainerDestination result = new Models.OutputFileBlobContainerDestination() { ContainerUrl = this.ContainerUrl, + IdentityReference = UtilitiesInternal.CreateObjectWithNullCheck(this.IdentityReference, (o) => o.GetTransportObject()), Path = this.Path, }; diff --git a/sdk/batch/Microsoft.Azure.Batch/src/Generated/ResourceFile.cs b/sdk/batch/Microsoft.Azure.Batch/src/Generated/ResourceFile.cs index 4fd67c360cfa..35b43d3d5d94 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/Generated/ResourceFile.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/Generated/ResourceFile.cs @@ -33,13 +33,16 @@ public partial class ResourceFile : ITransportObjectProviderThe storage container name in the auto storage account. /// The blob prefix to use when downloading blobs from an Azure Storage container. Only the blobs whose names begin /// with the specified prefix will be downloaded. + /// The reference to the user assigned identity to use to access Azure Blob Storage specified by storageContainerUrl + /// or httpUrl internal ResourceFile( string httpUrl = default(string), string fileMode = default(string), string filePath = default(string), string storageContainerUrl = default(string), string autoStorageContainerName = default(string), - string blobPrefix = default(string)) + string blobPrefix = default(string), + ComputeNodeIdentityReference identityReference = default(ComputeNodeIdentityReference)) { this.HttpUrl = httpUrl; this.FileMode = fileMode; @@ -47,6 +50,7 @@ internal ResourceFile( this.StorageContainerUrl = storageContainerUrl; this.AutoStorageContainerName = autoStorageContainerName; this.BlobPrefix = blobPrefix; + this.IdentityReference = identityReference; } internal ResourceFile(Models.ResourceFile protocolObject) @@ -56,6 +60,7 @@ internal ResourceFile(Models.ResourceFile protocolObject) this.FileMode = protocolObject.FileMode; this.FilePath = protocolObject.FilePath; this.HttpUrl = protocolObject.HttpUrl; + this.IdentityReference = UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.IdentityReference, o => new ComputeNodeIdentityReference(o).Freeze()); this.StorageContainerUrl = protocolObject.StorageContainerUrl; } @@ -113,6 +118,12 @@ internal ResourceFile(Models.ResourceFile protocolObject) /// public string HttpUrl { get; } + /// + /// Gets the reference to the user assigned identity to use to access Azure Blob Storage specified by storageContainerUrl + /// or httpUrl + /// + public ComputeNodeIdentityReference IdentityReference { get; } + /// /// Gets the URL of the blob container within Azure Blob Storage. /// @@ -160,6 +171,7 @@ bool IReadOnly.IsReadOnly FileMode = this.FileMode, FilePath = this.FilePath, HttpUrl = this.HttpUrl, + IdentityReference = UtilitiesInternal.CreateObjectWithNullCheck(this.IdentityReference, (o) => o.GetTransportObject()), StorageContainerUrl = this.StorageContainerUrl, }; diff --git a/sdk/batch/Microsoft.Azure.Batch/src/Generated/UserAssignedIdentity.cs b/sdk/batch/Microsoft.Azure.Batch/src/Generated/UserAssignedIdentity.cs new file mode 100644 index 000000000000..3de3ff597743 --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/src/Generated/UserAssignedIdentity.cs @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +// +// This file was autogenerated by a tool. +// Do not modify it. +// + +namespace Microsoft.Azure.Batch +{ + using Models = Microsoft.Azure.Batch.Protocol.Models; + using System; + using System.Collections.Generic; + using System.Linq; + + /// + /// The reference to a user assigned identity associated with the Batch pool which a compute node will use. + /// + public partial class UserAssignedIdentity : ITransportObjectProvider, IPropertyMetadata + { + private class PropertyContainer : PropertyCollection + { + public readonly PropertyAccessor ClientIdProperty; + public readonly PropertyAccessor PrincipalIdProperty; + public readonly PropertyAccessor ResourceIdProperty; + + public PropertyContainer() : base(BindingState.Unbound) + { + this.ClientIdProperty = this.CreatePropertyAccessor(nameof(ClientId), BindingAccess.Read); + this.PrincipalIdProperty = this.CreatePropertyAccessor(nameof(PrincipalId), BindingAccess.Read); + this.ResourceIdProperty = this.CreatePropertyAccessor(nameof(ResourceId), BindingAccess.Read | BindingAccess.Write); + } + + public PropertyContainer(Models.UserAssignedIdentity protocolObject) : base(BindingState.Bound) + { + this.ClientIdProperty = this.CreatePropertyAccessor( + protocolObject.ClientId, + nameof(ClientId), + BindingAccess.Read); + this.PrincipalIdProperty = this.CreatePropertyAccessor( + protocolObject.PrincipalId, + nameof(PrincipalId), + BindingAccess.Read); + this.ResourceIdProperty = this.CreatePropertyAccessor( + protocolObject.ResourceId, + nameof(ResourceId), + BindingAccess.Read); + } + } + + private readonly PropertyContainer propertyContainer; + + #region Constructors + + /// + /// Initializes a new instance of the class. + /// + /// The ARM resource id of the user assigned identity + public UserAssignedIdentity( + string resourceId) + { + this.propertyContainer = new PropertyContainer(); + this.ResourceId = resourceId; + } + + internal UserAssignedIdentity(Models.UserAssignedIdentity protocolObject) + { + this.propertyContainer = new PropertyContainer(protocolObject); + } + + #endregion Constructors + + #region UserAssignedIdentity + + /// + /// Gets the client id of the user assigned identity. + /// + public string ClientId + { + get { return this.propertyContainer.ClientIdProperty.Value; } + } + + /// + /// Gets the principal id of the user assigned identity. + /// + public string PrincipalId + { + get { return this.propertyContainer.PrincipalIdProperty.Value; } + } + + /// + /// Gets or sets the ARM resource id of the user assigned identity + /// + public string ResourceId + { + get { return this.propertyContainer.ResourceIdProperty.Value; } + set { this.propertyContainer.ResourceIdProperty.Value = value; } + } + + #endregion // UserAssignedIdentity + + #region IPropertyMetadata + + bool IModifiable.HasBeenModified + { + get { return this.propertyContainer.HasBeenModified; } + } + + bool IReadOnly.IsReadOnly + { + get { return this.propertyContainer.IsReadOnly; } + set { this.propertyContainer.IsReadOnly = value; } + } + + #endregion //IPropertyMetadata + + #region Internal/private methods + /// + /// Return a protocol object of the requested type. + /// + /// The protocol object of the requested type. + Models.UserAssignedIdentity ITransportObjectProvider.GetTransportObject() + { + Models.UserAssignedIdentity result = new Models.UserAssignedIdentity() + { + ResourceId = this.ResourceId, + }; + + return result; + } + + /// + /// Converts a collection of protocol layer objects to object layer collection objects. + /// + internal static IList ConvertFromProtocolCollection(IEnumerable protoCollection) + { + ConcurrentChangeTrackedModifiableList converted = UtilitiesInternal.CollectionToThreadSafeCollectionIModifiable( + items: protoCollection, + objectCreationFunc: o => new UserAssignedIdentity(o)); + + return converted; + } + + /// + /// Converts a collection of protocol layer objects to object layer collection objects, in a frozen state. + /// + internal static IList ConvertFromProtocolCollectionAndFreeze(IEnumerable protoCollection) + { + ConcurrentChangeTrackedModifiableList converted = UtilitiesInternal.CollectionToThreadSafeCollectionIModifiable( + items: protoCollection, + objectCreationFunc: o => new UserAssignedIdentity(o).Freeze()); + + converted = UtilitiesInternal.CreateObjectWithNullCheck(converted, o => o.Freeze()); + + return converted; + } + + /// + /// Converts a collection of protocol layer objects to object layer collection objects, with each object marked readonly + /// and returned as a readonly collection. + /// + internal static IReadOnlyList ConvertFromProtocolCollectionReadOnly(IEnumerable protoCollection) + { + IReadOnlyList converted = + UtilitiesInternal.CreateObjectWithNullCheck( + UtilitiesInternal.CollectionToNonThreadSafeCollection( + items: protoCollection, + objectCreationFunc: o => new UserAssignedIdentity(o).Freeze()), o => o.AsReadOnly()); + + return converted; + } + + #endregion // Internal/private methods + } +} \ No newline at end of file diff --git a/sdk/batch/Microsoft.Azure.Batch/src/Generated/VMExtension.cs b/sdk/batch/Microsoft.Azure.Batch/src/Generated/VMExtension.cs new file mode 100644 index 000000000000..6954bc651dbd --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/src/Generated/VMExtension.cs @@ -0,0 +1,278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +// +// This file was autogenerated by a tool. +// Do not modify it. +// + +namespace Microsoft.Azure.Batch +{ + using Models = Microsoft.Azure.Batch.Protocol.Models; + using System; + using System.Collections.Generic; + using System.Linq; + + /// + /// The configuration for virtual machine extensions. + /// + public partial class VMExtension : ITransportObjectProvider, IPropertyMetadata + { + private class PropertyContainer : PropertyCollection + { + public readonly PropertyAccessor AutoUpgradeMinorVersionProperty; + public readonly PropertyAccessor NameProperty; + public readonly PropertyAccessor ProtectedSettingsProperty; + public readonly PropertyAccessor> ProvisionAfterExtensionsProperty; + public readonly PropertyAccessor PublisherProperty; + public readonly PropertyAccessor SettingsProperty; + public readonly PropertyAccessor TypeProperty; + public readonly PropertyAccessor TypeHandlerVersionProperty; + + public PropertyContainer() : base(BindingState.Unbound) + { + this.AutoUpgradeMinorVersionProperty = this.CreatePropertyAccessor(nameof(AutoUpgradeMinorVersion), BindingAccess.Read | BindingAccess.Write); + this.NameProperty = this.CreatePropertyAccessor(nameof(Name), BindingAccess.Read | BindingAccess.Write); + this.ProtectedSettingsProperty = this.CreatePropertyAccessor(nameof(ProtectedSettings), BindingAccess.Read | BindingAccess.Write); + this.ProvisionAfterExtensionsProperty = this.CreatePropertyAccessor>(nameof(ProvisionAfterExtensions), BindingAccess.Read | BindingAccess.Write); + this.PublisherProperty = this.CreatePropertyAccessor(nameof(Publisher), BindingAccess.Read | BindingAccess.Write); + this.SettingsProperty = this.CreatePropertyAccessor(nameof(Settings), BindingAccess.Read | BindingAccess.Write); + this.TypeProperty = this.CreatePropertyAccessor(nameof(Type), BindingAccess.Read | BindingAccess.Write); + this.TypeHandlerVersionProperty = this.CreatePropertyAccessor(nameof(TypeHandlerVersion), BindingAccess.Read | BindingAccess.Write); + } + + public PropertyContainer(Models.VMExtension protocolObject) : base(BindingState.Bound) + { + this.AutoUpgradeMinorVersionProperty = this.CreatePropertyAccessor( + protocolObject.AutoUpgradeMinorVersion, + nameof(AutoUpgradeMinorVersion), + BindingAccess.Read | BindingAccess.Write); + this.NameProperty = this.CreatePropertyAccessor( + protocolObject.Name, + nameof(Name), + BindingAccess.Read | BindingAccess.Write); + this.ProtectedSettingsProperty = this.CreatePropertyAccessor( + protocolObject.ProtectedSettings, + nameof(ProtectedSettings), + BindingAccess.Read | BindingAccess.Write); + this.ProvisionAfterExtensionsProperty = this.CreatePropertyAccessor( + UtilitiesInternal.CollectionToThreadSafeCollection(protocolObject.ProvisionAfterExtensions, o => o), + nameof(ProvisionAfterExtensions), + BindingAccess.Read | BindingAccess.Write); + this.PublisherProperty = this.CreatePropertyAccessor( + protocolObject.Publisher, + nameof(Publisher), + BindingAccess.Read | BindingAccess.Write); + this.SettingsProperty = this.CreatePropertyAccessor( + protocolObject.Settings, + nameof(Settings), + BindingAccess.Read | BindingAccess.Write); + this.TypeProperty = this.CreatePropertyAccessor( + protocolObject.Type, + nameof(Type), + BindingAccess.Read | BindingAccess.Write); + this.TypeHandlerVersionProperty = this.CreatePropertyAccessor( + protocolObject.TypeHandlerVersion, + nameof(TypeHandlerVersion), + BindingAccess.Read | BindingAccess.Write); + } + } + + private readonly PropertyContainer propertyContainer; + + #region Constructors + + /// + /// Initializes a new instance of the class. + /// + /// The name of the virtual machine extension. + /// The name of the extension handler publisher. + /// The type of the extension. + public VMExtension( + string name, + string publisher, + string type) + { + this.propertyContainer = new PropertyContainer(); + this.Name = name; + this.Publisher = publisher; + this.Type = type; + } + + internal VMExtension(Models.VMExtension protocolObject) + { + this.propertyContainer = new PropertyContainer(protocolObject); + } + + #endregion Constructors + + #region VMExtension + + /// + /// Gets or sets indicates whether the extension should use a newer minor version if one is available at deployment + /// time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this + /// property set to true. + /// + public bool? AutoUpgradeMinorVersion + { + get { return this.propertyContainer.AutoUpgradeMinorVersionProperty.Value; } + set { this.propertyContainer.AutoUpgradeMinorVersionProperty.Value = value; } + } + + /// + /// Gets or sets the name of the virtual machine extension. + /// + public string Name + { + get { return this.propertyContainer.NameProperty.Value; } + set { this.propertyContainer.NameProperty.Value = value; } + } + + /// + /// Gets or sets the extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected + /// settings at all. + /// + public object ProtectedSettings + { + get { return this.propertyContainer.ProtectedSettingsProperty.Value; } + set { this.propertyContainer.ProtectedSettingsProperty.Value = value; } + } + + /// + /// Gets or sets the collection of extension names. + /// + /// + /// Collection of extension names after which this extension needs to be provisioned. + /// + public IList ProvisionAfterExtensions + { + get { return this.propertyContainer.ProvisionAfterExtensionsProperty.Value; } + set + { + this.propertyContainer.ProvisionAfterExtensionsProperty.Value = ConcurrentChangeTrackedList.TransformEnumerableToConcurrentList(value); + } + } + + /// + /// Gets or sets the name of the extension handler publisher. + /// + public string Publisher + { + get { return this.propertyContainer.PublisherProperty.Value; } + set { this.propertyContainer.PublisherProperty.Value = value; } + } + + /// + /// Gets or sets jSON formatted public settings for the extension. + /// + public object Settings + { + get { return this.propertyContainer.SettingsProperty.Value; } + set { this.propertyContainer.SettingsProperty.Value = value; } + } + + /// + /// Gets or sets the type of the extension. + /// + public string Type + { + get { return this.propertyContainer.TypeProperty.Value; } + set { this.propertyContainer.TypeProperty.Value = value; } + } + + /// + /// Gets or sets the version of script handler. + /// + public string TypeHandlerVersion + { + get { return this.propertyContainer.TypeHandlerVersionProperty.Value; } + set { this.propertyContainer.TypeHandlerVersionProperty.Value = value; } + } + + #endregion // VMExtension + + #region IPropertyMetadata + + bool IModifiable.HasBeenModified + { + get { return this.propertyContainer.HasBeenModified; } + } + + bool IReadOnly.IsReadOnly + { + get { return this.propertyContainer.IsReadOnly; } + set { this.propertyContainer.IsReadOnly = value; } + } + + #endregion //IPropertyMetadata + + #region Internal/private methods + /// + /// Return a protocol object of the requested type. + /// + /// The protocol object of the requested type. + Models.VMExtension ITransportObjectProvider.GetTransportObject() + { + Models.VMExtension result = new Models.VMExtension() + { + AutoUpgradeMinorVersion = this.AutoUpgradeMinorVersion, + Name = this.Name, + ProtectedSettings = this.ProtectedSettings, + ProvisionAfterExtensions = this.ProvisionAfterExtensions, + Publisher = this.Publisher, + Settings = this.Settings, + Type = this.Type, + TypeHandlerVersion = this.TypeHandlerVersion, + }; + + return result; + } + + /// + /// Converts a collection of protocol layer objects to object layer collection objects. + /// + internal static IList ConvertFromProtocolCollection(IEnumerable protoCollection) + { + ConcurrentChangeTrackedModifiableList converted = UtilitiesInternal.CollectionToThreadSafeCollectionIModifiable( + items: protoCollection, + objectCreationFunc: o => new VMExtension(o)); + + return converted; + } + + /// + /// Converts a collection of protocol layer objects to object layer collection objects, in a frozen state. + /// + internal static IList ConvertFromProtocolCollectionAndFreeze(IEnumerable protoCollection) + { + ConcurrentChangeTrackedModifiableList converted = UtilitiesInternal.CollectionToThreadSafeCollectionIModifiable( + items: protoCollection, + objectCreationFunc: o => new VMExtension(o).Freeze()); + + converted = UtilitiesInternal.CreateObjectWithNullCheck(converted, o => o.Freeze()); + + return converted; + } + + /// + /// Converts a collection of protocol layer objects to object layer collection objects, with each object marked readonly + /// and returned as a readonly collection. + /// + internal static IReadOnlyList ConvertFromProtocolCollectionReadOnly(IEnumerable protoCollection) + { + IReadOnlyList converted = + UtilitiesInternal.CreateObjectWithNullCheck( + UtilitiesInternal.CollectionToNonThreadSafeCollection( + items: protoCollection, + objectCreationFunc: o => new VMExtension(o).Freeze()), o => o.AsReadOnly()); + + return converted; + } + + #endregion // Internal/private methods + } +} \ No newline at end of file diff --git a/sdk/batch/Microsoft.Azure.Batch/src/Generated/VMExtensionInstanceView.cs b/sdk/batch/Microsoft.Azure.Batch/src/Generated/VMExtensionInstanceView.cs new file mode 100644 index 000000000000..169f0cf1c01c --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/src/Generated/VMExtensionInstanceView.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +// +// This file was autogenerated by a tool. +// Do not modify it. +// + +namespace Microsoft.Azure.Batch +{ + using Models = Microsoft.Azure.Batch.Protocol.Models; + using System; + using System.Collections.Generic; + using System.Linq; + + /// + /// The vm extension instance view. + /// + public partial class VMExtensionInstanceView : ITransportObjectProvider, IPropertyMetadata + { + private class PropertyContainer : PropertyCollection + { + public readonly PropertyAccessor NameProperty; + public readonly PropertyAccessor> StatusesProperty; + public readonly PropertyAccessor> SubStatusesProperty; + + public PropertyContainer() : base(BindingState.Unbound) + { + this.NameProperty = this.CreatePropertyAccessor(nameof(Name), BindingAccess.Read | BindingAccess.Write); + this.StatusesProperty = this.CreatePropertyAccessor>(nameof(Statuses), BindingAccess.Read | BindingAccess.Write); + this.SubStatusesProperty = this.CreatePropertyAccessor>(nameof(SubStatuses), BindingAccess.Read | BindingAccess.Write); + } + + public PropertyContainer(Models.VMExtensionInstanceView protocolObject) : base(BindingState.Bound) + { + this.NameProperty = this.CreatePropertyAccessor( + protocolObject.Name, + nameof(Name), + BindingAccess.Read); + this.StatusesProperty = this.CreatePropertyAccessor( + InstanceViewStatus.ConvertFromProtocolCollectionAndFreeze(protocolObject.Statuses), + nameof(Statuses), + BindingAccess.Read); + this.SubStatusesProperty = this.CreatePropertyAccessor( + InstanceViewStatus.ConvertFromProtocolCollectionAndFreeze(protocolObject.SubStatuses), + nameof(SubStatuses), + BindingAccess.Read); + } + } + + private readonly PropertyContainer propertyContainer; + + #region Constructors + + /// + /// Initializes a new instance of the class. + /// + public VMExtensionInstanceView() + { + this.propertyContainer = new PropertyContainer(); + } + + internal VMExtensionInstanceView(Models.VMExtensionInstanceView protocolObject) + { + this.propertyContainer = new PropertyContainer(protocolObject); + } + + #endregion Constructors + + #region VMExtensionInstanceView + + /// + /// Gets or sets the name of the vm extension instance view. + /// + public string Name + { + get { return this.propertyContainer.NameProperty.Value; } + set { this.propertyContainer.NameProperty.Value = value; } + } + + /// + /// Gets or sets the resource status information. + /// + public IList Statuses + { + get { return this.propertyContainer.StatusesProperty.Value; } + set + { + this.propertyContainer.StatusesProperty.Value = ConcurrentChangeTrackedModifiableList.TransformEnumerableToConcurrentModifiableList(value); + } + } + + /// + /// Gets or sets the resource substatus information. + /// + public IList SubStatuses + { + get { return this.propertyContainer.SubStatusesProperty.Value; } + set + { + this.propertyContainer.SubStatusesProperty.Value = ConcurrentChangeTrackedModifiableList.TransformEnumerableToConcurrentModifiableList(value); + } + } + + #endregion // VMExtensionInstanceView + + #region IPropertyMetadata + + bool IModifiable.HasBeenModified + { + get { return this.propertyContainer.HasBeenModified; } + } + + bool IReadOnly.IsReadOnly + { + get { return this.propertyContainer.IsReadOnly; } + set { this.propertyContainer.IsReadOnly = value; } + } + + #endregion //IPropertyMetadata + + #region Internal/private methods + /// + /// Return a protocol object of the requested type. + /// + /// The protocol object of the requested type. + Models.VMExtensionInstanceView ITransportObjectProvider.GetTransportObject() + { + Models.VMExtensionInstanceView result = new Models.VMExtensionInstanceView() + { + Name = this.Name, + Statuses = UtilitiesInternal.ConvertToProtocolCollection(this.Statuses), + SubStatuses = UtilitiesInternal.ConvertToProtocolCollection(this.SubStatuses), + }; + + return result; + } + + + #endregion // Internal/private methods + } +} \ No newline at end of file diff --git a/sdk/batch/Microsoft.Azure.Batch/src/Generated/VirtualMachineConfiguration.cs b/sdk/batch/Microsoft.Azure.Batch/src/Generated/VirtualMachineConfiguration.cs index 8dc7dfbabcb2..7df31bb9f1dd 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/Generated/VirtualMachineConfiguration.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/Generated/VirtualMachineConfiguration.cs @@ -27,9 +27,12 @@ private class PropertyContainer : PropertyCollection public readonly PropertyAccessor ContainerConfigurationProperty; public readonly PropertyAccessor> DataDisksProperty; public readonly PropertyAccessor DiskEncryptionConfigurationProperty; + public readonly PropertyAccessor> ExtensionsProperty; public readonly PropertyAccessor ImageReferenceProperty; public readonly PropertyAccessor LicenseTypeProperty; public readonly PropertyAccessor NodeAgentSkuIdProperty; + public readonly PropertyAccessor NodePlacementConfigurationProperty; + public readonly PropertyAccessor OSDiskProperty; public readonly PropertyAccessor WindowsConfigurationProperty; public PropertyContainer() : base(BindingState.Unbound) @@ -37,9 +40,12 @@ public PropertyContainer() : base(BindingState.Unbound) this.ContainerConfigurationProperty = this.CreatePropertyAccessor(nameof(ContainerConfiguration), BindingAccess.Read | BindingAccess.Write); this.DataDisksProperty = this.CreatePropertyAccessor>(nameof(DataDisks), BindingAccess.Read | BindingAccess.Write); this.DiskEncryptionConfigurationProperty = this.CreatePropertyAccessor(nameof(DiskEncryptionConfiguration), BindingAccess.Read | BindingAccess.Write); + this.ExtensionsProperty = this.CreatePropertyAccessor>(nameof(Extensions), BindingAccess.Read | BindingAccess.Write); this.ImageReferenceProperty = this.CreatePropertyAccessor(nameof(ImageReference), BindingAccess.Read | BindingAccess.Write); this.LicenseTypeProperty = this.CreatePropertyAccessor(nameof(LicenseType), BindingAccess.Read | BindingAccess.Write); this.NodeAgentSkuIdProperty = this.CreatePropertyAccessor(nameof(NodeAgentSkuId), BindingAccess.Read | BindingAccess.Write); + this.NodePlacementConfigurationProperty = this.CreatePropertyAccessor(nameof(NodePlacementConfiguration), BindingAccess.Read | BindingAccess.Write); + this.OSDiskProperty = this.CreatePropertyAccessor(nameof(OSDisk), BindingAccess.Read | BindingAccess.Write); this.WindowsConfigurationProperty = this.CreatePropertyAccessor(nameof(WindowsConfiguration), BindingAccess.Read | BindingAccess.Write); } @@ -57,6 +63,10 @@ public PropertyContainer(Models.VirtualMachineConfiguration protocolObject) : ba UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.DiskEncryptionConfiguration, o => new DiskEncryptionConfiguration(o)), nameof(DiskEncryptionConfiguration), BindingAccess.Read | BindingAccess.Write); + this.ExtensionsProperty = this.CreatePropertyAccessor( + VMExtension.ConvertFromProtocolCollection(protocolObject.Extensions), + nameof(Extensions), + BindingAccess.Read | BindingAccess.Write); this.ImageReferenceProperty = this.CreatePropertyAccessor( UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.ImageReference, o => new ImageReference(o)), nameof(ImageReference), @@ -69,6 +79,14 @@ public PropertyContainer(Models.VirtualMachineConfiguration protocolObject) : ba protocolObject.NodeAgentSKUId, nameof(NodeAgentSkuId), BindingAccess.Read | BindingAccess.Write); + this.NodePlacementConfigurationProperty = this.CreatePropertyAccessor( + UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.NodePlacementConfiguration, o => new NodePlacementConfiguration(o)), + nameof(NodePlacementConfiguration), + BindingAccess.Read | BindingAccess.Write); + this.OSDiskProperty = this.CreatePropertyAccessor( + UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.OsDisk, o => new OSDisk(o)), + nameof(OSDisk), + BindingAccess.Read | BindingAccess.Write); this.WindowsConfigurationProperty = this.CreatePropertyAccessor( UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.WindowsConfiguration, o => new WindowsConfiguration(o)), nameof(WindowsConfiguration), @@ -145,6 +163,21 @@ public DiskEncryptionConfiguration DiskEncryptionConfiguration set { this.propertyContainer.DiskEncryptionConfigurationProperty.Value = value; } } + /// + /// Gets or sets the virtual machine extension for the pool. + /// + /// + /// If specified, the extensions mentioned in this configuration will be installed on each node. + /// + public IList Extensions + { + get { return this.propertyContainer.ExtensionsProperty.Value; } + set + { + this.propertyContainer.ExtensionsProperty.Value = ConcurrentChangeTrackedModifiableList.TransformEnumerableToConcurrentModifiableList(value); + } + } + /// /// Gets or sets a reference to the Azure Virtual Machines Marketplace Image or the custom Virtual Machine Image /// to use. @@ -184,6 +217,27 @@ public string NodeAgentSkuId set { this.propertyContainer.NodeAgentSkuIdProperty.Value = value; } } + /// + /// Gets or sets the node placement configuration for the pool. + /// + /// + /// This configuration will specify rules on how nodes in the pool will be physically allocated. + /// + public NodePlacementConfiguration NodePlacementConfiguration + { + get { return this.propertyContainer.NodePlacementConfigurationProperty.Value; } + set { this.propertyContainer.NodePlacementConfigurationProperty.Value = value; } + } + + /// + /// Gets or sets settings for the operating system disk of the Virtual Machine. + /// + public OSDisk OSDisk + { + get { return this.propertyContainer.OSDiskProperty.Value; } + set { this.propertyContainer.OSDiskProperty.Value = value; } + } + /// /// Gets or sets windows operating system settings on the Virtual Machine. This property must not be specified if /// the ImageReference property specifies a Linux OS image. @@ -223,9 +277,12 @@ bool IReadOnly.IsReadOnly ContainerConfiguration = UtilitiesInternal.CreateObjectWithNullCheck(this.ContainerConfiguration, (o) => o.GetTransportObject()), DataDisks = UtilitiesInternal.ConvertToProtocolCollection(this.DataDisks), DiskEncryptionConfiguration = UtilitiesInternal.CreateObjectWithNullCheck(this.DiskEncryptionConfiguration, (o) => o.GetTransportObject()), + Extensions = UtilitiesInternal.ConvertToProtocolCollection(this.Extensions), ImageReference = UtilitiesInternal.CreateObjectWithNullCheck(this.ImageReference, (o) => o.GetTransportObject()), LicenseType = this.LicenseType, NodeAgentSKUId = this.NodeAgentSkuId, + NodePlacementConfiguration = UtilitiesInternal.CreateObjectWithNullCheck(this.NodePlacementConfiguration, (o) => o.GetTransportObject()), + OsDisk = UtilitiesInternal.CreateObjectWithNullCheck(this.OSDisk, (o) => o.GetTransportObject()), WindowsConfiguration = UtilitiesInternal.CreateObjectWithNullCheck(this.WindowsConfiguration, (o) => o.GetTransportObject()), }; diff --git a/sdk/batch/Microsoft.Azure.Batch/src/Generated/VirtualMachineInfo.cs b/sdk/batch/Microsoft.Azure.Batch/src/Generated/VirtualMachineInfo.cs new file mode 100644 index 000000000000..62e59f0b686c --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/src/Generated/VirtualMachineInfo.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +// +// This file was autogenerated by a tool. +// Do not modify it. +// + +namespace Microsoft.Azure.Batch +{ + using Models = Microsoft.Azure.Batch.Protocol.Models; + using System; + using System.Collections.Generic; + using System.Linq; + + /// + /// Info about the current state of the virtual machine. + /// + public partial class VirtualMachineInfo : ITransportObjectProvider, IPropertyMetadata + { + private class PropertyContainer : PropertyCollection + { + public readonly PropertyAccessor ImageReferenceProperty; + + public PropertyContainer() : base(BindingState.Unbound) + { + this.ImageReferenceProperty = this.CreatePropertyAccessor(nameof(ImageReference), BindingAccess.Read | BindingAccess.Write); + } + + public PropertyContainer(Models.VirtualMachineInfo protocolObject) : base(BindingState.Bound) + { + this.ImageReferenceProperty = this.CreatePropertyAccessor( + UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.ImageReference, o => new ImageReference(o).Freeze()), + nameof(ImageReference), + BindingAccess.Read); + } + } + + private readonly PropertyContainer propertyContainer; + + #region Constructors + + /// + /// Initializes a new instance of the class. + /// + public VirtualMachineInfo() + { + this.propertyContainer = new PropertyContainer(); + } + + internal VirtualMachineInfo(Models.VirtualMachineInfo protocolObject) + { + this.propertyContainer = new PropertyContainer(protocolObject); + } + + #endregion Constructors + + #region VirtualMachineInfo + + /// + /// Gets or sets the reference to the Azure Virtual Machine's Marketplace Image. + /// + public ImageReference ImageReference + { + get { return this.propertyContainer.ImageReferenceProperty.Value; } + set { this.propertyContainer.ImageReferenceProperty.Value = value; } + } + + #endregion // VirtualMachineInfo + + #region IPropertyMetadata + + bool IModifiable.HasBeenModified + { + get { return this.propertyContainer.HasBeenModified; } + } + + bool IReadOnly.IsReadOnly + { + get { return this.propertyContainer.IsReadOnly; } + set { this.propertyContainer.IsReadOnly = value; } + } + + #endregion //IPropertyMetadata + + #region Internal/private methods + /// + /// Return a protocol object of the requested type. + /// + /// The protocol object of the requested type. + Models.VirtualMachineInfo ITransportObjectProvider.GetTransportObject() + { + Models.VirtualMachineInfo result = new Models.VirtualMachineInfo() + { + ImageReference = UtilitiesInternal.CreateObjectWithNullCheck(this.ImageReference, (o) => o.GetTransportObject()), + }; + + return result; + } + + /// + /// Converts a collection of protocol layer objects to object layer collection objects. + /// + internal static IList ConvertFromProtocolCollection(IEnumerable protoCollection) + { + ConcurrentChangeTrackedModifiableList converted = UtilitiesInternal.CollectionToThreadSafeCollectionIModifiable( + items: protoCollection, + objectCreationFunc: o => new VirtualMachineInfo(o)); + + return converted; + } + + /// + /// Converts a collection of protocol layer objects to object layer collection objects, in a frozen state. + /// + internal static IList ConvertFromProtocolCollectionAndFreeze(IEnumerable protoCollection) + { + ConcurrentChangeTrackedModifiableList converted = UtilitiesInternal.CollectionToThreadSafeCollectionIModifiable( + items: protoCollection, + objectCreationFunc: o => new VirtualMachineInfo(o).Freeze()); + + converted = UtilitiesInternal.CreateObjectWithNullCheck(converted, o => o.Freeze()); + + return converted; + } + + /// + /// Converts a collection of protocol layer objects to object layer collection objects, with each object marked readonly + /// and returned as a readonly collection. + /// + internal static IReadOnlyList ConvertFromProtocolCollectionReadOnly(IEnumerable protoCollection) + { + IReadOnlyList converted = + UtilitiesInternal.CreateObjectWithNullCheck( + UtilitiesInternal.CollectionToNonThreadSafeCollection( + items: protoCollection, + objectCreationFunc: o => new VirtualMachineInfo(o).Freeze()), o => o.AsReadOnly()); + + return converted; + } + + #endregion // Internal/private methods + } +} \ No newline at end of file diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/AccountOperations.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/AccountOperations.cs index 50bf6925af6d..863f5ea67ab3 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/AccountOperations.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/AccountOperations.cs @@ -313,7 +313,9 @@ internal AccountOperations(BatchServiceClient client) } /// - /// Gets the number of Compute Nodes in each state, grouped by Pool. + /// 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. /// /// /// Additional parameters for the operation @@ -800,7 +802,9 @@ internal AccountOperations(BatchServiceClient client) } /// - /// Gets the number of Compute Nodes in each state, grouped by Pool. + /// 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. /// /// /// The NextLink from the previous successful call to List operation. diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/AccountOperationsExtensions.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/AccountOperationsExtensions.cs index e90197352bf1..4aa8cab85f2d 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/AccountOperationsExtensions.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/AccountOperationsExtensions.cs @@ -56,7 +56,9 @@ public static partial class AccountOperationsExtensions } /// - /// Gets the number of Compute Nodes in each state, grouped by Pool. + /// 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. /// /// /// The operations group for this extension method. @@ -70,7 +72,9 @@ public static partial class AccountOperationsExtensions } /// - /// Gets the number of Compute Nodes in each state, grouped by Pool. + /// 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. /// /// /// The operations group for this extension method. @@ -130,7 +134,9 @@ public static partial class AccountOperationsExtensions } /// - /// Gets the number of Compute Nodes in each state, grouped by Pool. + /// 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. /// /// /// The operations group for this extension method. @@ -147,7 +153,9 @@ public static partial class AccountOperationsExtensions } /// - /// Gets the number of Compute Nodes in each state, grouped by Pool. + /// 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. /// /// /// The operations group for this extension method. diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/BatchServiceClient.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/BatchServiceClient.cs index fdc97709c665..d4c2e009860d 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/BatchServiceClient.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/BatchServiceClient.cs @@ -119,6 +119,11 @@ public partial class BatchServiceClient : ServiceClient, IBa /// public virtual IComputeNodeOperations ComputeNode { get; private set; } + /// + /// Gets the IComputeNodeExtensionOperations. + /// + public virtual IComputeNodeExtensionOperations ComputeNodeExtension { get; private set; } + /// /// Initializes a new instance of the BatchServiceClient class. /// @@ -255,8 +260,9 @@ private void Initialize() JobSchedule = new JobScheduleOperations(this); Task = new TaskOperations(this); ComputeNode = new ComputeNodeOperations(this); + ComputeNodeExtension = new ComputeNodeExtensionOperations(this); BaseUri = "{batchUrl}"; - ApiVersion = "2020-09-01.12.0"; + ApiVersion = "2021-06-01.14.0"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/ComputeNodeExtensionOperations.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/ComputeNodeExtensionOperations.cs new file mode 100644 index 000000000000..2d0a9d78baa3 --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/ComputeNodeExtensionOperations.cs @@ -0,0 +1,839 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Batch.Protocol +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Serialization; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ComputeNodeExtensionOperations operations. + /// + internal partial class ComputeNodeExtensionOperations : IServiceOperations, IComputeNodeExtensionOperations + { + /// + /// Initializes a new instance of the ComputeNodeExtensionOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ComputeNodeExtensionOperations(BatchServiceClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the BatchServiceClient + /// + public BatchServiceClient Client { get; private set; } + + /// + /// Gets information about the specified Compute Node Extension. + /// + /// + /// The ID of the Pool that contains the Compute Node. + /// + /// + /// The ID of the Compute Node that contains the extensions. + /// + /// + /// The name of the of the Compute Node Extension that you want to get + /// information about. + /// + /// + /// Additional parameters for the operation + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string poolId, string nodeId, string extensionName, ComputeNodeExtensionGetOptions computeNodeExtensionGetOptions = default(ComputeNodeExtensionGetOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.BatchUrl == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.BatchUrl"); + } + if (poolId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "poolId"); + } + if (nodeId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nodeId"); + } + if (extensionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "extensionName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + string select = default(string); + if (computeNodeExtensionGetOptions != null) + { + select = computeNodeExtensionGetOptions.Select; + } + int? timeout = default(int?); + if (computeNodeExtensionGetOptions != null) + { + timeout = computeNodeExtensionGetOptions.Timeout; + } + System.Guid? clientRequestId = default(System.Guid?); + if (computeNodeExtensionGetOptions != null) + { + clientRequestId = computeNodeExtensionGetOptions.ClientRequestId; + } + bool? returnClientRequestId = default(bool?); + if (computeNodeExtensionGetOptions != null) + { + returnClientRequestId = computeNodeExtensionGetOptions.ReturnClientRequestId; + } + System.DateTime? ocpDate = default(System.DateTime?); + if (computeNodeExtensionGetOptions != null) + { + ocpDate = computeNodeExtensionGetOptions.OcpDate; + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("poolId", poolId); + tracingParameters.Add("nodeId", nodeId); + tracingParameters.Add("extensionName", extensionName); + tracingParameters.Add("select", select); + tracingParameters.Add("timeout", timeout); + tracingParameters.Add("clientRequestId", clientRequestId); + tracingParameters.Add("returnClientRequestId", returnClientRequestId); + tracingParameters.Add("ocpDate", ocpDate); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri; + var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "pools/{poolId}/nodes/{nodeId}/extensions/{extensionName}"; + _url = _url.Replace("{batchUrl}", Client.BatchUrl); + _url = _url.Replace("{poolId}", System.Uri.EscapeDataString(poolId)); + _url = _url.Replace("{nodeId}", System.Uri.EscapeDataString(nodeId)); + _url = _url.Replace("{extensionName}", System.Uri.EscapeDataString(extensionName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (select != null) + { + _queryParameters.Add(string.Format("$select={0}", System.Uri.EscapeDataString(select))); + } + if (timeout != null) + { + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + if (clientRequestId != null) + { + if (_httpRequest.Headers.Contains("client-request-id")) + { + _httpRequest.Headers.Remove("client-request-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); + } + if (returnClientRequestId != null) + { + if (_httpRequest.Headers.Contains("return-client-request-id")) + { + _httpRequest.Headers.Remove("return-client-request-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); + } + if (ocpDate != null) + { + if (_httpRequest.Headers.Contains("ocp-date")) + { + _httpRequest.Headers.Remove("ocp-date"); + } + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new BatchErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists the Compute Nodes Extensions in the specified Pool. + /// + /// + /// The ID of the Pool that contains Compute Node. + /// + /// + /// The ID of the Compute Node that you want to list extensions. + /// + /// + /// Additional parameters for the operation + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task,ComputeNodeExtensionListHeaders>> ListWithHttpMessagesAsync(string poolId, string nodeId, ComputeNodeExtensionListOptions computeNodeExtensionListOptions = default(ComputeNodeExtensionListOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.BatchUrl == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.BatchUrl"); + } + if (poolId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "poolId"); + } + if (nodeId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nodeId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + string select = default(string); + if (computeNodeExtensionListOptions != null) + { + select = computeNodeExtensionListOptions.Select; + } + int? maxResults = default(int?); + if (computeNodeExtensionListOptions != null) + { + maxResults = computeNodeExtensionListOptions.MaxResults; + } + int? timeout = default(int?); + if (computeNodeExtensionListOptions != null) + { + timeout = computeNodeExtensionListOptions.Timeout; + } + System.Guid? clientRequestId = default(System.Guid?); + if (computeNodeExtensionListOptions != null) + { + clientRequestId = computeNodeExtensionListOptions.ClientRequestId; + } + bool? returnClientRequestId = default(bool?); + if (computeNodeExtensionListOptions != null) + { + returnClientRequestId = computeNodeExtensionListOptions.ReturnClientRequestId; + } + System.DateTime? ocpDate = default(System.DateTime?); + if (computeNodeExtensionListOptions != null) + { + ocpDate = computeNodeExtensionListOptions.OcpDate; + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("poolId", poolId); + tracingParameters.Add("nodeId", nodeId); + tracingParameters.Add("select", select); + tracingParameters.Add("maxResults", maxResults); + tracingParameters.Add("timeout", timeout); + tracingParameters.Add("clientRequestId", clientRequestId); + tracingParameters.Add("returnClientRequestId", returnClientRequestId); + tracingParameters.Add("ocpDate", ocpDate); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri; + var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "pools/{poolId}/nodes/{nodeId}/extensions"; + _url = _url.Replace("{batchUrl}", Client.BatchUrl); + _url = _url.Replace("{poolId}", System.Uri.EscapeDataString(poolId)); + _url = _url.Replace("{nodeId}", System.Uri.EscapeDataString(nodeId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (select != null) + { + _queryParameters.Add(string.Format("$select={0}", System.Uri.EscapeDataString(select))); + } + if (maxResults != null) + { + _queryParameters.Add(string.Format("maxresults={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(maxResults, Client.SerializationSettings).Trim('"')))); + } + if (timeout != null) + { + _queryParameters.Add(string.Format("timeout={0}", System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject(timeout, Client.SerializationSettings).Trim('"')))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + if (clientRequestId != null) + { + if (_httpRequest.Headers.Contains("client-request-id")) + { + _httpRequest.Headers.Remove("client-request-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); + } + if (returnClientRequestId != null) + { + if (_httpRequest.Headers.Contains("return-client-request-id")) + { + _httpRequest.Headers.Remove("return-client-request-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); + } + if (ocpDate != null) + { + if (_httpRequest.Headers.Contains("ocp-date")) + { + _httpRequest.Headers.Remove("ocp-date"); + } + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new BatchErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse,ComputeNodeExtensionListHeaders>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists the Compute Nodes Extensions in the specified Pool. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Additional parameters for the operation + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task,ComputeNodeExtensionListHeaders>> ListNextWithHttpMessagesAsync(string nextPageLink, ComputeNodeExtensionListNextOptions computeNodeExtensionListNextOptions = default(ComputeNodeExtensionListNextOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + System.Guid? clientRequestId = default(System.Guid?); + if (computeNodeExtensionListNextOptions != null) + { + clientRequestId = computeNodeExtensionListNextOptions.ClientRequestId; + } + bool? returnClientRequestId = default(bool?); + if (computeNodeExtensionListNextOptions != null) + { + returnClientRequestId = computeNodeExtensionListNextOptions.ReturnClientRequestId; + } + System.DateTime? ocpDate = default(System.DateTime?); + if (computeNodeExtensionListNextOptions != null) + { + ocpDate = computeNodeExtensionListNextOptions.OcpDate; + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("clientRequestId", clientRequestId); + tracingParameters.Add("returnClientRequestId", returnClientRequestId); + tracingParameters.Add("ocpDate", ocpDate); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + if (clientRequestId != null) + { + if (_httpRequest.Headers.Contains("client-request-id")) + { + _httpRequest.Headers.Remove("client-request-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("client-request-id", SafeJsonConvert.SerializeObject(clientRequestId, Client.SerializationSettings).Trim('"')); + } + if (returnClientRequestId != null) + { + if (_httpRequest.Headers.Contains("return-client-request-id")) + { + _httpRequest.Headers.Remove("return-client-request-id"); + } + _httpRequest.Headers.TryAddWithoutValidation("return-client-request-id", SafeJsonConvert.SerializeObject(returnClientRequestId, Client.SerializationSettings).Trim('"')); + } + if (ocpDate != null) + { + if (_httpRequest.Headers.Contains("ocp-date")) + { + _httpRequest.Headers.Remove("ocp-date"); + } + _httpRequest.Headers.TryAddWithoutValidation("ocp-date", SafeJsonConvert.SerializeObject(ocpDate, new DateTimeRfc1123JsonConverter()).Trim('"')); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new BatchErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + BatchError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse,ComputeNodeExtensionListHeaders>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/ComputeNodeExtensionOperationsExtensions.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/ComputeNodeExtensionOperationsExtensions.cs new file mode 100644 index 000000000000..0b52cb949910 --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/ComputeNodeExtensionOperationsExtensions.cs @@ -0,0 +1,165 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Batch.Protocol +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ComputeNodeExtensionOperations. + /// + public static partial class ComputeNodeExtensionOperationsExtensions + { + /// + /// Gets information about the specified Compute Node Extension. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The ID of the Pool that contains the Compute Node. + /// + /// + /// The ID of the Compute Node that contains the extensions. + /// + /// + /// The name of the of the Compute Node Extension that you want to get + /// information about. + /// + /// + /// Additional parameters for the operation + /// + public static NodeVMExtension Get(this IComputeNodeExtensionOperations operations, string poolId, string nodeId, string extensionName, ComputeNodeExtensionGetOptions computeNodeExtensionGetOptions = default(ComputeNodeExtensionGetOptions)) + { + return operations.GetAsync(poolId, nodeId, extensionName, computeNodeExtensionGetOptions).GetAwaiter().GetResult(); + } + + /// + /// Gets information about the specified Compute Node Extension. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The ID of the Pool that contains the Compute Node. + /// + /// + /// The ID of the Compute Node that contains the extensions. + /// + /// + /// The name of the of the Compute Node Extension that you want to get + /// information about. + /// + /// + /// Additional parameters for the operation + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IComputeNodeExtensionOperations operations, string poolId, string nodeId, string extensionName, ComputeNodeExtensionGetOptions computeNodeExtensionGetOptions = default(ComputeNodeExtensionGetOptions), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(poolId, nodeId, extensionName, computeNodeExtensionGetOptions, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists the Compute Nodes Extensions in the specified Pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The ID of the Pool that contains Compute Node. + /// + /// + /// The ID of the Compute Node that you want to list extensions. + /// + /// + /// Additional parameters for the operation + /// + public static IPage List(this IComputeNodeExtensionOperations operations, string poolId, string nodeId, ComputeNodeExtensionListOptions computeNodeExtensionListOptions = default(ComputeNodeExtensionListOptions)) + { + return operations.ListAsync(poolId, nodeId, computeNodeExtensionListOptions).GetAwaiter().GetResult(); + } + + /// + /// Lists the Compute Nodes Extensions in the specified Pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The ID of the Pool that contains Compute Node. + /// + /// + /// The ID of the Compute Node that you want to list extensions. + /// + /// + /// Additional parameters for the operation + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IComputeNodeExtensionOperations operations, string poolId, string nodeId, ComputeNodeExtensionListOptions computeNodeExtensionListOptions = default(ComputeNodeExtensionListOptions), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(poolId, nodeId, computeNodeExtensionListOptions, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists the Compute Nodes Extensions in the specified Pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Additional parameters for the operation + /// + public static IPage ListNext(this IComputeNodeExtensionOperations operations, string nextPageLink, ComputeNodeExtensionListNextOptions computeNodeExtensionListNextOptions = default(ComputeNodeExtensionListNextOptions)) + { + return operations.ListNextAsync(nextPageLink, computeNodeExtensionListNextOptions).GetAwaiter().GetResult(); + } + + /// + /// Lists the Compute Nodes Extensions in the specified Pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Additional parameters for the operation + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IComputeNodeExtensionOperations operations, string nextPageLink, ComputeNodeExtensionListNextOptions computeNodeExtensionListNextOptions = default(ComputeNodeExtensionListNextOptions), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, computeNodeExtensionListNextOptions, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/IAccountOperations.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/IAccountOperations.cs index db2c390c71a1..ef15b2f3f20a 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/IAccountOperations.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/IAccountOperations.cs @@ -48,6 +48,8 @@ public partial interface IAccountOperations Task,AccountListSupportedImagesHeaders>> ListSupportedImagesWithHttpMessagesAsync(AccountListSupportedImagesOptions accountListSupportedImagesOptions = default(AccountListSupportedImagesOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// 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. /// /// /// Additional parameters for the operation @@ -96,6 +98,8 @@ public partial interface IAccountOperations Task,AccountListSupportedImagesHeaders>> ListSupportedImagesNextWithHttpMessagesAsync(string nextPageLink, AccountListSupportedImagesNextOptions accountListSupportedImagesNextOptions = default(AccountListSupportedImagesNextOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// 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. /// /// /// The NextLink from the previous successful call to List operation. diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/IBatchServiceClient.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/IBatchServiceClient.cs index f84bee902fad..864078ec6415 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/IBatchServiceClient.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/IBatchServiceClient.cs @@ -113,5 +113,10 @@ public partial interface IBatchServiceClient : System.IDisposable /// IComputeNodeOperations ComputeNode { get; } + /// + /// Gets the IComputeNodeExtensionOperations. + /// + IComputeNodeExtensionOperations ComputeNodeExtension { get; } + } } diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/IComputeNodeExtensionOperations.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/IComputeNodeExtensionOperations.cs new file mode 100644 index 000000000000..b085c042aae0 --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/IComputeNodeExtensionOperations.cs @@ -0,0 +1,112 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Batch.Protocol +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ComputeNodeExtensionOperations operations. + /// + public partial interface IComputeNodeExtensionOperations + { + /// + /// Gets information about the specified Compute Node Extension. + /// + /// + /// The ID of the Pool that contains the Compute Node. + /// + /// + /// The ID of the Compute Node that contains the extensions. + /// + /// + /// The name of the of the Compute Node Extension that you want to get + /// information about. + /// + /// + /// Additional parameters for the operation + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string poolId, string nodeId, string extensionName, ComputeNodeExtensionGetOptions computeNodeExtensionGetOptions = default(ComputeNodeExtensionGetOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists the Compute Nodes Extensions in the specified Pool. + /// + /// + /// The ID of the Pool that contains Compute Node. + /// + /// + /// The ID of the Compute Node that you want to list extensions. + /// + /// + /// Additional parameters for the operation + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task,ComputeNodeExtensionListHeaders>> ListWithHttpMessagesAsync(string poolId, string nodeId, ComputeNodeExtensionListOptions computeNodeExtensionListOptions = default(ComputeNodeExtensionListOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists the Compute Nodes Extensions in the specified Pool. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Additional parameters for the operation + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task,ComputeNodeExtensionListHeaders>> ListNextWithHttpMessagesAsync(string nextPageLink, ComputeNodeExtensionListNextOptions computeNodeExtensionListNextOptions = default(ComputeNodeExtensionListNextOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/IJobOperations.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/IJobOperations.cs index 549427f422be..45bffafc2364 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/IJobOperations.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/IJobOperations.cs @@ -402,7 +402,9 @@ public partial interface IJobOperations /// /// 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. + /// 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. /// /// /// The ID of the Job. diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/IPoolOperations.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/IPoolOperations.cs index 6f562dfc7adf..9d5a35ca1729 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/IPoolOperations.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/IPoolOperations.cs @@ -454,7 +454,7 @@ public partial interface IPoolOperations /// /// This operation can only run when the allocation state of the Pool /// is steady. When this operation runs, the allocation state changes - /// from steady to resizing. + /// from steady to resizing. Each request may remove up to 100 nodes. /// /// /// The ID of the Pool from which you want to remove Compute Nodes. diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/JobOperations.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/JobOperations.cs index d7f79489fd66..4a528d970ba4 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/JobOperations.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/JobOperations.cs @@ -3552,7 +3552,8 @@ internal JobOperations(BatchServiceClient client) /// /// 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. + /// 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. /// /// /// The ID of the Job. diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/JobOperationsExtensions.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/JobOperationsExtensions.cs index c33a0484dd71..674b0291227c 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/JobOperationsExtensions.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/JobOperationsExtensions.cs @@ -673,7 +673,8 @@ public static partial class JobOperationsExtensions /// /// 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. + /// 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. /// /// /// The operations group for this extension method. @@ -695,7 +696,8 @@ public static partial class JobOperationsExtensions /// /// 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. + /// 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. /// /// /// The operations group for this extension method. diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/AzureBlobFileSystemConfiguration.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/AzureBlobFileSystemConfiguration.cs index b3cb8432f58e..ce9f5ea48204 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/AzureBlobFileSystemConfiguration.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/AzureBlobFileSystemConfiguration.cs @@ -41,7 +41,9 @@ public AzureBlobFileSystemConfiguration() /// The Azure Storage SAS token. /// Additional command line options to /// pass to the mount command. - public AzureBlobFileSystemConfiguration(string accountName, string containerName, string relativeMountPath, string accountKey = default(string), string sasKey = default(string), string blobfuseOptions = default(string)) + /// The reference to the user assigned + /// identity to use to access containerName + public AzureBlobFileSystemConfiguration(string accountName, string containerName, string relativeMountPath, string accountKey = default(string), string sasKey = default(string), string blobfuseOptions = default(string), ComputeNodeIdentityReference identityReference = default(ComputeNodeIdentityReference)) { AccountName = accountName; ContainerName = containerName; @@ -49,6 +51,7 @@ public AzureBlobFileSystemConfiguration() SasKey = sasKey; BlobfuseOptions = blobfuseOptions; RelativeMountPath = relativeMountPath; + IdentityReference = identityReference; CustomInit(); } @@ -73,8 +76,8 @@ public AzureBlobFileSystemConfiguration() /// Gets or sets the Azure Storage Account key. /// /// - /// This property is mutually exclusive with sasKey and one must be - /// specified. + /// This property is mutually exclusive with both sasKey and identity; + /// exactly one must be specified. /// [JsonProperty(PropertyName = "accountKey")] public string AccountKey { get; set; } @@ -83,8 +86,8 @@ public AzureBlobFileSystemConfiguration() /// Gets or sets the Azure Storage SAS token. /// /// - /// This property is mutually exclusive with accountKey and one must be - /// specified. + /// This property is mutually exclusive with both accountKey and + /// identity; exactly one must be specified. /// [JsonProperty(PropertyName = "sasKey")] public string SasKey { get; set; } @@ -112,5 +115,16 @@ public AzureBlobFileSystemConfiguration() [JsonProperty(PropertyName = "relativeMountPath")] public string RelativeMountPath { get; set; } + /// + /// Gets or sets the reference to the user assigned identity to use to + /// access containerName + /// + /// + /// This property is mutually exclusive with both accountKey and + /// sasKey; exactly one must be specified. + /// + [JsonProperty(PropertyName = "identityReference")] + public ComputeNodeIdentityReference IdentityReference { get; set; } + } } diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/BatchPoolIdentity.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/BatchPoolIdentity.cs new file mode 100644 index 000000000000..5c97f6f87cdd --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/BatchPoolIdentity.cs @@ -0,0 +1,79 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Batch.Protocol.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The identity of the Batch pool, if configured. + /// + /// + /// The identity of the Batch pool, if configured. + /// + public partial class BatchPoolIdentity + { + /// + /// Initializes a new instance of the BatchPoolIdentity class. + /// + public BatchPoolIdentity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BatchPoolIdentity class. + /// + /// The identity of the Batch pool, if + /// configured. + /// The list of user identities + /// associated with the Batch account. + public BatchPoolIdentity(PoolIdentityType type, IList userAssignedIdentities = default(IList)) + { + Type = type; + UserAssignedIdentities = userAssignedIdentities; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the identity of the Batch pool, if configured. + /// + /// + /// The list of user identities associated with the Batch pool. The + /// user identity dictionary key references will be ARM resource ids in + /// the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// Possible values include: 'UserAssigned', 'None' + /// + [JsonProperty(PropertyName = "type")] + public PoolIdentityType Type { get; set; } + + /// + /// Gets or sets the list of user identities associated with the Batch + /// account. + /// + /// + /// The user identity dictionary key references will be ARM resource + /// ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// + [JsonProperty(PropertyName = "userAssignedIdentities")] + public IList UserAssignedIdentities { get; set; } + + } +} diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/CloudJob.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/CloudJob.cs index 350c67da94d6..990947900750 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/CloudJob.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/CloudJob.cs @@ -48,6 +48,8 @@ public CloudJob() /// The time at which the Job /// entered its previous state. /// The priority of the Job. + /// The maximum number of tasks that can + /// be executed in parallel for the job. /// The execution constraints for the /// Job. /// Details of a Job Manager Task to be @@ -73,7 +75,7 @@ public CloudJob() /// Job. /// Resource usage statistics for the entire /// lifetime of the Job. - public CloudJob(string id = default(string), string displayName = default(string), bool? usesTaskDependencies = default(bool?), string url = default(string), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), System.DateTime? creationTime = default(System.DateTime?), JobState? state = default(JobState?), System.DateTime? stateTransitionTime = default(System.DateTime?), JobState? previousState = default(JobState?), System.DateTime? previousStateTransitionTime = default(System.DateTime?), int? priority = default(int?), JobConstraints constraints = default(JobConstraints), JobManagerTask jobManagerTask = default(JobManagerTask), JobPreparationTask jobPreparationTask = default(JobPreparationTask), JobReleaseTask jobReleaseTask = default(JobReleaseTask), IList commonEnvironmentSettings = default(IList), PoolInformation poolInfo = default(PoolInformation), OnAllTasksComplete? onAllTasksComplete = default(OnAllTasksComplete?), OnTaskFailure? onTaskFailure = default(OnTaskFailure?), JobNetworkConfiguration networkConfiguration = default(JobNetworkConfiguration), IList metadata = default(IList), JobExecutionInformation executionInfo = default(JobExecutionInformation), JobStatistics stats = default(JobStatistics)) + public CloudJob(string id = default(string), string displayName = default(string), bool? usesTaskDependencies = default(bool?), string url = default(string), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), System.DateTime? creationTime = default(System.DateTime?), JobState? state = default(JobState?), System.DateTime? stateTransitionTime = default(System.DateTime?), JobState? previousState = default(JobState?), System.DateTime? previousStateTransitionTime = default(System.DateTime?), int? priority = default(int?), int? maxParallelTasks = default(int?), JobConstraints constraints = default(JobConstraints), JobManagerTask jobManagerTask = default(JobManagerTask), JobPreparationTask jobPreparationTask = default(JobPreparationTask), JobReleaseTask jobReleaseTask = default(JobReleaseTask), IList commonEnvironmentSettings = default(IList), PoolInformation poolInfo = default(PoolInformation), OnAllTasksComplete? onAllTasksComplete = default(OnAllTasksComplete?), OnTaskFailure? onTaskFailure = default(OnTaskFailure?), JobNetworkConfiguration networkConfiguration = default(JobNetworkConfiguration), IList metadata = default(IList), JobExecutionInformation executionInfo = default(JobExecutionInformation), JobStatistics stats = default(JobStatistics)) { Id = id; DisplayName = displayName; @@ -87,6 +89,7 @@ public CloudJob() PreviousState = previousState; PreviousStateTransitionTime = previousStateTransitionTime; Priority = priority; + MaxParallelTasks = maxParallelTasks; Constraints = constraints; JobManagerTask = jobManagerTask; JobPreparationTask = jobPreparationTask; @@ -213,6 +216,20 @@ public CloudJob() [JsonProperty(PropertyName = "priority")] public int? Priority { get; set; } + /// + /// Gets or sets 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. + /// + [JsonProperty(PropertyName = "maxParallelTasks")] + public int? MaxParallelTasks { get; set; } + /// /// Gets or sets the execution constraints for the Job. /// diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/CloudPool.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/CloudPool.cs index 991a894e9938..91eec9334f14 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/CloudPool.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/CloudPool.cs @@ -98,7 +98,9 @@ public CloudPool() /// the entire lifetime of the Pool. /// A list of file systems to mount on /// each node in the pool. - public CloudPool(string id = default(string), string displayName = default(string), string url = default(string), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), System.DateTime? creationTime = default(System.DateTime?), PoolState? state = default(PoolState?), System.DateTime? stateTransitionTime = default(System.DateTime?), AllocationState? allocationState = default(AllocationState?), System.DateTime? allocationStateTransitionTime = default(System.DateTime?), string vmSize = default(string), CloudServiceConfiguration cloudServiceConfiguration = default(CloudServiceConfiguration), VirtualMachineConfiguration virtualMachineConfiguration = default(VirtualMachineConfiguration), System.TimeSpan? resizeTimeout = default(System.TimeSpan?), IList resizeErrors = default(IList), int? currentDedicatedNodes = default(int?), int? currentLowPriorityNodes = default(int?), int? targetDedicatedNodes = default(int?), int? targetLowPriorityNodes = default(int?), bool? enableAutoScale = default(bool?), string autoScaleFormula = default(string), System.TimeSpan? autoScaleEvaluationInterval = default(System.TimeSpan?), AutoScaleRun autoScaleRun = default(AutoScaleRun), bool? enableInterNodeCommunication = default(bool?), NetworkConfiguration networkConfiguration = default(NetworkConfiguration), StartTask startTask = default(StartTask), IList certificateReferences = default(IList), IList applicationPackageReferences = default(IList), IList applicationLicenses = default(IList), int? taskSlotsPerNode = default(int?), TaskSchedulingPolicy taskSchedulingPolicy = default(TaskSchedulingPolicy), IList userAccounts = default(IList), IList metadata = default(IList), PoolStatistics stats = default(PoolStatistics), IList mountConfiguration = default(IList)) + /// The identity of the Batch pool, if + /// configured. + public CloudPool(string id = default(string), string displayName = default(string), string url = default(string), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?), System.DateTime? creationTime = default(System.DateTime?), PoolState? state = default(PoolState?), System.DateTime? stateTransitionTime = default(System.DateTime?), AllocationState? allocationState = default(AllocationState?), System.DateTime? allocationStateTransitionTime = default(System.DateTime?), string vmSize = default(string), CloudServiceConfiguration cloudServiceConfiguration = default(CloudServiceConfiguration), VirtualMachineConfiguration virtualMachineConfiguration = default(VirtualMachineConfiguration), System.TimeSpan? resizeTimeout = default(System.TimeSpan?), IList resizeErrors = default(IList), int? currentDedicatedNodes = default(int?), int? currentLowPriorityNodes = default(int?), int? targetDedicatedNodes = default(int?), int? targetLowPriorityNodes = default(int?), bool? enableAutoScale = default(bool?), string autoScaleFormula = default(string), System.TimeSpan? autoScaleEvaluationInterval = default(System.TimeSpan?), AutoScaleRun autoScaleRun = default(AutoScaleRun), bool? enableInterNodeCommunication = default(bool?), NetworkConfiguration networkConfiguration = default(NetworkConfiguration), StartTask startTask = default(StartTask), IList certificateReferences = default(IList), IList applicationPackageReferences = default(IList), IList applicationLicenses = default(IList), int? taskSlotsPerNode = default(int?), TaskSchedulingPolicy taskSchedulingPolicy = default(TaskSchedulingPolicy), IList userAccounts = default(IList), IList metadata = default(IList), PoolStatistics stats = default(PoolStatistics), IList mountConfiguration = default(IList), BatchPoolIdentity identity = default(BatchPoolIdentity)) { Id = id; DisplayName = displayName; @@ -135,6 +137,7 @@ public CloudPool() Metadata = metadata; Stats = stats; MountConfiguration = mountConfiguration; + Identity = identity; CustomInit(); } @@ -303,7 +306,7 @@ public CloudPool() /// the Pool. /// /// - /// Low-priority Compute Nodes which have been preempted are included + /// low-priority Compute Nodes which have been preempted are included /// in this count. /// [JsonProperty(PropertyName = "currentLowPriorityNodes")] @@ -328,7 +331,7 @@ public CloudPool() /// time. /// /// - /// If false, at least one of targetDedicateNodes and + /// 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. @@ -496,5 +499,17 @@ public CloudPool() [JsonProperty(PropertyName = "mountConfiguration")] public IList MountConfiguration { get; set; } + /// + /// Gets or sets the identity of the Batch pool, if configured. + /// + /// + /// The list of user identities associated with the Batch pool. The + /// user identity dictionary key references will be ARM resource ids in + /// the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// + [JsonProperty(PropertyName = "identity")] + public BatchPoolIdentity Identity { get; set; } + } } diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/CloudTask.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/CloudTask.cs index 1c9bb5ba31e9..53ccde178929 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/CloudTask.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/CloudTask.cs @@ -76,7 +76,7 @@ public CloudTask() /// The execution constraints that apply to /// this Task. /// The number of scheduling slots that the - /// Task required to run. + /// Task requires to run. /// The user identity under which the Task /// runs. /// Information about the execution of the @@ -315,7 +315,7 @@ public CloudTask() public TaskConstraints Constraints { get; set; } /// - /// Gets or sets the number of scheduling slots that the Task required + /// Gets or sets the number of scheduling slots that the Task requires /// to run. /// /// diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/ComputeNode.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/ComputeNode.cs index 7b6a7766100b..ba7921499592 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/ComputeNode.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/ComputeNode.cs @@ -82,7 +82,9 @@ public ComputeNode() /// Information about the Compute Node /// agent version and the time the Compute Node upgraded to a new /// version. - public ComputeNode(string id = default(string), string url = default(string), ComputeNodeState? state = default(ComputeNodeState?), SchedulingState? schedulingState = default(SchedulingState?), System.DateTime? stateTransitionTime = default(System.DateTime?), System.DateTime? lastBootTime = default(System.DateTime?), System.DateTime? allocationTime = default(System.DateTime?), string ipAddress = default(string), string affinityId = default(string), string vmSize = default(string), int? totalTasksRun = default(int?), int? runningTasksCount = default(int?), int? runningTaskSlotsCount = default(int?), int? totalTasksSucceeded = default(int?), IList recentTasks = default(IList), StartTask startTask = default(StartTask), StartTaskInformation startTaskInfo = default(StartTaskInformation), IList certificateReferences = default(IList), IList errors = default(IList), bool? isDedicated = default(bool?), ComputeNodeEndpointConfiguration endpointConfiguration = default(ComputeNodeEndpointConfiguration), NodeAgentInformation nodeAgentInfo = default(NodeAgentInformation)) + /// Info about the current state of + /// the virtual machine. + public ComputeNode(string id = default(string), string url = default(string), ComputeNodeState? state = default(ComputeNodeState?), SchedulingState? schedulingState = default(SchedulingState?), System.DateTime? stateTransitionTime = default(System.DateTime?), System.DateTime? lastBootTime = default(System.DateTime?), System.DateTime? allocationTime = default(System.DateTime?), string ipAddress = default(string), string affinityId = default(string), string vmSize = default(string), int? totalTasksRun = default(int?), int? runningTasksCount = default(int?), int? runningTaskSlotsCount = default(int?), int? totalTasksSucceeded = default(int?), IList recentTasks = default(IList), StartTask startTask = default(StartTask), StartTaskInformation startTaskInfo = default(StartTaskInformation), IList certificateReferences = default(IList), IList errors = default(IList), bool? isDedicated = default(bool?), ComputeNodeEndpointConfiguration endpointConfiguration = default(ComputeNodeEndpointConfiguration), NodeAgentInformation nodeAgentInfo = default(NodeAgentInformation), VirtualMachineInfo virtualMachineInfo = default(VirtualMachineInfo)) { Id = id; Url = url; @@ -106,6 +108,7 @@ public ComputeNode() IsDedicated = isDedicated; EndpointConfiguration = endpointConfiguration; NodeAgentInfo = nodeAgentInfo; + VirtualMachineInfo = virtualMachineInfo; CustomInit(); } @@ -325,5 +328,11 @@ public ComputeNode() [JsonProperty(PropertyName = "nodeAgentInfo")] public NodeAgentInformation NodeAgentInfo { get; set; } + /// + /// Gets or sets info about the current state of the virtual machine. + /// + [JsonProperty(PropertyName = "virtualMachineInfo")] + public VirtualMachineInfo VirtualMachineInfo { get; set; } + } } diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/ComputeNodeExtensionGetHeaders.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/ComputeNodeExtensionGetHeaders.cs new file mode 100644 index 000000000000..39ffa311871f --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/ComputeNodeExtensionGetHeaders.cs @@ -0,0 +1,105 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Batch.Protocol.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for Get operation. + /// + public partial class ComputeNodeExtensionGetHeaders + { + /// + /// Initializes a new instance of the ComputeNodeExtensionGetHeaders + /// class. + /// + public ComputeNodeExtensionGetHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ComputeNodeExtensionGetHeaders + /// class. + /// + /// The client-request-id provided by the + /// client during the request. This will be returned only if the + /// return-client-request-id parameter was set to true. + /// A unique identifier for the request that + /// was made to the Batch service. If a request is consistently failing + /// and you have verified that the request is properly formulated, you + /// may use this value to report the error to Microsoft. In your + /// report, include the value of this request ID, the approximate time + /// that the request was made, the Batch Account against which the + /// request was made, and the region that Account resides in. + /// The ETag HTTP response header. This is an opaque + /// string. You can use it to detect whether the resource has changed + /// between requests. In particular, you can pass the ETag to one of + /// the If-Modified-Since, If-Unmodified-Since, If-Match or + /// If-None-Match headers. + /// The time at which the resource was last + /// modified. + public ComputeNodeExtensionGetHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?)) + { + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the client-request-id provided by the client during + /// the request. This will be returned only if the + /// return-client-request-id parameter was set to true. + /// + [JsonProperty(PropertyName = "client-request-id")] + public System.Guid? ClientRequestId { get; set; } + + /// + /// Gets or sets a unique identifier for the request that was made to + /// the Batch service. If a request is consistently failing and you + /// have verified that the request is properly formulated, you may use + /// this value to report the error to Microsoft. In your report, + /// include the value of this request ID, the approximate time that the + /// request was made, the Batch Account against which the request was + /// made, and the region that Account resides in. + /// + [JsonProperty(PropertyName = "request-id")] + public System.Guid? RequestId { get; set; } + + /// + /// Gets or sets the ETag HTTP response header. This is an opaque + /// string. You can use it to detect whether the resource has changed + /// between requests. In particular, you can pass the ETag to one of + /// the If-Modified-Since, If-Unmodified-Since, If-Match or + /// If-None-Match headers. + /// + [JsonProperty(PropertyName = "ETag")] + public string ETag { get; set; } + + /// + /// Gets or sets the time at which the resource was last modified. + /// + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] + public System.DateTime? LastModified { get; set; } + + } +} diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/ComputeNodeExtensionGetOptions.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/ComputeNodeExtensionGetOptions.cs new file mode 100644 index 000000000000..d6aa974045a0 --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/ComputeNodeExtensionGetOptions.cs @@ -0,0 +1,101 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Batch.Protocol.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Additional parameters for Get operation. + /// + public partial class ComputeNodeExtensionGetOptions + { + /// + /// Initializes a new instance of the ComputeNodeExtensionGetOptions + /// class. + /// + public ComputeNodeExtensionGetOptions() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ComputeNodeExtensionGetOptions + /// class. + /// + /// An OData $select clause. + /// The maximum time that the server can spend + /// processing the request, in seconds. The default is 30 + /// seconds. + /// The caller-generated request + /// identity, in the form of a GUID with no decoration such as curly + /// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. + /// Whether the server should + /// return the client-request-id in the response. + /// The time the request was issued. Client + /// libraries typically set this to the current system clock time; set + /// it explicitly if you are calling the REST API directly. + public ComputeNodeExtensionGetOptions(string select = default(string), int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) + { + Select = select; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets an OData $select clause. + /// + [Newtonsoft.Json.JsonIgnore] + public string Select { get; set; } + + /// + /// Gets or sets the maximum time that the server can spend processing + /// the request, in seconds. The default is 30 seconds. + /// + [Newtonsoft.Json.JsonIgnore] + public int? Timeout { get; set; } + + /// + /// Gets or sets the caller-generated request identity, in the form of + /// a GUID with no decoration such as curly braces, e.g. + /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. + /// + [Newtonsoft.Json.JsonIgnore] + public System.Guid? ClientRequestId { get; set; } + + /// + /// Gets or sets whether the server should return the client-request-id + /// in the response. + /// + [Newtonsoft.Json.JsonIgnore] + public bool? ReturnClientRequestId { get; set; } + + /// + /// Gets or sets the time the request was issued. Client libraries + /// typically set this to the current system clock time; set it + /// explicitly if you are calling the REST API directly. + /// + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [Newtonsoft.Json.JsonIgnore] + public System.DateTime? OcpDate { get; set; } + + } +} diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/ComputeNodeExtensionListHeaders.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/ComputeNodeExtensionListHeaders.cs new file mode 100644 index 000000000000..67c4a5d817cb --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/ComputeNodeExtensionListHeaders.cs @@ -0,0 +1,105 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Batch.Protocol.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for List operation. + /// + public partial class ComputeNodeExtensionListHeaders + { + /// + /// Initializes a new instance of the ComputeNodeExtensionListHeaders + /// class. + /// + public ComputeNodeExtensionListHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ComputeNodeExtensionListHeaders + /// class. + /// + /// The client-request-id provided by the + /// client during the request. This will be returned only if the + /// return-client-request-id parameter was set to true. + /// A unique identifier for the request that + /// was made to the Batch service. If a request is consistently failing + /// and you have verified that the request is properly formulated, you + /// may use this value to report the error to Microsoft. In your + /// report, include the value of this request ID, the approximate time + /// that the request was made, the Batch Account against which the + /// request was made, and the region that Account resides in. + /// The ETag HTTP response header. This is an opaque + /// string. You can use it to detect whether the resource has changed + /// between requests. In particular, you can pass the ETag to one of + /// the If-Modified-Since, If-Unmodified-Since, If-Match or + /// If-None-Match headers. + /// The time at which the resource was last + /// modified. + public ComputeNodeExtensionListHeaders(System.Guid? clientRequestId = default(System.Guid?), System.Guid? requestId = default(System.Guid?), string eTag = default(string), System.DateTime? lastModified = default(System.DateTime?)) + { + ClientRequestId = clientRequestId; + RequestId = requestId; + ETag = eTag; + LastModified = lastModified; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the client-request-id provided by the client during + /// the request. This will be returned only if the + /// return-client-request-id parameter was set to true. + /// + [JsonProperty(PropertyName = "client-request-id")] + public System.Guid? ClientRequestId { get; set; } + + /// + /// Gets or sets a unique identifier for the request that was made to + /// the Batch service. If a request is consistently failing and you + /// have verified that the request is properly formulated, you may use + /// this value to report the error to Microsoft. In your report, + /// include the value of this request ID, the approximate time that the + /// request was made, the Batch Account against which the request was + /// made, and the region that Account resides in. + /// + [JsonProperty(PropertyName = "request-id")] + public System.Guid? RequestId { get; set; } + + /// + /// Gets or sets the ETag HTTP response header. This is an opaque + /// string. You can use it to detect whether the resource has changed + /// between requests. In particular, you can pass the ETag to one of + /// the If-Modified-Since, If-Unmodified-Since, If-Match or + /// If-None-Match headers. + /// + [JsonProperty(PropertyName = "ETag")] + public string ETag { get; set; } + + /// + /// Gets or sets the time at which the resource was last modified. + /// + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "Last-Modified")] + public System.DateTime? LastModified { get; set; } + + } +} diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/ComputeNodeExtensionListNextOptions.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/ComputeNodeExtensionListNextOptions.cs new file mode 100644 index 000000000000..9cdbf019e33b --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/ComputeNodeExtensionListNextOptions.cs @@ -0,0 +1,82 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Batch.Protocol.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Additional parameters for ListNext operation. + /// + public partial class ComputeNodeExtensionListNextOptions + { + /// + /// Initializes a new instance of the + /// ComputeNodeExtensionListNextOptions class. + /// + public ComputeNodeExtensionListNextOptions() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ComputeNodeExtensionListNextOptions class. + /// + /// The caller-generated request + /// identity, in the form of a GUID with no decoration such as curly + /// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. + /// Whether the server should + /// return the client-request-id in the response. + /// The time the request was issued. Client + /// libraries typically set this to the current system clock time; set + /// it explicitly if you are calling the REST API directly. + public ComputeNodeExtensionListNextOptions(System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) + { + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the caller-generated request identity, in the form of + /// a GUID with no decoration such as curly braces, e.g. + /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. + /// + [Newtonsoft.Json.JsonIgnore] + public System.Guid? ClientRequestId { get; set; } + + /// + /// Gets or sets whether the server should return the client-request-id + /// in the response. + /// + [Newtonsoft.Json.JsonIgnore] + public bool? ReturnClientRequestId { get; set; } + + /// + /// Gets or sets the time the request was issued. Client libraries + /// typically set this to the current system clock time; set it + /// explicitly if you are calling the REST API directly. + /// + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [Newtonsoft.Json.JsonIgnore] + public System.DateTime? OcpDate { get; set; } + + } +} diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/ComputeNodeExtensionListOptions.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/ComputeNodeExtensionListOptions.cs new file mode 100644 index 000000000000..5d5485384e2b --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/ComputeNodeExtensionListOptions.cs @@ -0,0 +1,112 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Batch.Protocol.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Additional parameters for List operation. + /// + public partial class ComputeNodeExtensionListOptions + { + /// + /// Initializes a new instance of the ComputeNodeExtensionListOptions + /// class. + /// + public ComputeNodeExtensionListOptions() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ComputeNodeExtensionListOptions + /// class. + /// + /// An OData $select clause. + /// The maximum number of items to return in + /// the response. A maximum of 1000 Compute Nodes can be + /// returned. + /// The maximum time that the server can spend + /// processing the request, in seconds. The default is 30 + /// seconds. + /// The caller-generated request + /// identity, in the form of a GUID with no decoration such as curly + /// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. + /// Whether the server should + /// return the client-request-id in the response. + /// The time the request was issued. Client + /// libraries typically set this to the current system clock time; set + /// it explicitly if you are calling the REST API directly. + public ComputeNodeExtensionListOptions(string select = default(string), int? maxResults = default(int?), int? timeout = default(int?), System.Guid? clientRequestId = default(System.Guid?), bool? returnClientRequestId = default(bool?), System.DateTime? ocpDate = default(System.DateTime?)) + { + Select = select; + MaxResults = maxResults; + Timeout = timeout; + ClientRequestId = clientRequestId; + ReturnClientRequestId = returnClientRequestId; + OcpDate = ocpDate; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets an OData $select clause. + /// + [Newtonsoft.Json.JsonIgnore] + public string Select { get; set; } + + /// + /// Gets or sets the maximum number of items to return in the response. + /// A maximum of 1000 Compute Nodes can be returned. + /// + [Newtonsoft.Json.JsonIgnore] + public int? MaxResults { get; set; } + + /// + /// Gets or sets the maximum time that the server can spend processing + /// the request, in seconds. The default is 30 seconds. + /// + [Newtonsoft.Json.JsonIgnore] + public int? Timeout { get; set; } + + /// + /// Gets or sets the caller-generated request identity, in the form of + /// a GUID with no decoration such as curly braces, e.g. + /// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. + /// + [Newtonsoft.Json.JsonIgnore] + public System.Guid? ClientRequestId { get; set; } + + /// + /// Gets or sets whether the server should return the client-request-id + /// in the response. + /// + [Newtonsoft.Json.JsonIgnore] + public bool? ReturnClientRequestId { get; set; } + + /// + /// Gets or sets the time the request was issued. Client libraries + /// typically set this to the current system clock time; set it + /// explicitly if you are calling the REST API directly. + /// + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [Newtonsoft.Json.JsonIgnore] + public System.DateTime? OcpDate { get; set; } + + } +} diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/ComputeNodeIdentityReference.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/ComputeNodeIdentityReference.cs new file mode 100644 index 000000000000..6811395551c5 --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/ComputeNodeIdentityReference.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Batch.Protocol.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The reference to a user assigned identity associated with the Batch + /// pool which a compute node will use. + /// + public partial class ComputeNodeIdentityReference + { + /// + /// Initializes a new instance of the ComputeNodeIdentityReference + /// class. + /// + public ComputeNodeIdentityReference() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ComputeNodeIdentityReference + /// class. + /// + /// The ARM resource id of the user assigned + /// identity. + public ComputeNodeIdentityReference(string resourceId = default(string)) + { + ResourceId = resourceId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the ARM resource id of the user assigned identity. + /// + [JsonProperty(PropertyName = "resourceId")] + public string ResourceId { get; set; } + + } +} diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/ContainerRegistry.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/ContainerRegistry.cs index 78a1c6f9ca1e..0cb1a007da6e 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/ContainerRegistry.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/ContainerRegistry.cs @@ -34,11 +34,15 @@ public ContainerRegistry() /// The password to log into the registry /// server. /// The registry URL. - public ContainerRegistry(string userName, string password, string registryServer = default(string)) + /// The reference to the user assigned + /// identity to use to access an Azure Container Registry instead of + /// username and password. + public ContainerRegistry(string userName = default(string), string password = default(string), string registryServer = default(string), ComputeNodeIdentityReference identityReference = default(ComputeNodeIdentityReference)) { - RegistryServer = registryServer; UserName = userName; Password = password; + RegistryServer = registryServer; + IdentityReference = identityReference; CustomInit(); } @@ -47,15 +51,6 @@ public ContainerRegistry() /// partial void CustomInit(); - /// - /// Gets or sets the registry URL. - /// - /// - /// If omitted, the default is "docker.io". - /// - [JsonProperty(PropertyName = "registryServer")] - public string RegistryServer { get; set; } - /// /// Gets or sets the user name to log into the registry server. /// @@ -68,5 +63,22 @@ public ContainerRegistry() [JsonProperty(PropertyName = "password")] public string Password { get; set; } + /// + /// Gets or sets the registry URL. + /// + /// + /// If omitted, the default is "docker.io". + /// + [JsonProperty(PropertyName = "registryServer")] + public string RegistryServer { get; set; } + + /// + /// Gets or sets the reference to the user assigned identity to use to + /// access an Azure Container Registry instead of username and + /// password. + /// + [JsonProperty(PropertyName = "identityReference")] + public ComputeNodeIdentityReference IdentityReference { get; set; } + } } diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/DiffDiskPlacement.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/DiffDiskPlacement.cs new file mode 100644 index 000000000000..7c7b872350da --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/DiffDiskPlacement.cs @@ -0,0 +1,57 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Batch.Protocol.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for DiffDiskPlacement. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum DiffDiskPlacement + { + /// + /// The Ephemeral OS Disk is stored on the VM cache. + /// + [EnumMember(Value = "CacheDisk")] + CacheDisk + } + internal static class DiffDiskPlacementEnumExtension + { + internal static string ToSerializedValue(this DiffDiskPlacement? value) + { + return value == null ? null : ((DiffDiskPlacement)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this DiffDiskPlacement value) + { + switch( value ) + { + case DiffDiskPlacement.CacheDisk: + return "CacheDisk"; + } + return null; + } + + internal static DiffDiskPlacement? ParseDiffDiskPlacement(this string value) + { + switch( value ) + { + case "CacheDisk": + return DiffDiskPlacement.CacheDisk; + } + return null; + } + } +} diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/DiffDiskSettings.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/DiffDiskSettings.cs new file mode 100644 index 000000000000..0ddfc250280c --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/DiffDiskSettings.cs @@ -0,0 +1,64 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Batch.Protocol.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Specifies the ephemeral Disk Settings for the operating system disk + /// used by the compute node (VM). + /// + public partial class DiffDiskSettings + { + /// + /// Initializes a new instance of the DiffDiskSettings class. + /// + public DiffDiskSettings() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DiffDiskSettings class. + /// + /// Specifies the ephemeral disk placement for + /// operating system disk for all VMs in the pool. + public DiffDiskSettings(DiffDiskPlacement? placement = default(DiffDiskPlacement?)) + { + Placement = placement; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets 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://docs.microsoft.com/en-us/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements + /// and Linux VMs at + /// https://docs.microsoft.com/en-us/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements. + /// Possible values include: 'CacheDisk' + /// + [JsonProperty(PropertyName = "placement")] + public DiffDiskPlacement? Placement { get; set; } + + } +} diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/DiskEncryptionTarget.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/DiskEncryptionTarget.cs index 0fdfe4c96bf1..6c51df6d3a3e 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/DiskEncryptionTarget.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/DiskEncryptionTarget.cs @@ -22,9 +22,7 @@ namespace Microsoft.Azure.Batch.Protocol.Models public enum DiskEncryptionTarget { /// - /// The temporary disk on the compute node is encrypted. On Linux this - /// encryption applies to other partitions (such as those on mounted - /// data disks) when encryption occurs at boot time. + /// The OS Disk on the compute node is encrypted. /// [EnumMember(Value = "osdisk")] OsDisk, diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/ImageReference.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/ImageReference.cs index 2fe667ee9803..3d3662512a4e 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/ImageReference.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/ImageReference.cs @@ -14,10 +14,10 @@ namespace Microsoft.Azure.Batch.Protocol.Models using System.Linq; /// - /// A reference to an Azure Virtual Machines Marketplace Image or a - /// bring-your-own Shared Image Gallery Image. To get the list of all Azure - /// Marketplace Image references verified by Azure Batch, see the 'List - /// Supported Images' operation. + /// A reference to an Azure Virtual Machines Marketplace Image or a Shared + /// Image Gallery Image. To get the list of all Azure Marketplace Image + /// references verified by Azure Batch, see the 'List Supported Images' + /// operation. /// public partial class ImageReference { @@ -47,13 +47,18 @@ public ImageReference() /// or /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageDefinitionName} /// for always defaulting to the latest image version. - public ImageReference(string publisher = default(string), string offer = default(string), string sku = default(string), string version = default(string), string virtualMachineImageId = default(string)) + /// 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'. + public ImageReference(string publisher = default(string), string offer = default(string), string sku = default(string), string version = default(string), string virtualMachineImageId = default(string), string exactVersion = default(string)) { Publisher = publisher; Offer = offer; Sku = sku; Version = version; VirtualMachineImageId = virtualMachineImageId; + ExactVersion = exactVersion; CustomInit(); } @@ -125,5 +130,14 @@ public ImageReference() [JsonProperty(PropertyName = "virtualMachineImageId")] public string VirtualMachineImageId { get; set; } + /// + /// Gets 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'. + /// + [JsonProperty(PropertyName = "exactVersion")] + public string ExactVersion { get; private set; } + } } diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/InstanceViewStatus.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/InstanceViewStatus.cs new file mode 100644 index 000000000000..a77c3918ecbb --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/InstanceViewStatus.cs @@ -0,0 +1,87 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Batch.Protocol.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The instance view status. + /// + public partial class InstanceViewStatus + { + /// + /// Initializes a new instance of the InstanceViewStatus class. + /// + public InstanceViewStatus() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the InstanceViewStatus class. + /// + /// The status code. + /// The localized label for the + /// status. + /// Level code. + /// The detailed status message. + /// The time of the status. + public InstanceViewStatus(string code = default(string), string displayStatus = default(string), StatusLevelTypes? level = default(StatusLevelTypes?), string message = default(string), string time = default(string)) + { + Code = code; + DisplayStatus = displayStatus; + Level = level; + Message = message; + Time = time; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the status code. + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; set; } + + /// + /// Gets or sets the localized label for the status. + /// + [JsonProperty(PropertyName = "displayStatus")] + public string DisplayStatus { get; set; } + + /// + /// Gets or sets level code. + /// + /// + /// Possible values include: 'Error', 'Info', 'Warning' + /// + [JsonProperty(PropertyName = "level")] + public StatusLevelTypes? Level { get; set; } + + /// + /// Gets or sets the detailed status message. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; set; } + + /// + /// Gets or sets the time of the status. + /// + [JsonProperty(PropertyName = "time")] + public string Time { get; set; } + + } +} diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/JobAddParameter.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/JobAddParameter.cs index 79e5fa0ff27a..a68ca00e8534 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/JobAddParameter.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/JobAddParameter.cs @@ -38,6 +38,8 @@ public JobAddParameter() /// Job's Tasks. /// The display name for the Job. /// The priority of the Job. + /// The maximum number of tasks that can + /// be executed in parallel for the job. /// The execution constraints for the /// Job. /// Details of a Job Manager Task to be @@ -59,11 +61,12 @@ public JobAddParameter() /// define dependencies on each other. The default is false. /// The network configuration for /// the Job. - public JobAddParameter(string id, PoolInformation poolInfo, string displayName = default(string), int? priority = default(int?), JobConstraints constraints = default(JobConstraints), JobManagerTask jobManagerTask = default(JobManagerTask), JobPreparationTask jobPreparationTask = default(JobPreparationTask), JobReleaseTask jobReleaseTask = default(JobReleaseTask), IList commonEnvironmentSettings = default(IList), OnAllTasksComplete? onAllTasksComplete = default(OnAllTasksComplete?), OnTaskFailure? onTaskFailure = default(OnTaskFailure?), IList metadata = default(IList), bool? usesTaskDependencies = default(bool?), JobNetworkConfiguration networkConfiguration = default(JobNetworkConfiguration)) + public JobAddParameter(string id, PoolInformation poolInfo, string displayName = default(string), int? priority = default(int?), int? maxParallelTasks = default(int?), JobConstraints constraints = default(JobConstraints), JobManagerTask jobManagerTask = default(JobManagerTask), JobPreparationTask jobPreparationTask = default(JobPreparationTask), JobReleaseTask jobReleaseTask = default(JobReleaseTask), IList commonEnvironmentSettings = default(IList), OnAllTasksComplete? onAllTasksComplete = default(OnAllTasksComplete?), OnTaskFailure? onTaskFailure = default(OnTaskFailure?), IList metadata = default(IList), bool? usesTaskDependencies = default(bool?), JobNetworkConfiguration networkConfiguration = default(JobNetworkConfiguration)) { Id = id; DisplayName = displayName; Priority = priority; + MaxParallelTasks = maxParallelTasks; Constraints = constraints; JobManagerTask = jobManagerTask; JobPreparationTask = jobPreparationTask; @@ -118,6 +121,20 @@ public JobAddParameter() [JsonProperty(PropertyName = "priority")] public int? Priority { get; set; } + /// + /// Gets or sets 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. + /// + [JsonProperty(PropertyName = "maxParallelTasks")] + public int? MaxParallelTasks { get; set; } + /// /// Gets or sets the execution constraints for the Job. /// diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/JobManagerTask.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/JobManagerTask.cs index 1f33809f0db7..01f28b15d9a1 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/JobManagerTask.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/JobManagerTask.cs @@ -76,7 +76,7 @@ public JobManagerTask() /// Constraints that apply to the Job Manager /// Task. /// The number of scheduling slots that the - /// Task required to run. + /// Task requires to run. /// Whether completion of the Job /// Manager Task signifies completion of the entire Job. /// The user identity under which the Job @@ -216,13 +216,14 @@ public JobManagerTask() public TaskConstraints Constraints { get; set; } /// - /// Gets or sets the number of scheduling slots that the Task required + /// Gets or sets the number of scheduling slots that the Task requires /// 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. + /// multi-instance Tasks, this property is not supported and must not + /// be specified. /// [JsonProperty(PropertyName = "requiredSlots")] public int? RequiredSlots { get; set; } diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/JobPatchParameter.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/JobPatchParameter.cs index be75da1f8472..ecf8083b5e3f 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/JobPatchParameter.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/JobPatchParameter.cs @@ -32,6 +32,8 @@ public JobPatchParameter() /// Initializes a new instance of the JobPatchParameter class. /// /// The priority of the Job. + /// The maximum number of tasks that can + /// be executed in parallel for the job. /// The action the Batch service /// should take when all Tasks in the Job are in the completed /// state. @@ -41,9 +43,10 @@ public JobPatchParameter() /// Job's Tasks. /// A list of name-value pairs associated with /// the Job as metadata. - public JobPatchParameter(int? priority = default(int?), OnAllTasksComplete? onAllTasksComplete = default(OnAllTasksComplete?), JobConstraints constraints = default(JobConstraints), PoolInformation poolInfo = default(PoolInformation), IList metadata = default(IList)) + public JobPatchParameter(int? priority = default(int?), int? maxParallelTasks = default(int?), OnAllTasksComplete? onAllTasksComplete = default(OnAllTasksComplete?), JobConstraints constraints = default(JobConstraints), PoolInformation poolInfo = default(PoolInformation), IList metadata = default(IList)) { Priority = priority; + MaxParallelTasks = maxParallelTasks; OnAllTasksComplete = onAllTasksComplete; Constraints = constraints; PoolInfo = poolInfo; @@ -67,6 +70,20 @@ public JobPatchParameter() [JsonProperty(PropertyName = "priority")] public int? Priority { get; set; } + /// + /// Gets or sets 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. + /// + [JsonProperty(PropertyName = "maxParallelTasks")] + public int? MaxParallelTasks { get; set; } + /// /// Gets or sets the action the Batch service should take when all /// Tasks in the Job are in the completed state. diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/JobSpecification.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/JobSpecification.cs index 95706a307765..48ee2fb9c77b 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/JobSpecification.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/JobSpecification.cs @@ -36,6 +36,8 @@ public JobSpecification() /// Tasks of Jobs created under this schedule. /// The priority of Jobs created under this /// schedule. + /// The maximum number of tasks that can + /// be executed in parallel for the job. /// The display name for Jobs created under /// this schedule. /// Whether Tasks in the Job can @@ -66,9 +68,10 @@ public JobSpecification() /// Job Manager, Job Preparation and Job Release Tasks). /// A list of name-value pairs associated with /// each Job created under this schedule as metadata. - public JobSpecification(PoolInformation poolInfo, int? priority = default(int?), string displayName = default(string), bool? usesTaskDependencies = default(bool?), OnAllTasksComplete? onAllTasksComplete = default(OnAllTasksComplete?), OnTaskFailure? onTaskFailure = default(OnTaskFailure?), JobNetworkConfiguration networkConfiguration = default(JobNetworkConfiguration), JobConstraints constraints = default(JobConstraints), JobManagerTask jobManagerTask = default(JobManagerTask), JobPreparationTask jobPreparationTask = default(JobPreparationTask), JobReleaseTask jobReleaseTask = default(JobReleaseTask), IList commonEnvironmentSettings = default(IList), IList metadata = default(IList)) + public JobSpecification(PoolInformation poolInfo, int? priority = default(int?), int? maxParallelTasks = default(int?), string displayName = default(string), bool? usesTaskDependencies = default(bool?), OnAllTasksComplete? onAllTasksComplete = default(OnAllTasksComplete?), OnTaskFailure? onTaskFailure = default(OnTaskFailure?), JobNetworkConfiguration networkConfiguration = default(JobNetworkConfiguration), JobConstraints constraints = default(JobConstraints), JobManagerTask jobManagerTask = default(JobManagerTask), JobPreparationTask jobPreparationTask = default(JobPreparationTask), JobReleaseTask jobReleaseTask = default(JobReleaseTask), IList commonEnvironmentSettings = default(IList), IList metadata = default(IList)) { Priority = priority; + MaxParallelTasks = maxParallelTasks; DisplayName = displayName; UsesTaskDependencies = usesTaskDependencies; OnAllTasksComplete = onAllTasksComplete; @@ -102,6 +105,20 @@ public JobSpecification() [JsonProperty(PropertyName = "priority")] public int? Priority { get; set; } + /// + /// Gets or sets 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. + /// + [JsonProperty(PropertyName = "maxParallelTasks")] + public int? MaxParallelTasks { get; set; } + /// /// Gets or sets the display name for Jobs created under this schedule. /// diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/NodePlacementConfiguration.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/NodePlacementConfiguration.cs new file mode 100644 index 000000000000..f72baefd94d4 --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/NodePlacementConfiguration.cs @@ -0,0 +1,62 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Batch.Protocol.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Node placement configuration for a pool. + /// + /// + /// For regional placement, nodes in the pool will be allocated in the same + /// region. For zonal placement, nodes in the pool will be spread across + /// different zones with best effort balancing. + /// + public partial class NodePlacementConfiguration + { + /// + /// Initializes a new instance of the NodePlacementConfiguration class. + /// + public NodePlacementConfiguration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NodePlacementConfiguration class. + /// + /// Node placement Policy type on Batch + /// Pools. + public NodePlacementConfiguration(NodePlacementPolicyType? policy = default(NodePlacementPolicyType?)) + { + Policy = policy; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets node placement Policy type on Batch Pools. + /// + /// + /// Allocation policy used by Batch Service to provision the nodes. If + /// not specified, Batch will use the regional policy. Possible values + /// include: 'regional', 'zonal' + /// + [JsonProperty(PropertyName = "policy")] + public NodePlacementPolicyType? Policy { get; set; } + + } +} diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/NodePlacementPolicyType.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/NodePlacementPolicyType.cs new file mode 100644 index 000000000000..4ae5332aa548 --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/NodePlacementPolicyType.cs @@ -0,0 +1,67 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Batch.Protocol.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for NodePlacementPolicyType. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum NodePlacementPolicyType + { + /// + /// All nodes in the pool will be allocated in the same region. + /// + [EnumMember(Value = "regional")] + Regional, + /// + /// Nodes in the pool will be spread across different availability + /// zones with best effort balancing. + /// + [EnumMember(Value = "zonal")] + Zonal + } + internal static class NodePlacementPolicyTypeEnumExtension + { + internal static string ToSerializedValue(this NodePlacementPolicyType? value) + { + return value == null ? null : ((NodePlacementPolicyType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this NodePlacementPolicyType value) + { + switch( value ) + { + case NodePlacementPolicyType.Regional: + return "regional"; + case NodePlacementPolicyType.Zonal: + return "zonal"; + } + return null; + } + + internal static NodePlacementPolicyType? ParseNodePlacementPolicyType(this string value) + { + switch( value ) + { + case "regional": + return NodePlacementPolicyType.Regional; + case "zonal": + return NodePlacementPolicyType.Zonal; + } + return null; + } + } +} diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/NodeRemoveParameter.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/NodeRemoveParameter.cs index de3f49ab8f3d..929c0c554561 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/NodeRemoveParameter.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/NodeRemoveParameter.cs @@ -55,6 +55,9 @@ public NodeRemoveParameter() /// Gets or sets 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. + /// [JsonProperty(PropertyName = "nodeList")] public IList NodeList { get; set; } diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/NodeVMExtension.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/NodeVMExtension.cs new file mode 100644 index 000000000000..73cbb74f2122 --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/NodeVMExtension.cs @@ -0,0 +1,69 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Batch.Protocol.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The configuration for virtual machine extension instance view. + /// + public partial class NodeVMExtension + { + /// + /// Initializes a new instance of the NodeVMExtension class. + /// + public NodeVMExtension() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NodeVMExtension class. + /// + /// The provisioning state of the + /// virtual machine extension. + /// The virtual machine extension + /// The vm extension instance view. + public NodeVMExtension(string provisioningState = default(string), VMExtension vmExtension = default(VMExtension), VMExtensionInstanceView instanceView = default(VMExtensionInstanceView)) + { + ProvisioningState = provisioningState; + VmExtension = vmExtension; + InstanceView = instanceView; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the provisioning state of the virtual machine + /// extension. + /// + [JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState { get; set; } + + /// + /// Gets or sets the virtual machine extension + /// + [JsonProperty(PropertyName = "vmExtension")] + public VMExtension VmExtension { get; set; } + + /// + /// Gets or sets the vm extension instance view. + /// + [JsonProperty(PropertyName = "instanceView")] + public VMExtensionInstanceView InstanceView { get; set; } + + } +} diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/OSDisk.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/OSDisk.cs new file mode 100644 index 000000000000..f06b28a86809 --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/OSDisk.cs @@ -0,0 +1,54 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Batch.Protocol.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Settings for the operating system disk of the compute node (VM). + /// + public partial class OSDisk + { + /// + /// Initializes a new instance of the OSDisk class. + /// + public OSDisk() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OSDisk class. + /// + /// Specifies the ephemeral Disk + /// Settings for the operating system disk used by the compute node + /// (VM). + public OSDisk(DiffDiskSettings ephemeralOSDiskSettings = default(DiffDiskSettings)) + { + EphemeralOSDiskSettings = ephemeralOSDiskSettings; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets specifies the ephemeral Disk Settings for the + /// operating system disk used by the compute node (VM). + /// + [JsonProperty(PropertyName = "ephemeralOSDiskSettings")] + public DiffDiskSettings EphemeralOSDiskSettings { get; set; } + + } +} diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/OutputFile.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/OutputFile.cs index 3010e86e1085..295f188dfcd3 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/OutputFile.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/OutputFile.cs @@ -18,6 +18,11 @@ namespace Microsoft.Azure.Batch.Protocol.Models /// another location after the Batch service has finished executing the /// Task process. /// + /// + /// On every file uploads, Batch service writes two log files to the + /// compute node, 'fileuploadout.txt' and 'fileuploaderr.txt'. These log + /// files are used to learn more about a specific failure. + /// public partial class OutputFile { /// diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/OutputFileBlobContainerDestination.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/OutputFileBlobContainerDestination.cs index cc581eb6b159..4c97a26109b8 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/OutputFileBlobContainerDestination.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/OutputFileBlobContainerDestination.cs @@ -36,10 +36,14 @@ public OutputFileBlobContainerDestination() /// Blob Storage to which to upload the file(s). /// The destination blob or virtual directory within /// the Azure Storage container. - public OutputFileBlobContainerDestination(string containerUrl, string path = default(string)) + /// The reference to the user assigned + /// identity to use to access Azure Blob Storage specified by + /// containerUrl + public OutputFileBlobContainerDestination(string containerUrl, string path = default(string), ComputeNodeIdentityReference identityReference = default(ComputeNodeIdentityReference)) { Path = path; ContainerUrl = containerUrl; + IdentityReference = identityReference; CustomInit(); } @@ -70,11 +74,22 @@ public OutputFileBlobContainerDestination() /// which to upload the file(s). /// /// - /// The URL must include a Shared Access Signature (SAS) granting write - /// permissions to the container. + /// If not using a managed identity, the URL must include a Shared + /// Access Signature (SAS) granting write permissions to the container. /// [JsonProperty(PropertyName = "containerUrl")] public string ContainerUrl { get; set; } + /// + /// Gets or sets 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 + /// + [JsonProperty(PropertyName = "identityReference")] + public ComputeNodeIdentityReference IdentityReference { get; set; } + } } diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/PoolAddParameter.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/PoolAddParameter.cs index 11ac859e39af..f3ed7d9917f3 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/PoolAddParameter.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/PoolAddParameter.cs @@ -221,7 +221,7 @@ public PoolAddParameter() /// time. /// /// - /// If false, at least one of targetDedicateNodes and + /// 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. diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/PoolIdentityType.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/PoolIdentityType.cs new file mode 100644 index 000000000000..862d036b406b --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/PoolIdentityType.cs @@ -0,0 +1,67 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Batch.Protocol.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for PoolIdentityType. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum PoolIdentityType + { + /// + /// Batch pool has user assigned identities with it. + /// + [EnumMember(Value = "UserAssigned")] + UserAssigned, + /// + /// Batch pool has no identity associated with it. Setting `None` in + /// update pool will remove existing identities. + /// + [EnumMember(Value = "None")] + None + } + internal static class PoolIdentityTypeEnumExtension + { + internal static string ToSerializedValue(this PoolIdentityType? value) + { + return value == null ? null : ((PoolIdentityType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this PoolIdentityType value) + { + switch( value ) + { + case PoolIdentityType.UserAssigned: + return "UserAssigned"; + case PoolIdentityType.None: + return "None"; + } + return null; + } + + internal static PoolIdentityType? ParsePoolIdentityType(this string value) + { + switch( value ) + { + case "UserAssigned": + return PoolIdentityType.UserAssigned; + case "None": + return PoolIdentityType.None; + } + return null; + } + } +} diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/PoolNodeCounts.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/PoolNodeCounts.cs index d29b1bc0f7f9..5374d6c01a86 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/PoolNodeCounts.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/PoolNodeCounts.cs @@ -32,7 +32,7 @@ public PoolNodeCounts() /// The ID of the Pool. /// The number of dedicated Compute Nodes in /// each state. - /// The number of low priority Compute Nodes + /// The number of low-priority Compute Nodes /// in each state. public PoolNodeCounts(string poolId, NodeCounts dedicated = default(NodeCounts), NodeCounts lowPriority = default(NodeCounts)) { @@ -60,7 +60,7 @@ public PoolNodeCounts() public NodeCounts Dedicated { get; set; } /// - /// Gets or sets the number of low priority Compute Nodes in each + /// Gets or sets the number of low-priority Compute Nodes in each /// state. /// [JsonProperty(PropertyName = "lowPriority")] diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/PoolSpecification.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/PoolSpecification.cs index cc59f1e36989..0d9a7e81c9ce 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/PoolSpecification.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/PoolSpecification.cs @@ -224,7 +224,7 @@ public PoolSpecification() /// time. /// /// - /// If false, at least one of targetDedicateNodes and + /// If false, at least one of targetDedicatedNodes and /// targetLowPriorityNodes must be specified. If true, the /// autoScaleFormula element is required. The Pool automatically /// resizes according to the formula. The default value is false. diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/ResourceFile.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/ResourceFile.cs index de8357125632..702b696392d5 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/ResourceFile.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/ResourceFile.cs @@ -42,7 +42,10 @@ public ResourceFile() /// directory. /// The file permission mode attribute in octal /// format. - public ResourceFile(string autoStorageContainerName = default(string), string storageContainerUrl = default(string), string httpUrl = default(string), string blobPrefix = default(string), string filePath = default(string), string fileMode = default(string)) + /// The reference to the user assigned + /// identity to use to access Azure Blob Storage specified by + /// storageContainerUrl or httpUrl + public ResourceFile(string autoStorageContainerName = default(string), string storageContainerUrl = default(string), string httpUrl = default(string), string blobPrefix = default(string), string filePath = default(string), string fileMode = default(string), ComputeNodeIdentityReference identityReference = default(ComputeNodeIdentityReference)) { AutoStorageContainerName = autoStorageContainerName; StorageContainerUrl = storageContainerUrl; @@ -50,6 +53,7 @@ public ResourceFile() BlobPrefix = blobPrefix; FilePath = filePath; FileMode = fileMode; + IdentityReference = identityReference; CustomInit(); } @@ -77,12 +81,12 @@ public ResourceFile() /// /// The autoStorageContainerName, storageContainerUrl and httpUrl /// properties are mutually exclusive and one of them must be - /// specified. This URL must be readable and listable using anonymous - /// access; that is, the Batch service does not present any credentials - /// when downloading blobs from the container. There are two ways to - /// get such a URL for a container in Azure storage: include a Shared - /// Access Signature (SAS) granting read and list permissions on the - /// container, or set the ACL for the container to allow public access. + /// specified. This URL must be readable and listable from compute + /// nodes. There are three ways to get such a URL for a container in + /// Azure storage: include a Shared Access Signature (SAS) granting + /// read and list permissions on the container, use a managed identity + /// with read and list permissions, or set the ACL for the container to + /// allow public access. /// [JsonProperty(PropertyName = "storageContainerUrl")] public string StorageContainerUrl { get; set; } @@ -94,12 +98,11 @@ public ResourceFile() /// The autoStorageContainerName, storageContainerUrl and httpUrl /// properties are mutually exclusive and one of them must be /// specified. If the URL points to Azure Blob Storage, it must be - /// readable using anonymous access; that is, the Batch service does - /// not present any credentials when downloading the blob. There are - /// two ways to get such a URL for a blob in Azure storage: include a - /// Shared Access Signature (SAS) granting read permissions on the - /// blob, or set the ACL for the blob or its container to allow public - /// access. + /// readable from compute nodes. There are three ways to get such a URL + /// for a blob in Azure storage: include a Shared Access Signature + /// (SAS) granting read permissions on the blob, use a managed identity + /// with read permission, or set the ACL for the blob or its container + /// to allow public access. /// [JsonProperty(PropertyName = "httpUrl")] public string HttpUrl { get; set; } @@ -150,5 +153,13 @@ public ResourceFile() [JsonProperty(PropertyName = "fileMode")] public string FileMode { get; set; } + /// + /// Gets or sets the reference to the user assigned identity to use to + /// access Azure Blob Storage specified by storageContainerUrl or + /// httpUrl + /// + [JsonProperty(PropertyName = "identityReference")] + public ComputeNodeIdentityReference IdentityReference { get; set; } + } } diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/StatusLevelTypes.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/StatusLevelTypes.cs new file mode 100644 index 000000000000..919eea804163 --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/StatusLevelTypes.cs @@ -0,0 +1,66 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Batch.Protocol.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for StatusLevelTypes. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum StatusLevelTypes + { + [EnumMember(Value = "Error")] + Error, + [EnumMember(Value = "Info")] + Info, + [EnumMember(Value = "Warning")] + Warning + } + internal static class StatusLevelTypesEnumExtension + { + internal static string ToSerializedValue(this StatusLevelTypes? value) + { + return value == null ? null : ((StatusLevelTypes)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this StatusLevelTypes value) + { + switch( value ) + { + case StatusLevelTypes.Error: + return "Error"; + case StatusLevelTypes.Info: + return "Info"; + case StatusLevelTypes.Warning: + return "Warning"; + } + return null; + } + + internal static StatusLevelTypes? ParseStatusLevelTypes(this string value) + { + switch( value ) + { + case "Error": + return StatusLevelTypes.Error; + case "Info": + return StatusLevelTypes.Info; + case "Warning": + return StatusLevelTypes.Warning; + } + return null; + } + } +} diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/UploadBatchServiceLogsConfiguration.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/UploadBatchServiceLogsConfiguration.cs index dfe6945aa515..8ee195704379 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/UploadBatchServiceLogsConfiguration.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/UploadBatchServiceLogsConfiguration.cs @@ -39,11 +39,15 @@ public UploadBatchServiceLogsConfiguration() /// upload Batch Service log file(s). /// The end of the time range from which to /// upload Batch Service log file(s). - public UploadBatchServiceLogsConfiguration(string containerUrl, System.DateTime startTime, System.DateTime? endTime = default(System.DateTime?)) + /// The reference to the user assigned + /// identity to use to access Azure Blob Storage specified by + /// containerUrl. + public UploadBatchServiceLogsConfiguration(string containerUrl, System.DateTime startTime, System.DateTime? endTime = default(System.DateTime?), ComputeNodeIdentityReference identityReference = default(ComputeNodeIdentityReference)) { ContainerUrl = containerUrl; StartTime = startTime; EndTime = endTime; + IdentityReference = identityReference; CustomInit(); } @@ -57,10 +61,11 @@ public UploadBatchServiceLogsConfiguration() /// which to upload the Batch Service log file(s). /// /// - /// 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. + /// 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. /// [JsonProperty(PropertyName = "containerUrl")] public string ContainerUrl { get; set; } @@ -94,5 +99,16 @@ public UploadBatchServiceLogsConfiguration() [JsonProperty(PropertyName = "endTime")] public System.DateTime? EndTime { get; set; } + /// + /// Gets or sets 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. + /// + [JsonProperty(PropertyName = "identityReference")] + public ComputeNodeIdentityReference IdentityReference { get; set; } + } } diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/UserAssignedIdentity.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/UserAssignedIdentity.cs new file mode 100644 index 000000000000..7da03fdc1833 --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/UserAssignedIdentity.cs @@ -0,0 +1,70 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Batch.Protocol.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The user assigned Identity + /// + public partial class UserAssignedIdentity + { + /// + /// Initializes a new instance of the UserAssignedIdentity class. + /// + public UserAssignedIdentity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UserAssignedIdentity class. + /// + /// The ARM resource id of the user assigned + /// identity + /// The client id of the user assigned + /// identity. + /// The principal id of the user assigned + /// identity. + public UserAssignedIdentity(string resourceId, string clientId = default(string), string principalId = default(string)) + { + ResourceId = resourceId; + ClientId = clientId; + PrincipalId = principalId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the ARM resource id of the user assigned identity + /// + [JsonProperty(PropertyName = "resourceId")] + public string ResourceId { get; set; } + + /// + /// Gets the client id of the user assigned identity. + /// + [JsonProperty(PropertyName = "clientId")] + public string ClientId { get; private set; } + + /// + /// Gets the principal id of the user assigned identity. + /// + [JsonProperty(PropertyName = "principalId")] + public string PrincipalId { get; private set; } + + } +} diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/VMExtension.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/VMExtension.cs new file mode 100644 index 000000000000..bd5f9c928a8b --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/VMExtension.cs @@ -0,0 +1,128 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Batch.Protocol.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The configuration for virtual machine extensions. + /// + public partial class VMExtension + { + /// + /// Initializes a new instance of the VMExtension class. + /// + public VMExtension() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VMExtension class. + /// + /// The name of the virtual machine + /// extension. + /// The name of the extension handler + /// publisher. + /// The type of the extension. + /// The version of script + /// handler. + /// Indicates whether the + /// extension should use a newer minor version if one is available at + /// deployment time. Once deployed, however, the extension will not + /// upgrade minor versions unless redeployed, even with this property + /// set to true. + /// JSON formatted public settings for the + /// extension. + /// The extension can contain either + /// protectedSettings or protectedSettingsFromKeyVault or no protected + /// settings at all. + /// The collection of extension + /// names. + public VMExtension(string name, string publisher, string type, string typeHandlerVersion = default(string), bool? autoUpgradeMinorVersion = default(bool?), object settings = default(object), object protectedSettings = default(object), IList provisionAfterExtensions = default(IList)) + { + Name = name; + Publisher = publisher; + Type = type; + TypeHandlerVersion = typeHandlerVersion; + AutoUpgradeMinorVersion = autoUpgradeMinorVersion; + Settings = settings; + ProtectedSettings = protectedSettings; + ProvisionAfterExtensions = provisionAfterExtensions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name of the virtual machine extension. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the name of the extension handler publisher. + /// + [JsonProperty(PropertyName = "publisher")] + public string Publisher { get; set; } + + /// + /// Gets or sets the type of the extension. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + /// + /// Gets or sets the version of script handler. + /// + [JsonProperty(PropertyName = "typeHandlerVersion")] + public string TypeHandlerVersion { get; set; } + + /// + /// Gets or sets indicates whether the extension should use a newer + /// minor version if one is available at deployment time. Once + /// deployed, however, the extension will not upgrade minor versions + /// unless redeployed, even with this property set to true. + /// + [JsonProperty(PropertyName = "autoUpgradeMinorVersion")] + public bool? AutoUpgradeMinorVersion { get; set; } + + /// + /// Gets or sets JSON formatted public settings for the extension. + /// + [JsonProperty(PropertyName = "settings")] + public object Settings { get; set; } + + /// + /// Gets or sets the extension can contain either protectedSettings or + /// protectedSettingsFromKeyVault or no protected settings at all. + /// + [JsonProperty(PropertyName = "protectedSettings")] + public object ProtectedSettings { get; set; } + + /// + /// Gets or sets the collection of extension names. + /// + /// + /// Collection of extension names after which this extension needs to + /// be provisioned. + /// + [JsonProperty(PropertyName = "provisionAfterExtensions")] + public IList ProvisionAfterExtensions { get; set; } + + } +} diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/VMExtensionInstanceView.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/VMExtensionInstanceView.cs new file mode 100644 index 000000000000..de06f197722d --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/VMExtensionInstanceView.cs @@ -0,0 +1,70 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Batch.Protocol.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The vm extension instance view. + /// + public partial class VMExtensionInstanceView + { + /// + /// Initializes a new instance of the VMExtensionInstanceView class. + /// + public VMExtensionInstanceView() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VMExtensionInstanceView class. + /// + /// The name of the vm extension instance + /// view. + /// The resource status information. + /// The resource status information. + public VMExtensionInstanceView(string name = default(string), IList statuses = default(IList), IList subStatuses = default(IList)) + { + Name = name; + Statuses = statuses; + SubStatuses = subStatuses; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name of the vm extension instance view. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the resource status information. + /// + [JsonProperty(PropertyName = "statuses")] + public IList Statuses { get; set; } + + /// + /// Gets or sets the resource status information. + /// + [JsonProperty(PropertyName = "subStatuses")] + public IList SubStatuses { get; set; } + + } +} diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/VirtualMachineConfiguration.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/VirtualMachineConfiguration.cs index 5c3855c61fc5..b7474fbdcd8c 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/VirtualMachineConfiguration.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/VirtualMachineConfiguration.cs @@ -49,7 +49,13 @@ public VirtualMachineConfiguration() /// for the Pool. /// The disk encryption /// configuration for the pool. - public VirtualMachineConfiguration(ImageReference imageReference, string nodeAgentSKUId, WindowsConfiguration windowsConfiguration = default(WindowsConfiguration), IList dataDisks = default(IList), string licenseType = default(string), ContainerConfiguration containerConfiguration = default(ContainerConfiguration), DiskEncryptionConfiguration diskEncryptionConfiguration = default(DiskEncryptionConfiguration)) + /// The node placement + /// configuration for the pool. + /// The virtual machine extension for the + /// pool. + /// Settings for the operating system disk of the + /// Virtual Machine. + public VirtualMachineConfiguration(ImageReference imageReference, string nodeAgentSKUId, WindowsConfiguration windowsConfiguration = default(WindowsConfiguration), IList dataDisks = default(IList), string licenseType = default(string), ContainerConfiguration containerConfiguration = default(ContainerConfiguration), DiskEncryptionConfiguration diskEncryptionConfiguration = default(DiskEncryptionConfiguration), NodePlacementConfiguration nodePlacementConfiguration = default(NodePlacementConfiguration), IList extensions = default(IList), OSDisk osDisk = default(OSDisk)) { ImageReference = imageReference; NodeAgentSKUId = nodeAgentSKUId; @@ -58,6 +64,9 @@ public VirtualMachineConfiguration() LicenseType = licenseType; ContainerConfiguration = containerConfiguration; DiskEncryptionConfiguration = diskEncryptionConfiguration; + NodePlacementConfiguration = nodePlacementConfiguration; + Extensions = extensions; + OsDisk = osDisk; CustomInit(); } @@ -161,5 +170,32 @@ public VirtualMachineConfiguration() [JsonProperty(PropertyName = "diskEncryptionConfiguration")] public DiskEncryptionConfiguration DiskEncryptionConfiguration { get; set; } + /// + /// Gets or sets the node placement configuration for the pool. + /// + /// + /// This configuration will specify rules on how nodes in the pool will + /// be physically allocated. + /// + [JsonProperty(PropertyName = "nodePlacementConfiguration")] + public NodePlacementConfiguration NodePlacementConfiguration { get; set; } + + /// + /// Gets or sets the virtual machine extension for the pool. + /// + /// + /// If specified, the extensions mentioned in this configuration will + /// be installed on each node. + /// + [JsonProperty(PropertyName = "extensions")] + public IList Extensions { get; set; } + + /// + /// Gets or sets settings for the operating system disk of the Virtual + /// Machine. + /// + [JsonProperty(PropertyName = "osDisk")] + public OSDisk OsDisk { get; set; } + } } diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/VirtualMachineInfo.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/VirtualMachineInfo.cs new file mode 100644 index 000000000000..4c01b8b26c78 --- /dev/null +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/Models/VirtualMachineInfo.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Batch.Protocol.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Info about the current state of the virtual machine. + /// + public partial class VirtualMachineInfo + { + /// + /// Initializes a new instance of the VirtualMachineInfo class. + /// + public VirtualMachineInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualMachineInfo class. + /// + /// The reference to the Azure Virtual + /// Machine's Marketplace Image. + public VirtualMachineInfo(ImageReference imageReference = default(ImageReference)) + { + ImageReference = imageReference; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the reference to the Azure Virtual Machine's + /// Marketplace Image. + /// + [JsonProperty(PropertyName = "imageReference")] + public ImageReference ImageReference { get; set; } + + } +} diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/PoolOperations.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/PoolOperations.cs index 5c961fb88336..7d29fb0f56ed 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/PoolOperations.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/PoolOperations.cs @@ -3999,7 +3999,7 @@ internal PoolOperations(BatchServiceClient client) /// /// This operation can only run when the allocation state of the Pool is /// steady. When this operation runs, the allocation state changes from steady - /// to resizing. + /// to resizing. Each request may remove up to 100 nodes. /// /// /// The ID of the Pool from which you want to remove Compute Nodes. diff --git a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/PoolOperationsExtensions.cs b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/PoolOperationsExtensions.cs index cc0026632d0a..254c2a31aaf4 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/PoolOperationsExtensions.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/GeneratedProtocol/PoolOperationsExtensions.cs @@ -769,7 +769,7 @@ public static partial class PoolOperationsExtensions /// /// This operation can only run when the allocation state of the Pool is /// steady. When this operation runs, the allocation state changes from steady - /// to resizing. + /// to resizing. Each request may remove up to 100 nodes. /// /// /// The operations group for this extension method. @@ -794,7 +794,7 @@ public static partial class PoolOperationsExtensions /// /// This operation can only run when the allocation state of the Pool is /// steady. When this operation runs, the allocation state changes from steady - /// to resizing. + /// to resizing. Each request may remove up to 100 nodes. /// /// /// The operations group for this extension method. diff --git a/sdk/batch/Microsoft.Azure.Batch/src/IProtocolLayer.cs b/sdk/batch/Microsoft.Azure.Batch/src/IProtocolLayer.cs index 1ccc90cc334c..8386488e46aa 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/IProtocolLayer.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/IProtocolLayer.cs @@ -70,6 +70,7 @@ internal interface IProtocolLayer : IDisposable Task> PatchJob( string jobId, int? priority, + int? maxParallelTasks, Models.OnAllTasksComplete? onAllTasksComplete, Models.PoolInformation poolInfo, Models.JobConstraints constraints, @@ -250,6 +251,10 @@ internal interface IProtocolLayer : IDisposable BehaviorManager bhMgr, CancellationToken cancellationToken); + Task> GetComputeNodeExtension(string poolId, string nodeId, string extensionName, BehaviorManager bhMgr, CancellationToken cancellationToken); + + Task, Models.ComputeNodeExtensionListHeaders>> ListComputeNodeExtensions(string poolId, string nodeId, string skipToken, BehaviorManager bhMgr, CancellationToken cancellationToken); + Task> UpdateTask(string jobId, string taskId, Models.TaskConstraints constraints, BehaviorManager bhMgr, CancellationToken cancellationToken); Task> DeleteNodeFileByNode(string poolId, string nodeId, string filePath, bool? recursive, BehaviorManager bhMgr, CancellationToken cancellationToken); diff --git a/sdk/batch/Microsoft.Azure.Batch/src/Microsoft.Azure.Batch.csproj b/sdk/batch/Microsoft.Azure.Batch/src/Microsoft.Azure.Batch.csproj index 1f671ddded88..cfbb2b2867a9 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/Microsoft.Azure.Batch.csproj +++ b/sdk/batch/Microsoft.Azure.Batch/src/Microsoft.Azure.Batch.csproj @@ -1,8 +1,7 @@ - + This client library provides access to the Microsoft Azure Batch service. - 14.1.0-beta.1 - 14.0.0 + 15.0.0 $(DefineConstants);CODESIGN true Microsoft Azure Batch diff --git a/sdk/batch/Microsoft.Azure.Batch/src/Protocol/BatchRequests/NamedBatchRequests.cs b/sdk/batch/Microsoft.Azure.Batch/src/Protocol/BatchRequests/NamedBatchRequests.cs index bdad41332759..5843e83e5049 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/Protocol/BatchRequests/NamedBatchRequests.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/Protocol/BatchRequests/NamedBatchRequests.cs @@ -740,6 +740,63 @@ public FileListFromComputeNodeNextBatchRequest( } } + /// + /// An for the ComputeNodeExtensionGet operation. + /// + public class ComputeNodeExtensionGetBatchRequest : Protocol.BatchRequest< + ComputeNodeExtensionGetOptions, + AzureOperationResponse> + { + /// + /// Initializes a new instance of the class. + /// + /// The service client to use. + /// A controlling the request lifetime. + public ComputeNodeExtensionGetBatchRequest( + BatchServiceClient serviceClient, + CancellationToken cancellationToken) : base(serviceClient, cancellationToken) + { + } + } + + /// + /// An for the ComputeNodeExtensionList operation. + /// + public class ComputeNodeExtensionListBatchRequest : Protocol.BatchRequest< + ComputeNodeExtensionListOptions, + AzureOperationResponse, ComputeNodeExtensionListHeaders>> + { + /// + /// Initializes a new instance of the class. + /// + /// The service client to use. + /// A controlling the request lifetime. + public ComputeNodeExtensionListBatchRequest( + BatchServiceClient serviceClient, + CancellationToken cancellationToken) : base(serviceClient, cancellationToken) + { + } + } + + /// + /// An for the ComputeNodeExtensionListNext operation. + /// + public class ComputeNodeExtensionListNextBatchRequest : Protocol.BatchRequest< + ComputeNodeExtensionListNextOptions, + AzureOperationResponse, ComputeNodeExtensionListHeaders>> + { + /// + /// Initializes a new instance of the class. + /// + /// The service client to use. + /// A controlling the request lifetime. + public ComputeNodeExtensionListNextBatchRequest( + BatchServiceClient serviceClient, + CancellationToken cancellationToken) : base(serviceClient, cancellationToken) + { + } + } + #endregion #region Job diff --git a/sdk/batch/Microsoft.Azure.Batch/src/Protocol/Models/ParameterExtensions.cs b/sdk/batch/Microsoft.Azure.Batch/src/Protocol/Models/ParameterExtensions.cs index da054ce94328..141d68070679 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/Protocol/Models/ParameterExtensions.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/Protocol/Models/ParameterExtensions.cs @@ -22,6 +22,9 @@ public partial class ComputeNodeListOptions : ITimeoutOptions, IODataSelect, IOD public partial class ComputeNodeListNextOptions : IOptions { } public partial class ComputeNodeRebootOptions : ITimeoutOptions { } public partial class ComputeNodeReimageOptions : ITimeoutOptions { } + public partial class ComputeNodeExtensionGetOptions : ITimeoutOptions, IODataSelect { } + public partial class ComputeNodeExtensionListOptions : ITimeoutOptions, IODataSelect { } + public partial class ComputeNodeExtensionListNextOptions : IOptions { } public partial class PoolRemoveNodesOptions : ITimeoutOptions { } public partial class ComputeNodeUpdateUserOptions : ITimeoutOptions { } public partial class ComputeNodeUploadBatchServiceLogsOptions : ITimeoutOptions { } diff --git a/sdk/batch/Microsoft.Azure.Batch/src/ProtocolLayer.cs b/sdk/batch/Microsoft.Azure.Batch/src/ProtocolLayer.cs index 5a87e7a2ff2c..e7b474cf494d 100644 --- a/sdk/batch/Microsoft.Azure.Batch/src/ProtocolLayer.cs +++ b/sdk/batch/Microsoft.Azure.Batch/src/ProtocolLayer.cs @@ -434,6 +434,7 @@ internal ProtocolLayer(Protocol.BatchServiceClient clientToUse) public Task> PatchJob( string jobId, int? priority, + int? maxParallelTasks, Models.OnAllTasksComplete? onAllTasksComplete, Models.PoolInformation poolInfo, Models.JobConstraints constraints, @@ -441,7 +442,7 @@ internal ProtocolLayer(Protocol.BatchServiceClient clientToUse) BehaviorManager bhMgr, CancellationToken cancellationToken) { - var parameters = new Models.JobPatchParameter(priority, onAllTasksComplete, constraints, poolInfo, metadata); + var parameters = new Models.JobPatchParameter(priority, maxParallelTasks, onAllTasksComplete, constraints, poolInfo, metadata); var request = new JobPatchBatchRequest(this._client, parameters, cancellationToken); request.ServiceRequestFunc = (lambdaCancelToken) => request.RestClient.Job.PatchWithHttpMessagesAsync( @@ -1329,6 +1330,52 @@ internal ProtocolLayer(Protocol.BatchServiceClient clientToUse) return asyncTask; } + public Task> GetComputeNodeExtension(string poolId, string nodeId, string extensionName, BehaviorManager bhMgr, CancellationToken cancellationToken) + { + var request = new ComputeNodeExtensionGetBatchRequest(_client, cancellationToken); + + request.ServiceRequestFunc = (lambdaCancelToken) => request.RestClient.ComputeNodeExtension.GetWithHttpMessagesAsync( + poolId, + nodeId, + extensionName, + request.Options, + request.CustomHeaders, + cancellationToken + ); + + var asyncTask = ProcessAndExecuteBatchRequest(request, bhMgr); + + return asyncTask; + } + + public Task, Models.ComputeNodeExtensionListHeaders>> ListComputeNodeExtensions(string poolId, string computeNodeId, string skipToken, BehaviorManager bhMgr, CancellationToken cancellationToken) + { + Task, Models.ComputeNodeExtensionListHeaders>> asyncTask; + + if (string.IsNullOrEmpty(skipToken)) + { + var request = new ComputeNodeExtensionListBatchRequest(this._client, cancellationToken); + + request.ServiceRequestFunc = (lambdaCancelToken) => request.RestClient.ComputeNodeExtension.ListWithHttpMessagesAsync( + poolId, + computeNodeId, + request.Options, + request.CustomHeaders, + lambdaCancelToken); + + asyncTask = ProcessAndExecuteBatchRequest(request, bhMgr); + } + else + { + var request = new ComputeNodeExtensionListNextBatchRequest(_client, cancellationToken); + + request.ServiceRequestFunc = (lambdaCancelToken) => request.RestClient.ComputeNodeExtension.ListNextWithHttpMessagesAsync(skipToken, request.Options, request.CustomHeaders, lambdaCancelToken); + asyncTask = ProcessAndExecuteBatchRequest(request, bhMgr); + } + + return asyncTask; + } + public Task> UpdateTask(string jobId, string taskId, Models.TaskConstraints taskConstraints, BehaviorManager bhMgr, CancellationToken cancellationToken) { var parameters = taskConstraints; diff --git a/sdk/batch/Microsoft.Azure.Batch/tests/UnitTests/TestUtilities/ObjectComparer.cs b/sdk/batch/Microsoft.Azure.Batch/tests/UnitTests/TestUtilities/ObjectComparer.cs index b41c878eb171..c687074ae193 100644 --- a/sdk/batch/Microsoft.Azure.Batch/tests/UnitTests/TestUtilities/ObjectComparer.cs +++ b/sdk/batch/Microsoft.Azure.Batch/tests/UnitTests/TestUtilities/ObjectComparer.cs @@ -222,9 +222,9 @@ private static bool IsObjectEqualsMethod(MethodInfo methodInfo) private static bool OverridesEqualsMethod(Type t) { - MethodInfo equalsMethod = t.GetMethods().Single(IsObjectEqualsMethod); + IEnumerable equalsMethods = t.GetMethods().Where(IsObjectEqualsMethod); - return !equalsMethod.DeclaringType.Equals(typeof (object)); + return !equalsMethods.Any(d => d.DeclaringType.Equals(typeof (object))); } } }